]>
Commit | Line | Data |
---|---|---|
778636d4 | 1 | #ifndef AliNanoAODTrack_H |
2 | #define AliNanoAODTrack_H | |
3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | ||
7 | //------------------------------------------------------------------------- | |
8 | // AOD NanoAOD track implementation | |
9 | // NanoAOD tracks are lightweight tracks which only contain a subset | |
10 | // of and ESD/AOD tracks. They are meant to be stored in specialized | |
11 | // nanoAOD for specific analysis. | |
12 | // The standard constructor takes either a AOD or an ESD track and a | |
13 | // list of comma separated variables. | |
14 | // Only those variables are actually allocated and saved with the track. | |
15 | // Attempts to use any other variable produces an AliFatal | |
16 | // | |
17 | // Allowed kin var: | |
18 | // pt, theta, phi, chi2perNDF, posx, posy, posz, covmat, posDCAx, | |
19 | // posDCAy, pDCAx, pDCAy, pDCAz, RAtAbsorberEnd, TPCncls, TPCnclsF, | |
20 | // TPCNCrossedRows, TrackPhiOnEMCal, TrackEtaOnEMCal, | |
21 | // TrackPtOnEMCal, ITSsignal, TPCsignal, TPCsignalTuned, | |
22 | // TPCsignalN, TPCmomentum, TPCTgl, TOFsignal, integratedLenght, | |
23 | // TOFsignalTuned, HMPIDsignal, HMPIDoccupancy, TRDsignal, | |
24 | // TRDChi2, TRDnSlices | |
25 | ||
26 | // Custom vars | |
27 | // if the var name begins by "cst", it allows to add a track | |
28 | // property not initially foreseen in the Vtrack or in the | |
29 | // original AOD. For instance, you can add the value of the | |
30 | // bayesian probability to be a kaon by using cstKBayes. Custom | |
31 | // variables can be set at once using | |
32 | // AliNanoAODTrack::SetCustomVariables(Double_t *vars), by | |
33 | // providing them in the same order as they are defined. // FIXME: to be implemented | |
34 | // | |
35 | // | |
36 | // TODO | |
37 | // - Go through class again after implementation | |
38 | // - Decide if you want to create a short or int array | |
39 | // - in the constructor, set the covariant matrix only if requested | |
40 | // | |
41 | // INFO/TO BE DECIDED | |
42 | // - I think this should not support muons, since muons have already their specialized AOD class | |
43 | // Author: Michele Floris, CERN | |
44 | //------------------------------------------------------------------------- | |
45 | ||
46 | #include <TRef.h> | |
47 | #include <TBits.h> | |
48 | #include <iostream> | |
49 | #include "AliVTrack.h" | |
50 | #include "AliAODVertex.h" | |
51 | #include "AliAODRedCov.h" | |
52 | #include "AliAODPid.h" | |
53 | #include "AliAODTrack.h" | |
54 | #include "TObjString.h" | |
55 | #include "TMap.h" | |
56 | #include "AliNanoAODTrackMapping.h" | |
57 | #include "AliNanoAODStorage.h" | |
58 | ||
59 | ||
60 | #include <vector> | |
61 | ||
62 | class AliVVertex; | |
63 | class AliDetectorPID; | |
64 | class AliTPCdEdxInfo; | |
65 | class AliAODEvent; | |
66 | class AliAODTrack; | |
67 | class AliESDTrack; | |
68 | ||
69 | class AliNanoAODTrack : public AliVTrack, public AliNanoAODStorage { | |
70 | ||
71 | public: | |
72 | ||
73 | using TObject::ClassName; | |
74 | ||
75 | AliNanoAODTrack(); | |
76 | AliNanoAODTrack(AliAODTrack * aodTrack, const char * vars); | |
77 | AliNanoAODTrack(AliESDTrack * esdTrack, const char * vars); | |
78 | AliNanoAODTrack(const char * vars); | |
79 | ||
80 | virtual ~AliNanoAODTrack(); | |
81 | AliNanoAODTrack(const AliNanoAODTrack& trk); | |
82 | AliNanoAODTrack& operator=(const AliNanoAODTrack& trk); | |
83 | ||
c11aeec8 | 84 | |
85 | virtual void Clear(Option_t * opt) ; | |
778636d4 | 86 | |
87 | // kinematics | |
88 | virtual Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : -999.; } | |
89 | virtual Double_t Phi() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi()); } | |
90 | virtual Double_t Theta() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta()); } | |
91 | ||
92 | virtual Double_t Px() const { return Pt() * TMath::Cos(Phi()); } | |
93 | virtual Double_t Py() const { return Pt() * TMath::Sin(Phi()); } | |
94 | virtual Double_t Pz() const { return Pt() / TMath::Tan(Theta()); } | |
95 | virtual Double_t Pt() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPt()); } | |
96 | virtual Double_t P() const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); } | |
97 | virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } | |
98 | ||
99 | virtual Double_t Xv() const { return GetProdVertex() ? GetProdVertex()->GetX() : -999.; } | |
100 | virtual Double_t Yv() const { return GetProdVertex() ? GetProdVertex()->GetY() : -999.; } | |
101 | virtual Double_t Zv() const { return GetProdVertex() ? GetProdVertex()->GetZ() : -999.; } | |
102 | virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } | |
103 | ||
104 | Double_t Chi2perNDF() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()); } | |
105 | UShort_t GetTPCNcls() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCncls()); } // FIXME: should this be short? | |
106 | ||
107 | virtual Double_t M() const { AliFatal("Not Implemented"); return -1; } | |
108 | Double_t M(AliAODTrack::AODTrkPID_t pid) const; | |
109 | virtual Double_t E() const { AliFatal("Not Implemented"); return -1; } | |
110 | Double_t E(AliAODTrack::AODTrkPID_t pid) const; | |
111 | Double_t E(Double_t m) const { return TMath::Sqrt(P()*P() + m*m); } | |
112 | virtual Double_t Y() const { AliFatal("Not Implemented"); return -1; } | |
113 | Double_t Y(AliAODTrack::AODTrkPID_t pid) const; | |
114 | Double_t Y(Double_t m) const; | |
115 | ||
116 | virtual Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * Theta())); } | |
117 | virtual Short_t Charge() const {return fCharge; } // FIXME: leave like this? Create shorts array? | |
118 | virtual Bool_t PropagateToDCA(const AliVVertex *vtx, | |
119 | Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3]); | |
120 | ||
121 | ||
122 | // Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;} | |
123 | ULong_t GetStatus() const { AliFatal("Not implemented"); return 0; } | |
124 | // ULong_t GetFlags() const { return fFlags; } | |
125 | ||
126 | // Int_t GetID() const { return (Int_t)fID; } // FIXME another int (short) | |
127 | Int_t GetID() const { AliFatal("Not Implemented"); return 0; } // FIXME another int (short) | |
128 | Int_t GetLabel() const { return fLabel; } // | |
129 | // void GetTOFLabel(Int_t *p) const; | |
130 | ||
131 | ||
132 | // Bool_t IsPrimaryCandidate() const; | |
133 | // FIXME: do we need any of the following (note that I already removed the bit enums) | |
134 | // Bool_t GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); } | |
135 | // Bool_t GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); } | |
136 | ||
137 | // Bool_t IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); } | |
138 | // Bool_t IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); } | |
139 | // Bool_t IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming | |
140 | // Bool_t IsTPCConstrained() const { return TestBit(kIsTPCConstrained); } | |
141 | // Bool_t IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); } | |
142 | // | |
143 | // | |
144 | template <typename T> void GetP(T *p) const { | |
145 | p[0]=Pt(); p[1]=Phi(); p[2]=Theta();} | |
146 | ||
147 | // template <typename T> void GetPxPyPz(T *p) const { | |
148 | // p[0] = Px(); p[1] = Py(); p[2] = Pz();} | |
149 | Bool_t GetPxPyPz(Double_t *p) const; | |
150 | ||
151 | ||
152 | template <typename T> Bool_t GetPosition(T *x) const { | |
153 | x[0]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); x[1]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()); x[2]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ()); | |
154 | return TestBit(AliAODTrack::kIsDCA);} | |
155 | ||
156 | // FIXME: only allocate if listed? | |
157 | // template <typename T> void SetCovMatrix(const T *covMatrix) { | |
158 | // if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>(); | |
159 | // fCovMatrix->SetCovMatrix(covMatrix);} | |
160 | ||
161 | // template <typename T> Bool_t GetCovMatrix(T *covMatrix) const { | |
162 | // if(!fCovMatrix) return kFALSE; | |
163 | // fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;} | |
164 | ||
165 | Bool_t GetXYZ(Double_t *p) const { | |
166 | return GetPosition(p); } | |
167 | ||
168 | Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const; | |
169 | ||
170 | Bool_t GetCovarianceXYZPxPyPz(Double_t /*cv*/[21]) const {AliFatal("Not implemented"); return 0;} | |
171 | // return GetCovMatrix(cv);} | |
172 | ||
173 | // void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;} | |
174 | ||
175 | Double_t XAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()); } | |
176 | Double_t YAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()); } | |
177 | Double_t ZAtDCA() const { // FIXME: not sure about this one | |
178 | if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()); | |
179 | else return -999.; } | |
180 | Bool_t XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; } | |
181 | ||
182 | Double_t DCA() const { // FIXME: not sure about this one | |
183 | if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); // FIXME: Why does this return posX? | |
184 | else return -999.; } | |
185 | ||
186 | Double_t PxAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAX()); } | |
187 | Double_t PyAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAY()); } | |
188 | Double_t PzAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAZ()); } | |
189 | Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); } | |
190 | Bool_t PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; } | |
191 | ||
192 | Double_t GetRAtAbsorberEnd() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()); } | |
193 | ||
194 | // For this whole block of cluster maps I could simply define a cluster map in the int array. For the moment comment all maps. Maybe not neede | |
195 | UChar_t GetITSClusterMap() const { AliFatal("Not Implemented"); return 0;}; | |
196 | // Int_t GetITSNcls() const; | |
197 | // Bool_t HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); } | |
198 | // UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }// Fixme: array of uchars or of int? | |
199 | // UInt_t GetMUONClusterMap() const { return (fITSMuonClusterMap&0x3ff0000)>>16; } // | |
200 | // UInt_t GetITSMUONClusterMap() const { return fITSMuonClusterMap; } | |
201 | ||
202 | // Bool_t TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);} | |
203 | // Bool_t TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);} | |
204 | // void SetFilterMap(UInt_t i){fFilterMap = i;} | |
205 | // UInt_t GetFilterMap() const {return fFilterMap;} | |
206 | ||
207 | // const TBits& GetTPCClusterMap() const {return fTPCClusterMap;} | |
208 | // const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;} | |
209 | // const TBits& GetTPCFitMap() const {return fTPCFitMap;} | |
210 | // const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;} | |
211 | ||
212 | Float_t GetTPCClusterInfo(Int_t /*nNeighbours=3*/, Int_t /*type=0*/, Int_t /*row0=0*/, Int_t /*row1=159*/, Int_t /*type*/=0) const { AliFatal("Not Implemented"); return 0;}; // FIXME What is this? | |
213 | ||
214 | // const TBits& GetTPCSharedMap() const {return fTPCSharedMap;} | |
215 | // const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;} | |
216 | // void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;} | |
217 | // void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;} | |
218 | // void SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;} | |
219 | // | |
220 | void SetTPCPointsF(UShort_t findable){fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF()] = findable;} | |
221 | void SetTPCNCrossedRows(UInt_t n) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows()] = n;} | |
222 | ||
223 | UShort_t GetTPCNclsF() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF());} | |
224 | UShort_t GetTPCNCrossedRows() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows());} | |
225 | Float_t GetTPCFoundFraction() const { return GetTPCNCrossedRows()>0 ? float(GetTPCNcls())/GetTPCNCrossedRows() : 0;} | |
226 | ||
227 | // Calorimeter Cluster | |
228 | // FIXME: to be implemented | |
229 | // Int_t GetEMCALcluster() const {return fCaloIndex;} | |
230 | // void SetEMCALcluster(Int_t index) {fCaloIndex=index;} | |
231 | // Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;} | |
232 | ||
233 | Double_t GetTrackPhiOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal());} | |
234 | Double_t GetTrackEtaOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal());} | |
235 | Double_t GetTrackPtOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal());} | |
236 | Double_t GetTrackPOnEMCal() const {return TMath::Abs(GetTrackEtaOnEMCal()) < 1 ? GetTrackPtOnEMCal()*TMath::CosH(GetTrackEtaOnEMCal()) : -999;} | |
237 | void SetTrackPhiEtaPtOnEMCal(Double_t phi,Double_t eta,Double_t pt) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal()]=phi;fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal()]=eta;fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal()]=pt;} | |
238 | ||
239 | // Int_t GetPHOScluster() const {return fCaloIndex;} // TODO: int array | |
240 | // void SetPHOScluster(Int_t index) {fCaloIndex=index;} | |
241 | // Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}//TODO: fFlags? | |
242 | ||
243 | //pid signal interface | |
244 | //TODO you can remove the PID object | |
245 | Double_t GetITSsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetITSsignal());} | |
246 | Double_t GetTPCsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignal());} | |
247 | Double_t GetTPCsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned());} | |
248 | void SetTPCsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned()] = signal;} | |
249 | UShort_t GetTPCsignalN() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalN());}// FIXME: what is this? | |
250 | // virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;} // FIXME: is this needed? | |
251 | Double_t GetTPCmomentum() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCmomentum()); } | |
252 | Double_t GetTPCTgl() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCTgl()); } // FIXME: what is this? | |
253 | Double_t GetTOFsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignal()); } | |
254 | Double_t GetIntegratedLength() const { AliFatal("Not implemented"); return 0;} // TODO: implement track lenght | |
9c35eb62 | 255 | void SetIntegratedLength(Double_t/* l*/) {AliFatal("Not implemented");} |
778636d4 | 256 | Double_t GetTOFsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned());} |
257 | void SetTOFsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned()] = signal;} | |
258 | Double_t GetHMPIDsignal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDsignal());}; | |
259 | Double_t GetHMPIDoccupancy() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDoccupancy());}; | |
260 | ||
261 | ||
262 | ||
263 | virtual void GetIntegratedTimes(Double_t */*times*/, Int_t) const { AliFatal("Not implemented"); return;} // FIXME check implementation | |
264 | ||
265 | // ________________________________________________________________________________________________________________ | |
266 | // *** FIXME Those methods used fPID in the AOD track. Reimplement as an array of kin vars? *** | |
267 | // It's also a bit ugly that I used a mixed approach here: some methods are commented, some other alifatal | |
268 | // void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const; | |
269 | // void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const; | |
270 | // Bool_t GetOuterHmpPxPyPz(Double_t *p) const; | |
271 | // Int_t GetHMPIDcluIdx() const;// FIXME: array of ints? | |
272 | // void GetITSdEdxSamples(Double_t s[4]) const; // FIXME: To be reimplemented. Use one kin var for each sample | |
273 | Int_t GetTOFBunchCrossing(Double_t /*b=0*/, Bool_t /*tpcPIDonly=kFALSE*/) const {AliFatal("Not Implemented"); return 0;}; | |
274 | UChar_t GetTRDncls(Int_t /*layer*/) const {AliFatal("Not Implemented"); return 0;}; | |
275 | Double_t GetTRDslice(Int_t /*plane*/, Int_t /*slice*/) const {AliFatal("Not Implemented"); return 0;}; | |
276 | Double_t GetTRDmomentum(Int_t /*plane*/, Double_t */*sp*/=0x0) const {AliFatal("Not Implemented"); return 0;}; | |
277 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
278 | ||
279 | Double_t GetTRDsignal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDsignal());} | |
280 | Double_t GetTRDchi2() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDChi2());} | |
281 | UChar_t GetTRDncls() const {return GetTRDncls(-1);} | |
282 | Int_t GetNumberOfTRDslices() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDnSlices()); } | |
283 | ||
284 | const AliAODEvent* GetAODEvent() const {return fAODEvent;}// FIXME: change to special event type | |
285 | void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;} | |
286 | ||
287 | AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); } // FIXME: change to special vertex type | |
288 | ||
289 | ||
290 | void Print(const Option_t *opt = "") const; | |
291 | ||
292 | // setters | |
293 | // void SetFlags(ULong_t flags) { fFlags = flags; } | |
294 | // void SetStatus(ULong_t flags) { fFlags|=flags; } | |
295 | // void ResetStatus(ULong_t flags) { fFlags&=~flags; } | |
296 | ||
297 | // void SetID(Short_t id) { fID = id; } | |
298 | void SetLabel(Int_t label) { fLabel = label; } | |
299 | // void SetTOFLabel(const Int_t* p); | |
300 | template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE); | |
301 | void SetDCA(Double_t d, Double_t z); | |
302 | void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForVtxFit) : ResetBit(AliAODTrack::kUsedForVtxFit); } | |
303 | void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForPrimVtxFit) : ResetBit(AliAODTrack::kUsedForPrimVtxFit); } | |
304 | ||
305 | void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming | |
306 | ||
307 | void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsTPCConstrained) : ResetBit(AliAODTrack::kIsTPCConstrained); } | |
308 | void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridTPCCG) : ResetBit(AliAODTrack::kIsHybridTPCCG); } | |
309 | ||
310 | void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsGlobalConstrained) : ResetBit(AliAODTrack::kIsGlobalConstrained); } | |
311 | void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridGCG) : ResetBit(AliAODTrack::kIsHybridGCG); } | |
312 | ||
313 | ||
314 | ||
315 | void SetOneOverPt(Double_t oneOverPt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = 1. / oneOverPt; } | |
316 | void SetPt(Double_t pt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = pt; }; | |
317 | void SetPhi(Double_t phi) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPhi()] = phi; } | |
318 | void SetTheta(Double_t theta) { fVars[AliNanoAODTrackMapping::GetInstance()->GetTheta()] = theta; } | |
319 | template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);// TODO: WHAT IS THIS FOR? | |
320 | void SetP() {AliFatal("Not Implemented");} | |
321 | ||
322 | void SetXYAtDCA(Double_t x, Double_t y) {fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()] = x; fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()]= y;} | |
323 | void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAX()] = pX; fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAY()] = pY; fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAZ()] = pZ;} | |
324 | ||
325 | void SetRAtAbsorberEnd(Double_t r) { fVars[AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()] = r; } | |
326 | ||
327 | void SetCharge(Short_t q) { fCharge = q; } | |
328 | void SetChi2perNDF(Double_t chi2perNDF) { fVars[AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()] = chi2perNDF; } | |
329 | ||
330 | // void SetITSClusterMap(UChar_t itsClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); } | |
331 | // void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); } | |
332 | // void SetMuonClusterMap(UInt_t muonClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); } | |
333 | // void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; } | |
334 | // void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; } | |
335 | // UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; } | |
336 | // void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; } | |
337 | // UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; } | |
338 | ||
339 | void SetProdVertex(TObject *vertex) { fProdVertex = vertex; } | |
340 | // void SetType(AliAODTrack::AODTrk_t ttype) { fType=ttype; }// FIXME: what is this? | |
341 | ||
342 | // | |
343 | ||
344 | ||
345 | // Dummy: FIXME why is this dummy? | |
346 | Int_t PdgCode() const {return 0;} | |
347 | ||
348 | // needed to inherit from VTrack, but not implemented | |
349 | virtual void SetDetectorPID(const AliDetectorPID */*pid*/) {AliFatal("Not Implemented"); return ;}; | |
350 | virtual const AliDetectorPID* GetDetectorPID() const {AliFatal("Not Implemented"); return 0;}; | |
351 | virtual UChar_t GetTRDntrackletsPID() const {AliFatal("Not Implemented"); return 0;}; | |
352 | virtual void GetHMPIDpid(Double_t */*p*/) const {AliFatal("Not Implemented"); return;}; | |
353 | virtual Double_t GetBz() const {AliFatal("Not Implemented"); return 0;}; | |
354 | virtual void GetBxByBz(Double_t [3]/*b[3]*/) const {AliFatal("Not Implemented"); return;}; | |
355 | virtual const AliExternalTrackParam * GetOuterParam() const {AliFatal("Not Implemented"); return 0;}; | |
356 | virtual const AliExternalTrackParam * GetInnerParam() const {AliFatal("Not Implemented"); return 0;}; | |
357 | virtual Int_t GetNcls(Int_t /*idet*/) const {AliFatal("Not Implemented"); return 0;}; | |
358 | virtual const Double_t *PID() const {AliFatal("Not Implemented"); return 0;}; | |
359 | ||
360 | ||
361 | ||
362 | private : | |
363 | ||
364 | ||
778636d4 | 365 | |
366 | // Momentum & position | |
367 | // FIXME: the following was replaced by posx, posy, posz. Check if the names make sense | |
368 | // Double32_t fPosition[3]; // position of first point on track or dca | |
369 | Int_t fLabel; // track label, points back to MC track | |
370 | TRef fProdVertex; // vertex of origin | |
371 | Short_t fCharge; // track charge | |
372 | const AliAODEvent* fAODEvent; //! | |
373 | ||
374 | ClassDef(AliNanoAODTrack, 1); | |
375 | }; | |
376 | ||
377 | // inline Bool_t AliNanoAODTrack::IsPrimaryCandidate() const | |
378 | // { | |
379 | // // FIXME: reimplement | |
380 | // // True of track passes primary particle selection (independent of type) | |
381 | // // | |
382 | // if (fFilterMap) { | |
383 | // return kTRUE; | |
384 | // } else { | |
385 | // return kFALSE; | |
386 | // } | |
387 | // } | |
388 | ||
389 | // FIXME: is this needed? | |
390 | // inline Int_t AliNanoAODTrack::GetITSNcls() const | |
391 | // { | |
392 | // // Number of points in ITS | |
393 | // Int_t n=0; | |
394 | // for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++; | |
395 | // return n; | |
396 | // } | |
397 | ||
398 | //______________________________________________________________________________ | |
399 | template <typename T> | |
400 | void AliNanoAODTrack::SetPosition(const T *x, const Bool_t dca) | |
401 | { | |
402 | // set the position | |
403 | ||
404 | if (x) { | |
405 | if (!dca) { | |
406 | ResetBit(AliAODTrack::kIsDCA); | |
407 | ||
408 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = x[0]; | |
409 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = x[1]; | |
410 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = x[2]; | |
411 | } else { | |
412 | SetBit(AliAODTrack::kIsDCA); | |
413 | // don't know any better yet | |
414 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = -999.; | |
415 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = -999.; | |
416 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = -999.; | |
417 | } | |
418 | } else { | |
419 | ResetBit(AliAODTrack::kIsDCA); | |
420 | ||
421 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = -999.; | |
422 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = -999.; | |
423 | fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = -999.; | |
424 | } | |
425 | } | |
426 | ||
427 | //template<> void AliNanoAODTrack::SetPosition(const double *, Bool_t); | |
428 | ||
429 | ||
430 | ||
431 | ||
432 | #endif |