]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Upgrade/AliToyMCDrawer.h
Updated drawing style
[u/mrichter/AliRoot.git] / TPC / Upgrade / AliToyMCDrawer.h
CommitLineData
a261de2f 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>
0403120d 8#include <TString.h>
9
a261de2f 10#include <AliTPCParam.h>
0403120d 11#include <AliTPCROC.h>
12
a261de2f 13#include "AliToyMCEvent.h"
14#include "AliToyMCTrack.h"
0403120d 15
a261de2f 16class TPolyMarker3D;
0403120d 17// class AliTPCROC;
a261de2f 18class TClonesArray;
19
33260805 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
a261de2f 35class 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
33260805 45 Int_t FillEventArray(Int_t middleEventNbr, Double_t snapShotTime = -1.);
a261de2f 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);
cdf56507 52 void DrawTrack2D(const AliToyMCTrack *track, Double_t centerTime, Double_t currentEventTime, Int_t color);
0403120d 53 void DrawLaserEvent(Int_t nLaserEvents=1, Int_t side=-1, Int_t rod=-1, Int_t bundle=-1, Int_t beam=-1);
a261de2f 54 void DrawGeometry();
cdf56507 55 void DrawGeometry2D();
a261de2f 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);
c484014f 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
a261de2f 65 const AliToyMCEvent* GetEvent(Int_t eventnr) const {return static_cast<const AliToyMCEvent*>(fEventArray->At(eventnr));}
cdf56507 66// private:
a261de2f 67
68 TTree* fInputTree;
0403120d 69 TFile* fInFile;
70 TString fFileName;
a261de2f 71 AliToyMCEvent* fEvent;
72 TClonesArray* fEventArray;
c484014f 73 TH1* fDispHist;
a261de2f 74
75 Double_t fCenterTime;
76 Double_t fDriftVel;
77 AliTPCParam *fTPCParam;
78 Double_t fMaxZ0;
a261de2f 79 Double_t fIFCRadius;
0403120d 80 Double_t fOFCRadius;
a261de2f 81 Double_t fTimeRange;
82 AliTPCROC *fRoc;
83 TClonesArray *fPoints;
0403120d 84 TClonesArray *fDistPoints;
85
c484014f 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
0403120d 94 Bool_t ConnectInputTree();
95
a261de2f 96 ClassDef(AliToyMCDrawer, 1);
97
98};
99
100
101
102
103
104
105
106
107
108
109#endif