1 ///////////////////////////////////////////////////////////////////////////
3 // AliFemtoEvent: hold the information specific to the event and a //
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. //
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"
21 #include "AliEventplane.h"
23 // Mike removed all of the AliFemtoTTree stuff here 21apr2006 - it was not used for a long time.
26 AliFemtoEvent::AliFemtoEvent():
33 fEstimateTracklets(0),
42 fIsCollisionCandidate(kTRUE),
57 fReactionPlaneAngle(0),
60 // Default constructor
61 fPrimVertPos[0]=-999.0;
62 fPrimVertPos[1]=-999.0;
63 fPrimVertPos[2]=-999.0;
64 fPrimVertCov[0]=0.000000000001;
65 fPrimVertCov[1]=0.000000000001;
66 fPrimVertCov[2]=0.000000000001;
67 fPrimVertCov[3]=0.000000000001;
68 fPrimVertCov[4]=0.000000000001;
69 fPrimVertCov[5]=0.000000000001;
70 fTrackCollection = new AliFemtoTrackCollection;
71 fV0Collection = new AliFemtoV0Collection;
72 fXiCollection = new AliFemtoXiCollection;
73 fKinkCollection = new AliFemtoKinkCollection;
77 AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoXiCut* xCut, AliFemtoKinkCut* kCut):
84 fEstimateTracklets(0),
93 fIsCollisionCandidate(kTRUE),
108 fReactionPlaneAngle(0),
110 { // copy constructor with track and v0 cuts
111 //cout << "AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoV0Cut* kCut)" << endl;
112 fEventNumber = ev.fEventNumber;
113 fRunNumber = ev.fRunNumber;
115 SetPrimVertCov(ev.PrimVertCov());
117 fZDCN1Energy=ev.fZDCN1Energy;
118 fZDCP1Energy=ev.fZDCP1Energy;
119 fZDCN2Energy=ev.fZDCN2Energy;
120 fZDCP2Energy=ev.fZDCP2Energy;
121 fZDCEMEnergy=ev.fZDCEMEnergy;
122 fZDCParticipants=ev.fZDCParticipants;
123 fNumberOfTracks = ev.fNumberOfTracks;
124 fNormalizedMult = ev.fNormalizedMult;
125 fEstimateITSTPC = ev.fEstimateITSTPC;
126 fEstimateTracklets = ev.fEstimateTracklets;
127 fEstimateITSPure = ev.fEstimateITSPure;
128 fCentralityV0 = ev.fCentralityV0;
129 fCentralityZNA=ev.fCentralityZNA;
130 fCentralityCL1=ev.fCentralityCL1;
131 fCentralityFMD = ev.fCentralityFMD;
132 fCentralitySPD1 = ev.fCentralitySPD1;
133 fCentralityTrk = ev.fCentralityTrk;
134 fMagneticField= ev.fMagneticField;
135 fIsCollisionCandidate = ev.fIsCollisionCandidate;
137 fTriggerMask=ev.fTriggerMask; // Trigger Type (mask)
138 fTriggerCluster=ev.fTriggerCluster;
139 fReactionPlaneAngle=ev.fReactionPlaneAngle;
142 // create collections
143 fTrackCollection = new AliFemtoTrackCollection;
144 fV0Collection = new AliFemtoV0Collection;
145 fXiCollection = new AliFemtoXiCollection;
146 fKinkCollection = new AliFemtoKinkCollection;
147 // copy track collection
148 for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) {
149 if ( !tCut || tCut->Pass(*tIter) ) {
150 AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
151 fTrackCollection->push_back(trackCopy);
154 // copy v0 collection
155 for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) {
156 if ( !vCut || vCut->Pass(*vIter) ) {
157 AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
158 fV0Collection->push_back(v0Copy);
161 // copy xi collection
162 for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) {
163 if ( !xCut || xCut->Pass(*xIter) ) {
164 AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
165 fXiCollection->push_back(xiCopy);
168 // copy kink collection
169 for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) {
170 if ( !kCut || kCut->Pass(*kIter) ) {
171 //cout << " kinkCut passed " << endl;
172 AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
173 fKinkCollection->push_back(kinkCopy);
177 //___________________
178 AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev):
185 fEstimateTracklets(0),
194 fIsCollisionCandidate(kTRUE),
209 fReactionPlaneAngle(0),
213 fEventNumber = ev.fEventNumber;
214 fRunNumber = ev.fRunNumber;
216 SetPrimVertCov(ev.PrimVertCov());
218 fZDCN1Energy=ev.fZDCN1Energy;
219 fZDCP1Energy=ev.fZDCP1Energy;
220 fZDCN2Energy=ev.fZDCN2Energy;
221 fZDCP2Energy=ev.fZDCP2Energy;
222 fZDCEMEnergy=ev.fZDCEMEnergy;
223 fZDCParticipants=ev.fZDCParticipants;
224 fNumberOfTracks = ev.fNumberOfTracks;
225 fEstimateITSTPC = ev.fEstimateITSTPC;
226 fEstimateTracklets = ev.fEstimateTracklets;
227 fEstimateITSPure = ev.fEstimateITSPure;
228 fCentralityV0 = ev.fCentralityV0;
229 fCentralityZNA = ev.fCentralityZNA;
230 fCentralityCL1 = ev.fCentralityCL1;
231 fCentralityFMD = ev.fCentralityFMD;
232 fCentralitySPD1 = ev.fCentralitySPD1;
233 fCentralityTrk = ev.fCentralityTrk;
234 fMagneticField= ev.fMagneticField;
235 fIsCollisionCandidate = ev.fIsCollisionCandidate;
236 fTriggerMask=ev.fTriggerMask; // Trigger Type (mask)
237 fTriggerCluster=ev.fTriggerCluster;
238 fReactionPlaneAngle=ev.fReactionPlaneAngle;
240 // create collections
241 fTrackCollection = new AliFemtoTrackCollection;
242 fV0Collection = new AliFemtoV0Collection;
243 fXiCollection = new AliFemtoXiCollection;
244 fKinkCollection = new AliFemtoKinkCollection;
245 // copy track collection
246 for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) {
247 AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
248 fTrackCollection->push_back(trackCopy);
250 // copy v0 collection
251 for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) {
252 AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
253 fV0Collection->push_back(v0Copy);
255 // copy xi collection
256 for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) {
257 AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
258 fXiCollection->push_back(xiCopy);
260 // copy kink collection
261 for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) {
262 //cout << " kinkCut passed " << endl;
263 AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
264 fKinkCollection->push_back(kinkCopy);
267 //______________________________
268 AliFemtoEvent& AliFemtoEvent::operator=(const AliFemtoEvent& aEvent)
270 // assignment operator
274 fEventNumber = aEvent.fEventNumber;
275 fRunNumber = aEvent.fRunNumber;
277 fZDCN1Energy=aEvent.fZDCN1Energy;
278 fZDCP1Energy=aEvent.fZDCP1Energy;
279 fZDCN2Energy=aEvent.fZDCN2Energy;
280 fZDCP2Energy=aEvent.fZDCP2Energy;
281 fZDCEMEnergy=aEvent.fZDCEMEnergy;
282 fZDCParticipants=aEvent.fZDCParticipants;
283 fNumberOfTracks = aEvent.fNumberOfTracks;
284 fEstimateITSTPC = aEvent.fEstimateITSTPC;
285 fEstimateTracklets = aEvent.fEstimateTracklets;
286 fEstimateITSPure = aEvent.fEstimateITSPure;
287 fCentralityV0 = aEvent.fCentralityV0;
288 fCentralityZNA = aEvent.fCentralityZNA;
289 fCentralityCL1 = aEvent.fCentralityCL1;
290 fCentralityFMD = aEvent.fCentralityFMD;
291 fCentralitySPD1 = aEvent.fCentralitySPD1;
292 fCentralityTrk = aEvent.fCentralityTrk;
293 fNormalizedMult = aEvent.fNormalizedMult;
294 fEstimateITSTPC = aEvent.fEstimateITSTPC;
295 fEstimateTracklets = aEvent.fEstimateTracklets;
296 fEstimateITSPure = aEvent.fEstimateITSPure;
297 fMagneticField= aEvent.fMagneticField;
298 fIsCollisionCandidate = aEvent.fIsCollisionCandidate;
300 fTriggerMask=aEvent.fTriggerMask; // Trigger Type (mask)
301 fTriggerCluster=aEvent.fTriggerCluster;
302 fReactionPlaneAngle=aEvent.fReactionPlaneAngle;
304 if (fTrackCollection) {
305 for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
308 fTrackCollection->clear();
309 delete fTrackCollection;
311 fTrackCollection = new AliFemtoTrackCollection;
314 for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){
316 }//added by M Chojnacki To avodid memory leak
317 fV0Collection->clear();
318 delete fV0Collection;
321 fV0Collection = new AliFemtoV0Collection;
324 for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){
327 fXiCollection->clear();
328 delete fXiCollection;
330 fXiCollection = new AliFemtoXiCollection;
332 if (fKinkCollection) {
333 for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){
336 fKinkCollection->clear();
337 delete fKinkCollection;
339 fKinkCollection = new AliFemtoKinkCollection;
341 // copy track collection
342 for ( AliFemtoTrackIterator tIter=aEvent.fTrackCollection->begin(); tIter!=aEvent.fTrackCollection->end(); tIter++) {
343 AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
344 fTrackCollection->push_back(trackCopy);
346 // copy v0 collection
347 for ( AliFemtoV0Iterator vIter=aEvent.fV0Collection->begin(); vIter!=aEvent.fV0Collection->end(); vIter++) {
348 AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
349 fV0Collection->push_back(v0Copy);
351 // copy xi collection
352 for ( AliFemtoXiIterator xIter=aEvent.fXiCollection->begin(); xIter!=aEvent.fXiCollection->end(); xIter++) {
353 AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
354 fXiCollection->push_back(xiCopy);
356 // copy kink collection
357 for ( AliFemtoKinkIterator kIter=aEvent.fKinkCollection->begin(); kIter!=aEvent.fKinkCollection->end(); kIter++) {
358 AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
359 fKinkCollection->push_back(kinkCopy);
365 //___________________
366 AliFemtoEvent::~AliFemtoEvent(){
369 cout << " AliFemtoEvent::~AliFemtoEvent() " << endl;
371 for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
374 fTrackCollection->clear();
375 delete fTrackCollection;
376 //must do the same for the V0 collection
377 for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){
379 }//added by M Chojnacki To avodid memory leak
380 fV0Collection->clear();
381 delete fV0Collection;
382 //must do the same for the Xi collection
383 for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){
386 fXiCollection->clear();
387 delete fXiCollection;
388 //must do the same for the Kink collection
389 for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){
392 fKinkCollection->clear();
393 delete fKinkCollection;
395 //___________________
399 void AliFemtoEvent::SetEventNumber(const unsigned short& event){fEventNumber = event;}
400 void AliFemtoEvent::SetRunNumber(const int& runNum){fRunNumber = runNum;}
403 void AliFemtoEvent::SetZDCN1Energy(const float& aZDCN1Energy){fZDCN1Energy=aZDCN1Energy;}
404 void AliFemtoEvent::SetZDCP1Energy(const float& aZDCP1Energy){fZDCP1Energy=aZDCP1Energy;}
405 void AliFemtoEvent::SetZDCN2Energy(const float& aZDCN2Energy){fZDCN2Energy=aZDCN2Energy;}
406 void AliFemtoEvent::SetZDCP2Energy(const float& aZDCP2Energy){fZDCP2Energy=aZDCP2Energy;}
407 void AliFemtoEvent::SetZDCEMEnergy(const float& aZDCEMEnergy){fZDCEMEnergy=aZDCEMEnergy;}
408 void AliFemtoEvent::SetZDCParticipants(const unsigned int& aZDCParticipants){fZDCParticipants=aZDCParticipants;}
410 void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTracks = tracks;}
411 void AliFemtoEvent::SetNormalizedMult(const int& i){fNormalizedMult = i;}
412 void AliFemtoEvent::SetSPDMult(const int& i){fSPDMult = i;}
414 void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;}
415 void AliFemtoEvent::SetPrimVertCov(const double* v){
416 fPrimVertCov[0] = v[0];
417 fPrimVertCov[1] = v[1];
418 fPrimVertCov[2] = v[2];
419 fPrimVertCov[3] = v[3];
420 fPrimVertCov[4] = v[4];
421 fPrimVertCov[5] = v[5];
423 void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;}
424 void AliFemtoEvent::SetIsCollisionCandidate(const bool& is){fIsCollisionCandidate = is;}
426 void AliFemtoEvent::SetTriggerMask(const unsigned long int& aTriggerMask) {fTriggerMask=aTriggerMask;}
427 void AliFemtoEvent::SetTriggerCluster(const unsigned char& aTriggerCluster) {fTriggerCluster=aTriggerCluster;}
430 unsigned short AliFemtoEvent::EventNumber() const {return fEventNumber;}
431 int AliFemtoEvent::RunNumber() const {return fRunNumber;}
435 unsigned short AliFemtoEvent::NumberOfTracks() const {return fNumberOfTracks;}
437 AliFemtoV0Collection* AliFemtoEvent::V0Collection() const {return fV0Collection;}
438 AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;}
439 AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;}
440 AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;}
441 AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;}
442 const double* AliFemtoEvent::PrimVertCov() const {return fPrimVertCov;}
443 double AliFemtoEvent::MagneticField() const {return fMagneticField;}
444 unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;}
445 unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;}
446 bool AliFemtoEvent::IsCollisionCandidate() const {return fIsCollisionCandidate;}
449 float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;}
450 float AliFemtoEvent::ZDCP1Energy() const {return fZDCP1Energy;}
451 float AliFemtoEvent::ZDCN2Energy() const {return fZDCN2Energy;}
452 float AliFemtoEvent::ZDCP2Energy() const {return fZDCP2Energy;}
453 float AliFemtoEvent::ZDCEMEnergy() const {return fZDCEMEnergy;}
454 unsigned int AliFemtoEvent::ZDCParticipants() const {return fZDCParticipants;}
456 void AliFemtoEvent::SetReactionPlaneAngle(const float& a) { fReactionPlaneAngle = a;}
457 float AliFemtoEvent::ReactionPlaneAngle() const { return fReactionPlaneAngle; }
458 void AliFemtoEvent::SetEP(AliEventplane* ep) { fEP = ep;}
459 AliEventplane* AliFemtoEvent::EP() const {return fEP; }
460 //fV0perEvent->Sumw2();
461 //----------------------------- below here is only for star
463 int AliFemtoEvent::UncorrectedNumberOfNegativePrimaries() const
465 return NumberOfTracks()/2;
468 int AliFemtoEvent::SPDMultiplicity() const
473 int AliFemtoEvent::NumberOfV0s() const
475 return V0Collection()->size();
478 int AliFemtoEvent::UncorrectedNumberOfPrimaries() const
480 if (fNormalizedMult < -1) {
481 // Count number of normalized charged tracks
482 Int_t tNormTrackCount = 0;
483 for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
484 if (!((*iter)->Flags()&(AliFemtoTrack::kTPCrefit))) continue;
485 if ((*iter)->TPCncls() < 50) continue;
486 if ((*iter)->TPCchi2()/(*iter)->TPCncls() > 60.0) continue;
487 if ((*iter)->ImpactD() > 6.0) continue;
488 if ((*iter)->ImpactZ() > 6.0) continue;
489 if (fabs((*iter)->P().PseudoRapidity()) > 0.9) continue;
493 return tNormTrackCount;
496 return fNormalizedMult;
497 // return NumberOfTracks();
500 unsigned short AliFemtoEvent::MultiplicityEstimateITSTPC() const
502 return fEstimateITSTPC;
505 unsigned short AliFemtoEvent::MultiplicityEstimateTracklets() const
507 return fEstimateTracklets;
510 unsigned short AliFemtoEvent::MultiplicityEstimateITSPure() const
512 return fEstimateITSPure;
515 void AliFemtoEvent::SetMultiplicityEstimateITSTPC(const unsigned short &s)
520 void AliFemtoEvent::SetMultiplicityEstimateTracklets(const unsigned short &s)
522 fEstimateTracklets = s;
525 void AliFemtoEvent::SetMultiplicityEstimateITSPure(const unsigned short &s)
527 fEstimateITSPure = s;
530 void AliFemtoEvent::SetCentralityV0(const float &c)
535 void AliFemtoEvent::SetCentralityZNA(const float &c)
540 void AliFemtoEvent::SetCentralityCL1(const float &c)
545 void AliFemtoEvent::SetCentralityFMD(const float &c)
550 void AliFemtoEvent::SetCentralitySPD1(const float &c)
555 void AliFemtoEvent::SetCentralityTrk(const float &c)
560 float AliFemtoEvent::CentralityV0() const
562 return fCentralityV0;
565 float AliFemtoEvent::CentralityZNA() const
567 return fCentralityZNA;
570 float AliFemtoEvent::CentralityCL1() const
572 return fCentralityCL1;
575 float AliFemtoEvent::CentralityFMD() const
577 return fCentralityFMD;
580 float AliFemtoEvent::CentralitySPD1() const
582 return fCentralitySPD1;
585 float AliFemtoEvent::CentralityTrk() const
587 return fCentralityTrk;