]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/DevNanoAOD/AliNanoAODTrack.h
Fixed a number of warnings
[u/mrichter/AliRoot.git] / PWG / DevNanoAOD / AliNanoAODTrack.h
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
84   // Storage helper methods
85   
86   // kinematics
87   virtual Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : -999.; }
88   virtual Double_t Phi()       const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi());   }
89   virtual Double_t Theta()     const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta()); }
90   
91   virtual Double_t Px() const { return Pt() * TMath::Cos(Phi()); }
92   virtual Double_t Py() const { return Pt() * TMath::Sin(Phi()); }
93   virtual Double_t Pz() const { return Pt() / TMath::Tan(Theta()); }
94   virtual Double_t Pt() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPt()); }
95   virtual Double_t P()  const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); }
96   virtual Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
97
98   virtual Double_t Xv() const { return GetProdVertex() ? GetProdVertex()->GetX() : -999.; }
99   virtual Double_t Yv() const { return GetProdVertex() ? GetProdVertex()->GetY() : -999.; }
100   virtual Double_t Zv() const { return GetProdVertex() ? GetProdVertex()->GetZ() : -999.; }
101   virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
102
103   Double_t Chi2perNDF()  const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()); }  
104   UShort_t GetTPCNcls()  const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCncls()); } // FIXME: should this be short?
105
106   virtual Double_t M() const { AliFatal("Not Implemented"); return -1; }
107   Double_t M(AliAODTrack::AODTrkPID_t pid) const;
108   virtual Double_t E() const { AliFatal("Not Implemented"); return -1; }
109   Double_t E(AliAODTrack::AODTrkPID_t pid) const;
110   Double_t E(Double_t m) const { return TMath::Sqrt(P()*P() + m*m); }
111   virtual Double_t Y() const { AliFatal("Not Implemented"); return  -1; }
112   Double_t Y(AliAODTrack::AODTrkPID_t pid) const;
113   Double_t Y(Double_t m) const;
114   
115   virtual Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * Theta())); }
116   virtual Short_t  Charge() const {return fCharge; } // FIXME: leave like this? Create shorts array?
117   virtual Bool_t   PropagateToDCA(const AliVVertex *vtx, 
118                                   Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3]);
119
120
121   // Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
122   ULong_t GetStatus() const { AliFatal("Not implemented"); return 0; }
123   // ULong_t GetFlags() const { return fFlags; }
124
125   //  Int_t   GetID() const { return (Int_t)fID; } // FIXME another int (short)
126   Int_t   GetID() const { AliFatal("Not Implemented"); return 0; } // FIXME another int (short)
127   Int_t   GetLabel() const { return fLabel; }  // 
128   // void    GetTOFLabel(Int_t *p) const;
129
130
131   //  Bool_t  IsPrimaryCandidate() const;
132   // FIXME: do we need any of the following (note that I already removed the bit enums)
133   // Bool_t  GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
134   // Bool_t  GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
135
136   // Bool_t  IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); }
137   // Bool_t  IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); }
138   // Bool_t  IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming
139   // Bool_t  IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
140   // Bool_t  IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
141   //
142   //
143   template <typename T> void GetP(T *p) const {
144     p[0]=Pt(); p[1]=Phi(); p[2]=Theta();}
145
146   //  template <typename T> void GetPxPyPz(T *p) const {
147   //    p[0] = Px(); p[1] = Py(); p[2] = Pz();}
148   Bool_t GetPxPyPz(Double_t *p) const;
149
150   
151   template <typename T> Bool_t GetPosition(T *x) const {
152     x[0]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); x[1]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()); x[2]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ());
153     return TestBit(AliAODTrack::kIsDCA);}
154
155   // FIXME: only allocate if listed?
156   // template <typename T> void SetCovMatrix(const T *covMatrix) {
157   //   if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
158   //   fCovMatrix->SetCovMatrix(covMatrix);}
159
160   // template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
161   //   if(!fCovMatrix) return kFALSE;
162   //   fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
163
164   Bool_t GetXYZ(Double_t *p) const {
165     return GetPosition(p); }
166   
167   Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
168   
169   Bool_t GetCovarianceXYZPxPyPz(Double_t /*cv*/[21]) const {AliFatal("Not implemented"); return 0;}
170   //   return GetCovMatrix(cv);}
171
172   // void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
173
174   Double_t XAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()); }
175   Double_t YAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()); }
176   Double_t ZAtDCA() const { // FIXME: not sure about this one
177     if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY());
178     else return -999.; }
179   Bool_t   XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
180   
181   Double_t DCA() const { // FIXME: not sure about this one
182     if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); // FIXME: Why does this return posX?
183     else return -999.; }
184   
185   Double_t PxAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAX()); }
186   Double_t PyAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAY()); }
187   Double_t PzAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAZ()); }
188   Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); }
189   Bool_t   PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
190   
191   Double_t GetRAtAbsorberEnd() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()); }
192   
193   // 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 
194   UChar_t  GetITSClusterMap() const       { AliFatal("Not Implemented"); return 0;};
195   // Int_t    GetITSNcls() const; 
196   // Bool_t   HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); }
197   // UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }// Fixme: array of uchars or of int?
198   // UInt_t   GetMUONClusterMap() const      { return (fITSMuonClusterMap&0x3ff0000)>>16; } // 
199   // UInt_t   GetITSMUONClusterMap() const   { return fITSMuonClusterMap; }
200   
201   // Bool_t  TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
202   // Bool_t  TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
203   // void    SetFilterMap(UInt_t i){fFilterMap = i;}
204   // UInt_t  GetFilterMap() const {return fFilterMap;}
205
206   // const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
207   // const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
208   // const TBits& GetTPCFitMap() const {return fTPCFitMap;}
209   // const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
210  
211   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? 
212   
213   // const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
214   // const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
215   // void    SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
216   // void    SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
217   // void    SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
218   // 
219   void    SetTPCPointsF(UShort_t  findable){fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF()] = findable;}
220   void    SetTPCNCrossedRows(UInt_t n)     {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows()] = n;}
221
222   UShort_t GetTPCNclsF() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF());}
223   UShort_t GetTPCNCrossedRows()  const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows());}
224   Float_t  GetTPCFoundFraction() const { return GetTPCNCrossedRows()>0 ? float(GetTPCNcls())/GetTPCNCrossedRows() : 0;}
225
226   // Calorimeter Cluster
227   // FIXME: to be implemented
228   // Int_t GetEMCALcluster() const {return fCaloIndex;}
229   // void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
230   // Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
231
232   Double_t GetTrackPhiOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal());}
233   Double_t GetTrackEtaOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal());}
234   Double_t GetTrackPtOnEMCal() const  {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal());}
235   Double_t GetTrackPOnEMCal() const {return TMath::Abs(GetTrackEtaOnEMCal()) < 1 ? GetTrackPtOnEMCal()*TMath::CosH(GetTrackEtaOnEMCal()) : -999;}
236   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;}
237
238   //  Int_t GetPHOScluster() const {return fCaloIndex;} // TODO: int array
239   //  void SetPHOScluster(Int_t index) {fCaloIndex=index;}
240   //  Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}//TODO: fFlags?
241
242   //pid signal interface
243   //TODO you can remove the PID object
244   Double_t  GetITSsignal()       const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetITSsignal());}
245   Double_t  GetTPCsignal()       const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignal());}
246   Double_t  GetTPCsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned());}
247   void      SetTPCsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned()] = signal;}
248   UShort_t  GetTPCsignalN()      const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalN());}// FIXME: what is this?
249   //  virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;} // FIXME: is this needed?
250   Double_t  GetTPCmomentum()     const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCmomentum()); }
251   Double_t  GetTPCTgl()          const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCTgl());      } // FIXME: what is this?
252   Double_t  GetTOFsignal()       const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignal());   } 
253   Double_t  GetIntegratedLength() const { AliFatal("Not implemented"); return 0;} // TODO: implement track lenght
254   void      SetIntegratedLength(Double_t/* l*/) {AliFatal("Not implemented");}
255   Double_t  GetTOFsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned());}
256   void      SetTOFsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned()] = signal;}
257   Double_t  GetHMPIDsignal()      const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDsignal());}; 
258   Double_t  GetHMPIDoccupancy()  const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDoccupancy());}; 
259   
260       
261   
262   virtual void GetIntegratedTimes(Double_t */*times*/, Int_t) const { AliFatal("Not implemented"); return;} // FIXME check implementation
263
264   // ________________________________________________________________________________________________________________
265   // *** FIXME Those methods used fPID in the AOD track. Reimplement as an array of kin vars? ***
266   // It's also a bit ugly that I used a mixed approach here: some methods are commented, some other alifatal
267   // void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const;  
268   // void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const;
269   //  Bool_t GetOuterHmpPxPyPz(Double_t *p) const;
270   //  Int_t     GetHMPIDcluIdx()     const;// FIXME: array of ints?
271   //   void      GetITSdEdxSamples(Double_t s[4]) const; // FIXME: To be reimplemented. Use one kin var for each sample
272   Int_t   GetTOFBunchCrossing(Double_t /*b=0*/, Bool_t /*tpcPIDonly=kFALSE*/) const {AliFatal("Not Implemented"); return 0;};
273   UChar_t   GetTRDncls(Int_t /*layer*/)                           const {AliFatal("Not Implemented"); return 0;}; 
274   Double_t  GetTRDslice(Int_t /*plane*/, Int_t /*slice*/)         const {AliFatal("Not Implemented"); return 0;};
275   Double_t  GetTRDmomentum(Int_t /*plane*/, Double_t */*sp*/=0x0) const {AliFatal("Not Implemented"); return 0;};
276   // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
277
278   Double_t  GetTRDsignal()         const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDsignal());}
279   Double_t  GetTRDchi2()           const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDChi2());}
280   UChar_t   GetTRDncls()           const {return GetTRDncls(-1);}
281   Int_t     GetNumberOfTRDslices() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDnSlices()); }
282
283   const AliAODEvent* GetAODEvent() const {return fAODEvent;}// FIXME: change to special event type
284   void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
285
286   AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); } // FIXME: change to special vertex type
287   
288   // print
289   void  Print(const Option_t *opt = "") const;
290
291   // setters
292   // void SetFlags(ULong_t flags) { fFlags = flags; }
293   // void SetStatus(ULong_t flags) { fFlags|=flags; }
294   // void ResetStatus(ULong_t flags) { fFlags&=~flags; }
295
296   //  void SetID(Short_t id) { fID = id; }
297   void SetLabel(Int_t label) { fLabel = label; }
298   // void SetTOFLabel(const Int_t* p);
299   template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
300   void SetDCA(Double_t d, Double_t z);
301   void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForVtxFit) : ResetBit(AliAODTrack::kUsedForVtxFit); }
302   void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForPrimVtxFit) : ResetBit(AliAODTrack::kUsedForPrimVtxFit); }
303
304   void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
305
306   void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsTPCConstrained) : ResetBit(AliAODTrack::kIsTPCConstrained); }
307   void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridTPCCG) : ResetBit(AliAODTrack::kIsHybridTPCCG); }
308
309   void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsGlobalConstrained) : ResetBit(AliAODTrack::kIsGlobalConstrained); }
310   void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridGCG) : ResetBit(AliAODTrack::kIsHybridGCG); }
311
312
313
314   void SetOneOverPt(Double_t oneOverPt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = 1. / oneOverPt; }
315   void SetPt(Double_t pt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = pt; };
316   void SetPhi(Double_t phi) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPhi()] = phi; }
317   void SetTheta(Double_t theta) { fVars[AliNanoAODTrackMapping::GetInstance()->GetTheta()] = theta; }
318   template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);// TODO: WHAT IS THIS FOR?
319   void SetP() {AliFatal("Not Implemented");}
320
321   void SetXYAtDCA(Double_t x, Double_t y) {fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()] = x;  fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()]= y;}
322   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;}
323   
324 void SetRAtAbsorberEnd(Double_t r) { fVars[AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()] = r; }
325   
326   void SetCharge(Short_t q) { fCharge = q; }
327 void SetChi2perNDF(Double_t chi2perNDF) { fVars[AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()] = chi2perNDF; }
328
329   // void SetITSClusterMap(UChar_t itsClusMap)                 { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
330   // void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
331   // void SetMuonClusterMap(UInt_t muonClusMap)                { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
332   // void SetITSMuonClusterMap(UInt_t itsMuonClusMap)          { fITSMuonClusterMap = itsMuonClusMap; }
333   // void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
334   // UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
335   // void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
336   // UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
337
338   void     SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
339   // void     SetType(AliAODTrack::AODTrk_t ttype) { fType=ttype; }// FIXME: what is this?
340
341   // 
342
343
344   // Dummy: FIXME why is this dummy?
345   Int_t    PdgCode() const {return 0;}
346
347   //  needed  to inherit from VTrack, but not implemented
348   virtual void  SetDetectorPID(const AliDetectorPID */*pid*/)  {AliFatal("Not Implemented"); return ;}; 
349   virtual const AliDetectorPID* GetDetectorPID() const {AliFatal("Not Implemented"); return 0;}; 
350   virtual UChar_t  GetTRDntrackletsPID() const  {AliFatal("Not Implemented"); return 0;}; 
351   virtual void      GetHMPIDpid(Double_t */*p*/) const  {AliFatal("Not Implemented"); return;}; 
352   virtual Double_t GetBz() const  {AliFatal("Not Implemented"); return 0;}; 
353   virtual void     GetBxByBz(Double_t [3]/*b[3]*/) const  {AliFatal("Not Implemented"); return;}; 
354   virtual const    AliExternalTrackParam * GetOuterParam() const {AliFatal("Not Implemented"); return 0;}; 
355   virtual const    AliExternalTrackParam * GetInnerParam() const {AliFatal("Not Implemented"); return 0;}; 
356   virtual Int_t    GetNcls(Int_t /*idet*/) const {AliFatal("Not Implemented"); return 0;}; 
357   virtual const Double_t *PID() const {AliFatal("Not Implemented"); return 0;}; 
358
359
360
361 private :
362
363
364   // Remove everything from here on?
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