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 SetTree(TTree *tree) { fTree=tree; }
72 TTree* GetTree() const { return fTree; }
74 AliExternalTrackParam* GetSeedFromTrack(const AliToyMCTrack * const tr, Bool_t forceSeed=kFALSE);
75 AliExternalTrackParam* GetSeedFromTrackIdeal(const AliToyMCTrack * const tr, EDet det );
76 AliExternalTrackParam* GetFittedTrackFromSeed(const AliToyMCTrack *tr, const AliExternalTrackParam *seed);
77 AliExternalTrackParam* GetFittedTrackFromSeedAllClusters(const AliToyMCTrack *tr, const AliExternalTrackParam *seed, Int_t &nClus);
78 AliExternalTrackParam* GetTrackRefit(const AliToyMCTrack * const tr, EDet det);
80 AliToyMCTrack *ConvertTPCSeedToToyMCTrack(const AliTPCseed &seed);
81 AliExternalTrackParam* GetRefittedTrack(const AliTPCseed &seed);
83 AliTPCclusterMI* FindMiddleCluster(const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
84 Double_t roady, Double_t roadz,
87 void AddMiddleClusters(AliTPCseed *seed,
88 const AliTPCclusterMI *clInner, const AliTPCclusterMI *clOuter,
89 Double_t roady, Double_t roadz,
90 Int_t &nTotalClusters, AliRieman &seedFit);
91 Int_t MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
92 void MakeSeeds(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
94 void SetRieman(const AliTPCseed &seed, AliRieman &rieman);
95 void CopyRieman(const AliRieman &from, AliRieman &to);
97 AliExternalTrackParam* ClusterToTrackAssociation(const AliTPCseed *seed, Int_t trackID, Int_t &nClus);
98 void ClusterToTrackAssociation(AliTPCseed &seed);
99 void AssociateClusters(AliTPCseed &seed, Int_t firstRow, Int_t lastRow, Bool_t direction);
101 void InitSpaceCharge();
103 void SetLongT0seed(Bool_t l) { fLongT0seed=l; }
104 Bool_t GetLongT0seed() const { return fLongT0seed; }
106 static TTree* ConnectTrees(const char* files);
108 Double_t GetVDrift() const;
109 Double_t GetZLength(Int_t roc) const;
111 void InitStreamer(TString addName, Int_t level=1);
113 void ConnectInputFile(const char* file, Int_t nmaxEv=-1);
116 void DumpTracksToTree(const char* file);
119 AliToyMCReconstruction(const AliToyMCReconstruction &rec);
120 AliToyMCReconstruction& operator= (AliToyMCReconstruction& rec);
122 void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p);
123 void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3]);
125 Int_t LoadInnerSectors();
126 Int_t LoadOuterSectors();
128 Int_t GetSector(AliExternalTrackParam *track);
129 void FillSectorStructure(Int_t maxev);
130 void FillSectorStructureAC();
132 void SetupTrackMaps();
134 void CookLabel(AliTPCseed *seed, Double_t fraction, Int_t info[5]=0);
136 void DumpSeedInfo(TObjArray *arr);
137 void DumpTrackInfo(TObjArray *arr);
138 void DumpSeedInfo(const AliToyMCTrack *toyTrack, AliTPCseed *seed);
141 void MarkClustersUsed(AliTPCseed *seed);
142 void ResetClustersZtoTime(AliTPCseed *seed);
145 Int_t fSeedingRow; // first row used for seeding
146 Int_t fSeedingDist; // distance of seeds
147 Int_t fClusterType; // cluster type to use
148 ECorrType fCorrectionType; // type of space point correction
149 Bool_t fDoTrackFit; // do track fitting
150 Bool_t fUseMaterial; // use material budget in tracking
151 Bool_t fIdealTracking; // use ideal coordinates for tracking
153 Int_t fNmaxEvents; // maximum number of events
155 // current reconstruction info
156 Double_t fTime0; // current time0 used for reconstruction
157 Bool_t fCreateT0seed; // if current seed is the T0 seed
158 Bool_t fLongT0seed; // if we should use a t0 seed including all clusters in the seed range
160 TTreeSRedirector *fStreamer; // debug streamer
161 TFile *fInputFile; // input file
162 TTree *fTree; // input tree with ToyMC info
163 AliToyMCEvent *fEvent; // input event
165 AliTPCParam *fTPCParam; // tpc reco parameters
166 AliTPCCorrection *fTPCCorrection; // space charge
168 const Int_t fkNSectorInner; //number of inner sectors
169 AliTPCtrackerSector *fInnerSectorArray; //array of inner sectors
170 const Int_t fkNSectorOuter; //number of outer sectors
171 AliTPCtrackerSector *fOuterSectorArray; //array of outer sectors
173 TClonesArray fAllClusters; //Array keeping all clusters for free seeding
175 TExMap fMapTrackEvent; // map global track number -> event number
176 TExMap fMapTrackTrackInEvent; // map global track number -> track in event
178 Bool_t fIsAC; // if we are tracking with sector arrays running from 0-36 rather than 0-18
180 ClassDef(AliToyMCReconstruction,0)