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 class for photon and other particles storage and
20 // correlation studies
21 // Author: Yves Schutz, CERN, Gustavo Conesa, INFN
22 //-------------------------------------------------------------------------
27 #include "AliAODPWG4Particle.h"
29 ClassImp(AliAODPWG4Particle)
32 //______________________________________________________________________________
33 AliAODPWG4Particle::AliAODPWG4Particle() :
35 fMomentum(0),fPdg(-1), fTag(-1), fLabel(-1), fCaloLabel(), fTrackLabel(),
36 fDetector(""), fDisp(0), fTof(0), fCharged(0), fBadDist(0)
45 //______________________________________________________________________________
46 AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):
48 fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(),
49 fDetector(""), fDisp(0),fTof(0),fCharged(0), fBadDist(0)
52 fMomentum = new TLorentzVector(px, py, pz, e);
60 //______________________________________________________________________________
61 AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):
63 fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(),
64 fDetector(""), fDisp(0),fTof(0),fCharged(0),fBadDist(0)
67 fMomentum = new TLorentzVector(p);
76 //______________________________________________________________________________
77 AliAODPWG4Particle::~AliAODPWG4Particle()
83 //______________________________________________________________________________
84 AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :
86 fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel), fCaloLabel(), fTrackLabel(),
87 fDetector(part.fDetector),fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged), fBadDist(part.fBadDist)
91 fMomentum = new TLorentzVector(*part.fMomentum);
93 fCaloLabel [0] = part.fCaloLabel[0];
94 fCaloLabel [1] = part.fCaloLabel[1];
95 fTrackLabel[0] = part.fTrackLabel[0];
96 fTrackLabel[1] = part.fTrackLabel[1];
99 //______________________________________________________________________________
100 AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle& part)
102 // Assignment operator
107 fLabel = part.fLabel;
108 fCaloLabel [0] = part.fCaloLabel[0];
109 fCaloLabel [1] = part.fCaloLabel[1];
110 fTrackLabel[0] = part.fTrackLabel[0];
111 fTrackLabel[1] = part.fTrackLabel[1];
112 fDetector =part.fDetector;
116 fCharged = part.fCharged;
117 fBadDist=part.fBadDist;
119 if (fMomentum ) delete fMomentum;
120 fMomentum = new TLorentzVector(*part.fMomentum);
127 //_______________________________________________________________
128 Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{
129 // returns true if particle satisfies given PID criterium
131 case 0: return kTRUE ; //No PID at all
134 if (fPdg == pdgwanted) return kTRUE;
135 else return kFALSE; //Overall PID calculated with bayesian methods.
137 case 2: return fDisp ; //only dispersion cut
138 case 3: return fTof ; //Only TOF cut
139 case 4: return fCharged ; //Only Charged cut
140 case 5: return fDisp && fTof ; //Dispersion and TOF
141 case 6: return fDisp && fCharged ; //Dispersion and Charged
142 case 7: return fTof && fCharged ; //TOF and Charged
143 case 8: return fDisp && fTof && fCharged ; // all 3 cuts
144 default: return kFALSE ; //Not known combination
148 //______________________________________________________________________________
149 void AliAODPWG4Particle::Print(Option_t* /*option*/) const
151 // Print information of all data members
152 printf("Particle 4-vector:\n");
153 printf(" E = %13.3f\n", E() );
154 printf(" Px = %13.3f\n", Px());
155 printf(" Py = %13.3f\n", Py());
156 printf(" Pz = %13.3f\n", Pz());
157 printf("TOF bit : %d\n",fTof);
158 printf("Charged bit : %d\n",fCharged);
159 printf("Dispersion bit : %d\n",fDisp);
160 printf("pdg : %d\n",fPdg);
161 printf("tag : %d\n",fTag);
162 printf("Trigger Detector : %s\n",fDetector.Data());