Corrected protection.
[u/mrichter/AliRoot.git] / STEER / AliAODPWG4Particle.h
CommitLineData
8a587055 1#ifndef ALIAODPWG4PARTICLE_H\r
2#define ALIAODPWG4PARTICLE_H\r
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *\r
4 * See cxx source for full Copyright notice */\r
5\r
6/* $Id: AliAODPWG4Particle.h $ */\r
7\r
8//-------------------------------------------------------------------------\r
9// Copy of AOD photon class, adapted for particle identification\r
10// and correlations analysis\r
11// Author: Yves Schutz, CERN, Gustavo Conesa, INFN\r
12//-------------------------------------------------------------------------\r
13\r
14//-- ROOT system --\r
15#include <TLorentzVector.h>\r
16class TString;\r
17\r
18//-- Analysis system\r
19#include "AliVParticle.h"\r
20\r
21class AliAODPWG4Particle : public AliVParticle {\r
22 \r
23 public:\r
24 AliAODPWG4Particle();\r
25 AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e);\r
26 AliAODPWG4Particle(TLorentzVector & p); \r
27 virtual ~AliAODPWG4Particle();\r
28 AliAODPWG4Particle(const AliAODPWG4Particle& photon); \r
29 AliAODPWG4Particle& operator=(const AliAODPWG4Particle& photon);\r
30\r
31 //enumerated type for various b-tags of electrons\r
32 enum btagTypes {kDVMTag0, kDVMTag1, kDVMTag2, kTransverseIPTag, kUnknownTag};\r
33\r
34 void SetBTagBit(Int_t &tag, const UInt_t set) const {\r
35 // Set bit of type set (btagTypes) in tag \r
36 tag |= (1<<set) ;\r
37 }\r
38\r
39 Bool_t CheckBTagBit(const Int_t tag, const UInt_t test) const {\r
40 // Check if in fBtag the bit test (btagTypes) is set. \r
41 if (tag & (1<<test) ) return kTRUE ;\r
42 else return kFALSE ;\r
43 }\r
44\r
45 // AliVParticle methods\r
46 virtual Double_t Px() const { return fMomentum->Px(); }\r
47 virtual Double_t Py() const { return fMomentum->Py(); }\r
48 virtual Double_t Pz() const { return fMomentum->Pz(); }\r
49 virtual Double_t Pt() const { return fMomentum->Pt(); }\r
50 virtual Double_t P() const { return fMomentum->P(); }\r
51 virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }\r
52 virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); }\r
53 virtual Double_t Phi() const;\r
54 virtual Double_t Theta() const { return fMomentum->Theta(); }\r
55 virtual Double_t E() const { return fMomentum->E(); }\r
56 virtual Double_t M() const { return fMomentum->M(); }\r
57 virtual Double_t Eta() const { return fMomentum->Eta(); }\r
58 virtual Double_t Y() const { return fMomentum->Rapidity();}\r
59 virtual Double_t Xv() const {return -999.;} // put reasonable values here\r
60 virtual Double_t Yv() const {return -999.;} //\r
61 virtual Double_t Zv() const {return -999.;} //\r
62 virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } \r
63 virtual void Print(Option_t* /*option*/) const;\r
64 \r
65 //\r
66 //Dummy\r
67 virtual Short_t Charge() const { return 0;}\r
68 virtual const Double_t* PID() const { return NULL;}\r
69 //\r
70 \r
71 virtual Int_t GetPdg() const {return fPdg ; }\r
72 virtual Int_t GetTag() const {return fTag ; }\r
73 virtual Int_t GetBtag() const {return fBtag ; }\r
74 virtual Int_t GetLabel() const {return fLabel ; }\r
75 virtual Int_t GetCaloLabel (Int_t i) const {return fCaloLabel[i] ; }\r
76 virtual Int_t GetTrackLabel(Int_t i) const {return fTrackLabel[i] ; }\r
77 virtual TString GetDetector() const {return fDetector ; }\r
78 virtual Bool_t GetDispBit(void) const {return fDisp ; }\r
79 virtual Bool_t GetTOFBit(void) const {return fTof ; }\r
80 virtual Bool_t GetChargedBit(void) const {return fCharged ; }\r
81 virtual Int_t DistToBad() const {return fBadDist ; } \r
82 virtual Int_t GetInputFileIndex() const {return fInputFileIndex ; }\r
477a0971 83 virtual Int_t GetFiducialArea() const {return fFidArea;}\r
84\r
85 virtual Bool_t IsTagged() const {return fTagged ; }\r
8a587055 86 \r
87 virtual void SetLabel(Int_t l) { fLabel = l ; }\r
88 virtual void SetCaloLabel (Int_t a, Int_t b) { fCaloLabel [0] = a; fCaloLabel [1] = b ; }\r
89 virtual void SetTrackLabel(Int_t a, Int_t b) { fTrackLabel[0] = a; fTrackLabel[1] = b ; }\r
90 \r
91 virtual void SetPdg(Int_t pdg) { fPdg = pdg ; }\r
92 virtual void SetTag(Int_t tag) { fTag = tag ; }\r
477a0971 93 virtual void SetTagged(Bool_t tag) { fTagged = tag ; }\r
8a587055 94 virtual void SetBtag(Int_t tag) { fBtag = tag ; }\r
95 virtual void SetDetector(TString d) { fDetector = d ; }\r
96 virtual void SetDispBit(Bool_t disp) { fDisp = disp ; } \r
97 virtual void SetTOFBit(Bool_t tof) { fTof = tof ;} \r
98 virtual void SetChargedBit(Bool_t ch) { fCharged = ch ; }\r
99 virtual void SetDistToBad(Int_t dist) { fBadDist=dist ;} \r
100 virtual void SetInputFileIndex(Int_t i){ fInputFileIndex = i;}\r
477a0971 101 virtual void SetFiducialArea(Int_t a) {fFidArea=a;}\r
8a587055 102 \r
103 TLorentzVector * Momentum() const { return fMomentum ; }\r
104 virtual void SetMomentum(TLorentzVector *lv) { fMomentum = lv ; }\r
105 \r
106 Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const;\r
477a0971 107 Double_t GetPairMass(AliAODPWG4Particle * p)const{ return (*(p->fMomentum)+*fMomentum).M(); }\r
6a8e543a 108 // Dummy\r
109 Int_t PdgCode() const {return 0;}\r
8a587055 110 \r
111 private:\r
112 TLorentzVector* fMomentum; // Photon 4-momentum vector\r
113 Int_t fPdg ; // id of particle\r
114 Int_t fTag ; // tag of particle (decay, fragment, prompt photon), MC\r
115 Int_t fBtag; // tag particle from B.\r
116 Int_t fLabel ; // MC label\r
117 Int_t fCaloLabel[2]; // CaloCluster index, 1 for photons, 2 for pi0.\r
118 Int_t fTrackLabel[2]; // Track lable, 1 for pions, 2 for conversion photons \r
119 TString fDetector ; // Detector where particle was measured.\r
120 Bool_t fDisp ; // Dispersion bit\r
121 Bool_t fTof ; // TOF bit\r
122 Bool_t fCharged ; // Charged bit\r
477a0971 123 Bool_t fTagged ; // If photon tagged (pi0 decay)\r
8a587055 124 Int_t fBadDist ; // Distance to bad module in module units\r
477a0971 125 Int_t fFidArea ; // Type of fiducial area hit by this photon\r
8a587055 126 Int_t fInputFileIndex;// 0, standard input, 1 first input added. \r
127 // Only possible one for now, more in future?\r
128 \r
477a0971 129 ClassDef(AliAODPWG4Particle,3);\r
8a587055 130};\r
131\r
132inline Double_t AliAODPWG4Particle::Phi() const\r
133{\r
134 // Return phi\r
135 Double_t phi = fMomentum->Phi();\r
477a0971 136 if (phi < 0.) phi += TMath::TwoPi();\r
8a587055 137 return phi;\r
138}\r
139\r
140#endif //ALIAODPWG4PARTICLE_H\r