]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODPWG4Particle.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[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//-------------------------------------------------------------------------
bfa9c596 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
21a4b1c0 13//-------------------------------------------------------------------------
14
15//-- ROOT system --
16#include <TLorentzVector.h>
17class TString;
18
19//-- Analysis system
20#include "AliVParticle.h"
21
22class AliAODPWG4Particle : public AliVParticle {
23
24 public:
25 AliAODPWG4Particle();
26 AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e);
27 AliAODPWG4Particle(TLorentzVector & p);
28
29 virtual ~AliAODPWG4Particle();
30 virtual void Clear(const Option_t* /*opt*/);
31
bfa9c596 32 AliAODPWG4Particle ( const AliAODPWG4Particle& photon);
33 AliAODPWG4Particle & operator=(const AliAODPWG4Particle& photon);
21a4b1c0 34
bfa9c596 35 // Main methods to recover kinematics or PID
36 TLorentzVector * Momentum() const { return fMomentum ; }
37 virtual void SetMomentum(TLorentzVector *lv) { fMomentum = lv ; }
38
39 Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const;
40 Double_t GetPairMass(AliAODPWG4Particle * p)const{ return (*(p->fMomentum)+*fMomentum).M(); }
41
21a4b1c0 42 // AliVParticle methods
43 virtual Double_t Px() const { return fMomentum->Px(); }
44 virtual Double_t Py() const { return fMomentum->Py(); }
45 virtual Double_t Pz() const { return fMomentum->Pz(); }
46 virtual Double_t Pt() const { return fMomentum->Pt(); }
47 virtual Double_t P() const { return fMomentum->P(); }
48 virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
49 virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); }
50 virtual Double_t Phi() const;
51 virtual Double_t Theta() const { return fMomentum->Theta(); }
52 virtual Double_t E() const { return fMomentum->E(); }
53 virtual Double_t M() const { return fMomentum->M(); }
54 virtual Double_t Eta() const { return fMomentum->Eta(); }
55 virtual Double_t Y() const { return fMomentum->Rapidity();}
bfa9c596 56 virtual Double_t Xv() const { return -999.;} // put reasonable values here
57 virtual Double_t Yv() const { return -999.;} //
58 virtual Double_t Zv() const { return -999.;} //
21a4b1c0 59 virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
60 virtual void Print(Option_t* /*option*/) const;
61
62 //
63 //Dummy
64 virtual Short_t Charge() const { return 0;}
65 virtual const Double_t* PID() const { return NULL;}
bfa9c596 66 Int_t PdgCode() const {return 0;}
67 //
68
21a4b1c0 69 //
bfa9c596 70 // Specific getters
71 virtual Int_t GetIdentifiedParticleType() const { return fPdg ; }
72
73 virtual Int_t GetLabel() const { return fLabel ; }
74 virtual Int_t GetCaloLabel (Int_t i) const { return fCaloLabel[i] ; }
75 virtual Int_t GetTrackLabel(Int_t i) const { return fTrackLabel[i]; }
76 virtual TString GetDetector() const { return fDetector ; }
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 ; }
21a4b1c0 95
bfa9c596 96 //
97 // Specific setters
98 virtual void SetIdentifiedParticleType(Int_t pdg) { fPdg = pdg ; }
99
21a4b1c0 100 virtual void SetLabel(Int_t l) { fLabel = l ; }
101 virtual void SetCaloLabel (Int_t a, Int_t b) { fCaloLabel [0] = a; fCaloLabel [1] = b ; }
102 virtual void SetTrackLabel(Int_t a, Int_t b) { fTrackLabel[0] = a; fTrackLabel[1] = b ; }
103 virtual void SetTrackLabel(Int_t a, Int_t b, Int_t c, Int_t d)
104 { fTrackLabel[0] = a; fTrackLabel[1] = b ; fTrackLabel[2] = c; fTrackLabel[3] = d; }
105
bfa9c596 106 virtual void SetDetector(TString d) { fDetector = d ; }
107 virtual void SetDetectorTag(UInt_t d) { fDetectorTag = d ; }
108 virtual void SetDispBit(Bool_t disp) { fDisp = disp ; }
109 virtual void SetTOFBit(Bool_t tof) { fTof = tof ; }
110 virtual void SetChargedBit(Bool_t ch) { fCharged = ch ; }
111 virtual void SetDistToBad(Int_t dist) { fBadDist = dist ; }
112 virtual void SetInputFileIndex(Int_t i){ fInputFileIndex = i ; }
113 virtual void SetFiducialArea(Int_t a) { fFidArea = a ; }
114
115 // Tags
116 virtual void SetTag(Int_t tag) { fTag = tag ; }
117 virtual void SetTagged(Bool_t tag) { fTagged = tag ; }
118 virtual void SetDecayTag(Int_t tag) { fDecayTag = tag ; }
119 virtual void SetIsolated(Bool_t iso) { fIsolated = iso ; }
120 virtual void SetLeadingParticle(Bool_t l) { fLeadingParticle = l ; }
21a4b1c0 121
bfa9c596 122 // Calorimeter specific param
123 virtual void SetNLM(UInt_t nlm) { fNLM = nlm ; }
124 virtual void SetM02(Float_t m02) { fM02 = m02 ; }
125
126 //
127 // BTagging
128 // enumerated type for various b-tags of electrons
129 enum btagTypes {kDVMTag0, kDVMTag1, kDVMTag2, kTransverseIPTag, kUnknownTag};
130
131 virtual void SetBtag(Int_t tag) { fBtag = tag ; }
132 virtual Int_t GetBtag() const { return fBtag ; }
133
134 void SetBTagBit(Int_t &tag, const UInt_t set) const {
135 // Set bit of type set (btagTypes) in tag
136 tag |= (1<<set) ;
137 }
138
139 Bool_t CheckBTagBit(const Int_t tag, const UInt_t test) const {
140 // Check if in fBtag the bit test (btagTypes) is set.
141 if (tag & (1<<test) ) return kTRUE ;
142 else return kFALSE ;
143 }
21a4b1c0 144
145 private:
bfa9c596 146 TLorentzVector* fMomentum; // Photon 4-momentum vector
21a4b1c0 147 Int_t fPdg ; // type of identified particle, same code as PDG, but this is not a MonteCarlo particle
148 Int_t fTag ; // tag of particle (decay, fragment, prompt photon), MC
21a4b1c0 149 Int_t fLabel ; // MC label
150 Int_t fCaloLabel[2]; // CaloCluster index, 1 for photons, 2 for pi0.
151 Int_t fTrackLabel[4]; // Track lable, 1 for pions, 2 for conversion photons
152 TString fDetector ; // Detector where particle was measured.
bfa9c596 153 UInt_t fDetectorTag ; // Detector where particle was measured, integer
21a4b1c0 154 Bool_t fDisp ; // Dispersion bit
155 Bool_t fTof ; // TOF bit
156 Bool_t fCharged ; // Charged bit
bfa9c596 157 Int_t fDecayTag; // Tag the photon as decay from, pi0, eta, pi0 side band, eta side band
21a4b1c0 158 Int_t fBadDist ; // Distance to bad module in module units
bfa9c596 159 UInt_t fNLM ; // Store the number of local maxima
160 Float_t fM02 ; // Store the main axis of the calorimeter shower shape
161 Bool_t fIsolated ; // Particle is isolated or not
162 Bool_t fLeadingParticle ; //Particle is leading or not
163
164 // Not in use currently ...
165 Bool_t fTagged ; // If photon tagged (pi0 decay), not used anymore, replace by fDecayTag
21a4b1c0 166 Int_t fFidArea ; // Type of fiducial area hit by this photon
bfa9c596 167 Int_t fInputFileIndex;// 0, standard input, 1 first input added. Only possible one for now, not really used.
168 Int_t fBtag; // tag particle from B.
169
170
171 ClassDef(AliAODPWG4Particle, 5);
21a4b1c0 172};
173
174inline Double_t AliAODPWG4Particle::Phi() const
175{
176 // Return phi
177 Double_t phi = fMomentum->Phi();
178 if (phi < 0.) phi += TMath::TwoPi();
179 return phi;
180}
181
182#endif //ALIAODPWG4PARTICLE_H