1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliAODPWG4Particle.h $ */
18 //-------------------------------------------------------------------------
19 // AOD objects class in use in the CaloTrackCorrelations
20 // analysis pacackge ($ALICE_ROOT/PWGGA/CaloTrackCorrelations)
22 // Author: Gustavo Conesa Balbastre - CNRS-LPSC-Grenoble
23 //-------------------------------------------------------------------------
28 #include "AliAODPWG4Particle.h"
30 ClassImp(AliAODPWG4Particle)
33 //______________________________________________________________________________
34 AliAODPWG4Particle::AliAODPWG4Particle() :
36 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
37 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
38 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
39 fBadDist(0), fNLM(0), fM02(0),
40 fIsolated(0), fLeadingParticle(0),
41 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
52 //______________________________________________________________________________
53 AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):
55 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
56 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
57 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
58 fBadDist(0), fNLM(0), fM02(0),
59 fIsolated(0), fLeadingParticle(0),
60 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
63 fMomentum = new TLorentzVector(px, py, pz, e);
73 //______________________________________________________________________________
74 AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):
76 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
77 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
78 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
79 fBadDist(0), fNLM(0), fM02(0),
80 fIsolated(0), fLeadingParticle(0),
81 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
84 fMomentum = new TLorentzVector(p);
95 //______________________________________________________________________________
96 AliAODPWG4Particle::~AliAODPWG4Particle()
102 //______________________________________________________________________________
103 void AliAODPWG4Particle::Clear(const Option_t* /*opt*/)
109 //______________________________________________________________________________
110 AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :
112 fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel),
113 fCaloLabel(), fTrackLabel(), fDetector(part.fDetector), fDetectorTag(part.fDetectorTag),
114 fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged), fDecayTag(part.fDecayTag),fBadDist(part.fBadDist),
115 fNLM(part.fNLM), fM02(part.fM02), fIsolated(part.fIsolated), fLeadingParticle(part.fLeadingParticle),
116 fTagged(part.fTagged), fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex),fBtag(part.fBtag)
119 fMomentum = new TLorentzVector(*part.fMomentum);
121 fCaloLabel [0] = part.fCaloLabel[0];
122 fCaloLabel [1] = part.fCaloLabel[1];
123 fTrackLabel[0] = part.fTrackLabel[0];
124 fTrackLabel[1] = part.fTrackLabel[1];
125 fTrackLabel[2] = part.fTrackLabel[2];
126 fTrackLabel[3] = part.fTrackLabel[3];
129 //________________________________________________________________________________
130 AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle & part)
132 // Assignment operator
137 fLabel = part.fLabel;
139 fCaloLabel [0] = part.fCaloLabel[0];
140 fCaloLabel [1] = part.fCaloLabel[1];
141 fTrackLabel[0] = part.fTrackLabel[0];
142 fTrackLabel[1] = part.fTrackLabel[1];
144 fDetectorTag = part.fDetectorTag;
145 fDetector = part.fDetector;
148 fCharged = part.fCharged;
149 fBadDist = part.fBadDist;
150 fDecayTag = part.fDecayTag;
154 fIsolated = part.fIsolated;
155 fLeadingParticle =part.fLeadingParticle;
158 fFidArea = part.fFidArea;
159 fTagged = part.fTagged;
160 fInputFileIndex = part.fInputFileIndex;
162 if (fMomentum ) delete fMomentum;
163 fMomentum = new TLorentzVector(*part.fMomentum);
169 //_______________________________________________________________
170 Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{
171 // returns true if particle satisfies given PID criterium
173 case 0: return kTRUE ; //No PID at all
176 if (fPdg == pdgwanted) return kTRUE;
177 else return kFALSE; //Overall PID calculated with bayesian methods.
179 case 2: return fDisp ; //only dispersion cut
180 case 3: return fTof ; //Only TOF cut
181 case 4: return fCharged ; //Only Charged cut
182 case 5: return fDisp && fTof ; //Dispersion and TOF
183 case 6: return fDisp && fCharged ; //Dispersion and Charged
184 case 7: return fTof && fCharged ; //TOF and Charged
185 case 8: return fDisp && fTof && fCharged ; // all 3 cuts
186 default: return kFALSE ; //Not known combination
190 //______________________________________________________________________________
191 void AliAODPWG4Particle::Print(Option_t* /*option*/) const
193 // Print information of all data members
194 printf("Particle 4-vector:\n");
195 printf(" E = %13.3f", E() );
196 printf(" Px = %13.3f", Px());
197 printf(" Py = %13.3f", Py());
198 printf(" Pz = %13.3f\n", Pz());
199 printf("PID bits :\n");
200 printf(" TOF : %d",fTof);
201 printf(" Charged : %d",fCharged);
202 printf(" Dispersion : %d\n",fDisp);
203 printf("PDG : %d\n",fPdg);
204 printf("Tag : %d\n",fTag);
205 printf("Btag : %d\n",fBtag);
206 printf("Pi0 Tag : %d\n",fDecayTag);
207 printf("Dist. to bad channel : %d\n",fBadDist);
208 printf("Fid Area : %d\n",fFidArea);
209 printf("Input File Index : %d\n",fInputFileIndex);
210 printf("Detector : %d\n",fDetectorTag);
211 if(fIsolated) printf("Isolated! \n");
212 if(fLeadingParticle) printf("Leading! \n");