]>
Commit | Line | Data |
---|---|---|
d1cf83f5 | 1 | #ifndef AliToyMCReconstruction_H |
2 | #define AliToyMCReconstruction_H | |
3 | ||
a06336b6 | 4 | #include <TString.h> |
d1cf83f5 | 5 | #include <TObject.h> |
38d9d609 | 6 | #include <TClonesArray.h> |
7 | #include <TExMap.h> | |
36a79b0d | 8 | #include <TVectorFfwd.h> |
d1cf83f5 | 9 | |
10 | class TTree; | |
11 | ||
12 | class TTreeSRedirector; | |
13 | class AliExternalTrackParam; | |
510cfcff | 14 | class AliTPCtrackerSector; |
4a777885 | 15 | class AliToyMCEvent; |
223d9e38 | 16 | class AliTPCCorrection; |
79f54519 | 17 | class AliTPCseed; |
502eb90b | 18 | class AliTPCtrackerRow; |
c484014f | 19 | class AliToyMCTrack; |
20 | class AliTPCclusterMI; | |
38d9d609 | 21 | class AliRieman; |
c484014f | 22 | class AliTrackPoint; |
23 | class AliTPCParam; | |
d1cf83f5 | 24 | |
25 | class AliToyMCReconstruction : public TObject { | |
26 | public: | |
27 | AliToyMCReconstruction(); | |
28 | virtual ~AliToyMCReconstruction(); | |
29 | ||
30 | enum ECorrType { | |
31 | kNoCorrection = 0, | |
32 | kTPCCenter, | |
33 | kAverageEta, | |
7f72a764 | 34 | kIdeal, |
88386c5c | 35 | kPreliminaryEta // NOT TO USE (needs fixing!!! Not yet in full code!!!) |
d1cf83f5 | 36 | }; |
37 | ||
e83fd282 | 38 | enum EDet { |
39 | kITS=0, | |
40 | kTPC, | |
41 | kTRD | |
42 | }; | |
43 | ||
4a777885 | 44 | void RunReco(const char* file, Int_t nmaxEv=-1); |
510cfcff | 45 | void RunRecoAllClusters(const char* file, Int_t nmaxEv=-1); |
5993ed4f | 46 | void RunRecoAllClustersStandardTracking(const char* file, Int_t nmaxEv=-1); |
a06336b6 | 47 | |
48 | void RunFullTracking(const char* file, Int_t nmaxEv=-1); | |
4a777885 | 49 | |
d1cf83f5 | 50 | // reconstruction settings |
a06336b6 | 51 | void SetRecoSettings(Bool_t idealTracking, Int_t clusterType, ECorrType correctionType, Int_t seedingRow=130, Int_t seedingDist=10) |
05da1b4e | 52 | { fIdealTracking=idealTracking; fClusterType=clusterType; fSeedingRow=seedingRow, fSeedingDist=seedingDist, fCorrectionType=correctionType; } |
d1cf83f5 | 53 | |
54 | void SetClusterType(Int_t type) { fClusterType = type; } | |
55 | Int_t GetClusterType() const { return fClusterType; } | |
56 | ||
57 | void SetSeedingRow(Int_t row) { fSeedingRow = row; } | |
58 | Int_t GetSeedingRow() const { return fSeedingRow; } | |
59 | ||
60 | void SetSeedingDist(Int_t dist) { fSeedingDist = dist; } | |
61 | Int_t GetSeedingDist() const { return fSeedingDist; } | |
62 | ||
63 | void SetCorrType(ECorrType type) { fCorrectionType = type; } | |
64 | ECorrType GetCorrectionType() const { return fCorrectionType; } | |
65 | ||
600eaa0d | 66 | void SetUseMaterialBudget(Bool_t mat) { fUseMaterial = mat; } |
67 | Bool_t GetUseMaterialBudget() const { return fUseMaterial; } | |
68 | ||
69 | void SetIdealTracking(Bool_t tr) { fIdealTracking = tr; } | |
70 | Bool_t GetIdealTracking() const { return fIdealTracking; } | |
4388aa4a | 71 | |
72 | void SetFillClusterRes(Bool_t res) { fFillClusterRes=res; } | |
73 | Bool_t GetFillClusterRes() const { return fFillClusterRes; } | |
74 | ||
36a79b0d | 75 | void SetUseT0list(Bool_t use) { fUseT0list=use; } |
76 | Bool_t GetUseT0list() const { return fUseT0list; } | |
4388aa4a | 77 | |
36a79b0d | 78 | void SetForceAlpha(Bool_t use) { fForceAlpha=use; } |
79 | Bool_t GetForceAlpha() const { return fForceAlpha; } | |
600eaa0d | 80 | |
d1cf83f5 | 81 | void SetTree(TTree *tree) { fTree=tree; } |
82 | TTree* GetTree() const { return fTree; } | |
83 | ||
9d548f3c | 84 | AliExternalTrackParam* GetSeedFromTrack(const AliToyMCTrack * const tr, Bool_t forceSeed=kFALSE); |
e83fd282 | 85 | AliExternalTrackParam* GetSeedFromTrackIdeal(const AliToyMCTrack * const tr, EDet det ); |
4388aa4a | 86 | AliExternalTrackParam* GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, TClonesArray *arrClustRes=0x0); |
c0ebc0e0 | 87 | AliExternalTrackParam* GetFittedTrackFromSeedAllClusters(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, Int_t &nClus); |
e83fd282 | 88 | AliExternalTrackParam* GetTrackRefit(const AliToyMCTrack * const tr, EDet det); |
0403120d | 89 | |
90 | AliToyMCTrack *ConvertTPCSeedToToyMCTrack(const AliTPCseed &seed); | |
91 | AliExternalTrackParam* GetRefittedTrack(const AliTPCseed &seed); | |
92 | ||
38d9d609 | 93 | AliTPCclusterMI* FindMiddleCluster(const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter, |
94 | Double_t roady, Double_t roadz, | |
95 | AliRieman &seedFit); | |
96 | ||
97 | void AddMiddleClusters(AliTPCseed *seed, | |
98 | const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter, | |
99 | Double_t roady, Double_t roadz, | |
100 | Int_t &nTotalClusters, AliRieman &seedFit); | |
9d548f3c | 101 | Int_t MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2); |
502eb90b | 102 | void MakeSeeds(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2); |
38d9d609 | 103 | |
9d548f3c | 104 | void SetRieman(const AliTPCseed &seed, AliRieman &rieman); |
105 | void CopyRieman(const AliRieman &from, AliRieman &to); | |
106 | ||
79f54519 | 107 | AliExternalTrackParam* ClusterToTrackAssociation(const AliTPCseed *seed, Int_t trackID, Int_t &nClus); |
9d548f3c | 108 | void ClusterToTrackAssociation(AliTPCseed &seed); |
109 | void AssociateClusters(AliTPCseed &seed, Int_t firstRow, Int_t lastRow, Bool_t direction); | |
110 | ||
d1cf83f5 | 111 | void InitSpaceCharge(); |
112 | ||
c484014f | 113 | void SetLongT0seed(Bool_t l) { fLongT0seed=l; } |
114 | Bool_t GetLongT0seed() const { return fLongT0seed; } | |
115 | ||
9e98dea8 | 116 | static TTree* ConnectTrees(const char* files); |
117 | ||
d1cf83f5 | 118 | Double_t GetVDrift() const; |
119 | Double_t GetZLength(Int_t roc) const; | |
5993ed4f | 120 | |
a06336b6 | 121 | void InitStreamer(TString addName, Int_t level=1); |
c0ebc0e0 | 122 | |
a06336b6 | 123 | void ConnectInputFile(const char* file, Int_t nmaxEv=-1); |
38d9d609 | 124 | void Cleanup(); |
a06336b6 | 125 | |
126 | void DumpTracksToTree(const char* file); | |
38d9d609 | 127 | |
128 | // private: | |
d1cf83f5 | 129 | AliToyMCReconstruction(const AliToyMCReconstruction &rec); |
130 | AliToyMCReconstruction& operator= (AliToyMCReconstruction& rec); | |
131 | ||
132 | void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p); | |
133 | void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3]); | |
c0ebc0e0 | 134 | |
135 | Int_t LoadInnerSectors(); | |
136 | Int_t LoadOuterSectors(); | |
137 | ||
138 | Int_t GetSector(AliExternalTrackParam *track); | |
139 | void FillSectorStructure(Int_t maxev); | |
a06336b6 | 140 | void FillSectorStructureAC(); |
38d9d609 | 141 | |
142 | void SetupTrackMaps(); | |
a06336b6 | 143 | |
144 | void CookLabel(AliTPCseed *seed, Double_t fraction, Int_t info[5]=0); | |
145 | ||
9d548f3c | 146 | void DumpSeedInfo(TObjArray *arr); |
147 | void DumpTrackInfo(TObjArray *arr); | |
148 | void DumpSeedInfo(const AliToyMCTrack *toyTrack, AliTPCseed *seed); | |
149 | ||
a06336b6 | 150 | |
151 | void MarkClustersUsed(AliTPCseed *seed); | |
9d548f3c | 152 | void ResetClustersZtoTime(AliTPCseed *seed); |
36a79b0d | 153 | |
154 | Float_t FindClosestT0(const TVectorF &t0list, Float_t t0seed); | |
d1cf83f5 | 155 | |
156 | // reco settings | |
157 | Int_t fSeedingRow; // first row used for seeding | |
158 | Int_t fSeedingDist; // distance of seeds | |
159 | Int_t fClusterType; // cluster type to use | |
160 | ECorrType fCorrectionType; // type of space point correction | |
161 | Bool_t fDoTrackFit; // do track fitting | |
162 | Bool_t fUseMaterial; // use material budget in tracking | |
600eaa0d | 163 | Bool_t fIdealTracking; // use ideal coordinates for tracking |
d1cf83f5 | 164 | |
a06336b6 | 165 | Int_t fNmaxEvents; // maximum number of events |
166 | ||
d1cf83f5 | 167 | // current reconstruction info |
168 | Double_t fTime0; // current time0 used for reconstruction | |
600eaa0d | 169 | Bool_t fCreateT0seed; // if current seed is the T0 seed |
c484014f | 170 | Bool_t fLongT0seed; // if we should use a t0 seed including all clusters in the seed range |
4388aa4a | 171 | Bool_t fFillClusterRes; // fill cluster residuals? |
36a79b0d | 172 | Bool_t fUseT0list; // if the list of T0 information should be used to guess the T0 |
173 | Bool_t fForceAlpha; // force the correct alpha for the t0 seed extrapolation | |
d1cf83f5 | 174 | |
175 | TTreeSRedirector *fStreamer; // debug streamer | |
38d9d609 | 176 | TFile *fInputFile; // input file |
d1cf83f5 | 177 | TTree *fTree; // input tree with ToyMC info |
4a777885 | 178 | AliToyMCEvent *fEvent; // input event |
d1cf83f5 | 179 | |
180 | AliTPCParam *fTPCParam; // tpc reco parameters | |
223d9e38 | 181 | AliTPCCorrection *fTPCCorrection; // space charge |
5993ed4f | 182 | |
a06336b6 | 183 | const Int_t fkNSectorInner; //number of inner sectors |
184 | AliTPCtrackerSector *fInnerSectorArray; //array of inner sectors | |
185 | const Int_t fkNSectorOuter; //number of outer sectors | |
186 | AliTPCtrackerSector *fOuterSectorArray; //array of outer sectors | |
38d9d609 | 187 | |
a06336b6 | 188 | TClonesArray fAllClusters; //Array keeping all clusters for free seeding |
38d9d609 | 189 | |
a06336b6 | 190 | TExMap fMapTrackEvent; // map global track number -> event number |
191 | TExMap fMapTrackTrackInEvent; // map global track number -> track in event | |
38d9d609 | 192 | |
a06336b6 | 193 | Bool_t fIsAC; // if we are tracking with sector arrays running from 0-36 rather than 0-18 |
38d9d609 | 194 | |
d1cf83f5 | 195 | ClassDef(AliToyMCReconstruction,0) |
196 | }; | |
197 | ||
198 | ||
199 | #endif |