]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AOD/AliAODTrack.h
fTRDsignal is added to AliAODPid class (copied from AliESDtrack).
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODTrack.h
index 11a174446e8781802ea4709200a175ce5530d891..fbce74b30451f5d7a168b0f8798f3319864b2691 100644 (file)
@@ -20,6 +20,9 @@
  
 
 class AliVVertex;
+class AliDetectorPID;
+class AliTPCdEdxInfo;
+class AliAODEvent;
 
 class AliAODTrack : public AliVTrack {
 
@@ -42,14 +45,14 @@ class AliAODTrack : public AliVTrack {
 
 
   enum AODTrkFilterBits_t {
-    kTrkTPCOnly = BIT(1), // Standard TPC only tracks
-    kTrkITSsa   = BIT(2), // ITS standalone
-    kTrkITSConstrained = BIT(3), // Pixel OR necessary for the electrons
-    kTrkElectronsPID = BIT(4),    // PID for the electrons
-    kTrkGlobalNoDCA = BIT(5), // standard cuts with very loose DCA
-    kTrkGlobal = BIT(6),  // standard cuts with tight DCA cut
-    kTrkGlobalSDD = BIT(7), // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster tracks selected by this cut are exclusive to those selected by the previous cut
-    kTrkTPCOnlyConstrained = BIT(8) // TPC only tracks: TPConly information constrained to SPD vertex in the filter below
+    kTrkTPCOnly            = BIT(0), // Standard TPC only tracks
+    kTrkITSsa              = BIT(1), // ITS standalone
+    kTrkITSConstrained     = BIT(2), // Pixel OR necessary for the electrons
+    kTrkElectronsPID       = BIT(3),    // PID for the electrons
+    kTrkGlobalNoDCA        = BIT(4), // standard cuts with very loose DCA
+    kTrkGlobal             = BIT(5),  // standard cuts with tight DCA cut
+    kTrkGlobalSDD          = BIT(6), // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster tracks selected by this cut are exclusive to those selected by the previous cut
+    kTrkTPCOnlyConstrained = BIT(7) // TPC only tracks: TPConly information constrained to SPD vertex in the filter below
   };
   
 
@@ -124,7 +127,11 @@ class AliAODTrack : public AliVTrack {
   virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
 
   Double_t Chi2perNDF()  const { return fChi2perNDF; }
-  UShort_t GetTPCNcls()  const { return fTPCClusterMap.CountBits();}
+  UShort_t GetTPCNcls()  const { 
+    UShort_t cl = fTPCFitMap.CountBits();
+    if(cl==0)cl = fTPCClusterMap.CountBits();// backward compatibility
+    return cl;
+  }
   
   virtual Double_t M() const { return M(GetMostProbablePID()); }
   Double_t M(AODTrkPID_t pid) const;
@@ -148,10 +155,10 @@ class AliAODTrack : public AliVTrack {
   void ConvertAliPIDtoAODPID();
   void SetDetPID(AliAODPid *aodpid) {fDetPid = aodpid;}
 
-  template <class T> void GetPID(T *pid) const {
+  template <typename T> void GetPID(T *pid) const {
     for(Int_t i=0; i<10; ++i) pid[i]=fPID[i];}
  
-  template <class T> void SetPID(const T *pid) {
+  template <typename T> void SetPID(const T *pid) {
     if(pid) for(Int_t i=0; i<10; ++i) fPID[i]=pid[i];
     else {for(Int_t i=0; i<10; fPID[i++]=0.) ; fPID[AliAODTrack::kUnknown]=1.;}}
 
@@ -172,30 +179,32 @@ class AliAODTrack : public AliVTrack {
   Bool_t  IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
   Bool_t  IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
   //
-  Int_t   GetTOFBunchCrossing(Double_t b=0) const;
+  Int_t   GetTOFBunchCrossing(Double_t b=0, Bool_t tpcPIDonly=kFALSE) const;
   //
-  template <class T> void GetP(T *p) const {
+  template <typename T> void GetP(T *p) const {
     p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
 
-//  template <class T> void GetPxPyPz(T *p) const {
+//  template <typename T> void GetPxPyPz(T *p) const {
 //    p[0] = Px(); p[1] = Py(); p[2] = Pz();}
   Bool_t GetPxPyPz(Double_t *p) const;
 
-  template <class T> Bool_t GetPosition(T *x) const {
+  template <typename T> Bool_t GetPosition(T *x) const {
     x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
     return TestBit(kIsDCA);}
 
-  template <class T> void SetCovMatrix(const T *covMatrix) {
+  template <typename T> void SetCovMatrix(const T *covMatrix) {
     if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
     fCovMatrix->SetCovMatrix(covMatrix);}
 
-  template <class T> Bool_t GetCovMatrix(T *covMatrix) const {
+  template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
     if(!fCovMatrix) return kFALSE;
     fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
 
   Bool_t GetXYZ(Double_t *p) const {
     return GetPosition(p); }
-
+  
+  Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
+  
   Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
     return GetCovMatrix(cv);}
 
@@ -232,30 +241,65 @@ class AliAODTrack : public AliVTrack {
   Bool_t  TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
   Bool_t  TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
   void    SetFilterMap(UInt_t i){fFilterMap = i;}
-  UInt_t  GetFilterMap(){return fFilterMap;}
+  UInt_t  GetFilterMap() const {return fFilterMap;}
 
   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
-  Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159) const;
+  const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
+  const TBits& GetTPCFitMap() const {return fTPCFitMap;}
+  const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
+  Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t /*type*/=0) const;
   
   const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
+  const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
   void    SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
   void    SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
+  void    SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
   void    SetTPCPointsF(UShort_t  findable){fTPCnclsF = findable;}
+  void    SetTPCNCrossedRows(UInt_t n)     {fTPCNCrossedRows = n;}
 
   UShort_t GetTPCNclsF() const { return fTPCnclsF;}
+  UShort_t GetTPCNCrossedRows()  const { return fTPCNCrossedRows;}
+  Float_t  GetTPCFoundFraction() const { return fTPCNCrossedRows>0 ? float(GetTPCNcls())/fTPCNCrossedRows : 0;}
+
+  // Calorimeter Cluster
+  Int_t GetEMCALcluster() const {return fCaloIndex;}
+  void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
+  Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
+
+  Double_t GetTrackPhiOnEMCal() const {return fTrackPhiOnEMCal;}
+  Double_t GetTrackEtaOnEMCal() const {return fTrackEtaOnEMCal;}
+  void SetTrackPhiEtaOnEMCal(Double_t phi,Double_t eta) {fTrackPhiOnEMCal=phi;fTrackEtaOnEMCal=eta;}
+
+  Int_t GetPHOScluster() const {return fCaloIndex;}
+  void SetPHOScluster(Int_t index) {fCaloIndex=index;}
+  Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}
 
   //pid signal interface
   Double_t  GetITSsignal()       const { return fDetPid?fDetPid->GetITSsignal():0.;    }
+  void      GetITSdEdxSamples(Double_t s[4]) const;
   Double_t  GetTPCsignal()       const { return fDetPid?fDetPid->GetTPCsignal():0.;    }
+  Double_t  GetTPCsignalTunedOnData() const { return fTPCsignalTuned;}
+  void      SetTPCsignalTunedOnData(Double_t signal) {fTPCsignalTuned = signal;}
   UShort_t  GetTPCsignalN()      const { return fDetPid?fDetPid->GetTPCsignalN():0;    }
+  virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;}
   Double_t  GetTPCmomentum()     const { return fDetPid?fDetPid->GetTPCmomentum():0.;  }
-  Double_t  GetTOFsignal()       const { return fDetPid?fDetPid->GetTOFsignal():0.; }
+  Double_t  GetTOFsignal()       const { return fDetPid?fDetPid->GetTOFsignal():0.;    }
+  Double_t  GetHMPIDsignal()     const { return 0.;  } // TODO: To be implemented properly with the new HMPID object
+  
   void      GetIntegratedTimes(Double_t *times) const {if (fDetPid) fDetPid->GetIntegratedTimes(times); }
   Double_t  GetTRDslice(Int_t plane, Int_t slice) const;
+  Double_t  GetTRDsignal()                        const {return fDetPid ? fDetPid->GetTRDsignal() : 0;}
   Double_t  GetTRDmomentum(Int_t plane, Double_t */*sp*/=0x0) const;
-  void      GetHMPIDpid(Double_t *p) const { if (fDetPid) fDetPid->GetHMPIDprobs(p); }
+  Double_t  GetTRDchi2()                 const {return fDetPid ? fDetPid->GetTRDChi2() : -1;}
+  UChar_t   GetTRDncls(Int_t layer)      const;
+  UChar_t   GetTRDncls()                 const {return GetTRDncls(-1);}
+  UChar_t   GetTRDntrackletsPID() const;
+  Int_t     GetNumberOfTRDslices() const { return fDetPid?fDetPid->GetTRDnSlices():0; }
+  void      GetHMPIDpid(Double_t */*p*/) const { return; } // TODO: To be implemented properly with the new HMPID object
+
+  const AliAODEvent* GetAODEvent() const {return fAODEvent;}
+  void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
 
-  
   AliAODPid    *GetDetPid() const { return fDetPid; }
   AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
   
@@ -270,13 +314,16 @@ class AliAODTrack : public AliVTrack {
   void SetID(Short_t id) { fID = id; }
   void SetLabel(Int_t label) { fLabel = label; }
 
-  template <class T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
+  template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
   void SetDCA(Double_t d, Double_t z);
   void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForVtxFit) : ResetBit(kUsedForVtxFit); }
   void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForPrimVtxFit) : ResetBit(kUsedForPrimVtxFit); }
 
   void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
+
   void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsTPCConstrained) : ResetBit(kIsTPCConstrained); }
+  void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridTPCCG) : ResetBit(kIsHybridTPCCG); }
+
   void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsGlobalConstrained) : ResetBit(kIsGlobalConstrained); }
   void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridGCG) : ResetBit(kIsHybridGCG); }
 
