AliPhysics  master (3d17d9d)
AliCaloTrackParticle.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 #include "AliCaloTrackParticle.h"
17 
19 ClassImp(AliCaloTrackParticle)
21 
22 //______________________________________________________________________________
27 AliVParticle(),
28 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
29 fCaloLabel(), fTrackLabel(), fDetectorTag(-1), fWeight(1),
30 fBadDist(0), fNLM(0), fM02(0), fM20(0),
31 fTime(0),fNCells(0),fSuperModule(0),fCellAbsIdMax(0),
32 fDecayTag(0),fIsolated(0), fLeadingParticle(0),
33 fIsoPerpConeSumPt(0), fDisp(0), fTof(0), fCharged(0),
34 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
35 {
36  fCaloLabel [0] = -1;
37  fCaloLabel [1] = -1;
38  fTrackLabel[0] = -1;
39  fTrackLabel[1] = -1;
40  fTrackLabel[2] = -1;
41  fTrackLabel[3] = -1;
42 
43  fIsoConePtLead[0] = 0.;
44  fIsoConeSumPt [0] = 0.;
45  fIsoConePtLead[1] = 0.;
46  fIsoConeSumPt [1] = 0.;
47 
48  fIsoEtaBandSumPt[0] = 0.;
49  fIsoEtaBandSumPt[1] = 0.;
50  fIsoPhiBandSumPt[0] = 0.;
51  fIsoPhiBandSumPt[1] = 0.;
52 
53  fIsoConeExcessAreaEta[0] = 0 ;
54  fIsoConeExcessAreaEta[1] = 0 ;
55  fIsoConeExcessAreaPhi[0] = 0 ;
56  fIsoConeExcessAreaPhi[1] = 0 ;
57 
58 }
59 
60 //______________________________________________________________________________
72  AliVParticle(),
73  fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
74  fCaloLabel(), fTrackLabel(), fDetectorTag(-1), fWeight(1),
75  fBadDist(0), fNLM(0), fM02(0), fM20(0),
76  fTime(0),fNCells(0),fSuperModule(0),fCellAbsIdMax(0),
77  fDecayTag(0),fIsolated(0), fLeadingParticle(0),
78  fIsoPerpConeSumPt(0), fDisp(0), fTof(0), fCharged(0),
79  fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
80 {
81  fMomentum = new TLorentzVector(px, py, pz, e);
82 
83  fCaloLabel [0] = -1;
84  fCaloLabel [1] = -1;
85  fTrackLabel[0] = -1;
86  fTrackLabel[1] = -1;
87  fTrackLabel[2] = -1;
88  fTrackLabel[3] = -1;
89 
90  fIsoConePtLead[0] = 0.;
91  fIsoConeSumPt [0] = 0.;
92  fIsoConePtLead[1] = 0.;
93  fIsoConeSumPt [1] = 0.;
94 
95  fIsoEtaBandSumPt[0] = 0.;
96  fIsoEtaBandSumPt[1] = 0.;
97  fIsoPhiBandSumPt[0] = 0.;
98  fIsoPhiBandSumPt[1] = 0.;
99 
100  fIsoConeExcessAreaEta[0] = 0 ;
101  fIsoConeExcessAreaEta[1] = 0 ;
102  fIsoConeExcessAreaPhi[0] = 0 ;
103  fIsoConeExcessAreaPhi[1] = 0 ;
104 }
105 
106 //______________________________________________________________________________
115  AliVParticle(),
116  fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
118  fBadDist(0), fNLM(0), fM02(0), fM20(0),
122  fIsoPerpConeSumPt(0), fDisp(0), fTof(0), fCharged(0),
123  fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
124 {
125  fMomentum = new TLorentzVector(p);
126 
127  fCaloLabel [0] = -1;
128  fCaloLabel [1] = -1;
129  fTrackLabel[0] = -1;
130  fTrackLabel[1] = -1;
131  fTrackLabel[2] = -1;
132  fTrackLabel[3] = -1;
133 
134  fIsoConePtLead[0] = 0.;
135  fIsoConeSumPt [0] = 0.;
136  fIsoConePtLead[1] = 0.;
137  fIsoConeSumPt [1] = 0.;
138 
139  fIsoEtaBandSumPt[0] = 0.;
140  fIsoEtaBandSumPt[1] = 0.;
141  fIsoPhiBandSumPt[0] = 0.;
142  fIsoPhiBandSumPt[1] = 0.;
143 
144  fIsoConeExcessAreaEta[0] = 0 ;
145  fIsoConeExcessAreaEta[1] = 0 ;
146  fIsoConeExcessAreaPhi[0] = 0 ;
147  fIsoConeExcessAreaPhi[1] = 0 ;
148 }
149 
150 //______________________________________________________________________________
155 {
156  delete fMomentum;
157 }
158 
159 //______________________________________________________________________________
164 {
165  delete fMomentum;
166 }
167 
168 //______________________________________________________________________________
173  AliVParticle(part),
174  fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel),
176  fBadDist(part.fBadDist),fNLM(part.fNLM), fM02(part.fM02), fM20(part.fM20),
180  fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged),
182 {
183  fMomentum = new TLorentzVector(*part.fMomentum);
184 
185  fCaloLabel [0] = part.fCaloLabel[0];
186  fCaloLabel [1] = part.fCaloLabel[1];
187  fTrackLabel[0] = part.fTrackLabel[0];
188  fTrackLabel[1] = part.fTrackLabel[1];
189  fTrackLabel[2] = part.fTrackLabel[2];
190  fTrackLabel[3] = part.fTrackLabel[3];
191 
192  fIsoConePtLead[0] = part.fIsoConePtLead[0];
193  fIsoConeSumPt [0] = part.fIsoConeSumPt [0];
194  fIsoConePtLead[1] = part.fIsoConePtLead[1];
195  fIsoConeSumPt [1] = part.fIsoConeSumPt [1];
196 
197  fIsoEtaBandSumPt[0] = part.fIsoEtaBandSumPt[0];
198  fIsoEtaBandSumPt[1] = part.fIsoEtaBandSumPt[1];
199  fIsoPhiBandSumPt[0] = part.fIsoPhiBandSumPt[0];
200  fIsoPhiBandSumPt[1] = part.fIsoPhiBandSumPt[1];
201 
206 }
207 
208 //________________________________________________________________________________
213 {
214  if(this!=&part)
215  {
216  fPdg = part.fPdg;
217  fTag = part.fTag;
218  fLabel = part.fLabel;
219 
220  fCaloLabel [0] = part.fCaloLabel[0];
221  fCaloLabel [1] = part.fCaloLabel[1];
222  fTrackLabel[0] = part.fTrackLabel[0];
223  fTrackLabel[1] = part.fTrackLabel[1];
224 
225  fIsoConePtLead[0] = part.fIsoConePtLead[0];
226  fIsoConeSumPt [0] = part.fIsoConeSumPt [0];
227  fIsoConePtLead[1] = part.fIsoConePtLead[1];
228  fIsoConeSumPt [1] = part.fIsoConeSumPt [1];
229 
231 
232  fIsoEtaBandSumPt[0] = part.fIsoEtaBandSumPt[0];
233  fIsoEtaBandSumPt[1] = part.fIsoEtaBandSumPt[1];
234  fIsoPhiBandSumPt[0] = part.fIsoPhiBandSumPt[0];
235  fIsoPhiBandSumPt[1] = part.fIsoPhiBandSumPt[1];
236 
241 
242  fDetectorTag = part.fDetectorTag;
243  fWeight = part.fWeight;
244  fDisp = part.fDisp;
245  fTof = part.fTof;
246  fCharged = part.fCharged;
247  fBadDist = part.fBadDist;
248  fDecayTag = part.fDecayTag;
249 
250  fNLM = part.fNLM;
251  fM02 = part.fM02;
252  fM20 = part.fM20;
253  fIsolated = part.fIsolated;
255 
256  fBtag = part.fBtag;
257  fFidArea = part.fFidArea;
258  fTagged = part.fTagged;
260 
261  if (fMomentum ) delete fMomentum;
262  fMomentum = new TLorentzVector(*part.fMomentum);
263  }
264 
265  return *this;
266 }
267 
268 //_______________________________________________________________
273 {
274  switch(ipid)
275  {
276  case 0: return kTRUE ; //No PID at all
277  case 1:
278  {
279  if (fPdg == pdgwanted) return kTRUE;
280  else return kFALSE; //Overall PID calculated with bayesian methods.
281  }
282  case 2: return fDisp ; //only dispersion cut
283  case 3: return fTof ; //Only TOF cut
284  case 4: return fCharged ; //Only Charged cut
285  case 5: return fDisp && fTof ; //Dispersion and TOF
286  case 6: return fDisp && fCharged ; //Dispersion and Charged
287  case 7: return fTof && fCharged ; //TOF and Charged
288  case 8: return fDisp && fTof && fCharged ; // all 3 cuts
289  default: return kFALSE ; //Not known combination
290  }
291 }
292 
293 //_________________________________________________________
297 void AliCaloTrackParticle::Print(Option_t* /*option*/) const
298 {
299  printf("Particle 4-vector:\n");
300  printf(" E = %13.3f", E() );
301  printf(" Px = %13.3f", Px());
302  printf(" Py = %13.3f", Py());
303  printf(" Pz = %13.3f\n", Pz());
304  printf("Id PDG : %d\n",fPdg);
305  printf("MC Tag : %d\n",fTag);
306  printf("Weight : %2.3f\n",fWeight);
307  printf("Dist. to bad channel : %d\n",fBadDist);
308 
309  printf("Detector : %d, Labels:\n",fDetectorTag);
310  printf(" Calo: %d, %d \n",fCaloLabel[0],fCaloLabel[1]);
311  printf(" Track: %d, %d, %d, %d \n",fTrackLabel[0],fTrackLabel[1],fTrackLabel[2],fTrackLabel[3]);
312 
313  if(fDetectorTag!=2) // Avoid tracks, AliFiducialCut::kCTS
314  {
315  printf("Calo param: \n");
316  printf(" M02: %2.2f\n",fM02);
317  printf(" M20: %2.2f\n",fM20);
318  printf(" NCell: %d\n",fNCells);
319  printf(" Time: %2.3f\n",fTime);
320  printf(" SModule: %d\n",fSuperModule);
321  printf(" CellAbsIdMax: %d\n",fCellAbsIdMax);
322  }
323 
324  printf("Tags: \n");
325 // printf("Btag : %d\n",fBtag);
326  printf(" Pi0 Tag : %d\n",fDecayTag);
327  if(fIsolated) printf(" Isolated! \n");
328  if(fLeadingParticle) printf(" Leading! \n");
329 
330  printf("Isolation cone: \n");
331  printf("\t charged: pT Max %2.2f, Sum pT %2.2f",fIsoConePtLead[0],fIsoConeSumPt[0]);
332  printf("\t neutral: pT Max %2.2f, Sum pT %2.2f",fIsoConePtLead[1],fIsoConeSumPt[1]);
333 
334  printf("UE Eta band: charged %2.2f, neutral %2.2f",fIsoEtaBandSumPt[0],fIsoEtaBandSumPt[1]);
335  printf("UE Phi band: charged %2.2f, neutral %2.2f",fIsoPhiBandSumPt[0],fIsoPhiBandSumPt[1]);
336 
337  printf("Excess cone eta: charged %2.2f, neutral %2.2f",fIsoConeExcessAreaEta[0],fIsoConeExcessAreaEta[1]);
338  printf("Excess cone phi: charged %2.2f, neutral %2.2f",fIsoConeExcessAreaPhi[0],fIsoConeExcessAreaPhi[1]);
339 
340  printf("PID bits :\n");
341  printf(" TOF : %d",fTof);
342  printf(" Charged : %d",fCharged);
343  printf(" Dispersion : %d\n",fDisp);
344 
345  // printf("Fid Area : %d\n",fFidArea);
346  // printf("Input File Index : %d\n",fInputFileIndex);
347 }
Bool_t fCharged
Charged bit.
virtual Double_t Pz() const
double Double_t
Definition: External.C:58
UInt_t fDetectorTag
Detector where particle was measured, integer.
Int_t fCellAbsIdMax
Store the absID of max energy cell in calorimeter cluster.
Int_t fPdg
type of identified particle, same code as PDG, but this is not a MonteCarlo particle ...
Int_t fInputFileIndex
0, standard input, 1 first input added. Only possible one for now, not really used.
Int_t fBadDist
Distance to calorimeter bad cell in cell units.
Float_t fIsoEtaBandSumPt[2]
Sum of Pt in UE eta band of tracks [0] and calo clusters [1] for isolation.
Float_t fIsoConeExcessAreaEta[2]
Fraction of cone area out of acceptance in eta for tracks [0] and calo clusters [1].
Bool_t IsPIDOK(Int_t ipid, Int_t pdgwanted) const
virtual Double_t E() const
Float_t fWeight
Weight to be applied to histogram.
Float_t fIsoConePtLead[2]
Pt of track [0] and calo cluster [1] with highest energy in the isolation cone.
Int_t fFidArea
Type of fiducial area hit by this photon.
int Int_t
Definition: External.C:63
virtual void Print(Option_t *) const
Container for input particle information on CaloTrackCorr package.
Bool_t fDisp
Dispersion bit.
Float_t fIsoPerpConeSumPt
Sum of Pt of tracks in perpendicular cones to isolation candidate.
Int_t fCaloLabel[2]
CaloCluster index, 1 for photons, 2 for pi0.
virtual Double_t Py() const
Bool_t fLeadingParticle
Particle is leading or not.
AliCaloTrackParticle & operator=(const AliCaloTrackParticle &photon)
Int_t fNCells
Store the number of cells in calorimeter cluster.
Int_t fBtag
tag particle from B.
virtual void Clear(const Option_t *)
Int_t fDecayTag
Tag the photon as decay from, pi0, eta, pi0 side band, eta side band.
Float_t fM20
Store the second axis of the calorimeter shower shape.
Int_t fTrackLabel[4]
Track lable, 1 for pions, 2 for conversion photons.
Float_t fM02
Store the main axis of the calorimeter shower shape.
Float_t fIsoPhiBandSumPt[2]
Sum of Pt in UE phi band of tracks [0] and calo clusters [1] for isolation.
virtual Double_t Px() const
UInt_t fNLM
Store the number of local maxima in calorimeter cluster.
Bool_t fTagged
If photon tagged (pi0 decay), not used anymore, replace by fDecayTag.
Bool_t fIsolated
Particle is isolated or not.
Int_t fTag
tag of particle (decay, fragment, prompt photon), MC
TLorentzVector * fMomentum
Photon 4-momentum vector.
Float_t fIsoConeExcessAreaPhi[2]
Fraction of cone area out of acceptance in phi for tracks [0] and calo clusters [1].
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
Float_t fIsoConeSumPt[2]
Sum of Pt of tracks [0] and calo clusters [1] in the isolation cone.
Int_t fSuperModule
Store the super-module number of calorimeter cluster.
Float_t fTime
Store the time of calorimeter cluster or track, nano seconds.