]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliESDComparisonMI.h
Use pointers instead of static members (Marian)
[u/mrichter/AliRoot.git] / PWG1 / AliESDComparisonMI.h
1 #ifndef ALIESDCOMPARISONMI_H
2 #define ALIESDCOMPARISONMI_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 //////////////////////////////////////////////////////////////////////////////
9 //                          Class AliESDComparisonMI                        //
10 //   collect together MC info and Rec info for comparison purposes 
11 //                                           - effieciency studies and so on//                                                                 //
12 //   marian.ivanov@cern.ch                                                  //
13 //////////////////////////////////////////////////////////////////////////////
14
15
16 #include "TObject.h"
17 #include "AliESD.h"
18
19 #include "AliESDtrack.h"
20 #include "AliV0.h"
21 #include "AliESDfriendTrack.h"
22 #include "AliITStrackMI.h"
23 #include "AliTRDtrack.h"
24 class AliTPCseed;
25
26 /////////////////////////////////////////////////////////////////////////
27 class AliESDRecInfo: public TObject {
28   
29 public:
30   AliESDRecInfo();
31   AliESDRecInfo(const AliESDRecInfo& recinfo);
32   ~AliESDRecInfo();
33   void UpdatePoints(AliESDtrack* track);
34   void Update(AliMCInfo* info,AliTPCParam * par, Bool_t reconstructed, AliESD *event);
35   void Reset();
36   //
37   void SetESDtrack(const AliESDtrack *track);
38   AliESDtrack *GetESDtrack() const { return fESDtrack;}
39   AliESDfriendTrack *GetTrackF() const  { return fTrackF;}
40   AliTPCseed *GetTPCtrack() const { return fTPCtrack;}
41   AliITStrackMI *GetITStrack() const { return fITStrack;}
42   AliTRDtrack   *GetTRDtrack() const { return fTRDtrack;}
43   //
44   Float_t  fTPCPoints[10]; //start , biggest end points,max density .. density at the last 30 pad-rows
45   Double_t fTPCinR0[5];   //generated position of the track at inner tpc - radius [3] and fi [4]
46   Double_t fTPCinR1[5];   //reconstructed postion of the track           - radius [3] and fi [
47   Double_t fTPCinP0[5];   //generated position of the track at inner tpc
48   Double_t fTPCinP1[5];   //reconstructed postion of the track
49   Double_t fTPCAngle0[2]; // generated angle 
50   Double_t fTPCAngle1[2]; //refconstructed angle 
51   Double_t fTPCDelta[5];  // deltas
52   Double_t fTPCPools[5];  // pools
53   Double_t fITSinR0[5];   //generated position of the track at inner tpc
54   Double_t fITSinR1[5];   //reconstructed postion of the track
55   Double_t fITSinP0[5];   //generated position of the track at inner tpc
56   Double_t fITSinP1[5];   //reconstructed postion of the track
57   Double_t fITSAngle0[2]; // generated angle 
58   Double_t fITSAngle1[2]; //refconstructed angle
59   Double_t fITSDelta[5];  // deltas
60   Double_t fITSPools[5];  // pools
61   Float_t  fTRLocalCoord[3];       //local coordinates of the track ref.
62   Int_t    fStatus[4];        // status -0 not found - 1 -only in - 2 -in-out -3 -in -out-refit
63   Int_t    fLabels[2];         // labels
64
65   Bool_t   fITSOn;           // ITS refitted inward
66   Bool_t   fTRDOn;           // ITS refitted inward
67   Float_t  fDeltaP;          //delta of momenta
68   Double_t fSign;           // sign
69   Int_t    fReconstructed;         //flag if track was reconstructed
70   Int_t    fFake;             // fake track
71   Int_t    fMultiple;         // number of reconstructions
72   Bool_t   fTPCOn;           // TPC refitted inward
73   Float_t  fBestTOFmatch;        //best matching between times
74
75 private:
76   AliESDtrack   *fESDtrack;        // esd track
77   AliESDfriendTrack *fTrackF;      // friend track
78   AliTPCseed *fTPCtrack;        // tpc track
79   AliITStrackMI *fITStrack;        // its track
80   AliTRDtrack   *fTRDtrack;        // trd track
81   
82   ClassDef(AliESDRecInfo,2)  // container for 
83 };
84
85
86
87 /////////////////////////////////////////////////////////
88 /////////////////////////////////////////////////////////
89 /////////////////////////////////////////////////////////
90
91
92 class AliESDRecV0Info: public TObject {
93 public:
94   void Update(Float_t vertex[3]);
95   AliESDRecInfo  fT1;      //track1
96   AliESDRecInfo  fT2;      //track2  
97   Double_t       fDist1;    //info about closest distance according closest MC - linear DCA
98   Double_t       fDist2;    //info about closest distance parabolic DCA
99   Double_t       fInvMass;  //reconstructed invariant mass -
100   //
101   Double_t       fPdr[3];    //momentum at vertex daughter  - according approx at DCA
102   Double_t       fXr[3];     //rec. position according helix
103   //
104   Double_t       fRs[2];     // minimum radius in rphi intersection
105   Double_t       fDistMinR; // distance at minimal radius
106   Double_t       fPm[3];    //momentum at the vertex mother
107   Double_t       fAngle[3]; //three angles
108   Double_t       fRr;       // rec position of the vertex 
109   Int_t          fLab[2];   //MC label of the partecle
110   Float_t        fPointAngleFi; //point angle fi
111   Float_t        fPointAngleTh; //point angle theta
112   Float_t        fPointAngle;   //point angle full
113   Int_t          fV0Status;       // status of the kink
114   AliV0*         fV0tpc;           // Vo information from reconsturction according TPC
115   AliV0*         fV0its;           // Vo information from reconsturction according ITS
116   AliV0*         fV0rec;           // V0 information form the reconstruction
117   Int_t          fMultiple;
118   Int_t          fV0Multiple;
119   Int_t          fRecStatus;    // status form the reconstuction
120   ClassDef(AliESDRecV0Info,2)   // container for  
121 };
122
123
124
125 class AliESDRecKinkInfo: public TObject {
126 public:
127   void Update();
128   AliESDRecInfo  fT1;      //track1
129   AliESDRecInfo  fT2;      //track2  
130   AliESDkink     fKink;    //kink
131   Double_t       fDist1;    //info about closest distance according closest MC - linear DCA
132   Double_t       fDist2;    //info about closest distance parabolic DCA
133   Double_t       fInvMass;  //reconstructed invariant mass -
134   //
135   Double_t       fPdr[3];    //momentum at vertex daughter  - according approx at DCA
136   Double_t       fXr[3];     //rec. position according helix
137   //
138   Double_t       fPm[3];    //momentum at the vertex mother
139   Double_t       fAngle[3]; //three angles
140   Double_t       fRr;       // rec position of the vertex 
141   Double_t       fMinR;     // minimum radius in rphi intersection
142   Double_t       fDistMinR; // distance at minimal radius
143   Int_t          fLab[2];   //MC label of the partecle
144   Float_t        fPointAngleFi; //point angle fi
145   Float_t        fPointAngleTh; //point angle theta
146   Float_t        fPointAngle;   //point angle full
147   Int_t          fStatus;       //status -tracks 
148   Int_t          fRecStatus;    //kink -status- 0 - not found  1-good -  fake
149   Int_t          fMultiple;
150   Int_t          fKinkMultiple;
151   ClassDef(AliESDRecKinkInfo,1)   // container for  
152 };
153
154
155
156
157 ////////////////////////////////////////////////////////////////////////
158 // 
159 // Start of implementation of the class AliESDComparisonMI
160 //
161 ////////////////////////////////////////////////////////////////////////
162
163 class AliESDComparisonMI {
164
165 public:
166   AliESDComparisonMI();
167   AliESDComparisonMI(const char* fnGenTracks,
168            const char* fnCmpRes      ="cmpTracks.root", 
169            const char* fnGalice      ="galice.root", Int_t direction=0,
170            Int_t nEvents=1, Int_t firstEvent=0);
171   virtual ~AliESDComparisonMI();
172   void Reset();
173   Int_t Exec();
174   Int_t Exec(Int_t nEvents, Int_t firstEventNr);
175   Int_t SetIO();
176   Int_t SetIO(Int_t eventNr );
177   void CreateTreeCmp();
178   void CloseOutputFile();
179   Bool_t ConnectGenTree();
180   Int_t TreeGenLoop(Int_t eventNr);
181   Int_t TreeTLoop();
182   Int_t BuildKinkInfo0(Int_t eventNr); // build kink info 0
183   Int_t BuildV0Info(Int_t eventNr); // build kink info 0
184   void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
185   void SetNEvents(Int_t i) {fNEvents = i;}
186   void SetDebug(Int_t level) {fDebug = level;}
187
188 // tmp method, should go to TrackReferenceESD
189   static TVector3 TR2Local(AliTrackReference *trackRef,
190                     AliTPCParam *paramTPC);
191
192 private:
193
194   Int_t fEventNr;                 //! current event number
195   Int_t fNEvents;                 //! number of events to process
196   Int_t fFirstEventNr;            //! first event to process
197   //
198   char  fFnCmp[1000];                   //! output file name with cmp tracks
199   TFile *fFileCmp;                //! output file with cmp tracks
200   TTree *fTreeCmp;                //! output tree with cmp tracks
201   TTree *fTreeCmpKinks;                //! output tree with cmp Kinks
202   TTree *fTreeCmpV0;                //! output tree with cmp V0
203   //
204   char  fFnGenTracks[1000];             //! input file name with gen tracks
205   TFile *fFileGenTracks;
206   TTree *fTreeGenTracks;
207   TTree *fTreeGenKinks;            // tree with gen kinks
208   TTree *fTreeGenV0;            // tree with gen V0
209   //
210   //
211   Int_t  fDirection;
212   //
213   AliRunLoader * fLoader;         //! pointer to the run loader
214   //TTree *fTreeRecTracks;          //! tree with reconstructed tracks
215   //
216   Short_t *fIndexRecTracks;         //! index of particle label in the TreeT_ESD
217   Short_t *fFakeRecTracks;          //! number of fake tracks
218   Short_t *fMultiRecTracks;         //! number of multiple reconstructions
219   //
220   Short_t *fIndexRecKinks;         //! index of particle label in treeesd
221   Short_t *fMultiRecKinks;         //! number of multiple reconstructions
222   Short_t *fSignedKinks;           //! indicator that kink was not fake
223   //
224   Short_t *fIndexRecV0;         //! index of particle label in treeesd
225   Short_t *fMultiRecV0;         //! number of multiple reconstructions
226   Short_t *fSignedV0;                //! indicator that kink was not fake
227   //
228   TObjArray *fRecArray;           // container with rec infos
229   AliESD *fEvent;                 //!event
230   AliESDfriend *fESDfriend;              //!event friend
231   //
232   AliTPCParam* fParamTPC;         //! AliTPCParam
233   Int_t fNParticles;              //! number of particles in the input tree genTracks
234   Int_t fDebug;                   //! debug flag  
235   Int_t fNextTreeGenEntryToRead;    //! last entry already read from genTracks tree
236   Int_t fNextKinkToRead;            //! last entry already read from genKinks tree
237   Int_t fNextV0ToRead;            //! last entry already read from genV0 tree
238   //
239   AliMCInfo*  fMCInfo;           //! MC information writen per particle
240   AliGenKinkInfo* fGenKinkInfo;      //! MC information writen per Kink
241   AliGenV0Info* fGenV0Info;      //! MC information writen per Kink
242   AliESDRecInfo*  fRecInfo;          //! Rec. information writen per particle
243   AliESDfriendTrack*  fFriend;          //! friend track
244   AliESDRecKinkInfo* fRecKinkInfo;    //! reconstructed kink info
245   AliESDRecV0Info* fRecV0Info;    //! reconstructed kink info
246   //
247
248   ClassDef(AliESDComparisonMI,1)    // class which creates and fills tree with ESDGenTrack objects
249 };
250
251
252 #endif