]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODTrack.h
i)Restructuring of the GRP preprocessor ii)Adding the storage of raw data tag files...
[u/mrichter/AliRoot.git] / STEER / AliAODTrack.h
index 8103b6732d4b63db64f3f78dff184459b2342b1c..61e98ca008dfed8a496f6a84c126758cb8527078 100644 (file)
 #include <TRef.h>
 #include <TParticle.h>
 
-#include "AliVirtualParticle.h"
+#include "AliVParticle.h"
 #include "AliAODVertex.h"
 #include "AliAODRedCov.h"
 
-class AliAODTrack : public AliVirtualParticle {
+class AliAODTrack : public AliVParticle {
 
  public:
   
-  enum AODTrk_t {kUndef=-1, kPrimary, kSecondary, kOrphan};
+  enum AODTrk_t {kUndef = -1, 
+                kPrimary, 
+                kSecondary, 
+                kOrphan};
 
   enum AODTrkBits_t {
     kIsDCA=BIT(14),   // set if fPosition is the DCA and not the position of the first point
-    kUsedForPrimVtxFit=BIT(15) // set if this track was used to fit the primary vertex
+    kUsedForVtxFit=BIT(15), // set if this track was used to fit the vertex it is attached to
+    kUsedForPrimVtxFit=BIT(16) // set if this track was used to fit the primary vertex
   };
 
   enum AODTrkPID_t {
-    kElectron     =  0, 
-    kMuon         =  1, 
-    kPion         =  2, 
-    kKaon         =  3, 
-    kProton       =  4, 
+    kElectron     =  0,
+    kMuon         =  1,
+    kPion         =  2,
+    kKaon         =  3,
+    kProton       =  4,
     kDeuteron     =  5,
     kTriton       =  6,
     kHelium3      =  7,
@@ -43,7 +47,7 @@ class AliAODTrack : public AliVirtualParticle {
   };
 
   AliAODTrack();
-  AliAODTrack(Int_t id,
+  AliAODTrack(Short_t id,
              Int_t label,
              Double_t p[3],
              Bool_t cartesian,
@@ -54,10 +58,12 @@ class AliAODTrack : public AliVirtualParticle {
              UChar_t itsClusMap,
              Double_t pid[10],
              AliAODVertex *prodVertex,
+             Bool_t usedForVtxFit,
              Bool_t usedForPrimVtxFit,
-             AODTrk_t ttype=kUndef);
+             AODTrk_t ttype=kUndef,
+             UInt_t selectInfo=0);
 
-  AliAODTrack(Int_t id,
+  AliAODTrack(Short_t id,
              Int_t label,
              Float_t p[3],
              Bool_t cartesian,
@@ -68,8 +74,10 @@ class AliAODTrack : public AliVirtualParticle {
              UChar_t itsClusMap,
              Float_t pid[10],
              AliAODVertex *prodVertex,
+             Bool_t usedForVtxFit,
              Bool_t usedForPrimVtxFit,
-             AODTrk_t ttype=kUndef);
+             AODTrk_t ttype=kUndef,
+             UInt_t selectInfo=0);
 
   virtual ~AliAODTrack();
   AliAODTrack(const AliAODTrack& trk); 
@@ -86,7 +94,7 @@ class AliAODTrack : public AliVirtualParticle {
   virtual Double_t Pt() const { return fMomentum[0]; }
   virtual Double_t P()  const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); }
   
-  Double_t Chi2() const { return fChi2; }
+  Double_t Chi2perNDF() const { return fChi2perNDF; }
   
   virtual Double_t M() const { return M(GetMostProbablePID()); }
   Double_t M(AODTrkPID_t pid) const;
@@ -111,12 +119,13 @@ class AliAODTrack : public AliVirtualParticle {
  
   template <class 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.);}}
+    else {for(Int_t i=0; i<10; fPID[i++]=0.); fPID[AliAODTrack::kUnknown]=1.;}}
 
-  Int_t GetID() const { return fID; }
-  Int_t GetLabel() const { return fLabel; } 
-  Char_t GetType() const { return fType;}
-  Bool_t GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
+  Short_t GetID() const { return fID; }
+  Int_t   GetLabel() const { return fLabel; } 
+  Char_t  GetType() const { return fType;}
+  Bool_t  GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
+  Bool_t  GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
 
   template <class T> void GetP(T *p) const {
     p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
@@ -138,7 +147,10 @@ class AliAODTrack : public AliVirtualParticle {
 
   void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
 
-  UChar_t GetITSClusterMap() const { return fITSClusterMap; }
+  UChar_t GetITSClusterMap() const     { return (UChar_t)fITSMuonClusterMap; }
+  UInt_t  GetMUONClusterMap() const    { return fITSMuonClusterMap/65536; }
+  UInt_t  GetITSMUONClusterMap() const { return fITSMuonClusterMap; }
+  Bool_t  TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
 
   AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
   
@@ -146,11 +158,12 @@ class AliAODTrack : public AliVirtualParticle {
   void  Print(const Option_t *opt = "") const;
 
   // setters
-  void SetID(Int_t id) { fID = id; }
+  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);
   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 SetOneOverPt(Double_t oneOverPt) { fMomentum[0] = oneOverPt; }
@@ -161,9 +174,29 @@ class AliAODTrack : public AliVirtualParticle {
   void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
 
   void SetCharge(Short_t q) { fCharge = q; }
-  void SetChi2(Double_t chi2) { fChi2 = chi2; }
-
-  void SetITSClusterMap(UChar_t itsClusMap) { fITSClusterMap = itsClusMap; }
+  void SetChi2perNDF(Double_t chi2perNDF) { fChi2perNDF = chi2perNDF; }
+
+  void SetITSClusterMap(UChar_t itsClusMap)        { fITSMuonClusterMap = (UInt_t)itsClusMap; }
+  void SetMuonClusterMap(UInt_t muonClusMap)       { fITSMuonClusterMap = muonClusMap*65536; }
+  void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; }
+
+  Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
+                                       //  0 Muon track does not match trigger
+                                       //  1 Muon track match but does not pass pt cut
+                                       //  2 Muon track match Low pt cut
+                                       //  3 Muon track match High pt cut
+  void     SetMatchTrigger(Int_t MatchTrigger);
+  Int_t    MatchTrigger() const { return (GetMatchTrigger()>0)?1:0; }  //  Muon track matches trigger track
+  Int_t    MatchTriggerAnyPt()   const  { return (GetMatchTrigger()>0)?1:0; }  //  Muon track matches trigger track
+  Int_t    MatchTriggerLowPt()   const  { return (GetMatchTrigger()>1)?1:0; }  //  Muon track matches trigger track and passes Low pt cut
+  Int_t    MatchTriggerHighPt()  const  { return (GetMatchTrigger()>2)?1:0; }  //  Muon track matches trigger track and passes High pt cut
+  Double_t GetChi2MatchTrigger() const  { return fChi2MatchTrigger;}
+  void     SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger;}
+  UShort_t GetHitsPatternInTrigCh() const { return (fITSMuonClusterMap&0xff00)>>8; }
+  void     SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh);
+  Int_t    HitsMT(Int_t istation, Int_t iplane, Char_t *cathode=0);  // Check if track hits Muon chambers
+  Int_t    HitsMuonChamber(Int_t MuonChamber);  // Check if track hits Muon chambers
+  Bool_t   IsMuonTrack() const { return fITSMuonClusterMap>>16;}  // This scheme has to be checked, still!
 
   void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
 
@@ -173,24 +206,27 @@ class AliAODTrack : public AliVirtualParticle {
  private :
 
   // Momentum & position
-  Double32_t    fMomentum[3];    // momemtum stored in pt, phi, theta
-  Double32_t    fPosition[3];    // position of first point on track or dca
+  Double32_t    fMomentum[3];       // momemtum stored in pt, phi, theta
+  Double32_t    fPosition[3];       // position of first point on track or dca
 
-  Double32_t    fPID[10];        // [0.,1.,8] pointer to PID object
-  Double32_t    fChi2;           // chi2 of mometum fit
+  Double32_t    fChi2perNDF;        // chi2/NDF of mometum fit
+  Double32_t    fChi2MatchTrigger;  // chi2 of trigger/track matching
+  Double32_t    fPID[10];           // [0.,1.,8] pointer to PID object
 
-  Int_t         fID;             // unique track ID, points back to the ESD track
-  Int_t         fLabel;          // track label, points back to MC track
+  Int_t         fLabel;             // track label, points back to MC track
   
-  AliAODRedCov<6> *fCovMatrix;   // covariance matrix (x, y, z, px, py, pz)
-  TRef          fProdVertex;     // vertex of origin
+  UInt_t        fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer (ITS: bit 1-8, muon: bit 17-32) 
+  UInt_t        fFilterMap;         // filter information, one bit per set of cuts
+
+  Short_t       fID;                // unique track ID, points back to the ESD track
 
-  Char_t        fCharge;         // particle charge
-  UChar_t       fITSClusterMap;  // map of ITS cluster, one bit per layer
-  Char_t        fType;           // Track Type
+  Char_t        fCharge;            // particle charge
+  Char_t        fType;              // Track Type
 
+  AliAODRedCov<6> *fCovMatrix;      // covariance matrix (x, y, z, px, py, pz)
+  TRef          fProdVertex;        // vertex of origin
 
-  ClassDef(AliAODTrack,1);
+  ClassDef(AliAODTrack,5);
 };
 
 #endif