]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/PartCorrBase/AliAODPWG4Particle.h
Fix for improper corrections from revision 30849
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / 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 //     Copy of AOD photon class, adapted for particle identification
10 //     and correlations analysis
11 //     Author: Yves Schutz, CERN, Gustavo Conesa, INFN
12 //-------------------------------------------------------------------------
13
14 //-- ROOT system --
15 #include <TLorentzVector.h>
16 class TString;
17
18 //-- Analysis system
19 #include "AliVParticle.h"
20
21 class AliAODPWG4Particle : public AliVParticle {
22
23  public:
24     AliAODPWG4Particle();
25     AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e);
26     AliAODPWG4Particle(TLorentzVector & p);  
27     virtual ~AliAODPWG4Particle();
28     AliAODPWG4Particle(const AliAODPWG4Particle& photon); 
29     AliAODPWG4Particle& operator=(const AliAODPWG4Particle& photon);
30
31     // AliVParticle methods
32     virtual Double_t Px()         const { return fMomentum->Px();      }
33     virtual Double_t Py()         const { return fMomentum->Py();      }
34     virtual Double_t Pz()         const { return fMomentum->Pz();      }
35     virtual Double_t Pt()         const { return fMomentum->Pt();      }
36     virtual Double_t P()          const { return fMomentum->P();       }
37     virtual Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
38     virtual Double_t OneOverPt()  const { return 1. / fMomentum->Pt(); }
39     virtual Double_t Phi()        const;
40     virtual Double_t Theta()      const { return fMomentum->Theta();   }
41     virtual Double_t E()          const { return fMomentum->E();       }
42     virtual Double_t M()          const { return fMomentum->M();       }
43     virtual Double_t Eta()        const { return fMomentum->Eta();     }
44     virtual Double_t Y()          const { return fMomentum->Rapidity();}
45     virtual Double_t Xv()         const {return -999.;} // put reasonable values here
46     virtual Double_t Yv()         const {return -999.;} //
47     virtual Double_t Zv()         const {return -999.;} //
48     virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }  
49     virtual void     Print(Option_t* /*option*/) const;
50
51     //
52     //Dummy
53     virtual Short_t Charge()      const { return 0;}
54     virtual const Double_t* PID() const { return NULL;}
55     //
56
57     virtual Int_t GetPdg()   const {return fPdg ; }
58     virtual Int_t GetTag()   const {return fTag ; }
59     virtual Int_t GetLabel()   const {return fLabel ; }
60         virtual Int_t GetCaloLabel (Int_t i) const {return fCaloLabel[i];}
61         virtual Int_t GetTrackLabel(Int_t i) const {return fTrackLabel[i];}
62     virtual TString GetDetector()   const {return fDetector ; }
63
64     virtual Bool_t   GetDispBit(void) const {return fDisp;}
65     virtual Bool_t   GetTOFBit(void) const {return fTof;}
66     virtual Bool_t   GetChargedBit(void) const {return fCharged;}
67     virtual Int_t    DistToBad() const  {return fBadDist ;} 
68
69     virtual void SetPdg(Int_t pdg)   {fPdg = pdg ; }
70     virtual void SetTag(Int_t tag)   {fTag = tag ; }
71     virtual void SetLabel(Int_t l)   {fLabel = l ; }
72         virtual void SetCaloLabel (Int_t a, Int_t b)   {fCaloLabel [0] = a; fCaloLabel [1] = b  ; }
73         virtual void SetTrackLabel(Int_t a, Int_t b)   {fTrackLabel[0] = a; fTrackLabel[1] = b  ; }
74         virtual void SetDetector(TString d)   {fDetector = d ; }
75
76     virtual void SetDispBit(Bool_t chi2){fDisp = chi2 ;} 
77     virtual void SetTOFBit(Bool_t tof){fTof = tof ;} 
78     virtual void SetChargedBit(Bool_t ch){fCharged = ch; }
79     virtual void SetDistToBad(Int_t dist){fBadDist=dist;} 
80   
81         TLorentzVector  * Momentum() const {return fMomentum ; }
82     virtual void SetMomentum(TLorentzVector *lv) {fMomentum = lv ; }
83   
84         Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const;
85   
86  private:
87     TLorentzVector* fMomentum;  // Photon 4-momentum vector
88     Int_t           fPdg;       // id of particle
89     Int_t           fTag;       // tag of particle (decay, fragment, prompt photon)
90     Int_t           fLabel;     // MC label
91         Int_t                   fCaloLabel[2];  // CaloCluster index, 1 for photons, 2 for pi0.
92         Int_t           fTrackLabel[2]; // Track lable, 1 for pions, 2 for conversion photons 
93     TString         fDetector;  // Detector where particle was measured.
94         
95     Bool_t                      fDisp ;     //Dispersion bit
96     Bool_t                      fTof ;      //TOF bit
97     Bool_t                      fCharged ;  //Charged bit
98     Int_t           fBadDist ;  //Distance to bad module in module units
99         
100         ClassDef(AliAODPWG4Particle,1);
101 };
102
103 inline Double_t AliAODPWG4Particle::Phi() const
104 {
105   // Return phi
106   Double_t phi = fMomentum->Phi();
107   if (phi < 0.) phi += 2. * TMath::Pi();
108   return phi;
109 }
110
111 #endif //ALIAODPWG4PARTICLE_H