]>
Commit | Line | Data |
---|---|---|
df9db588 | 1 | #ifndef AliAODNeutral_H |
2 | #define AliAODNeutral_H | |
3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------------------------- | |
9 | // AOD track base class | |
10 | // Author: Markus Oldenburg, CERN | |
11 | //------------------------------------------------------------------------- | |
12 | ||
13 | #include <TRef.h> | |
14 | ||
15 | #include "AliVirtualParticle.h" | |
16 | #include "AliAODVertex.h" | |
17 | #include "AliAODTrack.h" | |
18 | ||
19 | class AliAODNeutral : public AliVirtualParticle { | |
20 | ||
21 | public: | |
22 | ||
23 | enum AODTrk_t {kUndef=-1, kPrimary, kSecondary, kOrphan}; | |
24 | ||
25 | enum AODTrkBits_t { | |
26 | kIsDCA=BIT(14) // set if fPosition is the DCA and not the position of the first point | |
27 | }; | |
28 | ||
29 | enum AODNeuTrkPID_t { | |
30 | kUnknown=0, kPhoton, kPi0, kNeutron, kKaon0, kEleCon, kOther}; | |
31 | ||
32 | AliAODNeutral(); | |
33 | AliAODNeutral(Int_t id, | |
34 | Int_t label, | |
35 | Double_t energy, | |
36 | Double_t x[3], | |
37 | Bool_t dca, | |
38 | Double_t covMatrix[21], | |
39 | Double_t pid[10], | |
40 | AliAODVertex *prodVertex, | |
41 | AliAODTrack *primTrack, | |
42 | Char_t ttype=kUndef); | |
43 | ||
44 | AliAODNeutral(Int_t id, | |
45 | Int_t label, | |
46 | Float_t energy, | |
47 | Float_t x[3], | |
48 | Bool_t dca, | |
49 | Float_t covMatrix[21], | |
50 | Float_t pid[10], | |
51 | AliAODVertex *prodVertex, | |
52 | AliAODTrack *primTrack, | |
53 | Char_t ttype=kUndef); | |
54 | ||
55 | virtual ~AliAODNeutral(); | |
56 | AliAODNeutral(const AliAODNeutral& trk); | |
57 | AliAODNeutral& operator=(const AliAODNeutral& trk); | |
58 | ||
59 | Double_t Chi2() const { return fChi2; } | |
60 | ||
61 | virtual Double_t E() const { return fEnergy; } | |
62 | // make a connection to the PID object, here!!! | |
63 | virtual Double_t M() const { return -999.; } | |
64 | ||
65 | // make a connection to the PID object, here!!! | |
66 | virtual Double_t Y() const { return -999.; } | |
67 | ||
68 | // PID | |
69 | virtual const Double_t *PID() const { return fPID; } | |
70 | ||
71 | template <class T> void GetPID(T *pid) const { | |
72 | for(Int_t i=0; i<10; ++i) pid[i]=fPID[i];} | |
73 | ||
74 | template <class T> void SetPID(const T *pid) { | |
75 | if(pid) for(Int_t i=0; i<10; ++i) fPID[i]=pid[i]; | |
76 | else {for(Int_t i=1; i<10; fPID[i++]=0); fPID[0]=1.;}} | |
77 | ||
78 | Int_t GetID() const { return fID; } | |
79 | Int_t GetLabel() const { return fLabel; } | |
80 | ||
81 | template <class T> Bool_t GetPosition(T *x) const { | |
82 | x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2]; | |
83 | return TestBit(kIsDCA);} | |
84 | ||
85 | template <class T> void SetCovMatrix(const T *covMatrix) { | |
86 | if(!fCovMatrix) fCovMatrix=new AliAODNeuCov(); | |
87 | fCovMatrix->SetCovMatrix(covMatrix);} | |
88 | ||
89 | template <class T> Bool_t GetCovMatrix(T *covMatrix) const { | |
90 | if(!fCovMatrix) return kFALSE; | |
91 | fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;} | |
92 | ||
93 | void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;} | |
94 | ||
95 | AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); } | |
96 | AliAODTrack *GetPrimTrack() const { return (AliAODTrack*)fPrimTrack.GetObject(); } | |
97 | ||
98 | ||
99 | void Print(const Option_t *opt = "") const; | |
100 | ||
101 | // setters | |
102 | void SetID(const Int_t id) { fID = id; } | |
103 | void SetLabel(const Int_t label) {fLabel = label; } | |
104 | ||
105 | template <class T> void SetPosition(const T *x, const Bool_t isDCA = kFALSE); | |
106 | void SetDCA(Double_t d, Double_t z); | |
107 | ||
108 | void SetChi2(const Double_t chi2) { fChi2 = chi2; } | |
109 | ||
110 | void SetProdVertex(TObject *vertex) { fProdVertex = vertex; } | |
111 | void SetPrimTrack(TObject *ptrack) { fPrimTrack = ptrack; } | |
112 | ||
113 | virtual Double_t Px() const {return 0.;} | |
114 | virtual Double_t Py() const {return 0.;} | |
115 | virtual Double_t Pz() const {return 0.;} | |
116 | virtual Double_t Pt() const {return 0.;} | |
117 | virtual Double_t P() const {return 0.;} | |
118 | virtual Double_t OneOverPt() const {return 0.;} | |
119 | virtual Double_t Phi() const {return 0.;} | |
120 | virtual Double_t Theta() const {return 0.;} | |
121 | virtual Double_t Eta() const {return 0.;} | |
122 | virtual Short_t Charge() const {return 0.;} | |
123 | ||
124 | class AliAODNeuCov { | |
125 | ||
126 | // | |
127 | // Class containing the covariance matrix for the cluster | |
128 | // | |
129 | // X Y Z E | |
130 | // | |
131 | // X fDiag[ 0] | |
132 | // | |
133 | // Y fOdia[ 0] fDiag[ 1] | |
134 | // | |
135 | // Z fOdia[ 1] fOdia[ 2] fDiag[ 2] | |
136 | // | |
137 | // E fOdia[ 3] fOdia[ 4] fOdia[ 5] fDiag[ 3] | |
138 | // | |
139 | ||
140 | public: | |
141 | AliAODNeuCov() {} | |
142 | virtual ~AliAODNeuCov() {} | |
143 | template <class T> void GetCovMatrix(T *cmat) const; | |
144 | template <class T> void SetCovMatrix(T *cmat); | |
145 | ||
146 | private: | |
147 | Double32_t fDiag[4]; // Diagonal elements | |
148 | Double32_t fODia[6]; // [-1, 1,8] 8 bit precision for off diagonal elements | |
149 | ||
150 | ClassDef(AliAODNeutral::AliAODNeuCov,1) | |
151 | ||
152 | }; | |
153 | ||
154 | private : | |
155 | ||
156 | // Energy & position | |
157 | Double32_t fEnergy; // energy | |
158 | Double32_t fPosition[3]; // position of first point on track or dca | |
159 | ||
160 | Double32_t fPID[10]; // [0.,1.,8] pointer to PID object | |
161 | Double32_t fChi2; // chi2 of mometum fit | |
162 | ||
163 | Int_t fID; // unique track ID, points back to the ESD track | |
164 | Int_t fLabel; // particle label, points back to MC track | |
165 | ||
166 | AliAODNeuCov *fCovMatrix; // covariance matrix (x, y, z, E) | |
167 | TRef fProdVertex; // vertex of origin | |
168 | TRef fPrimTrack; // primary track number associated with this cluster | |
169 | ||
170 | UChar_t fType; | |
171 | ||
172 | ||
173 | ClassDef(AliAODNeutral,1); | |
174 | }; | |
175 | ||
176 | #endif |