]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/info/AliTRDtrackInfo.h
fix codding conventions. Still to be done:
[u/mrichter/AliRoot.git] / PWG1 / TRD / info / AliTRDtrackInfo.h
1 #ifndef ALITRDTRACKINFO_H
2 #define ALITRDTRACKINFO_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTRDtrackInfo.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8 ////////////////////////////////////////////////////////////////////////////
9 //                                                                        //
10 //  Reconstruction QA                                                     //
11 //                                                                        //
12 ////////////////////////////////////////////////////////////////////////////
13
14 #ifndef ALIPID_H
15 #include "AliPID.h"
16 #endif
17
18
19 template <typename Value> class TVectorT;
20 typedef struct TVectorT<Double_t> TVectorD;
21 class AliTRDseedV1;
22 class AliTRDtrackV1;
23 class AliTrackReference;
24 class AliExternalTrackParam;
25 class AliTRDtrackInfo : public TObject{
26 public:
27   enum{
28     kNTrackRefs = 12
29   };
30   class AliESDinfo{
31     friend class AliTRDtrackInfo;  // Friend class
32   public:
33     AliESDinfo();
34     AliESDinfo(const AliESDinfo &esd);
35     virtual ~AliESDinfo();
36     AliESDinfo& operator=(const AliESDinfo &esd);
37     void Delete(const Option_t *);
38     Bool_t      HasV0() const {return fHasV0;}
39     Int_t       GetId() const {return fId;}
40     ULong_t     GetStatus() const {return fStatus;}
41     Int_t       GetKinkIndex() const {return fKinkIndex;}
42     UShort_t    GetTPCncls() const {return fTPCncls;}
43     UChar_t     GetPidQuality() const {return fTRDpidQuality;}
44     Int_t       GetNSlices() const {return fTRDnSlices;}
45     Double32_t* GetSliceIter() const {return fTRDslices;}
46     const Double32_t* GetResponseIter() const {return &fTRDr[0];}
47     AliExternalTrackParam* GetOuterParam() const { return fOP;}
48     const Int_t* GetV0pid() const {return &fTRDv0pid[0];}
49     Int_t       GetV0pid(Int_t i) const {return fTRDv0pid[i];}
50
51   protected:
52     UChar_t     fHasV0;         // v0 bit
53     Int_t       fId;            // ESD track id
54     ULong_t     fStatus;        // ESD track status
55     Int_t       fKinkIndex;     // ESD kink index
56     UShort_t    fTPCncls;       // Number of Clusters inside TPC
57     Double32_t  fTRDr[AliPID::kSPECIES];  // TRD radial position
58     UChar_t     fTRDpidQuality; // TRD PID quality
59     Int_t       fTRDnSlices;    // number of slices used for PID
60     Double32_t *fTRDslices;     //[fTRDnSlices] 
61     AliExternalTrackParam *fOP; // outer param
62     Int_t  fTRDv0pid[AliPID::kSPECIES]; // PID from v0s
63
64     ClassDef(AliESDinfo, 3)     // ESD info related to TRD
65   };
66
67   class AliMCinfo{
68   friend class AliTRDtrackInfo;
69   public:
70     //typedef AliTrackReference (const* constAliTrackReference);
71     AliMCinfo();
72     AliMCinfo(const AliMCinfo &mc);
73     virtual ~AliMCinfo();
74     AliMCinfo& operator=(const AliMCinfo &mc);
75     Int_t   GetLabel() const {return fLabel;}
76     Int_t   GetNTrackRefs() const {return fNTrackRefs;}
77     Int_t   GetPDG() const {return fPDG;}
78     Int_t   GetPID() const ;
79     Bool_t  GetDirections(Float_t &x0, Float_t &y0, Float_t &z0, Float_t &dydx, Float_t &dzdx, Float_t &pt, UChar_t &s) const;
80     AliTrackReference const* GetTrackRef(Int_t ref=0) const {return fTrackRefs[ref];}
81     static Double_t GetKalmanStep() {return fgKalmanStep;}
82     void    PropagateKalman(
83         TVectorD *dx, TVectorD *dy, TVectorD *dz, 
84         TVectorD *pt, TVectorD *dpt, TVectorD *c) const;
85     static void SetKalmanStep(Double_t s) {fgKalmanStep = s;}
86   protected:
87     Int_t   fLabel;               // MC label  
88     Int_t   fPDG;                 // particle code
89     Int_t   fNTrackRefs;            // number of track refs
90     static Double_t fgKalmanStep; // Kalman step propagation
91     AliTrackReference  *fTrackRefs[kNTrackRefs];        // track refs array
92
93     ClassDef(AliMCinfo, 2)      // MC info related to TRD
94   };
95
96   AliTRDtrackInfo();
97   AliTRDtrackInfo(const AliTRDtrackInfo &trdInfo);
98   ~AliTRDtrackInfo();
99
100 //  void               Clear(const Option_t *){}
101   void               Delete(const Option_t *);
102   AliTRDtrackInfo&   operator=(const AliTRDtrackInfo &trdInfo);
103   void               AddTrackRef(const AliTrackReference *trackRef);
104   Int_t              GetTrackId() const { return fESD.fId;}
105   const AliESDinfo*  GetESDinfo() const { return &fESD; }
106   const AliMCinfo*   GetMCinfo() const { return fMC; }
107   Int_t              GetNumberOfClusters() const;
108   Int_t              GetNumberOfClustersRefit() const {return fNClusters;}
109   Int_t              GetNTracklets() const;
110   Int_t              GetNTrackRefs() const {return fMC ? fMC->fNTrackRefs:0;} 
111   Int_t              GetLabel() const { return fMC ? fMC->fLabel:0; }
112   Int_t              GetKinkIndex() const { return fESD.fKinkIndex;}
113   UShort_t           GetTPCncls() const { return fESD.fTPCncls;}
114   Int_t              GetPDG() const { return fMC ? fMC->fPDG : 0; }
115   Int_t              GetPID() const { return fMC ? fMC->GetPID() : -1; }
116   ULong_t            GetStatus() const {return fESD.fStatus;}
117   AliTRDtrackV1*     GetTrack() const { return fTRDtrack; }
118   AliTrackReference* GetTrackRef(Int_t entry) const;
119   AliTrackReference* GetTrackRef(const AliTRDseedV1* const tracklet) const;
120
121   Bool_t             IsCurved() const {return TestBit(kCurv);}
122   Bool_t             IsPrimary() const {return TestBit(kPrim);}
123   Bool_t             HasESDtrack() const{return ((fTRDtrack != 0x0) ||(fESD.fOP != 0));}
124   Bool_t             HasMCinfo() const { return (Bool_t)fMC; }
125
126   void               SetCurved(Bool_t curv = kTRUE) {SetBit(kCurv, curv);}
127   void               SetLabel(Int_t lab) {if(fMC) fMC->fLabel = lab; }
128   void               SetNumberOfClustersRefit(Int_t n) {fNClusters = n;}
129   inline void        SetMC();
130   void               SetPDG(Int_t pdg) {if(fMC) fMC->fPDG = pdg; }
131   void               SetPrimary(Bool_t prim = kTRUE) {SetBit(kPrim, prim);}
132   void               SetOuterParam(const AliExternalTrackParam *op);
133   void               SetStatus(ULong_t stat) {fESD.fStatus = stat;}
134   void               SetKinkIndex(Int_t kinkIndex) {fESD.fKinkIndex = kinkIndex;}
135   void               SetTPCncls(UShort_t TPCncls) {fESD.fTPCncls = TPCncls;}
136   void               SetTrackId(Int_t id) {fESD.fId = id;}
137   void               SetTrack(const AliTRDtrackV1 *track);
138   void               SetESDpidQuality(UChar_t q) { fESD.fTRDpidQuality = q;}
139   void               SetSlices(Int_t n, Double32_t *s);
140   inline void        SetESDpid(Double_t *);
141   inline void        SetV0pid(Int_t *);
142   void               SetV0(Bool_t v0=kTRUE) {fESD.fHasV0 = v0;}
143   
144 private:
145     enum{
146       kCurv = 14,
147       kPrim = 15
148   };
149   // this 2 data members have to go to ESD header.
150   Int_t              fNClusters;        // Numer of clusters from refit
151   AliTRDtrackV1      *fTRDtrack;            // tracklets data array
152   AliMCinfo          *fMC;            // MC extract for TRD
153   AliESDinfo         fESD;            // ESD extract for TRD
154
155   ClassDef(AliTRDtrackInfo, 4)        // TRD track info
156 };
157
158
159 //________________________________________________________
160 inline void AliTRDtrackInfo::SetMC()
161 {
162   if(!fMC) fMC = new AliMCinfo();
163 }
164
165 //________________________________________________________
166 inline void AliTRDtrackInfo::SetESDpid(Double_t * const r)
167
168   for(Int_t is = AliPID::kSPECIES; is--;) fESD.fTRDr[is] = r[is];
169 }
170
171 //________________________________________________________
172 inline void AliTRDtrackInfo::SetV0pid(Int_t * const r)
173
174   for(Int_t is = AliPID::kSPECIES; is--;) fESD.fTRDv0pid[is] = r[is];
175 }
176
177 #endif