fTRDsignal is added to AliAODPid class (copied from AliESDtrack).
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODPWG4Particle.cxx
CommitLineData
8a587055 1/**************************************************************************\r
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15\r
16/* $Id: AliAODPWG4Particle.h $ */\r
17\r
18//-------------------------------------------------------------------------\r
19// AOD class for photon and other particles storage and \r
20// correlation studies\r
21// Author: Yves Schutz, CERN, Gustavo Conesa, INFN\r
22//-------------------------------------------------------------------------\r
23\r
24//-- ROOT system --\r
25\r
26//-- Analysis system\r
27#include "AliAODPWG4Particle.h"\r
28\r
29ClassImp(AliAODPWG4Particle)\r
30\r
31\r
32//______________________________________________________________________________\r
33AliAODPWG4Particle::AliAODPWG4Particle() :\r
34AliVParticle(),\r
35fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1), fCaloLabel(), fTrackLabel(),\r
78e39bd0 36fDetector(""), fDisp(0), fTof(0), fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0)\r
8a587055 37{\r
38 // constructor\r
39 fCaloLabel [0] = -1;\r
40 fCaloLabel [1] = -1;\r
41 fTrackLabel[0] = -1;\r
42 fTrackLabel[1] = -1;\r
4c624582 43 fTrackLabel[2] = -1;\r
44 fTrackLabel[3] = -1;\r
8a587055 45}\r
46\r
47//______________________________________________________________________________\r
48AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):\r
49 AliVParticle(),\r
50 fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1),fCaloLabel(), fTrackLabel(),\r
78e39bd0 51 fDetector(""), fDisp(0), fTof(0),fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0)\r
8a587055 52{\r
53 // constructor\r
54 fMomentum = new TLorentzVector(px, py, pz, e);\r
55 \r
56 fCaloLabel [0] = -1;\r
57 fCaloLabel [1] = -1;\r
58 fTrackLabel[0] = -1;\r
59 fTrackLabel[1] = -1; \r
4c624582 60 fTrackLabel[2] = -1;\r
61 fTrackLabel[3] = -1; \r
8a587055 62}\r
63\r
64//______________________________________________________________________________\r
65AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):\r
66 AliVParticle(),\r
67 fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1),fCaloLabel(), fTrackLabel(),\r
78e39bd0 68 fDetector(""), fDisp(0), fTof(0), fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0)\r
8a587055 69{\r
70 // constructor\r
71 fMomentum = new TLorentzVector(p);\r
72 \r
73 fCaloLabel [0] = -1;\r
74 fCaloLabel [1] = -1;\r
75 fTrackLabel[0] = -1;\r
76 fTrackLabel[1] = -1;\r
4c624582 77 fTrackLabel[2] = -1;\r
78 fTrackLabel[3] = -1;\r
8a587055 79}\r
80\r
81\r
82//______________________________________________________________________________\r
83AliAODPWG4Particle::~AliAODPWG4Particle() \r
84{\r
85 // destructor\r
86 delete fMomentum;\r
87}\r
88\r
89//______________________________________________________________________________\r
032002d9 90void AliAODPWG4Particle::Clear(const Option_t* /*opt*/) \r
91{\r
92 //clear\r
93 delete fMomentum;\r
94}\r
95\r
96//______________________________________________________________________________\r
8a587055 97AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :\r
98 AliVParticle(part),\r
99 fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fBtag(part.fBtag), fLabel(part.fLabel), \r
100 fCaloLabel(), fTrackLabel(), fDetector(part.fDetector),fDisp(part.fDisp), \r
78e39bd0 101 fTof(part.fTof), fCharged(part.fCharged), fTagged(part.fTagged), fBadDist(part.fBadDist), \r
102 fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex)\r
8a587055 103{\r
104 // Copy constructor\r
105 fMomentum = new TLorentzVector(*part.fMomentum);\r
106 \r
107 fCaloLabel [0] = part.fCaloLabel[0];\r
108 fCaloLabel [1] = part.fCaloLabel[1];\r
109 fTrackLabel[0] = part.fTrackLabel[0];\r
110 fTrackLabel[1] = part.fTrackLabel[1];\r
4c624582 111 fTrackLabel[2] = part.fTrackLabel[2];\r
112 fTrackLabel[3] = part.fTrackLabel[3];\r
8a587055 113}\r
114\r
115//______________________________________________________________________________\r
116AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle& part)\r
117{\r
118 // Assignment operator\r
119 if(this!=&part) {\r
120 \r
121 fPdg = part.fPdg;\r
122 fTag = part.fTag;\r
123 fBtag = part.fBtag;\r
124 fLabel = part.fLabel;\r
125 \r
126 fCaloLabel [0] = part.fCaloLabel[0];\r
127 fCaloLabel [1] = part.fCaloLabel[1];\r
128 fTrackLabel[0] = part.fTrackLabel[0];\r
129 fTrackLabel[1] = part.fTrackLabel[1];\r
130 \r
131 fDetector = part.fDetector;\r
132 fDisp = part.fDisp; \r
133 fTof = part.fTof; \r
134 fCharged = part.fCharged; \r
78e39bd0 135 fTagged = part.fTagged;\r
8a587055 136 fBadDist = part.fBadDist;\r
78e39bd0 137 fFidArea = part.fFidArea;\r
8a587055 138 fInputFileIndex = part.fInputFileIndex;\r
139 \r
140 if (fMomentum ) delete fMomentum; \r
141 fMomentum = new TLorentzVector(*part.fMomentum);\r
142 }\r
143 \r
144 return *this;\r
145}\r
146\r
147\r
148//_______________________________________________________________\r
149Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{\r
150 // returns true if particle satisfies given PID criterium\r
151 switch(ipid){\r
152 case 0: return kTRUE ; //No PID at all\r
153 case 1: \r
154 {\r
155 if (fPdg == pdgwanted) return kTRUE; \r
156 else return kFALSE; //Overall PID calculated with bayesian methods.\r
157 }\r
158 case 2: return fDisp ; //only dispersion cut\r
159 case 3: return fTof ; //Only TOF cut\r
160 case 4: return fCharged ; //Only Charged cut\r
161 case 5: return fDisp && fTof ; //Dispersion and TOF\r
162 case 6: return fDisp && fCharged ; //Dispersion and Charged\r
163 case 7: return fTof && fCharged ; //TOF and Charged\r
164 case 8: return fDisp && fTof && fCharged ; // all 3 cuts\r
165 default: return kFALSE ; //Not known combination\r
166 }\r
167}\r
168\r
169//______________________________________________________________________________\r
170void AliAODPWG4Particle::Print(Option_t* /*option*/) const \r
171{\r
172 // Print information of all data members\r
173 printf("Particle 4-vector:\n");\r
174 printf(" E = %13.3f", E() );\r
175 printf(" Px = %13.3f", Px());\r
176 printf(" Py = %13.3f", Py());\r
177 printf(" Pz = %13.3f\n", Pz());\r
178 printf("PID bits :\n");\r
179 printf(" TOF : %d",fTof);\r
180 printf(" Charged : %d",fCharged);\r
181 printf(" Dispersion : %d\n",fDisp);\r
182 printf("PDG : %d\n",fPdg);\r
183 printf("Tag : %d\n",fTag); \r
184 printf("Btag : %d\n",fBtag); \r
78e39bd0 185 printf("Pi0 Tag : %d\n",fTagged); \r
8a587055 186 printf("Dist. to bad channel : %d\n",fBadDist); \r
78e39bd0 187 printf("Fid Area : %d\n",fFidArea); \r
8a587055 188 printf("Input File Index : %d\n",fInputFileIndex); \r
189 printf("Detector : %s\n",fDetector.Data());\r
190 \r
191}\r