PandaRoot
PndMvdEventAna.h
Go to the documentation of this file.
1 //
2 // C++ Interface: PndMvdMCEventAna
3 //
4 // Description:
5 //
6 //
7 // Author: t.stockmanns <stockman@ikp455>, (C) 2007
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef PNDMVDEVENTANA_H
13 #define PNDMVDEVENTANA_H
14 
15 #include "PndSdsMCPoint.h"
16 #include "PndGeoHandling.h"
17 #include "TTree.h"
18 #include "TCanvas.h"
19 #include "TH1.h"
20 #include "TH2.h"
21 #include "TFile.h"
22 #include "TClonesArray.h"
23 #include "TString.h"
24 
25 #include <map>
26 #include <vector>
34  public:
36  PndMvdEventAna(TString fileName);
37  virtual ~PndMvdEventAna(){};
38 
39  virtual void Init(TString fileName);
40  void InitCanvas();
41 
42  void AnaEvents(Int_t count);
43  void AnaEventNr(Int_t Nr);
44  void NextEvent();
45  void DrawHistos();
46  void DrawHisto(TString path, TString opt = "");
47  void SetCanvasColumns(Int_t col) { fCancol = col; };
48  void SetDrawOption(TString histoName, TString option);
49  void SetSelection(TString sel) { fSelection = sel; };
50  void FillVector();
51  void DrawVector(Int_t index, TString opt);
52  Int_t GetEventNr() const { return fActiveEvent; };
53  TString GetSelection() const { return fSelection; };
54  TH1 *GetHisto(TString histoName) { return fHistos[histoName]; };
55  TH1 *GetHisto(Int_t i) { return fHistoVector[i]; };
56  virtual void InitBranch() = 0; // set fClassName and fBranchName here
57  virtual void InitHistos() = 0;
58  virtual void AnaHits();
59  virtual void AnaHitNr(Int_t i){};
60  virtual void BeginOfEventAction(){};
61  virtual void EndOfEventAction(){};
62  virtual void ClearHistos(){};
63 
64  protected:
65  Int_t fActiveEvent;
66  Int_t fAnaEvents;
67  TFile *fFile;
68  TTree *fTree;
69  TClonesArray *fHitArray;
70  TString fClassName; // has to be set in constructor of derived class
71  TString fBranchName; // has to be set in constructor of derived class
72  TString fSelection; // will be passed to derived classes to do an event selection
73  TCanvas *fCan;
74  std::map<TString, TH1 *> fHistos;
75  std::map<TString, TString> fDrawOption; // stores the drawOption for the Draw command
76  std::vector<TH1 *> fHistoVector;
77  Int_t fCancol;
79 
81 };
82 
83 #endif
std::vector< TH1 * > fHistoVector
virtual void InitBranch()=0
void DrawHisto(TString path, TString opt="")
TH1 * GetHisto(Int_t i)
TCanvas * fCan
void SetCanvasColumns(Int_t col)
TString fSelection
virtual void ClearHistos()
void SetDrawOption(TString histoName, TString option)
void SetSelection(TString sel)
PndGeoHandling * fGeoH
unsigned int i
Definition: P4_F32vec4.h:21
ClassDef(PndMvdEventAna, 1)
TString GetSelection() const
TString fBranchName
virtual void Init(TString fileName)
Class to access the naming information of the MVD.
void DrawVector(Int_t index, TString opt)
TH1 * GetHisto(TString histoName)
TClonesArray * fHitArray
virtual void BeginOfEventAction()
std::map< TString, TString > fDrawOption
virtual void AnaHits()
virtual void InitHistos()=0
virtual ~PndMvdEventAna()
virtual void AnaHitNr(Int_t i)
TString fClassName
void AnaEventNr(Int_t Nr)
void AnaEvents(Int_t count)
virtual void EndOfEventAction()
Int_t GetEventNr() const
std::map< TString, TH1 * > fHistos