1 #ifndef AliToyMCReconstruction_H
2 #define AliToyMCReconstruction_H
6 #include <TClonesArray.h>
11 class TTreeSRedirector;
12 class AliExternalTrackParam;
13 class AliTPCtrackerSector;
15 class AliTPCCorrection;
17 class AliTPCtrackerRow;
19 class AliTPCclusterMI;
24 class AliToyMCReconstruction : public TObject {
26 AliToyMCReconstruction();
27 virtual ~AliToyMCReconstruction();
34 kPreliminaryEta // NOT TO USE (needs fixing!!! Not yet in full code!!!)
43 void RunReco(const char* file, Int_t nmaxEv=-1);
44 void RunRecoAllClusters(const char* file, Int_t nmaxEv=-1);
45 void RunRecoAllClustersStandardTracking(const char* file, Int_t nmaxEv=-1);
47 void RunFullTracking(const char* file, Int_t nmaxEv=-1);
49 // reconstruction settings
50 void SetRecoSettings(Bool_t idealTracking, Int_t clusterType, ECorrType correctionType, Int_t seedingRow=130, Int_t seedingDist=10)
51 { fIdealTracking=idealTracking; fClusterType=clusterType; fSeedingRow=seedingRow, fSeedingDist=seedingDist, fCorrectionType=correctionType; }
53 void SetClusterType(Int_t type) { fClusterType = type; }
54 Int_t GetClusterType() const { return fClusterType; }
56 void SetSeedingRow(Int_t row) { fSeedingRow = row; }
57 Int_t GetSeedingRow() const { return fSeedingRow; }
59 void SetSeedingDist(Int_t dist) { fSeedingDist = dist; }
60 Int_t GetSeedingDist() const { return fSeedingDist; }
62 void SetCorrType(ECorrType type) { fCorrectionType = type; }
63 ECorrType GetCorrectionType() const { return fCorrectionType; }
65 void SetUseMaterialBudget(Bool_t mat) { fUseMaterial = mat; }
66 Bool_t GetUseMaterialBudget() const { return fUseMaterial; }
68 void SetIdealTracking(Bool_t tr) { fIdealTracking = tr; }
69 Bool_t GetIdealTracking() const { return fIdealTracking; }
71 void SetFillClusterRes(Bool_t res) { fFillClusterRes=res; }
72 Bool_t GetFillClusterRes() const { return fFillClusterRes; }
76 void SetTree(TTree *tree) { fTree=tree; }
77 TTree* GetTree() const { return fTree; }
79 AliExternalTrackParam* GetSeedFromTrack(const AliToyMCTrack * const tr, Bool_t forceSeed=kFALSE);
80 AliExternalTrackParam* GetSeedFromTrackIdeal(const AliToyMCTrack * const tr, EDet det );
81 AliExternalTrackParam* GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, TClonesArray *arrClustRes=0x0);
82 AliExternalTrackParam* GetFittedTrackFromSeedAllClusters(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, Int_t &nClus);
83 AliExternalTrackParam* GetTrackRefit(const AliToyMCTrack * const tr, EDet det);
85 AliToyMCTrack *ConvertTPCSeedToToyMCTrack(const AliTPCseed &seed);
86 AliExternalTrackParam* GetRefittedTrack(const AliTPCseed &seed);
88 AliTPCclusterMI* FindMiddleCluster(const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
89 Double_t roady, Double_t roadz,
92 void AddMiddleClusters(AliTPCseed *seed,
93 const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
94 Double_t roady, Double_t roadz,
95 Int_t &nTotalClusters, AliRieman &seedFit);
96 Int_t MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
97 void MakeSeeds(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
99 void SetRieman(const AliTPCseed &seed, AliRieman &rieman);
100 void CopyRieman(const AliRieman &from, AliRieman &to);
102 AliExternalTrackParam* ClusterToTrackAssociation(const AliTPCseed *seed, Int_t trackID, Int_t &nClus);
103 void ClusterToTrackAssociation(AliTPCseed &seed);
104 void AssociateClusters(AliTPCseed &seed, Int_t firstRow, Int_t lastRow, Bool_t direction);
106 void InitSpaceCharge();
108 void SetLongT0seed(Bool_t l) { fLongT0seed=l; }
109 Bool_t GetLongT0seed() const { return fLongT0seed; }
111 static TTree* ConnectTrees(const char* files);
113 Double_t GetVDrift() const;
114 Double_t GetZLength(Int_t roc) const;
116 void InitStreamer(TString addName, Int_t level=1);
118 void ConnectInputFile(const char* file, Int_t nmaxEv=-1);
121 void DumpTracksToTree(const char* file);
124 AliToyMCReconstruction(const AliToyMCReconstruction &rec);
125 AliToyMCReconstruction& operator= (AliToyMCReconstruction& rec);
127 void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p);
128 void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3]);
130 Int_t LoadInnerSectors();
131 Int_t LoadOuterSectors();
133 Int_t GetSector(AliExternalTrackParam *track);
134 void FillSectorStructure(Int_t maxev);
135 void FillSectorStructureAC();
137 void SetupTrackMaps();
139 void CookLabel(AliTPCseed *seed, Double_t fraction, Int_t info[5]=0);
141 void DumpSeedInfo(TObjArray *arr);
142 void DumpTrackInfo(TObjArray *arr);
143 void DumpSeedInfo(const AliToyMCTrack *toyTrack, AliTPCseed *seed);
146 void MarkClustersUsed(AliTPCseed *seed);
147 void ResetClustersZtoTime(AliTPCseed *seed);
150 Int_t fSeedingRow; // first row used for seeding
151 Int_t fSeedingDist; // distance of seeds
152 Int_t fClusterType; // cluster type to use
153 ECorrType fCorrectionType; // type of space point correction
154 Bool_t fDoTrackFit; // do track fitting
155 Bool_t fUseMaterial; // use material budget in tracking
156 Bool_t fIdealTracking; // use ideal coordinates for tracking
158 Int_t fNmaxEvents; // maximum number of events
160 // current reconstruction info
161 Double_t fTime0; // current time0 used for reconstruction
162 Bool_t fCreateT0seed; // if current seed is the T0 seed
163 Bool_t fLongT0seed; // if we should use a t0 seed including all clusters in the seed range
164 Bool_t fFillClusterRes; // fill cluster residuals?
166 TTreeSRedirector *fStreamer; // debug streamer
167 TFile *fInputFile; // input file
168 TTree *fTree; // input tree with ToyMC info
169 AliToyMCEvent *fEvent; // input event
171 AliTPCParam *fTPCParam; // tpc reco parameters
172 AliTPCCorrection *fTPCCorrection; // space charge
174 const Int_t fkNSectorInner; //number of inner sectors
175 AliTPCtrackerSector *fInnerSectorArray; //array of inner sectors
176 const Int_t fkNSectorOuter; //number of outer sectors
177 AliTPCtrackerSector *fOuterSectorArray; //array of outer sectors
179 TClonesArray fAllClusters; //Array keeping all clusters for free seeding
181 TExMap fMapTrackEvent; // map global track number -> event number
182 TExMap fMapTrackTrackInEvent; // map global track number -> track in event
184 Bool_t fIsAC; // if we are tracking with sector arrays running from 0-36 rather than 0-18
186 ClassDef(AliToyMCReconstruction,0)