]>
Commit | Line | Data |
---|---|---|
d0e92d9a | 1 | /////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoEvent: hold the information specific to the event and a // | |
4 | // track list // | |
5 | // AliFemtoEvent is the "transient microDST" Objects of this class are // | |
6 | // generated from the input data by a Reader, and then presented to // | |
7 | // the Cuts of the various active Analyses. // | |
8 | // // | |
9 | /////////////////////////////////////////////////////////////////////////// | |
10 | #include "AliFemtoEvent.h" | |
11 | #include "AliFemtoTrack.h" | |
12 | #include "AliFemtoV0.h" | |
13 | #include "AliFemtoXi.h" | |
14 | #include "AliFemtoKink.h" | |
15 | #include "AliFemtoTrackCut.h" | |
16 | #include "AliFemtoV0Cut.h" | |
17 | #include "AliFemtoXiCut.h" | |
18 | #include "AliFemtoKinkCut.h" | |
19 | #include "PhysicalConstants.h" | |
20 | #include "SystemOfUnits.h" | |
67427ff7 | 21 | |
22 | // Mike removed all of the AliFemtoTTree stuff here 21apr2006 - it was not used for a long time. | |
23 | ||
24 | ||
25 | ||
26 | //___________________ | |
0215f606 | 27 | AliFemtoEvent::AliFemtoEvent(): |
28 | fEventNumber(0), | |
29 | fRunNumber(0), | |
30 | fNumberOfTracks(0), | |
03decc29 | 31 | fNormalizedMult(-1), |
0215f606 | 32 | fMagneticField(0), |
73695088 | 33 | fIsCollisionCandidate(kTRUE), |
0215f606 | 34 | fPrimVertPos(0,0,0), |
63a5982a | 35 | fPrimVertCov(), |
0215f606 | 36 | fTrackCollection(0), |
37 | fV0Collection(0), | |
38 | fXiCollection(0), | |
39 | fKinkCollection(0), | |
40 | fZDCN1Energy(0), | |
41 | fZDCP1Energy(0), | |
42 | fZDCN2Energy(0), | |
43 | fZDCP2Energy(0), | |
44 | fZDCEMEnergy(0), | |
45 | fZDCParticipants(0), | |
46 | fTriggerMask(0), | |
683877d2 | 47 | fTriggerCluster(0), |
48 | fReactionPlaneAngle(0) | |
0215f606 | 49 | { |
d0e92d9a | 50 | // Default constructor |
67427ff7 | 51 | fPrimVertPos[0]=-999.0; |
52 | fPrimVertPos[1]=-999.0; | |
53 | fPrimVertPos[2]=-999.0; | |
63a5982a | 54 | fPrimVertCov[0]=0.000000000001; |
55 | fPrimVertCov[1]=0.000000000001; | |
56 | fPrimVertCov[2]=0.000000000001; | |
57 | fPrimVertCov[3]=0.000000000001; | |
58 | fPrimVertCov[4]=0.000000000001; | |
59 | fPrimVertCov[5]=0.000000000001; | |
67427ff7 | 60 | fTrackCollection = new AliFemtoTrackCollection; |
61 | fV0Collection = new AliFemtoV0Collection; | |
62 | fXiCollection = new AliFemtoXiCollection; | |
63 | fKinkCollection = new AliFemtoKinkCollection; | |
64 | fMagneticField=0.0; | |
65 | } | |
66 | //___________________ | |
0215f606 | 67 | AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoXiCut* xCut, AliFemtoKinkCut* kCut): |
68 | fEventNumber(0), | |
69 | fRunNumber(0), | |
70 | fNumberOfTracks(0), | |
03decc29 | 71 | fNormalizedMult(-1), |
0215f606 | 72 | fMagneticField(0), |
73695088 | 73 | fIsCollisionCandidate(kTRUE), |
0215f606 | 74 | fPrimVertPos(0,0,0), |
63a5982a | 75 | fPrimVertCov(), |
0215f606 | 76 | fTrackCollection(0), |
77 | fV0Collection(0), | |
78 | fXiCollection(0), | |
79 | fKinkCollection(0), | |
80 | fZDCN1Energy(0), | |
81 | fZDCP1Energy(0), | |
82 | fZDCN2Energy(0), | |
83 | fZDCP2Energy(0), | |
84 | fZDCEMEnergy(0), | |
85 | fZDCParticipants(0), | |
86 | fTriggerMask(0), | |
683877d2 | 87 | fTriggerCluster(0), |
88 | fReactionPlaneAngle(0) | |
0215f606 | 89 | { // copy constructor with track and v0 cuts |
67427ff7 | 90 | //cout << "AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoV0Cut* kCut)" << endl; |
91 | fEventNumber = ev.fEventNumber; | |
92 | fRunNumber = ev.fRunNumber; | |
93 | ||
63a5982a | 94 | SetPrimVertCov(ev.PrimVertCov()); |
95 | ||
67427ff7 | 96 | fZDCN1Energy=ev.fZDCN1Energy; |
97 | fZDCP1Energy=ev.fZDCP1Energy; | |
98 | fZDCN2Energy=ev.fZDCN2Energy; | |
99 | fZDCP2Energy=ev.fZDCP2Energy; | |
100 | fZDCEMEnergy=ev.fZDCEMEnergy; | |
101 | fZDCParticipants=ev.fZDCParticipants; | |
102 | fNumberOfTracks = ev.fNumberOfTracks; | |
03decc29 | 103 | fNormalizedMult = ev.fNormalizedMult; |
67427ff7 | 104 | fMagneticField= ev.fMagneticField; |
73695088 | 105 | fIsCollisionCandidate = ev.fIsCollisionCandidate; |
106 | ||
67427ff7 | 107 | fTriggerMask=ev.fTriggerMask; // Trigger Type (mask) |
108 | fTriggerCluster=ev.fTriggerCluster; | |
683877d2 | 109 | fReactionPlaneAngle=ev.fReactionPlaneAngle; |
110 | ||
67427ff7 | 111 | // create collections |
112 | fTrackCollection = new AliFemtoTrackCollection; | |
113 | fV0Collection = new AliFemtoV0Collection; | |
114 | fXiCollection = new AliFemtoXiCollection; | |
115 | fKinkCollection = new AliFemtoKinkCollection; | |
116 | // copy track collection | |
117 | for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) { | |
118 | if ( !tCut || tCut->Pass(*tIter) ) { | |
119 | AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter); | |
120 | fTrackCollection->push_back(trackCopy); | |
121 | } | |
122 | } | |
123 | // copy v0 collection | |
124 | for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) { | |
125 | if ( !vCut || vCut->Pass(*vIter) ) { | |
126 | AliFemtoV0* v0Copy = new AliFemtoV0(**vIter); | |
127 | fV0Collection->push_back(v0Copy); | |
128 | } | |
129 | } | |
130 | // copy xi collection | |
131 | for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) { | |
132 | if ( !xCut || xCut->Pass(*xIter) ) { | |
133 | AliFemtoXi* xiCopy = new AliFemtoXi(**xIter); | |
134 | fXiCollection->push_back(xiCopy); | |
135 | } | |
136 | } | |
137 | // copy kink collection | |
138 | for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) { | |
139 | if ( !kCut || kCut->Pass(*kIter) ) { | |
140 | //cout << " kinkCut passed " << endl; | |
141 | AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter); | |
142 | fKinkCollection->push_back(kinkCopy); | |
143 | } | |
144 | } | |
145 | } | |
ea77036b | 146 | //___________________ |
147 | AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev): | |
148 | fEventNumber(0), | |
149 | fRunNumber(0), | |
150 | fNumberOfTracks(0), | |
03decc29 | 151 | fNormalizedMult(-1), |
ea77036b | 152 | fMagneticField(0), |
73695088 | 153 | fIsCollisionCandidate(kTRUE), |
ea77036b | 154 | fPrimVertPos(0,0,0), |
63a5982a | 155 | fPrimVertCov(), |
ea77036b | 156 | fTrackCollection(0), |
157 | fV0Collection(0), | |
158 | fXiCollection(0), | |
159 | fKinkCollection(0), | |
160 | fZDCN1Energy(0), | |
161 | fZDCP1Energy(0), | |
162 | fZDCN2Energy(0), | |
163 | fZDCP2Energy(0), | |
164 | fZDCEMEnergy(0), | |
165 | fZDCParticipants(0), | |
166 | fTriggerMask(0), | |
683877d2 | 167 | fTriggerCluster(0), |
168 | fReactionPlaneAngle(0) | |
ea77036b | 169 | { |
170 | // copy constructor | |
171 | fEventNumber = ev.fEventNumber; | |
172 | fRunNumber = ev.fRunNumber; | |
173 | ||
63a5982a | 174 | SetPrimVertCov(ev.PrimVertCov()); |
175 | ||
ea77036b | 176 | fZDCN1Energy=ev.fZDCN1Energy; |
177 | fZDCP1Energy=ev.fZDCP1Energy; | |
178 | fZDCN2Energy=ev.fZDCN2Energy; | |
179 | fZDCP2Energy=ev.fZDCP2Energy; | |
180 | fZDCEMEnergy=ev.fZDCEMEnergy; | |
181 | fZDCParticipants=ev.fZDCParticipants; | |
182 | fNumberOfTracks = ev.fNumberOfTracks; | |
183 | fMagneticField= ev.fMagneticField; | |
73695088 | 184 | fIsCollisionCandidate = ev.fIsCollisionCandidate; |
ea77036b | 185 | fTriggerMask=ev.fTriggerMask; // Trigger Type (mask) |
186 | fTriggerCluster=ev.fTriggerCluster; | |
683877d2 | 187 | fReactionPlaneAngle=ev.fReactionPlaneAngle; |
ea77036b | 188 | // create collections |
189 | fTrackCollection = new AliFemtoTrackCollection; | |
190 | fV0Collection = new AliFemtoV0Collection; | |
191 | fXiCollection = new AliFemtoXiCollection; | |
192 | fKinkCollection = new AliFemtoKinkCollection; | |
193 | // copy track collection | |
194 | for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) { | |
195 | AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter); | |
196 | fTrackCollection->push_back(trackCopy); | |
197 | } | |
198 | // copy v0 collection | |
199 | for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) { | |
200 | AliFemtoV0* v0Copy = new AliFemtoV0(**vIter); | |
201 | fV0Collection->push_back(v0Copy); | |
202 | } | |
203 | // copy xi collection | |
204 | for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) { | |
205 | AliFemtoXi* xiCopy = new AliFemtoXi(**xIter); | |
206 | fXiCollection->push_back(xiCopy); | |
207 | } | |
208 | // copy kink collection | |
209 | for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) { | |
210 | //cout << " kinkCut passed " << endl; | |
211 | AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter); | |
212 | fKinkCollection->push_back(kinkCopy); | |
213 | } | |
214 | } | |
0215f606 | 215 | //______________________________ |
216 | AliFemtoEvent& AliFemtoEvent::operator=(const AliFemtoEvent& aEvent) | |
217 | { | |
d0e92d9a | 218 | // assignment operator |
0215f606 | 219 | if (this == &aEvent) |
220 | return *this; | |
221 | ||
222 | fEventNumber = aEvent.fEventNumber; | |
223 | fRunNumber = aEvent.fRunNumber; | |
224 | ||
225 | fZDCN1Energy=aEvent.fZDCN1Energy; | |
226 | fZDCP1Energy=aEvent.fZDCP1Energy; | |
227 | fZDCN2Energy=aEvent.fZDCN2Energy; | |
228 | fZDCP2Energy=aEvent.fZDCP2Energy; | |
229 | fZDCEMEnergy=aEvent.fZDCEMEnergy; | |
230 | fZDCParticipants=aEvent.fZDCParticipants; | |
231 | fNumberOfTracks = aEvent.fNumberOfTracks; | |
03decc29 | 232 | fNormalizedMult = aEvent.fNormalizedMult; |
0215f606 | 233 | fMagneticField= aEvent.fMagneticField; |
73695088 | 234 | fIsCollisionCandidate = aEvent.fIsCollisionCandidate; |
235 | ||
0215f606 | 236 | fTriggerMask=aEvent.fTriggerMask; // Trigger Type (mask) |
237 | fTriggerCluster=aEvent.fTriggerCluster; | |
683877d2 | 238 | fReactionPlaneAngle=aEvent.fReactionPlaneAngle; |
0215f606 | 239 | // create collections |
240 | fTrackCollection = new AliFemtoTrackCollection; | |
241 | fV0Collection = new AliFemtoV0Collection; | |
242 | fXiCollection = new AliFemtoXiCollection; | |
243 | fKinkCollection = new AliFemtoKinkCollection; | |
244 | // copy track collection | |
245 | for ( AliFemtoTrackIterator tIter=aEvent.fTrackCollection->begin(); tIter!=aEvent.fTrackCollection->end(); tIter++) { | |
246 | AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter); | |
247 | fTrackCollection->push_back(trackCopy); | |
248 | } | |
249 | // copy v0 collection | |
250 | for ( AliFemtoV0Iterator vIter=aEvent.fV0Collection->begin(); vIter!=aEvent.fV0Collection->end(); vIter++) { | |
251 | AliFemtoV0* v0Copy = new AliFemtoV0(**vIter); | |
252 | fV0Collection->push_back(v0Copy); | |
253 | } | |
254 | // copy xi collection | |
255 | for ( AliFemtoXiIterator xIter=aEvent.fXiCollection->begin(); xIter!=aEvent.fXiCollection->end(); xIter++) { | |
256 | AliFemtoXi* xiCopy = new AliFemtoXi(**xIter); | |
257 | fXiCollection->push_back(xiCopy); | |
258 | } | |
259 | // copy kink collection | |
260 | for ( AliFemtoKinkIterator kIter=aEvent.fKinkCollection->begin(); kIter!=aEvent.fKinkCollection->end(); kIter++) { | |
261 | AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter); | |
262 | fKinkCollection->push_back(kinkCopy); | |
263 | } | |
264 | ||
265 | return *this; | |
266 | } | |
267 | ||
67427ff7 | 268 | //___________________ |
269 | AliFemtoEvent::~AliFemtoEvent(){ | |
d0e92d9a | 270 | // destructor |
67427ff7 | 271 | #ifdef STHBTDEBUG |
272 | cout << " AliFemtoEvent::~AliFemtoEvent() " << endl; | |
273 | #endif | |
274 | for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){ | |
275 | delete *iter; | |
276 | } | |
277 | fTrackCollection->clear(); | |
278 | delete fTrackCollection; | |
279 | //must do the same for the V0 collection | |
d0e92d9a | 280 | for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){ |
281 | delete *tV0iter; | |
67427ff7 | 282 | }//added by M Chojnacki To avodid memory leak |
283 | fV0Collection->clear(); | |
284 | delete fV0Collection; | |
285 | //must do the same for the Xi collection | |
d0e92d9a | 286 | for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){ |
287 | delete *tXiIter; | |
67427ff7 | 288 | } |
289 | fXiCollection->clear(); | |
290 | delete fXiCollection; | |
291 | //must do the same for the Kink collection | |
292 | for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){ | |
293 | delete *kinkIter; | |
294 | } | |
295 | fKinkCollection->clear(); | |
296 | delete fKinkCollection; | |
297 | } | |
298 | //___________________ | |
299 | ||
300 | ||
301 | ||
302 | void AliFemtoEvent::SetEventNumber(const unsigned short& event){fEventNumber = event;} | |
303 | void AliFemtoEvent::SetRunNumber(const int& runNum){fRunNumber = runNum;} | |
304 | ||
305 | ||
9064872d | 306 | void AliFemtoEvent::SetZDCN1Energy(const float& aZDCN1Energy){fZDCN1Energy=aZDCN1Energy;} |
307 | void AliFemtoEvent::SetZDCP1Energy(const float& aZDCP1Energy){fZDCP1Energy=aZDCP1Energy;} | |
308 | void AliFemtoEvent::SetZDCN2Energy(const float& aZDCN2Energy){fZDCN2Energy=aZDCN2Energy;} | |
309 | void AliFemtoEvent::SetZDCP2Energy(const float& aZDCP2Energy){fZDCP2Energy=aZDCP2Energy;} | |
310 | void AliFemtoEvent::SetZDCEMEnergy(const float& aZDCEMEnergy){fZDCEMEnergy=aZDCEMEnergy;} | |
311 | void AliFemtoEvent::SetZDCParticipants(const unsigned int& aZDCParticipants){fZDCParticipants=aZDCParticipants;} | |
67427ff7 | 312 | |
313 | void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTracks = tracks;} | |
03decc29 | 314 | void AliFemtoEvent::SetNormalizedMult(const int& i){fNormalizedMult = i;} |
67427ff7 | 315 | |
316 | void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;} | |
63a5982a | 317 | void AliFemtoEvent::SetPrimVertCov(const double* v){ |
318 | fPrimVertCov[0] = v[0]; | |
319 | fPrimVertCov[1] = v[1]; | |
320 | fPrimVertCov[2] = v[2]; | |
321 | fPrimVertCov[3] = v[3]; | |
322 | fPrimVertCov[4] = v[4]; | |
323 | fPrimVertCov[5] = v[5]; | |
324 | } | |
67427ff7 | 325 | void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;} |
73695088 | 326 | void AliFemtoEvent::SetIsCollisionCandidate(const bool& is){fIsCollisionCandidate = is;} |
67427ff7 | 327 | |
9064872d | 328 | void AliFemtoEvent::SetTriggerMask(const unsigned long int& aTriggerMask) {fTriggerMask=aTriggerMask;} |
329 | void AliFemtoEvent::SetTriggerCluster(const unsigned char& aTriggerCluster) {fTriggerCluster=aTriggerCluster;} | |
67427ff7 | 330 | |
331 | ||
332 | unsigned short AliFemtoEvent::EventNumber() const {return fEventNumber;} | |
333 | int AliFemtoEvent::RunNumber() const {return fRunNumber;} | |
334 | ||
335 | ||
336 | ||
337 | unsigned short AliFemtoEvent::NumberOfTracks() const {return fNumberOfTracks;} | |
338 | ||
339 | AliFemtoV0Collection* AliFemtoEvent::V0Collection() const {return fV0Collection;} | |
340 | AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;} | |
341 | AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;} | |
342 | AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;} | |
343 | AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;} | |
63a5982a | 344 | const double* AliFemtoEvent::PrimVertCov() const {return fPrimVertCov;} |
67427ff7 | 345 | double AliFemtoEvent::MagneticField() const {return fMagneticField;} |
346 | unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;} | |
347 | unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;} | |
73695088 | 348 | bool AliFemtoEvent::IsCollisionCandidate() const {return fIsCollisionCandidate;} |
67427ff7 | 349 | |
350 | ||
351 | float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;} | |
352 | float AliFemtoEvent::ZDCP1Energy() const {return fZDCP1Energy;} | |
353 | float AliFemtoEvent::ZDCN2Energy() const {return fZDCN2Energy;} | |
354 | float AliFemtoEvent::ZDCP2Energy() const {return fZDCP2Energy;} | |
355 | float AliFemtoEvent::ZDCEMEnergy() const {return fZDCEMEnergy;} | |
356 | unsigned int AliFemtoEvent::ZDCParticipants() const {return fZDCParticipants;} | |
357 | ||
683877d2 | 358 | void AliFemtoEvent::SetReactionPlaneAngle(const float& a) { fReactionPlaneAngle = a;} |
359 | float AliFemtoEvent::ReactionPlaneAngle() const { return fReactionPlaneAngle; } | |
360 | ||
67427ff7 | 361 | //----------------------------- below here is only for star |
362 | ||
363 | double AliFemtoEvent::UncorrectedNumberOfNegativePrimaries() const | |
364 | { | |
365 | return NumberOfTracks()/2; | |
366 | } | |
367 | ||
368 | double AliFemtoEvent::UncorrectedNumberOfPrimaries() const | |
369 | { | |
03decc29 | 370 | if (fNormalizedMult < 0) { |
371 | // Count number of normalized charged tracks | |
372 | Int_t tNormTrackCount = 0; | |
373 | for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){ | |
374 | if (!((*iter)->Flags()&(AliFemtoTrack::kTPCrefit))) continue; | |
375 | if ((*iter)->TPCncls() < 50) continue; | |
376 | if ((*iter)->TPCchi2()/(*iter)->TPCncls() > 60.0) continue; | |
377 | if ((*iter)->ImpactD() > 6.0) continue; | |
378 | if ((*iter)->ImpactZ() > 6.0) continue; | |
69c1c8ff | 379 | if (fabs((*iter)->P().PseudoRapidity()) > 0.9) continue; |
03decc29 | 380 | |
381 | tNormTrackCount++; | |
382 | } | |
383 | return tNormTrackCount; | |
73695088 | 384 | } |
385 | ||
03decc29 | 386 | return fNormalizedMult; |
73695088 | 387 | // return NumberOfTracks(); |
67427ff7 | 388 | } |