]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODPWG4Particle.h
Added possibility to load automatically the field in analysis via AliInputEventHandle...
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODPWG4Particle.h
CommitLineData
21a4b1c0 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>
16class TString;
17
18//-- Analysis system
19#include "AliVParticle.h"
20
21class 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
28 virtual ~AliAODPWG4Particle();
29 virtual void Clear(const Option_t* /*opt*/);
30
31 AliAODPWG4Particle(const AliAODPWG4Particle& photon);
32 AliAODPWG4Particle& operator=(const AliAODPWG4Particle& photon);
33
34 //enumerated type for various b-tags of electrons
35 enum btagTypes {kDVMTag0, kDVMTag1, kDVMTag2, kTransverseIPTag, kUnknownTag};
36
37 void SetBTagBit(Int_t &tag, const UInt_t set) const {
38 // Set bit of type set (btagTypes) in tag
39 tag |= (1<<set) ;
40 }
41
42 Bool_t CheckBTagBit(const Int_t tag, const UInt_t test) const {
43 // Check if in fBtag the bit test (btagTypes) is set.
44 if (tag & (1<<test) ) return kTRUE ;
45 else return kFALSE ;
46 }
47
48 // AliVParticle methods
49 virtual Double_t Px() const { return fMomentum->Px(); }
50 virtual Double_t Py() const { return fMomentum->Py(); }
51 virtual Double_t Pz() const { return fMomentum->Pz(); }
52 virtual Double_t Pt() const { return fMomentum->Pt(); }
53 virtual Double_t P() const { return fMomentum->P(); }
54 virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
55 virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); }
56 virtual Double_t Phi() const;
57 virtual Double_t Theta() const { return fMomentum->Theta(); }
58 virtual Double_t E() const { return fMomentum->E(); }
59 virtual Double_t M() const { return fMomentum->M(); }
60 virtual Double_t Eta() const { return fMomentum->Eta(); }
61 virtual Double_t Y() const { return fMomentum->Rapidity();}
62 virtual Double_t Xv() const {return -999.;} // put reasonable values here
63 virtual Double_t Yv() const {return -999.;} //
64 virtual Double_t Zv() const {return -999.;} //
65 virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
66 virtual void Print(Option_t* /*option*/) const;
67
68 //
69 //Dummy
70 virtual Short_t Charge() const { return 0;}
71 virtual const Double_t* PID() const { return NULL;}
72 //
73
74 virtual Int_t GetIdentifiedParticleType() const {return fPdg ; }
75 virtual Int_t GetTag() const {return fTag ; }
76 virtual Int_t GetBtag() const {return fBtag ; }
77 virtual Int_t GetLabel() const {return fLabel ; }
78 virtual Int_t GetCaloLabel (Int_t i) const {return fCaloLabel[i] ; }
79 virtual Int_t GetTrackLabel(Int_t i) const {return fTrackLabel[i] ; }
80 virtual TString GetDetector() const {return fDetector ; }
81 virtual Bool_t GetDispBit(void) const {return fDisp ; }
82 virtual Bool_t GetTOFBit(void) const {return fTof ; }
83 virtual Bool_t GetChargedBit(void) const {return fCharged ; }
84 virtual Int_t DistToBad() const {return fBadDist ; }
85 virtual Int_t GetInputFileIndex() const {return fInputFileIndex ; }
86 virtual Int_t GetFiducialArea() const {return fFidArea;}
87
88 virtual Bool_t IsTagged() const {return fTagged ; }
89
90 virtual void SetLabel(Int_t l) { fLabel = l ; }
91 virtual void SetCaloLabel (Int_t a, Int_t b) { fCaloLabel [0] = a; fCaloLabel [1] = b ; }
92 virtual void SetTrackLabel(Int_t a, Int_t b) { fTrackLabel[0] = a; fTrackLabel[1] = b ; }
93 virtual void SetTrackLabel(Int_t a, Int_t b, Int_t c, Int_t d)
94 { fTrackLabel[0] = a; fTrackLabel[1] = b ; fTrackLabel[2] = c; fTrackLabel[3] = d; }
95
96 virtual void SetIdentifiedParticleType(Int_t pdg) { fPdg = pdg ; }
97 virtual void SetTag(Int_t tag) { fTag = tag ; }
98 virtual void SetTagged(Bool_t tag) { fTagged = tag ; }
99 virtual void SetBtag(Int_t tag) { fBtag = tag ; }
100 virtual void SetDetector(TString d) { fDetector = d ; }
101 virtual void SetDispBit(Bool_t disp) { fDisp = disp ; }
102 virtual void SetTOFBit(Bool_t tof) { fTof = tof ;}
103 virtual void SetChargedBit(Bool_t ch) { fCharged = ch ; }
104 virtual void SetDistToBad(Int_t dist) { fBadDist=dist ;}
105 virtual void SetInputFileIndex(Int_t i){ fInputFileIndex = i;}
106 virtual void SetFiducialArea(Int_t a) {fFidArea=a;}
107
108 TLorentzVector * Momentum() const { return fMomentum ; }
109 virtual void SetMomentum(TLorentzVector *lv) { fMomentum = lv ; }
110
111 Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const;
112 Double_t GetPairMass(AliAODPWG4Particle * p)const{ return (*(p->fMomentum)+*fMomentum).M(); }
113 // Dummy
114 Int_t PdgCode() const {return 0;}
115
116 private:
117 TLorentzVector* fMomentum; // Photon 4-momentum vector
118 Int_t fPdg ; // type of identified particle, same code as PDG, but this is not a MonteCarlo particle
119 Int_t fTag ; // tag of particle (decay, fragment, prompt photon), MC
120 Int_t fBtag; // tag particle from B.
121 Int_t fLabel ; // MC label
122 Int_t fCaloLabel[2]; // CaloCluster index, 1 for photons, 2 for pi0.
123 Int_t fTrackLabel[4]; // Track lable, 1 for pions, 2 for conversion photons
124 TString fDetector ; // Detector where particle was measured.
125 Bool_t fDisp ; // Dispersion bit
126 Bool_t fTof ; // TOF bit
127 Bool_t fCharged ; // Charged bit
128 Bool_t fTagged ; // If photon tagged (pi0 decay)
129 Int_t fBadDist ; // Distance to bad module in module units
130 Int_t fFidArea ; // Type of fiducial area hit by this photon
131 Int_t fInputFileIndex;// 0, standard input, 1 first input added.
132 // Only possible one for now, more in future?
133
134 ClassDef(AliAODPWG4Particle, 4);
135};
136
137inline Double_t AliAODPWG4Particle::Phi() const
138{
139 // Return phi
140 Double_t phi = fMomentum->Phi();
141 if (phi < 0.) phi += TMath::TwoPi();
142 return phi;
143}
144
145#endif //ALIAODPWG4PARTICLE_H