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