]>
Commit | Line | Data |
---|---|---|
402a4145 | 1 | #ifndef AliToyMCDrawer_H |
2 | #define AliToyMCDrawer_H | |
3 | ||
4 | #include <TGraph2D.h> | |
5 | #include <TH3F.h> | |
6 | #include <TTree.h> | |
7 | #include <TFile.h> | |
8 | #include <TString.h> | |
9 | ||
10 | #include <AliTPCParam.h> | |
11 | #include <AliTPCROC.h> | |
12 | ||
13 | #include "AliToyMCEvent.h" | |
14 | #include "AliToyMCTrack.h" | |
15 | ||
16 | class TPolyMarker3D; | |
17 | // class AliTPCROC; | |
18 | class TClonesArray; | |
19 | ||
20 | /* Visualization class. To use */ | |
21 | ||
22 | /* AliToyMCDrawer* draw = new AliToyMCDrawer() */ | |
23 | /* draw->SetFileName("path/to/toyMC.root") */ | |
24 | ||
25 | /* draw->FillEventArray(Int_t centerEventNumber) */ | |
26 | /* or */ | |
27 | /* draw->FillEventArray(Double_t time) */ | |
28 | /* to display with a certain event in the center or at a certain time */ | |
29 | ||
30 | /* draw->DrawEvents(Bool_t both, Bool_t before) */ | |
31 | /* where "both" will display events before and after the middle event and */ | |
32 | /* before will show also events before (after) the middle event if true (false) */ | |
33 | /* when "both" is false */ | |
34 | ||
35 | class AliToyMCDrawer : public TObject { | |
36 | ||
37 | ||
38 | public: | |
39 | AliToyMCDrawer(); | |
40 | AliToyMCDrawer(const AliToyMCDrawer &drawer); | |
41 | AliToyMCDrawer& operator = (const AliToyMCDrawer &drawer); | |
42 | ||
43 | virtual ~AliToyMCDrawer(); | |
44 | ||
45 | Int_t FillEventArray(Int_t middleEventNbr, Double_t snapShotTime = -1.); | |
46 | Int_t FillEventArray(Double_t snapShotTime); | |
47 | Int_t GetNumberOfEvents() const {return fEventArray->GetEntriesFast(); } | |
48 | ||
49 | void SetFileName(const Char_t* filename) {fFileName = filename;} | |
50 | void DrawEvent(AliToyMCEvent *currentEvent, Double_t centerTime, Int_t color); | |
51 | void DrawTrack(const AliToyMCTrack *track, Double_t centerTime, Double_t currentEventTime, Int_t color); | |
52 | void DrawTrack2D(const AliToyMCTrack *track, Double_t centerTime, Double_t currentEventTime, Int_t color); | |
53 | void DrawLaserEvent(Int_t nLaserEvents=1, Int_t side=-1, Int_t rod=-1, Int_t bundle=-1, Int_t beam=-1); | |
54 | void DrawGeometry(); | |
55 | void DrawGeometry2D(); | |
56 | void DrawEvents(Bool_t both = kFALSE, Bool_t before = kTRUE); | |
57 | // void DrawEvents(Bool_t time = kTRUE, Bool_t both = kTRUE, Bool_t before = kTRUE); | |
58 | ||
59 | void SetProjectionType(const char* type) { fProjectionType=type; fProjectionType.ToUpper(); } | |
60 | void SetRangeTimeZ (Float_t min, Float_t max) { fTimeZmin=min; fTimeZmax=max; } | |
61 | void SetRangeGlobalX(Float_t min, Float_t max) { fGlobalXmin=min; fGlobalXmax=max; } | |
62 | void SetRangeGlobalR(Float_t min, Float_t max) { fGlobalXmin=min; fGlobalXmax=max; } | |
63 | void SetRangeGlobalY(Float_t min, Float_t max) { fGlobalYmin=min; fGlobalYmax=max; } | |
64 | ||
65 | const AliToyMCEvent* GetEvent(Int_t eventnr) const {return static_cast<const AliToyMCEvent*>(fEventArray->At(eventnr));} | |
66 | // private: | |
67 | ||
68 | TTree* fInputTree; | |
69 | TFile* fInFile; | |
70 | TString fFileName; | |
71 | AliToyMCEvent* fEvent; | |
72 | TClonesArray* fEventArray; | |
73 | TH1* fDispHist; | |
74 | ||
75 | Double_t fCenterTime; | |
76 | Double_t fDriftVel; | |
77 | AliTPCParam *fTPCParam; | |
78 | Double_t fMaxZ0; | |
79 | Double_t fIFCRadius; | |
80 | Double_t fOFCRadius; | |
81 | Double_t fTimeRange; | |
82 | AliTPCROC *fRoc; | |
83 | TClonesArray *fPoints; | |
84 | TClonesArray *fDistPoints; | |
85 | ||
86 | TString fProjectionType; // projection type, x,y,z,r combinations | |
87 | Float_t fTimeZmin; // Xmin (time axis) | |
88 | Float_t fTimeZmax; // Xmax (time axis) | |
89 | Float_t fGlobalXmin; // Ymin (global x) | |
90 | Float_t fGlobalXmax; // Ymax (global x) | |
91 | Float_t fGlobalYmin; // Zmin (global y) | |
92 | Float_t fGlobalYmax; // Zmax (global y) | |
93 | ||
94 | Bool_t ConnectInputTree(); | |
95 | ||
96 | ClassDef(AliToyMCDrawer, 1); | |
97 | ||
98 | }; | |
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | #endif |