]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/Upgrade/AliToyMCDrawer.h
2d1809b1a8238759093ba04359ba6206583ceec1
[u/mrichter/AliRoot.git] / TPC / Upgrade / AliToyMCDrawer.h
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 DrawLaserEvent(Int_t nLaserEvents=1, Int_t side=-1, Int_t rod=-1, Int_t bundle=-1, Int_t beam=-1);
53   void DrawGeometry();
54   void DrawEvents(Bool_t both = kFALSE, Bool_t before = kTRUE);
55   //  void DrawEvents(Bool_t time = kTRUE, Bool_t both = kTRUE, Bool_t before = kTRUE);
56
57   void SetProjectionType(const char* type) { fProjectionType=type; fProjectionType.ToUpper(); }
58   void SetRangeTimeZ  (Float_t min, Float_t max) { fTimeZmin=min; fTimeZmax=max; }
59   void SetRangeGlobalX(Float_t min, Float_t max) { fGlobalXmin=min; fGlobalXmax=max; }
60   void SetRangeGlobalR(Float_t min, Float_t max) { fGlobalXmin=min; fGlobalXmax=max; }
61   void SetRangeGlobalY(Float_t min, Float_t max) { fGlobalYmin=min; fGlobalYmax=max; }
62   
63   const AliToyMCEvent* GetEvent(Int_t eventnr) const {return static_cast<const AliToyMCEvent*>(fEventArray->At(eventnr));}
64 private:
65
66   TTree* fInputTree;
67   TFile* fInFile;
68   TString fFileName;
69   AliToyMCEvent* fEvent;
70   TClonesArray* fEventArray;
71   TH1* fDispHist;
72   
73   Double_t fCenterTime;
74   Double_t fDriftVel;
75   AliTPCParam *fTPCParam;
76   Double_t fMaxZ0;
77   Double_t fIFCRadius;
78   Double_t fOFCRadius;
79   Double_t fTimeRange;
80   AliTPCROC *fRoc;
81   TClonesArray *fPoints;
82   TClonesArray *fDistPoints;
83
84   TString         fProjectionType;                  // projection type, x,y,z,r combinations
85   Float_t         fTimeZmin;                            // Xmin (time axis)
86   Float_t         fTimeZmax;                            // Xmax (time axis)
87   Float_t         fGlobalXmin;                            // Ymin (global x)
88   Float_t         fGlobalXmax;                            // Ymax (global x)
89   Float_t         fGlobalYmin;                            // Zmin (global y)
90   Float_t         fGlobalYmax;                            // Zmax (global y)
91   
92   Bool_t ConnectInputTree();
93   
94   ClassDef(AliToyMCDrawer, 1);
95
96 };
97
98
99
100
101
102
103
104
105
106
107 #endif