]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Upgrade/AliToyMCReconstruction.h
o add z0 list
[u/mrichter/AliRoot.git] / TPC / Upgrade / AliToyMCReconstruction.h
CommitLineData
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
10class TTree;
11
12class TTreeSRedirector;
13class AliExternalTrackParam;
510cfcff 14class AliTPCtrackerSector;
4a777885 15class AliToyMCEvent;
223d9e38 16class AliTPCCorrection;
79f54519 17class AliTPCseed;
502eb90b 18class AliTPCtrackerRow;
c484014f 19class AliToyMCTrack;
20class AliTPCclusterMI;
38d9d609 21class AliRieman;
c484014f 22class AliTrackPoint;
23class AliTPCParam;
d1cf83f5 24
25class AliToyMCReconstruction : public TObject {
26public:
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
f45d00f9 78 void SetUseZ0list(Bool_t use) { fUseZ0list=use; }
79 Bool_t GetUseZ0list() const { return fUseZ0list; }
80
36a79b0d 81 void SetForceAlpha(Bool_t use) { fForceAlpha=use; }
82 Bool_t GetForceAlpha() const { return fForceAlpha; }
600eaa0d 83
d1cf83f5 84 void SetTree(TTree *tree) { fTree=tree; }
85 TTree* GetTree() const { return fTree; }
86
9d548f3c 87 AliExternalTrackParam* GetSeedFromTrack(const AliToyMCTrack * const tr, Bool_t forceSeed=kFALSE);
e83fd282 88 AliExternalTrackParam* GetSeedFromTrackIdeal(const AliToyMCTrack * const tr, EDet det );
4388aa4a 89 AliExternalTrackParam* GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, TClonesArray *arrClustRes=0x0);
c0ebc0e0 90 AliExternalTrackParam* GetFittedTrackFromSeedAllClusters(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, Int_t &nClus);
e83fd282 91 AliExternalTrackParam* GetTrackRefit(const AliToyMCTrack * const tr, EDet det);
0403120d 92
93 AliToyMCTrack *ConvertTPCSeedToToyMCTrack(const AliTPCseed &seed);
94 AliExternalTrackParam* GetRefittedTrack(const AliTPCseed &seed);
95
38d9d609 96 AliTPCclusterMI* FindMiddleCluster(const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
97 Double_t roady, Double_t roadz,
98 AliRieman &seedFit);
99
100 void AddMiddleClusters(AliTPCseed *seed,
101 const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
102 Double_t roady, Double_t roadz,
103 Int_t &nTotalClusters, AliRieman &seedFit);
9d548f3c 104 Int_t MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
502eb90b 105 void MakeSeeds(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
38d9d609 106
9d548f3c 107 void SetRieman(const AliTPCseed &seed, AliRieman &rieman);
108 void CopyRieman(const AliRieman &from, AliRieman &to);
109
79f54519 110 AliExternalTrackParam* ClusterToTrackAssociation(const AliTPCseed *seed, Int_t trackID, Int_t &nClus);
9d548f3c 111 void ClusterToTrackAssociation(AliTPCseed &seed);
112 void AssociateClusters(AliTPCseed &seed, Int_t firstRow, Int_t lastRow, Bool_t direction);
113
d1cf83f5 114 void InitSpaceCharge();
115
c484014f 116 void SetLongT0seed(Bool_t l) { fLongT0seed=l; }
117 Bool_t GetLongT0seed() const { return fLongT0seed; }
118
9e98dea8 119 static TTree* ConnectTrees(const char* files);
120
d1cf83f5 121 Double_t GetVDrift() const;
122 Double_t GetZLength(Int_t roc) const;
5993ed4f 123
a06336b6 124 void InitStreamer(TString addName, Int_t level=1);
c0ebc0e0 125
a06336b6 126 void ConnectInputFile(const char* file, Int_t nmaxEv=-1);
38d9d609 127 void Cleanup();
a06336b6 128
129 void DumpTracksToTree(const char* file);
38d9d609 130
131// private:
d1cf83f5 132 AliToyMCReconstruction(const AliToyMCReconstruction &rec);
133 AliToyMCReconstruction& operator= (AliToyMCReconstruction& rec);
134
135 void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p);
136 void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3]);
c0ebc0e0 137
138 Int_t LoadInnerSectors();
139 Int_t LoadOuterSectors();
140
141 Int_t GetSector(AliExternalTrackParam *track);
142 void FillSectorStructure(Int_t maxev);
a06336b6 143 void FillSectorStructureAC();
38d9d609 144
145 void SetupTrackMaps();
a06336b6 146
147 void CookLabel(AliTPCseed *seed, Double_t fraction, Int_t info[5]=0);
148
9d548f3c 149 void DumpSeedInfo(TObjArray *arr);
150 void DumpTrackInfo(TObjArray *arr);
151 void DumpSeedInfo(const AliToyMCTrack *toyTrack, AliTPCseed *seed);
152
a06336b6 153
154 void MarkClustersUsed(AliTPCseed *seed);
9d548f3c 155 void ResetClustersZtoTime(AliTPCseed *seed);
36a79b0d 156
f45d00f9 157 Float_t FindClosestT0(const TVectorF &t0list, const TVectorF &z0list, AliExternalTrackParam &t0seed);
d1cf83f5 158
159 // reco settings
160 Int_t fSeedingRow; // first row used for seeding
161 Int_t fSeedingDist; // distance of seeds
162 Int_t fClusterType; // cluster type to use
163 ECorrType fCorrectionType; // type of space point correction
164 Bool_t fDoTrackFit; // do track fitting
165 Bool_t fUseMaterial; // use material budget in tracking
600eaa0d 166 Bool_t fIdealTracking; // use ideal coordinates for tracking
d1cf83f5 167
a06336b6 168 Int_t fNmaxEvents; // maximum number of events
169
d1cf83f5 170 // current reconstruction info
171 Double_t fTime0; // current time0 used for reconstruction
600eaa0d 172 Bool_t fCreateT0seed; // if current seed is the T0 seed
c484014f 173 Bool_t fLongT0seed; // if we should use a t0 seed including all clusters in the seed range
4388aa4a 174 Bool_t fFillClusterRes; // fill cluster residuals?
36a79b0d 175 Bool_t fUseT0list; // if the list of T0 information should be used to guess the T0
f45d00f9 176 Bool_t fUseZ0list; // if the list of Z vertex information should be used to guess the T0
36a79b0d 177 Bool_t fForceAlpha; // force the correct alpha for the t0 seed extrapolation
d1cf83f5 178
179 TTreeSRedirector *fStreamer; // debug streamer
38d9d609 180 TFile *fInputFile; // input file
d1cf83f5 181 TTree *fTree; // input tree with ToyMC info
4a777885 182 AliToyMCEvent *fEvent; // input event
d1cf83f5 183
184 AliTPCParam *fTPCParam; // tpc reco parameters
223d9e38 185 AliTPCCorrection *fTPCCorrection; // space charge
5993ed4f 186
a06336b6 187 const Int_t fkNSectorInner; //number of inner sectors
188 AliTPCtrackerSector *fInnerSectorArray; //array of inner sectors
189 const Int_t fkNSectorOuter; //number of outer sectors
190 AliTPCtrackerSector *fOuterSectorArray; //array of outer sectors
38d9d609 191
a06336b6 192 TClonesArray fAllClusters; //Array keeping all clusters for free seeding
38d9d609 193
a06336b6 194 TExMap fMapTrackEvent; // map global track number -> event number
195 TExMap fMapTrackTrackInEvent; // map global track number -> track in event
38d9d609 196
a06336b6 197 Bool_t fIsAC; // if we are tracking with sector arrays running from 0-36 rather than 0-18
38d9d609 198
d1cf83f5 199 ClassDef(AliToyMCReconstruction,0)
200};
201
202
203#endif