]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/JCORRAN/AliJBaseTrack.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJBaseTrack.h
1 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice */
3
4 // Short comment describing what this class does needed!
5
6 // $Id: AliJBaseTrack.h,v 1.5 2008/05/08 15:19:52 djkim Exp $
7
8 ///////////////////////////////////////////////////
9 /*
10    \file AliJBaseTrack.h
11    \brief
12    \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
13    \email: djkim@jyu.fi
14    \version $Revision: 1.5 $
15    \date $Date: 2008/05/08 15:19:52 $
16    */
17 ///////////////////////////////////////////////////
18
19 #ifndef ALIJBASETRACK_H
20 #define ALIJBASETRACK_H
21
22 #ifndef ROOT_TObject
23 #include <TObject.h>
24 #endif
25
26 #include <iostream>
27 #include <TLorentzVector.h>
28 #include <TMath.h>
29 #include  "AliJConst.h"
30
31 using namespace std;
32
33 class AliJBaseTrack : public TLorentzVector {
34     public:
35         enum { kIsIsolated, kNFlag };
36         AliJBaseTrack();
37         AliJBaseTrack(float px,float py, float pz, float e, Int_t id, Short_t ptype, Char_t charge); // constructor
38         AliJBaseTrack(const AliJBaseTrack& a);
39         AliJBaseTrack(const TLorentzVector & a);
40         virtual ~AliJBaseTrack(){;}    //destructor
41
42         double EtaAbs(){ return TMath::Abs(Eta()); }
43         float   GetTwoPiPhi() const {return Phi()>-kJPi/3 ? Phi() : kJTwoPi+Phi();} 
44         TLorentzVector GetLorentzVector(){ return TLorentzVector(Px(), Py(), Pz(), E());}
45
46         Int_t         GetID()           const { return fID;}
47         Int_t         GetLabel()        const { return fLabel; }
48         Short_t       GetParticleType() const { return fParticleType;}
49         ULong_t       GetStatus()       const { return fStatus; }
50         Short_t       GetCharge()       const { return fCharge; } 
51         UInt_t        GetFlags()        const { return fFlags; }
52         Bool_t        GetIsIsolated()   const { return IsTrue(kIsIsolated);}
53
54         Int_t         GetTriggBin()     const { return fTriggID; }
55         Int_t         GetAssocBin()     const { return fAssocID; }
56         Double32_t    GetTrackEff()     const { 
57             if(fTracEff==-1) {  cout<<"AliJBaseTrack: Uninitilized track eff " <<endl;  exit(-1);
58             } else return fTracEff;  }
59         Bool_t        IsInTriggerBin()  const { return fTriggID>=0; }
60         Bool_t        IsInAssocBin()    const { return fAssocID>=0; }
61         Double_t      GetWeight()       const { return fWeight;}             
62         Int_t         GetMCIndex()      const { return fMCIndex;}
63
64         void SetID      (const int id){fID=id;}
65         void SetLabel   (const Int_t label ){ fLabel=label; }
66         void SetParticleType(const Short_t ptype){ fParticleType=ptype; }
67         void SetStatus  (const ULong_t status){ fStatus=status; }
68         void SetCharge  (const Char_t charge){ fCharge=charge; }
69         void SetFlags   (const UInt_t bits ){ fFlags=bits; }        //MC, is primary flag
70         void SetIsIsolated(Bool_t tf){ SetFlag( kIsIsolated, tf); }
71
72         void SetTriggBin(const int id){fTriggID = id;}
73         void SetAssocBin(const int id){fAssocID = id;}
74         void SetTrackEff(const Double32_t inEff){fTracEff = inEff;}
75
76         void SetWeight(Double_t weight) { fWeight = weight;}
77         void SetMCIndex(Int_t idx) {      fMCIndex = idx;}
78
79         virtual void Print(Option_t *option="") const;
80
81         // Handel BitsData
82         Bool_t IsTrue(int i ) const { return TESTBIT(fFlags, i); }
83         void SetFlag(int i, Bool_t t){ if(t){SETBIT(fFlags,i);}else{CLRBIT(fFlags, i);}}
84
85         // Operators
86         AliJBaseTrack& operator=(const AliJBaseTrack& trk);
87
88     protected:
89         Int_t         fID;            // Unique track ID
90         Int_t         fLabel;         // Unique track label for MC-Data relation
91         Short_t       fParticleType;  // ParticleType 
92         Char_t        fCharge;        // track charge for real data
93         ULong_t       fStatus;        // reconstruction status flags or MC status 
94         UInt_t        fFlags;         // store series of any boolen value.
95
96         Int_t         fTriggID, fAssocID; //!   //id of trigger and assoc particle 
97         Double32_t    fTracEff;           //!   //track efficiency
98         Int_t         fMCIndex;           //!   //index of corresp. MC track
99         Double_t      fWeight;            //!   //particle weight
100
101         ClassDef(AliJBaseTrack,1)
102 };
103
104 #endif
105