@@ -286,7 +333,7 @@ class AliAODTrack : public AliVTrack {
   void SetPt(Double_t pt) { fMomentum[0] = pt; };
   void SetPhi(Double_t phi) { fMomentum[1] = phi; }
   void SetTheta(Double_t theta) { fMomentum[2] = theta; }
-  template <class T> void SetP(const T *p, Bool_t cartesian = kTRUE);
+  template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);
   void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
 
   void SetXYAtDCA(Double_t x, Double_t y) {fPositionAtDCA[0] = x; fPositionAtDCA[1] = y;}
@@ -301,6 +348,10 @@ class AliAODTrack : public AliVTrack {
   void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
   void SetMuonClusterMap(UInt_t muonClusMap)                { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
   void SetITSMuonClusterMap(UInt_t itsMuonClusMap)          { fITSMuonClusterMap = itsMuonClusMap; }
+  void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
+  UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
+  void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
+  UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
 
   Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
                                        //  0 Muon track does not match trigger
@@ -323,7 +374,9 @@ class AliAODTrack : public AliVTrack {
   void     SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
   void     SetType(AODTrk_t ttype) { fType=ttype; }
 
-
+  // Trasient PID object, is owned by the track
+  virtual void  SetDetectorPID(const AliDetectorPID *pid);
+  virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
 
   // Dummy
   Int_t    PdgCode() const {return 0;}
@@ -348,22 +401,38 @@ class AliAODTrack : public AliVTrack {
   
   UInt_t        fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer
                                     // (ITS: bit 1-8, muon trigger: bit 9-16, muon tracker: bit 17-26, muon match trigger: bit 31-32) 
+  UInt_t        fMUONtrigHitsMapTrg; // Muon trigger hits map from trigger
+  UInt_t        fMUONtrigHitsMapTrk; // Muon trigger hits map from tracker track extrapolation
   UInt_t        fFilterMap;         // filter information, one bit per set of cuts
 
+  TBits         fTPCFitMap;      // Map of clusters, one bit per padrow; if has a cluster on given padrow which is used in the fit   
   TBits         fTPCClusterMap;     // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
   TBits         fTPCSharedMap;      // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
+
   UShort_t      fTPCnclsF;          // findable clusters
+  UShort_t      fTPCNCrossedRows;   // n crossed rows
 
   Short_t       fID;                // unique track ID, points back to the ESD track
 
   Char_t        fCharge;            // particle charge
   Char_t        fType;              // Track Type
+
+  Int_t         fCaloIndex;         // index of associated EMCAL/PHOS cluster (AliAODCaloCluster)
+
   
   AliAODRedCov<6> *fCovMatrix;      // covariance matrix (x, y, z, px, py, pz)
-  AliAODPid    *fDetPid;            // more detailed or detector specific pid information
+  AliAODPid    *fDetPid;            // more detailed or detector specific raw pid information
+  mutable const AliDetectorPID* fDetectorPID; //! transient object to cache calibrated PID information
   TRef          fProdVertex;        // vertex of origin
 
-  ClassDef(AliAODTrack, 14);
+  Double_t      fTrackPhiOnEMCal;   // phi of track after being propagated to 430cm
+  Double_t      fTrackEtaOnEMCal;   // eta of track after being propagated to 430cm
+
+  Double_t      fTPCsignalTuned;    //! TPC signal tuned on data when using MC
+
+  const AliAODEvent* fAODEvent;     //! 
+
+  ClassDef(AliAODTrack, 19);
 };
 
 inline Bool_t  AliAODTrack::IsPrimaryCandidate() const
@@ -385,4 +454,35 @@ inline Int_t AliAODTrack::GetITSNcls() const
   return n;
 }
 
+//______________________________________________________________________________
+template <typename T> 
+void AliAODTrack::SetPosition(const T *x, const Bool_t dca) 
+{
+  // set the position
+
+  if (x) {
+    if (!dca) {
+      ResetBit(kIsDCA);
+
+      fPosition[0] = x[0];
+      fPosition[1] = x[1];
+      fPosition[2] = x[2];
+    } else {
+      SetBit(kIsDCA);
+      // don't know any better yet
+      fPosition[0] = -999.;
+      fPosition[1] = -999.;
+      fPosition[2] = -999.;
+    }
+  } else {
+    ResetBit(kIsDCA);
+
+    fPosition[0] = -999.;
+    fPosition[1] = -999.;
+    fPosition[2] = -999.;
+  }
+}
+
+//template<> void AliAODTrack::SetPosition(const double *, Bool_t);
+
 #endif