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(), fDetectorTag(-1),
38 fBadDist(0), fNLM(0), fM02(0),
39 fTime(0),fNCells(0),fSuperModule(0),
40 fDecayTag(0),fIsolated(0), fLeadingParticle(0),
41 fDisp(0), fTof(0), fCharged(0),
42 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
53 //______________________________________________________________________________
54 AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):
56 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
57 fCaloLabel(), fTrackLabel(), fDetectorTag(-1),
58 fBadDist(0), fNLM(0), fM02(0),
59 fTime(0),fNCells(0),fSuperModule(0),
60 fDecayTag(0),fIsolated(0), fLeadingParticle(0),
61 fDisp(0), fTof(0), fCharged(0),
62 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
65 fMomentum = new TLorentzVector(px, py, pz, e);
75 //______________________________________________________________________________
76 AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):
78 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
79 fCaloLabel(), fTrackLabel(),fDetectorTag(-1),
80 fBadDist(0), fNLM(0), fM02(0),
81 fTime(0),fNCells(0),fSuperModule(0),
82 fDecayTag(0),fIsolated(0), fLeadingParticle(0),
83 fDisp(0), fTof(0), fCharged(0),
84 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
87 fMomentum = new TLorentzVector(p);
98 //______________________________________________________________________________
99 AliAODPWG4Particle::~AliAODPWG4Particle()
105 //______________________________________________________________________________
106 void AliAODPWG4Particle::Clear(const Option_t* /*opt*/)
112 //______________________________________________________________________________
113 AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :
115 fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel),
116 fCaloLabel(), fTrackLabel(), fDetectorTag(part.fDetectorTag),
117 fBadDist(part.fBadDist),fNLM(part.fNLM), fM02(part.fM02),
118 fTime(part.fTime),fNCells(part.fNCells),fSuperModule(part.fSuperModule),
119 fDecayTag(part.fDecayTag),fIsolated(part.fIsolated), fLeadingParticle(part.fLeadingParticle),
120 fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged),
121 fTagged(part.fTagged), fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex),fBtag(part.fBtag)
124 fMomentum = new TLorentzVector(*part.fMomentum);
126 fCaloLabel [0] = part.fCaloLabel[0];
127 fCaloLabel [1] = part.fCaloLabel[1];
128 fTrackLabel[0] = part.fTrackLabel[0];
129 fTrackLabel[1] = part.fTrackLabel[1];
130 fTrackLabel[2] = part.fTrackLabel[2];
131 fTrackLabel[3] = part.fTrackLabel[3];
134 //________________________________________________________________________________
135 AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle & part)
137 // Assignment operator
142 fLabel = part.fLabel;
144 fCaloLabel [0] = part.fCaloLabel[0];
145 fCaloLabel [1] = part.fCaloLabel[1];
146 fTrackLabel[0] = part.fTrackLabel[0];
147 fTrackLabel[1] = part.fTrackLabel[1];
149 fDetectorTag = part.fDetectorTag;
152 fCharged = part.fCharged;
153 fBadDist = part.fBadDist;
154 fDecayTag = part.fDecayTag;
158 fIsolated = part.fIsolated;
159 fLeadingParticle =part.fLeadingParticle;
162 fFidArea = part.fFidArea;
163 fTagged = part.fTagged;
164 fInputFileIndex = part.fInputFileIndex;
166 if (fMomentum ) delete fMomentum;
167 fMomentum = new TLorentzVector(*part.fMomentum);
173 //_______________________________________________________________
174 Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{
175 // returns true if particle satisfies given PID criterium
177 case 0: return kTRUE ; //No PID at all
180 if (fPdg == pdgwanted) return kTRUE;
181 else return kFALSE; //Overall PID calculated with bayesian methods.
183 case 2: return fDisp ; //only dispersion cut
184 case 3: return fTof ; //Only TOF cut
185 case 4: return fCharged ; //Only Charged cut
186 case 5: return fDisp && fTof ; //Dispersion and TOF
187 case 6: return fDisp && fCharged ; //Dispersion and Charged
188 case 7: return fTof && fCharged ; //TOF and Charged
189 case 8: return fDisp && fTof && fCharged ; // all 3 cuts
190 default: return kFALSE ; //Not known combination
194 //______________________________________________________________________________
195 void AliAODPWG4Particle::Print(Option_t* /*option*/) const
197 // Print information of all data members
199 printf("Particle 4-vector:\n");
200 printf(" E = %13.3f", E() );
201 printf(" Px = %13.3f", Px());
202 printf(" Py = %13.3f", Py());
203 printf(" Pz = %13.3f\n", Pz());
204 printf("Id PDG : %d\n",fPdg);
205 printf("MC Tag : %d\n",fTag);
206 printf("Dist. to bad channel : %d\n",fBadDist);
208 printf("Detector : %d, Labels:\n",fDetectorTag);
209 printf(" Calo: %d, %d \n",fCaloLabel[0],fCaloLabel[1]);
210 printf(" Track: %d, %d, %d, %d \n",fTrackLabel[0],fTrackLabel[1],fTrackLabel[2],fTrackLabel[3]);
212 if(fDetectorTag!=2) // Avoid tracks, AliFiducialCut::kCTS
214 printf("Calo param: \n");
215 printf(" M02: %2.3f\n",fM02);
216 printf(" NCell: %d\n",fNCells);
217 printf(" Time: %2.3f\n",fTime);
218 printf(" SModule: %d\n",fSuperModule);
222 // printf("Btag : %d\n",fBtag);
223 printf(" Pi0 Tag : %d\n",fDecayTag);
224 if(fIsolated) printf(" Isolated! \n");
225 if(fLeadingParticle) printf(" Leading! \n");
227 printf("PID bits :\n");
228 printf(" TOF : %d",fTof);
229 printf(" Charged : %d",fCharged);
230 printf(" Dispersion : %d\n",fDisp);
232 // printf("Fid Area : %d\n",fFidArea);
233 // printf("Input File Index : %d\n",fInputFileIndex);