]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCComparisonMI.h
New version of a macro
[u/mrichter/AliRoot.git] / TPC / AliTPCComparisonMI.h
CommitLineData
7699f61f 1
2
3////////////////////////////////////////////////////////////////////////
4//
5// Start of implementation of the class digitRow
6//
7////////////////////////////////////////////////////////////////////////
8const Int_t kgRowBytes = 32;
9
10class digitRow: public TObject {
11
12public:
13 digitRow();
14 virtual ~digitRow(){;}
15 void SetRow(Int_t row);
16 Bool_t TestRow(Int_t row);
17 digitRow & operator=(const digitRow &digOld);
18 Int_t RowsOn(Int_t upto=8*kgRowBytes);
19 Int_t Last();
20 Int_t First();
21 void Reset();
22
23//private:
24 UChar_t fDig[kgRowBytes];
25
26 ClassDef(digitRow,1) // container for digit pattern
27};
28ClassImp(digitRow)
29
30
31////////////////////////////////////////////////////////////////////////
32//
33// Start of implementation of the class AliTPCGenInfo
34//
35////////////////////////////////////////////////////////////////////////
36
37class AliTPCGenInfo: public TObject {
38
39public:
40 AliTPCGenInfo();
41 ~AliTPCGenInfo();
42
43 AliTrackReference fTrackRef; // track reference saved in the output tree
44 AliTrackReference fTrackRefOut; // decay track reference saved in the output tree
45 TParticle fParticle; // generated particle
46 Int_t fLabel; // track label
47 Int_t fEventNr; // event number
48
49 Float_t fDecayCoord[3]; // position of particle decay
50 Double_t fVDist[4]; //distance of the particle vertex from primary vertex
51
52 Int_t fRowsWithDigitsInn; // number of rows with digits in the inner sectors
53 Int_t fRowsWithDigits; // number of rows with digits in the outer sectors
54 Int_t fRowsTrackLength; // last - first row with digit
55 Int_t fDigitsInSeed; // digits in the default seed rows
56 Float_t fPrim; // theoretical dedx in tpc according particle momenta and mass
57 digitRow fRow; // information about digits row pattern
58 TClonesArray * fReferences; //containner with all track references
59 ClassDef(AliTPCGenInfo,1) // container for
60};
61ClassImp(AliTPCGenInfo)
62
63
64
65class AliTPCGenV0Info: public TObject {
66public:
67 AliTPCGenInfo fMCd; //info about daughter particle
68 AliTPCGenInfo fMCm; //info about mother particle
69 void Update(); // put some derived info to special field
70 Double_t fDist1; //info about closest distance according closest MC - linear DCA
71 Double_t fDist2; //info about closest distance parabolic DCA
72 //
73 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
74 Double_t fPd[4]; //exact momentum from MC info
75 Double_t fX[3]; //exact position of the vertex
76 Double_t fXr[3]; //rec. position according helix
77 //
78 Double_t fPm[3]; //momentum at the vertex mother
79 Double_t fAngle[3]; //three angels
80 Double_t fRr; // rec position of the vertex
81 Double_t fR; //exact r position of the vertex
82 Int_t fPdg[2]; //pdg code of mother and daugter particles
83 Int_t fLab[2]; //MC label of the partecle
84 ClassDef(AliTPCGenV0Info,1) // container for
85};
86ClassImp(AliTPCGenV0Info)
87
88
89
90void AliTPCGenV0Info::Update()
91{
92 fPd[0] = fMCd.fParticle.Px();
93 fPd[1] = fMCd.fParticle.Py();
94 fPd[2] = fMCd.fParticle.Pz();
95 fPd[3] = fMCd.fParticle.P();
96 fX[0] = fMCd.fParticle.Vx();
97 fX[1] = fMCd.fParticle.Vy();
98 fX[2] = fMCd.fParticle.Vz();
99 fR = TMath::Sqrt( fX[0]*fX[0]+
100 fX[1]*fX[1]);
101 fPdg[0] = fMCd.fParticle.GetPdgCode();
102 fPdg[1] = fMCm.fParticle.GetPdgCode();
103 //
104 fLab[0] = fMCd.fParticle.GetUniqueID();
105 fLab[1] = fMCm.fParticle.GetUniqueID();
106
107}
108
109
110
111
112 /////////////////////////////////////////////////////////////////////////
113class AliTPCRecInfo: public TObject {
114
115public:
116 AliTPCRecInfo(){fTP = new TClonesArray("AliTPCTrackPoint2",0);}
117 ~AliTPCRecInfo(){if (fTP) {fTP->Delete();delete fTP;}}
118 //
119 AliTPCtrack fTPCTrack; // tpc track
120 Float_t fTRLocalCoord[3]; //local coordinates of the track ref.
121 Int_t fReconstructed; //flag if track was reconstructed
122 Double_t fRecPhi; // reconstructed phi angle (0;2*kPI)
123 Double_t fLambda; // reconstructed
124 Double_t fRecPt_1; // reconstructed
125 Float_t fdEdx; // reconstructed dEdx
126 Int_t fFake; // fake track
127 Int_t fMultiple; // number of reconstructions
128 TClonesArray *fTP; //container with track points
129 void Reset();
130 //
131 ClassDef(AliTPCRecInfo,1) // container for
132};
133ClassImp(AliTPCRecInfo)
134
135void AliTPCRecInfo::Reset()
136{
137 fMultiple =0;
138 fFake =0;
139 fReconstructed=0;
140 fRecPhi =0;
141 fLambda =0;
142}
143
144
145/////////////////////////////////////////////////////////
146/////////////////////////////////////////////////////////
147/////////////////////////////////////////////////////////
148
149
150class AliTPCRecV0Info: public TObject {
151public:
152 AliTPCRecInfo fT1; //track1
153 AliTPCRecInfo fT2; //track2
154 Double_t fDist1; //info about closest distance according closest MC - linear DCA
155 Double_t fDist2; //info about closest distance parabolic DCA
156 //
157 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
158 Double_t fXr[3]; //rec. position according helix
159 //
160 Double_t fPm[3]; //momentum at the vertex mother
161 Double_t fAngle[3]; //three angles
162 Double_t fRr; // rec position of the vertex
163 Int_t fLab[2]; //MC label of the partecle
164 ClassDef(AliTPCRecV0Info,1) // container for
165};
166
167ClassImp(AliTPCRecV0Info)
168
169
170
171
172
173
174////////////////////////////////////////////////////////////////////////
175//
176// Start of implementation of the class TPCFindGenTracks
177//
178////////////////////////////////////////////////////////////////////////
179
180class TPCFindGenTracks {
181
182public:
183 TPCFindGenTracks();
184 TPCFindGenTracks(char * fnGalice, char* fnRes ="genTracks.root",
185 Int_t nEvents=1, Int_t firstEvent=0);
186 virtual ~TPCFindGenTracks();
187 void Reset();
188 Int_t Exec();
189 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
190 void CreateTreeGenTracks();
191 void CloseOutputFile();
192 Int_t TreeKLoop();
193 Int_t TreeTRLoop();
194 Int_t TreeDLoop();
195 //void FillInfo(Int_t iParticle);
196 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
197 void SetNEvents(Int_t i) {fNEvents = i;}
198 void SetDebug(Int_t level) {fDebug = level;}
199 Int_t SetIO(Int_t eventNr);
200 Int_t SetIO();
201 Float_t TR2LocalX(AliTrackReference *trackRef,
202 AliTPCParam *paramTPC);
203
204public:
205 AliTPCGenInfo* fMCInfo; //! information writen per particle
206 Int_t fDebug; //! debug flag
207 Int_t fEventNr; //! current event number
208 Int_t fLabel; //! track label
209 Int_t fNEvents; //! number of events to process
210 Int_t fFirstEventNr; //! first event to process
211 Int_t fNParticles; //! number of particles in TreeK
212 TTree *fTreeGenTracks; //! output tree with generated tracks
213 char *fFnRes; //! output file name with stored tracks
214 TFile *fFileGenTracks; //! output file with stored fTreeGenTracks
215 //
216 AliRunLoader * fLoader; //! pointer to the run loader
217 TTree * fTreeD; //! current tree with digits
218 TTree * fTreeTR; //! current tree with TR
219 AliStack *fStack; //! current stack
220 //
221 digitRow *fContainerDigitRow; //! big container for partial information
222 //
223 AliTrackReference *fReferences; //! container with track references
224 Int_t *fReferenceIndex0; //! first index for given track
225 Int_t *fReferenceIndex1; //! last index for given track
226 //
227 AliTPCParam* fParamTPC; //! AliTPCParam
228 Double_t fVPrim[3]; //! primary vertex position
229 // the fVDist[3] contains size of the 3-vector
230
231private:
232
233// some constants for the original non-pareller tracking (by Y.Belikov)
234 static const Int_t seedRow11 = 158; // nRowUp - 1
235 static const Int_t seedRow12 = 139; // nRowUp - 1 - (Int_t) 0.125*nRowUp
236 static const Int_t seedRow21 = 149; // seedRow11 - shift
237 static const Int_t seedRow22 = 130; // seedRow12 - shift
238 static const Double_t kRaddeg = 180./kPI;
239
240 static const Int_t fgMaxIndexTR = 50000; // maximum number of tracks with a track ref
241 static const Int_t fgMaxTR = 1000000; // maximum number of track refs
242
243 static const Int_t fgMaxParticles = 2000000; // maximum number of generated particles
244 static const Double_t fgPtCut = .1; // do not store particles with generated pT less than this
245 static const Float_t fgTrackRefLocalXMax = 82.95;
246 static const Float_t fgTrackRefLocalXMaxDelta = 5.;
247
248 ClassDef(TPCFindGenTracks,1) // class which creates and fills tree with TPCGenTrack objects
249};
250ClassImp(TPCFindGenTracks)
251
252
253
254////////////////////////////////////////////////////////////////////////
255//
256// Start of implementation of the class TPCCmpTr
257//
258////////////////////////////////////////////////////////////////////////
259
260class TPCCmpTr {
261
262public:
263 TPCCmpTr();
264 TPCCmpTr(char* fnGenTracks,
265 char* fnCmpRes ="cmpTracks.root",
266 char* fnGalice ="galice.root",
267 Int_t nEvents=1, Int_t firstEvent=0);
268 virtual ~TPCCmpTr();
269 void Reset();
270 Int_t Exec();
271 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
272 Int_t SetIO();
273 Int_t SetIO(Int_t eventNr );
274 void CreateTreeCmp();
275 void CloseOutputFile();
276 Bool_t ConnectGenTree();
277 Int_t TreeGenLoop(Int_t eventNr);
278 Int_t TreeTLoop(Int_t eventNr);
279 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
280 void SetNEvents(Int_t i) {fNEvents = i;}
281 void SetDebug(Int_t level) {fDebug = level;}
282
283// tmp method, should go to TrackReferenceTPC
284 TVector3 TR2Local(AliTrackReference *trackRef,
285 AliTPCParam *paramTPC);
286
287private:
288
289 Int_t fEventNr; //! current event number
290 Int_t fNEvents; //! number of events to process
291 Int_t fFirstEventNr; //! first event to process
292 //
293 char *fFnCmp; //! output file name with cmp tracks
294 TFile *fFileCmp; //! output file with cmp tracks
295 TTree *fTreeCmp; //! output tree with cmp tracks
296 //
297 char *fFnGenTracks; //! input file name with gen tracks
298 TFile *fFileGenTracks;
299 TTree *fTreeGenTracks;
300 //
301 //
302 AliRunLoader * fLoader; //! pointer to the run loader
303 TTree *fTreeRecTracks; //! tree with reconstructed tracks
304 TTree *fTreePoints; //! tree with reconstructed points
305 //
306 Int_t *fIndexRecTracks; //! index of particle label in the TreeT_TPC
307 Int_t *fFakeRecTracks; //! number of fake tracks
308 Int_t *fMultiRecTracks; //! number of multiple reconstructions
309 //
310 TObjArray * fTracks; //!container with tracks
311 TObjArray * fTrackPoints; //! container with track points
312 //
313 AliTPCParam* fParamTPC; //! AliTPCParam
314 Int_t fNParticles; //! number of particles in the input tree genTracks
315 Int_t fDebug; //! debug flag
316 Int_t fNextTreeGenEntryToRead; //! last entry already read from genTracks tree
317 //
318 AliTPCGenInfo* fMCInfo; //! MC information writen per particle
319 AliTPCRecInfo* fRecInfo; //! Rec. information writen per particle
320 //
321 AliTPCtrack *fTPCTrack; //! pointer to TPC track to connect branch
322
323 ClassDef(TPCCmpTr,1) // class which creates and fills tree with TPCGenTrack objects
324};
325ClassImp(TPCCmpTr)
326