]>
Commit | Line | Data |
---|---|---|
a65a7e70 | 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 | /* $Id: AliAODPWG4Particle.h $ */ | |
17 | ||
18 | //------------------------------------------------------------------------- | |
19 | // AOD class for photon and other particles storage and | |
20 | // correlation studies | |
21 | // Author: Yves Schutz, CERN, Gustavo Conesa, INFN | |
22 | //------------------------------------------------------------------------- | |
23 | ||
24 | //-- ROOT system -- | |
25 | ||
26 | //-- Analysis system | |
27 | #include "AliAODPWG4Particle.h" | |
28 | ||
29 | ClassImp(AliAODPWG4Particle) | |
30 | ||
31 | ||
32 | //______________________________________________________________________________ | |
33 | AliAODPWG4Particle::AliAODPWG4Particle() : | |
34 | AliVParticle(), | |
35 | fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1), fCaloLabel(), fTrackLabel(), | |
36 | fDetector(""), fDisp(0), fTof(0), fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0) | |
37 | { | |
38 | // constructor | |
39 | fCaloLabel [0] = -1; | |
40 | fCaloLabel [1] = -1; | |
41 | fTrackLabel[0] = -1; | |
42 | fTrackLabel[1] = -1; | |
43 | fTrackLabel[2] = -1; | |
44 | fTrackLabel[3] = -1; | |
45 | } | |
46 | ||
47 | //______________________________________________________________________________ | |
48 | AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e): | |
49 | AliVParticle(), | |
50 | fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1),fCaloLabel(), fTrackLabel(), | |
51 | fDetector(""), fDisp(0), fTof(0),fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0) | |
52 | { | |
53 | // constructor | |
54 | fMomentum = new TLorentzVector(px, py, pz, e); | |
55 | ||
56 | fCaloLabel [0] = -1; | |
57 | fCaloLabel [1] = -1; | |
58 | fTrackLabel[0] = -1; | |
59 | fTrackLabel[1] = -1; | |
60 | fTrackLabel[2] = -1; | |
61 | fTrackLabel[3] = -1; | |
62 | } | |
63 | ||
64 | //______________________________________________________________________________ | |
65 | AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p): | |
66 | AliVParticle(), | |
67 | fMomentum(0),fPdg(-1), fTag(0), fBtag(-1), fLabel(-1),fCaloLabel(), fTrackLabel(), | |
68 | fDetector(""), fDisp(0), fTof(0), fCharged(0), fTagged(0), fBadDist(0), fFidArea(0), fInputFileIndex(0) | |
69 | { | |
70 | // constructor | |
71 | fMomentum = new TLorentzVector(p); | |
72 | ||
73 | fCaloLabel [0] = -1; | |
74 | fCaloLabel [1] = -1; | |
75 | fTrackLabel[0] = -1; | |
76 | fTrackLabel[1] = -1; | |
77 | fTrackLabel[2] = -1; | |
78 | fTrackLabel[3] = -1; | |
79 | } | |
80 | ||
81 | ||
82 | //______________________________________________________________________________ | |
83 | AliAODPWG4Particle::~AliAODPWG4Particle() | |
84 | { | |
85 | // destructor | |
86 | delete fMomentum; | |
87 | } | |
88 | ||
89 | //______________________________________________________________________________ | |
90 | void AliAODPWG4Particle::Clear(const Option_t* /*opt*/) | |
91 | { | |
92 | //clear | |
93 | delete fMomentum; | |
94 | } | |
95 | ||
96 | //______________________________________________________________________________ | |
97 | AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) : | |
98 | AliVParticle(part), | |
99 | fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fBtag(part.fBtag), fLabel(part.fLabel), | |
100 | fCaloLabel(), fTrackLabel(), fDetector(part.fDetector),fDisp(part.fDisp), | |
101 | fTof(part.fTof), fCharged(part.fCharged), fTagged(part.fTagged), fBadDist(part.fBadDist), | |
102 | fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex) | |
103 | { | |
104 | // Copy constructor | |
105 | fMomentum = new TLorentzVector(*part.fMomentum); | |
106 | ||
107 | fCaloLabel [0] = part.fCaloLabel[0]; | |
108 | fCaloLabel [1] = part.fCaloLabel[1]; | |
109 | fTrackLabel[0] = part.fTrackLabel[0]; | |
110 | fTrackLabel[1] = part.fTrackLabel[1]; | |
111 | fTrackLabel[2] = part.fTrackLabel[2]; | |
112 | fTrackLabel[3] = part.fTrackLabel[3]; | |
113 | } | |
114 | ||
115 | //______________________________________________________________________________ | |
116 | AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle& part) | |
117 | { | |
118 | // Assignment operator | |
119 | if(this!=&part) { | |
120 | ||
121 | fPdg = part.fPdg; | |
122 | fTag = part.fTag; | |
123 | fBtag = part.fBtag; | |
124 | fLabel = part.fLabel; | |
125 | ||
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 | ||
131 | fDetector = part.fDetector; | |
132 | fDisp = part.fDisp; | |
133 | fTof = part.fTof; | |
134 | fCharged = part.fCharged; | |
135 | fTagged = part.fTagged; | |
136 | fBadDist = part.fBadDist; | |
137 | fFidArea = part.fFidArea; | |
138 | fInputFileIndex = part.fInputFileIndex; | |
139 | ||
140 | if (fMomentum ) delete fMomentum; | |
141 | fMomentum = new TLorentzVector(*part.fMomentum); | |
142 | } | |
143 | ||
144 | return *this; | |
145 | } | |
146 | ||
147 | ||
148 | //_______________________________________________________________ | |
149 | Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{ | |
150 | // returns true if particle satisfies given PID criterium | |
151 | switch(ipid){ | |
152 | case 0: return kTRUE ; //No PID at all | |
153 | case 1: | |
154 | { | |
155 | if (fPdg == pdgwanted) return kTRUE; | |
156 | else return kFALSE; //Overall PID calculated with bayesian methods. | |
157 | } | |
158 | case 2: return fDisp ; //only dispersion cut | |
159 | case 3: return fTof ; //Only TOF cut | |
160 | case 4: return fCharged ; //Only Charged cut | |
161 | case 5: return fDisp && fTof ; //Dispersion and TOF | |
162 | case 6: return fDisp && fCharged ; //Dispersion and Charged | |
163 | case 7: return fTof && fCharged ; //TOF and Charged | |
164 | case 8: return fDisp && fTof && fCharged ; // all 3 cuts | |
165 | default: return kFALSE ; //Not known combination | |
166 | } | |
167 | } | |
168 | ||
169 | //______________________________________________________________________________ | |
170 | void AliAODPWG4Particle::Print(Option_t* /*option*/) const | |
171 | { | |
172 | // Print information of all data members | |
173 | printf("Particle 4-vector:\n"); | |
174 | printf(" E = %13.3f", E() ); | |
175 | printf(" Px = %13.3f", Px()); | |
176 | printf(" Py = %13.3f", Py()); | |
177 | printf(" Pz = %13.3f\n", Pz()); | |
178 | printf("PID bits :\n"); | |
179 | printf(" TOF : %d",fTof); | |
180 | printf(" Charged : %d",fCharged); | |
181 | printf(" Dispersion : %d\n",fDisp); | |
182 | printf("PDG : %d\n",fPdg); | |
183 | printf("Tag : %d\n",fTag); | |
184 | printf("Btag : %d\n",fBtag); | |
185 | printf("Pi0 Tag : %d\n",fTagged); | |
186 | printf("Dist. to bad channel : %d\n",fBadDist); | |
187 | printf("Fid Area : %d\n",fFidArea); | |
188 | printf("Input File Index : %d\n",fInputFileIndex); | |
189 | printf("Detector : %s\n",fDetector.Data()); | |
190 | ||
191 | } |