]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliAODPWG4Particle.h
Enlarging window for DCS DPs retrieval for short runs for GRP + Keeping connection...
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODPWG4Particle.h
1 #ifndef ALIAODPWG4PARTICLE_H
2 #define ALIAODPWG4PARTICLE_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliAODPWG4Particle.h  $ */
7
8 //-------------------------------------------------------------------------
9 //     AOD objects class in use in the CaloTrackCorrelations
10 //     analysis pacackge ($ALICE_ROOT/PWGGA/CaloTrackCorrelations)
11 //
12 //     Author: Gustavo Conesa Balbastre - CNRS-LPSC-Grenoble
13 //-------------------------------------------------------------------------
14
15 //-- ROOT system --
16 #include <TLorentzVector.h>
17 class TString;
18
19 //-- Analysis system
20 #include "AliVParticle.h"
21
22 class AliAODPWG4Particle : public AliVParticle {
23   
24  public:
25   
26   AliAODPWG4Particle();
27   AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e);
28   AliAODPWG4Particle(TLorentzVector & p);
29   
30   virtual ~AliAODPWG4Particle();
31   virtual void Clear(const Option_t* /*opt*/);
32
33   AliAODPWG4Particle (           const AliAODPWG4Particle& photon);
34   AliAODPWG4Particle & operator=(const AliAODPWG4Particle& photon);
35
36   // Main methods to recover kinematics or PID
37   TLorentzVector * Momentum() const                { return fMomentum ; }
38   virtual void     SetMomentum(TLorentzVector *lv) { fMomentum = lv   ; }
39   
40   Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const;
41   Double_t GetPairMass(AliAODPWG4Particle * p)const{ return (*(p->fMomentum)+*fMomentum).M(); }
42   
43   // AliVParticle methods
44   virtual Double_t Px()         const { return fMomentum->Px();      }
45   virtual Double_t Py()         const { return fMomentum->Py();      }
46   virtual Double_t Pz()         const { return fMomentum->Pz();      }
47   virtual Double_t Pt()         const { return fMomentum->Pt();      }
48   virtual Double_t P()          const { return fMomentum->P();       }
49   virtual Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
50   virtual Double_t OneOverPt()  const { return 1. / fMomentum->Pt(); }
51   virtual Double_t Phi()        const;
52   virtual Double_t Theta()      const { return fMomentum->Theta();   }
53   virtual Double_t E()          const { return fMomentum->E();       }
54   virtual Double_t M()          const { return fMomentum->M();       }
55   virtual Double_t Eta()        const { return fMomentum->Eta();     }
56   virtual Double_t Y()          const { return fMomentum->Rapidity();}
57   virtual Double_t Xv()         const { return -999.;} // put reasonable values here
58   virtual Double_t Yv()         const { return -999.;} //
59   virtual Double_t Zv()         const { return -999.;} //
60   virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }  
61   virtual void     Print(Option_t* /*option*/) const;
62   
63   //
64   //Dummy
65   virtual Short_t Charge()      const { return 0;}
66   virtual const Double_t* PID() const { return NULL;}
67   Int_t   PdgCode() const {return 0;}
68   //
69
70   //
71   // Specific getters
72   virtual Int_t   GetIdentifiedParticleType() const { return fPdg     ; }
73
74   virtual Int_t   GetLabel()             const { return fLabel        ; }
75   virtual Int_t   GetCaloLabel (Int_t i) const { return fCaloLabel[i] ; }
76   virtual Int_t   GetTrackLabel(Int_t i) const { return fTrackLabel[i]; }
77   virtual UInt_t  GetDetectorTag()       const { return fDetectorTag  ; }
78   virtual Bool_t  GetDispBit()           const { return fDisp         ; }
79   virtual Bool_t  GetTOFBit()            const { return fTof          ; }
80   virtual Bool_t  GetChargedBit()        const { return fCharged      ; }
81   virtual Int_t   DistToBad()            const { return fBadDist      ; }
82   virtual Int_t   GetInputFileIndex()    const { return fInputFileIndex ; }
83   virtual Int_t   GetFiducialArea()      const { return fFidArea      ; }
84
85   // Tags
86   virtual Int_t   GetTag()               const { return fTag          ; }
87   virtual Bool_t  IsTagged()             const { return fTagged       ; }
88   virtual Int_t   DecayTag()             const { return fDecayTag     ; }
89   virtual Bool_t  IsIsolated()           const { return fIsolated     ; }
90   virtual Bool_t  IsLeadingParticle()    const { return fLeadingParticle ; }
91
92   // Calorimeter specific param
93   virtual Int_t   GetNLM()               const { return fNLM          ; }
94   virtual Float_t GetM02()               const { return fM02          ; }
95   virtual Float_t GetTime()              const { return fTime         ; }
96   virtual Int_t   GetNCells()            const { return fNCells       ; }
97   virtual Int_t   GetSModNumber()        const { return fSuperModule  ; }
98
99   //
100   // Specific setters
101   virtual void SetIdentifiedParticleType(Int_t pdg) { fPdg = pdg ; }
102
103   virtual void SetLabel(Int_t l)         { fLabel = l ; }
104   virtual void SetCaloLabel (Int_t a, Int_t b) { fCaloLabel [0] = a; fCaloLabel [1] = b  ; }
105   virtual void SetTrackLabel(Int_t a, Int_t b) { fTrackLabel[0] = a; fTrackLabel[1] = b  ; }
106   virtual void SetTrackLabel(Int_t a, Int_t b, Int_t c, Int_t d) 
107   { fTrackLabel[0] = a; fTrackLabel[1] = b  ; fTrackLabel[2] = c; fTrackLabel[3] = d; }
108   
109   virtual void SetDetectorTag(UInt_t d)  { fDetectorTag = d    ; }
110   virtual void SetDispBit(Bool_t disp)   { fDisp        = disp ; }
111   virtual void SetTOFBit(Bool_t tof)     { fTof         = tof  ; }
112   virtual void SetChargedBit(Bool_t ch)  { fCharged     = ch   ; }
113   virtual void SetDistToBad(Int_t dist)  { fBadDist     = dist ; }
114   virtual void SetInputFileIndex(Int_t i){ fInputFileIndex = i ; }
115   virtual void SetFiducialArea(Int_t a)  { fFidArea     = a    ; }
116
117   // Tags
118   virtual void SetTag(Int_t tag)         { fTag         = tag  ; }
119   virtual void SetTagged(Bool_t tag)     { fTagged      = tag  ; }
120   virtual void SetDecayTag(Int_t tag)    { fDecayTag    = tag  ; }
121   virtual void SetIsolated(Bool_t iso)   { fIsolated    = iso  ; }
122   virtual void SetLeadingParticle(Bool_t l) { fLeadingParticle = l ; }
123   
124   // Calorimeter specific param
125   virtual void SetNLM   (Int_t   nlm)    { fNLM         = nlm  ; }
126   virtual void SetM02   (Float_t m02)    { fM02         = m02  ; }
127   virtual void SetTime  (Float_t tim)    { fTime        = tim  ; }
128   virtual void SetNCells(Int_t   nce)    { fNCells      = nce  ; }
129   virtual void SetSModNumber(Int_t sm)   { fSuperModule = sm   ; }
130   
131   //
132   // BTagging
133   // enumerated type for various b-tags of electrons
134   enum btagTypes {kDVMTag0, kDVMTag1, kDVMTag2, kTransverseIPTag, kUnknownTag};
135   
136   virtual void  SetBtag(Int_t tag)      { fBtag        = tag  ; }
137   virtual Int_t GetBtag()         const { return fBtag        ; }
138
139   void SetBTagBit(Int_t &tag, const UInt_t set) const {
140     // Set bit of type set (btagTypes) in tag
141     tag |= (1<<set) ;
142   }
143   
144   Bool_t CheckBTagBit(const Int_t tag, const UInt_t test) const {
145     // Check if in fBtag the bit test (btagTypes) is set.
146     if (tag & (1<<test) ) return  kTRUE ;
147     else return kFALSE ;
148   }
149   
150  private:
151   
152   TLorentzVector* fMomentum; // Photon 4-momentum vector
153   Int_t      fPdg ;          // type of identified particle, same code as PDG, but this is not a MonteCarlo particle 
154   Int_t      fTag ;          // tag of particle (decay, fragment, prompt photon), MC
155   Int_t      fLabel ;        // MC label
156   Int_t      fCaloLabel[2];  // CaloCluster index, 1 for photons, 2 for pi0.
157   Int_t      fTrackLabel[4]; // Track lable, 1 for pions, 2 for conversion photons 
158   UInt_t     fDetectorTag ;  // Detector where particle was measured, integer
159   
160   // Calo specific
161   Int_t      fBadDist ;      // Distance to bad module in module units
162   UInt_t     fNLM ;          // Store the number of local maxima
163   Float_t    fM02 ;          // Store the main axis of the calorimeter shower shape
164   Float_t    fTime;          // Store the time of cluster or track, nano seconds
165   Int_t      fNCells;        // Store the number of cells in cluster
166   Int_t      fSuperModule;   // Store the super-module number of cluster
167   
168   // Tags
169   Int_t      fDecayTag;      // Tag the photon as decay from, pi0, eta, pi0 side band, eta side band
170   Bool_t     fIsolated ;     // Particle is isolated or not
171   Bool_t     fLeadingParticle ; //Particle is leading or not
172
173   // PID bits
174   Bool_t     fDisp ;         // Dispersion bit
175   Bool_t     fTof ;          // TOF bit
176   Bool_t     fCharged ;      // Charged bit
177
178   // Not in use currently ...
179   Bool_t     fTagged ;       // If photon tagged (pi0 decay), not used anymore, replace by fDecayTag
180   Int_t      fFidArea ;      // Type of fiducial area hit by this photon
181   Int_t      fInputFileIndex;// 0, standard input, 1 first input added. Only possible one for now, not really used.
182   Int_t      fBtag;          // tag particle from B.
183
184   
185   ClassDef(AliAODPWG4Particle, 6);
186 };
187
188 inline Double_t AliAODPWG4Particle::Phi() const
189 {
190   // Return phi
191   Double_t phi = fMomentum->Phi();
192   if (phi < 0.) phi += TMath::TwoPi();
193   return phi;
194 }
195
196 #endif //ALIAODPWG4PARTICLE_H