1 #ifndef AliToyMCDrawer_H
2 #define AliToyMCDrawer_H
10 #include <AliTPCParam.h>
11 #include <AliTPCROC.h>
13 #include "AliToyMCEvent.h"
14 #include "AliToyMCTrack.h"
20 /* Visualization class. To use */
22 /* AliToyMCDrawer* draw = new AliToyMCDrawer() */
23 /* draw->SetFileName("path/to/toyMC.root") */
25 /* draw->FillEventArray(Int_t centerEventNumber) */
27 /* draw->FillEventArray(Double_t time) */
28 /* to display with a certain event in the center or at a certain time */
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 */
35 class AliToyMCDrawer : public TObject {
40 AliToyMCDrawer(const AliToyMCDrawer &drawer);
41 AliToyMCDrawer& operator = (const AliToyMCDrawer &drawer);
43 virtual ~AliToyMCDrawer();
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(); }
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);
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);
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; }
65 const AliToyMCEvent* GetEvent(Int_t eventnr) const {return static_cast<const AliToyMCEvent*>(fEventArray->At(eventnr));}
71 AliToyMCEvent* fEvent;
72 TClonesArray* fEventArray;
77 AliTPCParam *fTPCParam;
83 TClonesArray *fPoints;
84 TClonesArray *fDistPoints;
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)
94 Bool_t ConnectInputTree();
96 ClassDef(AliToyMCDrawer, 1);