1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------
19 // Implementation of the AliESDEvent class
20 // This is the class to deal with during the physics analysis of data.
21 // It also ensures the backward compatibility with the old ESD format.
23 AliESDEvent *ev= new AliESDEvent();
24 ev->ReadFromTree(esdTree);
26 for (Int_t i=0; i<nev; i++) {
28 if(ev->GetAliESDOld())ev->CopyFromOldESD();
30 // The AliESDInputHandler does this automatically for you
32 // Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch
33 //-----------------------------------------------------------------
36 #include "TRefArray.h"
39 #include <TInterpreter.h>
41 #include "AliESDEvent.h"
42 #include "AliESDfriend.h"
43 #include "AliESDVZERO.h"
44 #include "AliESDFMD.h"
46 #include "AliESDMuonTrack.h"
47 #include "AliESDMuonCluster.h"
48 #include "AliESDMuonPad.h"
49 #include "AliESDPmdTrack.h"
50 #include "AliESDTrdTrack.h"
51 #include "AliESDVertex.h"
52 #include "AliESDcascade.h"
53 #include "AliESDPmdTrack.h"
54 #include "AliESDTrdTrigger.h"
55 #include "AliESDTrdTrack.h"
56 #include "AliESDTrdTracklet.h"
57 #include "AliESDVertex.h"
58 #include "AliVertexerTracks.h"
59 #include "AliESDcascade.h"
60 #include "AliESDkink.h"
61 #include "AliESDtrack.h"
62 #include "AliESDHLTtrack.h"
63 #include "AliESDCaloCluster.h"
64 #include "AliESDCaloCells.h"
66 #include "AliESDFMD.h"
67 #include "AliESDVZERO.h"
68 #include "AliMultiplicity.h"
69 #include "AliRawDataErrorLog.h"
71 #include "AliESDACORDE.h"
72 #include "AliESDHLTDecision.h"
73 #include "AliCentrality.h"
74 #include "AliESDCosmicTrack.h"
75 #include "AliTriggerConfiguration.h"
76 #include "AliTriggerClass.h"
77 #include "AliTriggerCluster.h"
79 #include "AliESDMFT.h"
81 #include "AliEventplane.h"
88 // here we define the names, some classes are no TNamed, therefore the classnames
90 const char* AliESDEvent::fgkESDListName[kESDListN] = {"AliESDRun",
118 "AliRawDataErrorLogs",
127 //______________________________________________________________________________
128 AliESDEvent::AliESDEvent():
130 fESDObjects(new TList()),
145 fSPDPileupVertices(0),
146 fTrkPileupVertices(0),
158 fEMCALCells(0), fPHOSCells(0),
161 fOldMuonStructure(kFALSE),
169 fDetectorStatus(0xFFFFFFFF),
170 fDAQDetectorPattern(0xFFFF),
171 fDAQAttributes(0xFFFF)
177 //______________________________________________________________________________
178 AliESDEvent::AliESDEvent(const AliESDEvent& esd):
180 fESDObjects(new TList()),
181 fESDRun(new AliESDRun(*esd.fESDRun)),
182 fHeader(new AliESDHeader(*esd.fHeader)),
183 fESDZDC(new AliESDZDC(*esd.fESDZDC)),
184 fESDFMD(new AliESDFMD(*esd.fESDFMD)),
185 fESDVZERO(new AliESDVZERO(*esd.fESDVZERO)),
186 fESDTZERO(new AliESDTZERO(*esd.fESDTZERO)),
187 fTPCVertex(new AliESDVertex(*esd.fTPCVertex)),
188 fSPDVertex(new AliESDVertex(*esd.fSPDVertex)),
189 fPrimaryVertex(new AliESDVertex(*esd.fPrimaryVertex)),
190 fSPDMult(new AliMultiplicity(*esd.fSPDMult)),
191 fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
192 fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
193 fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
194 fTrdTrigger(new AliESDTrdTrigger(*esd.fTrdTrigger)),
195 fSPDPileupVertices(new TClonesArray(*esd.fSPDPileupVertices)),
196 fTrkPileupVertices(new TClonesArray(*esd.fTrkPileupVertices)),
197 fTracks(new TClonesArray(*esd.fTracks)),
198 fMuonTracks(new TClonesArray(*esd.fMuonTracks)),
199 fMuonClusters(new TClonesArray(*esd.fMuonClusters)),
200 fMuonPads(new TClonesArray(*esd.fMuonPads)),
201 fPmdTracks(new TClonesArray(*esd.fPmdTracks)),
202 fTrdTracks(new TClonesArray(*esd.fTrdTracks)),
203 fTrdTracklets(new TClonesArray(*esd.fTrdTracklets)),
204 fV0s(new TClonesArray(*esd.fV0s)),
205 fCascades(new TClonesArray(*esd.fCascades)),
206 fKinks(new TClonesArray(*esd.fKinks)),
207 fCaloClusters(new TClonesArray(*esd.fCaloClusters)),
208 fEMCALCells(new AliESDCaloCells(*esd.fEMCALCells)),
209 fPHOSCells(new AliESDCaloCells(*esd.fPHOSCells)),
210 fCosmicTracks(new TClonesArray(*esd.fCosmicTracks)),
211 fErrorLogs(new TClonesArray(*esd.fErrorLogs)),
212 fOldMuonStructure(esd.fOldMuonStructure),
213 fESDOld(esd.fESDOld ? new AliESD(*esd.fESDOld) : 0),
214 fESDFriendOld(esd.fESDFriendOld ? new AliESDfriend(*esd.fESDFriendOld) : 0),
215 fConnected(esd.fConnected),
216 fUseOwnList(esd.fUseOwnList),
217 fTOFHeader(new AliTOFHeader(*esd.fTOFHeader)),
218 fCentrality(new AliCentrality(*esd.fCentrality)),
219 fEventplane(new AliEventplane(*esd.fEventplane)),
220 fDetectorStatus(esd.fDetectorStatus),
221 fDAQDetectorPattern(esd.fDAQDetectorPattern),
222 fDAQAttributes(esd.fDAQAttributes)
224 // , fESDMFT(new AliESDMFT(*esd.fESDMFT))
229 printf("copying ESD event...\n"); // AU
230 // CKB init in the constructor list and only add here ...
235 AddObject(fESDVZERO);
236 AddObject(fESDTZERO);
237 AddObject(fTPCVertex);
238 AddObject(fSPDVertex);
239 AddObject(fPrimaryVertex);
241 AddObject(fPHOSTrigger);
242 AddObject(fEMCALTrigger);
243 AddObject(fTrdTrigger);
244 AddObject(fSPDPileupVertices);
245 AddObject(fTrkPileupVertices);
247 AddObject(fMuonTracks);
248 AddObject(fPmdTracks);
249 AddObject(fTrdTracks);
250 AddObject(fTrdTracklets);
252 AddObject(fCascades);
254 AddObject(fCaloClusters);
255 AddObject(fEMCALCells);
256 AddObject(fPHOSCells);
257 AddObject(fCosmicTracks);
258 AddObject(fErrorLogs);
259 AddObject(fESDACORDE);
260 AddObject(fTOFHeader);
261 AddObject(fMuonClusters);
262 AddObject(fMuonPads);
264 // AddObject(fESDMFT);
270 //______________________________________________________________________________
271 AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
273 // Assignment operator
275 if(&source == this) return *this;
276 AliVEvent::operator=(source);
278 // This assumes that the list is already created
279 // and that the virtual void Copy(Tobject&) function
280 // is correctly implemented in the derived class
281 // otherwise only TObject::Copy() will be used
285 if((fESDObjects->GetSize()==0)&&(source.fESDObjects->GetSize()>=kESDListN)){
286 // We cover the case that we do not yet have the
287 // standard content but the source has it
291 TIter next(source.GetList());
294 while ((its = next())) {
295 name.Form("%s", its->GetName());
296 TObject *mine = fESDObjects->FindObject(name.Data());
298 TClass* pClass=TClass::GetClass(its->ClassName());
300 AliWarning(Form("Can not find class description for entry %s (%s)\n",
301 its->ClassName(), name.Data()));
305 mine=(TObject*)pClass->New();
307 // not in this: can be added to list
308 AliWarning(Form("%s:%d Could not find %s for copying \n",
309 (char*)__FILE__,__LINE__,name.Data()));
312 if(mine->InheritsFrom("TNamed")){
313 ((TNamed*)mine)->SetName(name);
315 else if(mine->InheritsFrom("TCollection")){
316 if(mine->InheritsFrom("TClonesArray")) {
317 TClonesArray* tcits = dynamic_cast<TClonesArray*>(its);
319 dynamic_cast<TClonesArray*>(mine)->SetClass(tcits->GetClass());
321 dynamic_cast<TCollection*>(mine)->SetName(name);
323 AliDebug(1, Form("adding object %s of type %s", mine->GetName(), mine->ClassName()));
327 if(!its->InheritsFrom("TCollection")){
331 else if(its->InheritsFrom("TClonesArray")){
332 // Create or expand the tclonesarray pointers
333 // so we can directly copy to the object
334 TClonesArray *itstca = (TClonesArray*)its;
335 TClonesArray *minetca = (TClonesArray*)mine;
337 // this leaves the capacity of the TClonesArray the same
338 // except for a factor of 2 increase when size > capacity
339 // does not release any memory occupied by the tca
340 minetca->ExpandCreate(itstca->GetEntriesFast());
341 for(int i = 0;i < itstca->GetEntriesFast();++i){
343 TObject *minetcaobj = minetca->At(i);
344 TObject *itstcaobj = itstca->At(i);
345 // no need to delete first
346 // pointers within the class should be handled by Copy()...
347 // Can there be Empty slots?
348 itstcaobj->Copy(*minetcaobj);
352 AliWarning(Form("%s:%d cannot copy TCollection \n",
353 (char*)__FILE__,__LINE__));
357 fOldMuonStructure = source.fOldMuonStructure;
359 fCentrality = source.fCentrality;
360 fEventplane = source.fEventplane;
362 fConnected = source.fConnected;
363 fUseOwnList = source.fUseOwnList;
365 fDetectorStatus = source.fDetectorStatus;
366 fDAQDetectorPattern = source.fDAQDetectorPattern;
367 fDAQAttributes = source.fDAQAttributes;
373 //______________________________________________________________________________
374 AliESDEvent::~AliESDEvent()
377 // Standard destructor
380 // everthing on the list gets deleted automatically
383 if(fESDObjects&&!fConnected)
388 if (fCentrality) delete fCentrality;
389 if (fEventplane) delete fEventplane;
393 void AliESDEvent::Copy(TObject &obj) const {
395 // interface to TOBject::Copy
396 // Copies the content of this into obj!
397 // bascially obj = *this
399 if(this==&obj)return;
400 AliESDEvent *robj = dynamic_cast<AliESDEvent*>(&obj);
401 if(!robj)return; // not an AliESEvent
406 //______________________________________________________________________________
407 void AliESDEvent::Reset()
411 // Std content + Non std content
413 // Reset the standard contents
415 fDetectorStatus = 0xFFFFFFFF;
416 fDAQDetectorPattern = 0xFFFF;
417 fDAQAttributes = 0xFFFF;
418 // reset for the old data without AliESDEvent...
419 if(fESDOld)fESDOld->Reset();
421 fESDFriendOld->~AliESDfriend();
422 new (fESDFriendOld) AliESDfriend();
426 if(fESDObjects->GetSize()>kESDListN){
427 // we have non std content
428 // this also covers esdfriends
429 for(int i = kESDListN;i < fESDObjects->GetSize();++i){
430 TObject *pObject = fESDObjects->At(i);
432 if(pObject->InheritsFrom(TClonesArray::Class())){
433 ((TClonesArray*)pObject)->Delete();
435 else if(!pObject->InheritsFrom(TCollection::Class())){
436 TClass *pClass = TClass::GetClass(pObject->ClassName());
437 if (pClass && pClass->GetListOfMethods()->FindObject("Clear")) {
438 AliDebug(1, Form("Clear for object %s class %s", pObject->GetName(), pObject->ClassName()));
442 AliDebug(1, Form("ResetWithPlacementNew for object %s class %s", pObject->GetName(), pObject->ClassName()));
443 ResetWithPlacementNew(pObject);
447 AliWarning(Form("No reset for %s \n",
448 pObject->ClassName()));
455 Bool_t AliESDEvent::ResetWithPlacementNew(TObject *pObject){
457 // funtion to reset using the already allocated space
459 Long_t dtoronly = TObject::GetDtorOnly();
460 TClass *pClass = TClass::GetClass(pObject->ClassName());
461 TObject::SetDtorOnly(pObject);
463 // Recreate with placement new
464 pClass->New(pObject);
465 // Restore the state.
466 TObject::SetDtorOnly((void*)dtoronly);
470 void AliESDEvent::ResetStdContent()
472 // Reset the standard contents
473 if(fESDRun) fESDRun->Reset();
474 if(fHeader) fHeader->Reset();
475 if(fCentrality) fCentrality->Reset();
476 if(fEventplane) fEventplane->Reset();
477 if(fESDZDC) fESDZDC->Reset();
482 // reset by callin d'to /c'tor keep the pointer
483 fESDVZERO->~AliESDVZERO();
484 new (fESDVZERO) AliESDVZERO();
487 fESDACORDE->~AliESDACORDE();
488 new (fESDACORDE) AliESDACORDE();
490 if(fESDTZERO) fESDTZERO->Reset();
491 // CKB no clear/reset implemented
493 fTPCVertex->~AliESDVertex();
494 new (fTPCVertex) AliESDVertex();
495 fTPCVertex->SetName(fgkESDListName[kTPCVertex]);
498 fSPDVertex->~AliESDVertex();
499 new (fSPDVertex) AliESDVertex();
500 fSPDVertex->SetName(fgkESDListName[kSPDVertex]);
503 fPrimaryVertex->~AliESDVertex();
504 new (fPrimaryVertex) AliESDVertex();
505 fPrimaryVertex->SetName(fgkESDListName[kPrimaryVertex]);
508 fSPDMult->~AliMultiplicity();
509 new (fSPDMult) AliMultiplicity();
512 fTOFHeader->~AliTOFHeader();
513 new (fTOFHeader) AliTOFHeader();
514 //fTOFHeader->SetName(fgkESDListName[kTOFHeader]);
517 fTrdTrigger->~AliESDTrdTrigger();
518 new (fTrdTrigger) AliESDTrdTrigger();
522 // fESDMFT->~AliESDMFT();
523 // new (fESDMFT) AliESDMFT();
527 if(fPHOSTrigger)fPHOSTrigger->DeAllocate();
528 if(fEMCALTrigger)fEMCALTrigger->DeAllocate();
529 if(fSPDPileupVertices)fSPDPileupVertices->Delete();
530 if(fTrkPileupVertices)fTrkPileupVertices->Delete();
531 if(fTracks)fTracks->Delete();
532 if(fMuonTracks)fMuonTracks->Clear("C");
533 if(fMuonClusters)fMuonClusters->Clear("C");
534 if(fMuonPads)fMuonPads->Clear("C");
535 if(fPmdTracks)fPmdTracks->Delete();
536 if(fTrdTracks)fTrdTracks->Delete();
537 if(fTrdTracklets)fTrdTracklets->Delete();
538 if(fV0s)fV0s->Delete();
539 if(fCascades)fCascades->Delete();
540 if(fKinks)fKinks->Delete();
541 if(fCaloClusters)fCaloClusters->Delete();
542 if(fPHOSCells)fPHOSCells->DeleteContainer();
543 if(fEMCALCells)fEMCALCells->DeleteContainer();
544 if(fCosmicTracks)fCosmicTracks->Delete();
545 if(fErrorLogs) fErrorLogs->Delete();
547 // don't reset fconnected fConnected and the list
552 Int_t AliESDEvent::AddV0(const AliESDv0 *v) {
556 TClonesArray &fv = *fV0s;
557 Int_t idx=fV0s->GetEntriesFast();
558 new(fv[idx]) AliESDv0(*v);
562 //______________________________________________________________________________
563 Bool_t AliESDEvent::IsDetectorInTriggerCluster(TString detector, AliTriggerConfiguration* trigConf) const {
564 // Check if a given detector was read-out in the analyzed event
565 const TObjArray& classesArray=trigConf->GetClasses();
566 ULong64_t trigMask=GetTriggerMask();
567 Int_t nclasses = classesArray.GetEntriesFast();
568 for(Int_t iclass=0; iclass < nclasses; iclass++ ) {
569 AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At(iclass);
570 Int_t classMask=trclass->GetMask();
571 if(trigMask & classMask){
572 TString detList=trclass->GetCluster()->GetDetectorsInCluster();
573 if(detList.Contains(detector.Data())){
580 //______________________________________________________________________________
581 void AliESDEvent::Print(Option_t *) const
584 // Print header information of the event
586 printf("ESD run information\n");
587 printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld Magnetic field %f \n",
588 GetEventNumberInFile(),
589 GetBunchCrossNumber(),
594 GetMagneticField() );
596 printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
597 fPrimaryVertex->GetXv(), fPrimaryVertex->GetXRes(),
598 fPrimaryVertex->GetYv(), fPrimaryVertex->GetYRes(),
599 fPrimaryVertex->GetZv(), fPrimaryVertex->GetZRes());
600 printf("Mean vertex in RUN: X=%.4f Y=%.4f Z=%.4f cm\n",
601 GetDiamondX(),GetDiamondY(),GetDiamondZ());
603 printf("SPD Multiplicity. Number of tracklets %d \n",
604 fSPDMult->GetNumberOfTracklets());
605 printf("Number of pileup primary vertices reconstructed with SPD %d\n",
606 GetNumberOfPileupVerticesSPD());
607 printf("Number of pileup primary vertices reconstructed using the tracks %d\n",
608 GetNumberOfPileupVerticesTracks());
609 printf("Number of tracks: \n");
610 printf(" charged %d\n", GetNumberOfTracks());
611 printf(" muon %d\n", GetNumberOfMuonTracks());
612 printf(" pmd %d\n", GetNumberOfPmdTracks());
613 printf(" trd %d\n", GetNumberOfTrdTracks());
614 printf(" trd trkl %d\n", GetNumberOfTrdTracklets());
615 printf(" v0 %d\n", GetNumberOfV0s());
616 printf(" cascades %d\n", GetNumberOfCascades());
617 printf(" kinks %d\n", GetNumberOfKinks());
618 if(fPHOSCells)printf(" PHOSCells %d\n", fPHOSCells->GetNumberOfCells());
619 else printf(" PHOSCells not in the Event\n");
620 if(fEMCALCells)printf(" EMCALCells %d\n", fEMCALCells->GetNumberOfCells());
621 else printf(" EMCALCells not in the Event\n");
622 printf(" CaloClusters %d\n", GetNumberOfCaloClusters());
623 printf(" FMD %s\n", (fESDFMD ? "yes" : "no"));
624 printf(" VZERO %s\n", (fESDVZERO ? "yes" : "no"));
625 printf(" muClusters %d\n", fMuonClusters ? fMuonClusters->GetEntriesFast() : 0);
626 printf(" muPad %d\n", fMuonPads ? fMuonPads->GetEntriesFast() : 0);
627 if (fCosmicTracks) printf(" Cosmics %d\n", GetNumberOfCosmicTracks());
629 //printf(" MFT %s\n", (fESDMFT ? "yes" : "no"));
633 TObject* pHLTDecision=GetHLTTriggerDecision();
634 printf("HLT trigger decision: %s\n", pHLTDecision?pHLTDecision->GetOption():"not available");
635 if (pHLTDecision) pHLTDecision->Print("compact");
640 void AliESDEvent::SetESDfriend(const AliESDfriend *ev) const {
642 // Attaches the complementary info to the ESD
646 // to be sure that we set the tracks also
647 // in case of old esds
648 // if(fESDOld)CopyFromOldESD();
650 Int_t ntrk=ev->GetNumberOfTracks();
652 for (Int_t i=0; i<ntrk; i++) {
653 const AliESDfriendTrack *f=ev->GetTrack(i);
654 if (!f) {AliFatal(Form("NULL pointer for ESD track %d",i));}
655 GetTrack(i)->SetFriendTrack(f);
659 Bool_t AliESDEvent::RemoveKink(Int_t rm) const {
660 // ---------------------------------------------------------
661 // Remove a kink candidate and references to it from ESD,
662 // if this candidate does not come from a reconstructed decay
663 // Not yet implemented...
664 // ---------------------------------------------------------
665 Int_t last=GetNumberOfKinks()-1;
666 if ((rm<0)||(rm>last)) return kFALSE;
671 Bool_t AliESDEvent::RemoveV0(Int_t rm) const {
672 // ---------------------------------------------------------
673 // Remove a V0 candidate and references to it from ESD,
674 // if this candidate does not come from a reconstructed decay
675 // ---------------------------------------------------------
676 Int_t last=GetNumberOfV0s()-1;
677 if ((rm<0)||(rm>last)) return kFALSE;
679 AliESDv0 *v0=GetV0(rm);
680 Int_t idxP=v0->GetPindex(), idxN=v0->GetNindex();
683 Int_t lastIdxP=v0->GetPindex(), lastIdxN=v0->GetNindex();
687 // Check if this V0 comes from a reconstructed decay
688 Int_t ncs=GetNumberOfCascades();
689 for (Int_t n=0; n<ncs; n++) {
690 AliESDcascade *cs=GetCascade(n);
692 Int_t csIdxP=cs->GetPindex();
693 Int_t csIdxN=cs->GetNindex();
696 if (idxN==csIdxN) return kFALSE;
698 if (csIdxP==lastIdxP)
699 if (csIdxN==lastIdxN) used++;
702 //Replace the removed V0 with the last V0
703 TClonesArray &a=*fV0s;
704 delete a.RemoveAt(rm);
706 if (rm==last) return kTRUE;
708 //v0 is pointing to the last V0 candidate...
709 new (a[rm]) AliESDv0(*v0);
710 delete a.RemoveAt(last);
712 if (!used) return kTRUE;
715 // Remap the indices of the daughters of reconstructed decays
716 for (Int_t n=0; n<ncs; n++) {
717 AliESDcascade *cs=GetCascade(n);
720 Int_t csIdxP=cs->GetPindex();
721 Int_t csIdxN=cs->GetNindex();
723 if (csIdxP==lastIdxP)
724 if (csIdxN==lastIdxN) {
725 cs->AliESDv0::SetIndex(1,idxP);
726 cs->AliESDv0::SetIndex(0,idxN);
728 if (!used) return kTRUE;
735 Bool_t AliESDEvent::RemoveTrack(Int_t rm) const {
736 // ---------------------------------------------------------
737 // Remove a track and references to it from ESD,
738 // if this track does not come from a reconstructed decay
739 // ---------------------------------------------------------
740 Int_t last=GetNumberOfTracks()-1;
741 if ((rm<0)||(rm>last)) return kFALSE;
745 // Check if this track comes from the reconstructed primary vertices
746 if (fTPCVertex && fTPCVertex->GetStatus()) {
747 UShort_t *primIdx=fTPCVertex->GetIndices();
748 Int_t n=fTPCVertex->GetNIndices();
750 Int_t idx=Int_t(primIdx[n]);
751 if (rm==idx) return kFALSE;
752 if (idx==last) used++;
755 if (fPrimaryVertex && fPrimaryVertex->GetStatus()) {
756 UShort_t *primIdx=fPrimaryVertex->GetIndices();
757 Int_t n=fPrimaryVertex->GetNIndices();
759 Int_t idx=Int_t(primIdx[n]);
760 if (rm==idx) return kFALSE;
761 if (idx==last) used++;
765 // Check if this track comes from a reconstructed decay
766 Int_t nv0=GetNumberOfV0s();
767 for (Int_t n=0; n<nv0; n++) {
768 AliESDv0 *v0=GetV0(n);
770 Int_t idx=v0->GetNindex();
771 if (rm==idx) return kFALSE;
772 if (idx==last) used++;
775 if (rm==idx) return kFALSE;
776 if (idx==last) used++;
779 Int_t ncs=GetNumberOfCascades();
780 for (Int_t n=0; n<ncs; n++) {
781 AliESDcascade *cs=GetCascade(n);
783 Int_t idx=cs->GetIndex();
784 if (rm==idx) return kFALSE;
785 if (idx==last) used++;
789 if (rm==idx) return kFALSE;
790 if (idx==last) used++;
793 if (rm==idx) return kFALSE;
794 if (idx==last) used++;
797 Int_t nkn=GetNumberOfKinks();
798 for (Int_t n=0; n<nkn; n++) {
799 AliESDkink *kn=GetKink(n);
801 Int_t idx=kn->GetIndex(0);
802 if (rm==idx) return kFALSE;
803 if (idx==last) used++;
806 if (rm==idx) return kFALSE;
807 if (idx==last) used++;
810 // Check if this track is associated with a CaloCluster
811 Int_t ncl=GetNumberOfCaloClusters();
812 for (Int_t n=0; n<ncl; n++) {
813 AliESDCaloCluster *cluster=GetCaloCluster(n);
814 TArrayI *arr=cluster->GetTracksMatched();
815 Int_t s=arr->GetSize();
817 Int_t idx=arr->At(s);
818 if (rm==idx) return kFALSE;
819 if (idx==last) used++;
825 //Replace the removed track with the last track
826 TClonesArray &a=*fTracks;
827 delete a.RemoveAt(rm);
829 if (rm==last) return kTRUE;
831 AliESDtrack *t=GetTrack(last);
832 if (!t) {AliFatal(Form("NULL pointer for ESD track %d",last));}
834 new (a[rm]) AliESDtrack(*t);
835 delete a.RemoveAt(last);
838 if (!used) return kTRUE;
841 // Remap the indices of the tracks used for the primary vertex reconstruction
842 if (fTPCVertex && fTPCVertex->GetStatus()) {
843 UShort_t *primIdx=fTPCVertex->GetIndices();
844 Int_t n=fTPCVertex->GetNIndices();
846 Int_t idx=Int_t(primIdx[n]);
848 primIdx[n]=Short_t(rm);
850 if (!used) return kTRUE;
854 if (fPrimaryVertex && fPrimaryVertex->GetStatus()) {
855 UShort_t *primIdx=fPrimaryVertex->GetIndices();
856 Int_t n=fPrimaryVertex->GetNIndices();
858 Int_t idx=Int_t(primIdx[n]);
860 primIdx[n]=Short_t(rm);
862 if (!used) return kTRUE;
867 // Remap the indices of the daughters of reconstructed decays
868 for (Int_t n=0; n<nv0; n++) {
869 AliESDv0 *v0=GetV0(n);
870 if (v0->GetIndex(0)==last) {
873 if (!used) return kTRUE;
875 if (v0->GetIndex(1)==last) {
878 if (!used) return kTRUE;
882 for (Int_t n=0; n<ncs; n++) {
883 AliESDcascade *cs=GetCascade(n);
884 if (cs->GetIndex()==last) {
887 if (!used) return kTRUE;
890 if (v0->GetIndex(0)==last) {
893 if (!used) return kTRUE;
895 if (v0->GetIndex(1)==last) {
898 if (!used) return kTRUE;
902 for (Int_t n=0; n<nkn; n++) {
903 AliESDkink *kn=GetKink(n);
904 if (kn->GetIndex(0)==last) {
907 if (!used) return kTRUE;
909 if (kn->GetIndex(1)==last) {
912 if (!used) return kTRUE;
916 // Remap the indices of the tracks accosicated with CaloClusters
917 for (Int_t n=0; n<ncl; n++) {
918 AliESDCaloCluster *cluster=GetCaloCluster(n);
919 TArrayI *arr=cluster->GetTracksMatched();
920 Int_t s=arr->GetSize();
922 Int_t idx=arr->At(s);
926 if (!used) return kTRUE;
935 Bool_t AliESDEvent::Clean(Float_t *cleanPars) {
937 // Remove the data which are not needed for the physics analysis.
939 // 1) Cleaning the V0 candidates
940 // ---------------------------
941 // If the cosine of the V0 pointing angle "csp" and
942 // the DCA between the daughter tracks "dca" does not satisfy
945 // csp > cleanPars[1] + dca/cleanPars[0]*(1.- cleanPars[1])
947 // an attempt to remove this V0 candidate from ESD is made.
949 // The V0 candidate gets removed if it does not belong to any
950 // recosntructed cascade decay
952 // 12.11.2007, optimal values: cleanPars[0]=0.5, cleanPars[1]=0.999
954 // 2) Cleaning the tracks
955 // ----------------------
956 // If track's transverse parameter is larger than cleanPars[2]
958 // track's longitudinal parameter is larger than cleanPars[3]
959 // an attempt to remove this track from ESD is made.
961 // The track gets removed if it does not come
962 // from a reconstructed decay
966 Float_t dcaMax=cleanPars[0];
967 Float_t cspMin=cleanPars[1];
969 Int_t nV0s=GetNumberOfV0s();
970 for (Int_t i=nV0s-1; i>=0; i--) {
971 AliESDv0 *v0=GetV0(i);
973 Float_t dca=v0->GetDcaV0Daughters();
974 Float_t csp=v0->GetV0CosineOfPointingAngle();
975 Float_t cspcut=cspMin + dca/dcaMax*(1.-cspMin);
976 if (csp > cspcut) continue;
977 if (RemoveV0(i)) rc=kTRUE;
981 Float_t dmax=cleanPars[2], zmax=cleanPars[3];
983 const AliESDVertex *vertex=GetPrimaryVertexSPD();
984 Bool_t vtxOK=vertex->GetStatus();
986 Int_t nTracks=GetNumberOfTracks();
987 for (Int_t i=nTracks-1; i>=0; i--) {
988 AliESDtrack *track=GetTrack(i);
989 if (!track) {AliFatal(Form("NULL pointer for ESD track %d",i));}
990 Float_t xy,z; track->GetImpactParameters(xy,z);
991 if ((TMath::Abs(xy) > dmax) || (vtxOK && (TMath::Abs(z) > zmax))) {
992 if (RemoveTrack(i)) rc=kTRUE;
999 Char_t AliESDEvent::AddPileupVertexSPD(const AliESDVertex *vtx)
1001 // Add a pileup primary vertex reconstructed with SPD
1002 TClonesArray &ftr = *fSPDPileupVertices;
1003 Char_t n=Char_t(ftr.GetEntriesFast());
1004 AliESDVertex *vertex = new(ftr[n]) AliESDVertex(*vtx);
1009 Char_t AliESDEvent::AddPileupVertexTracks(const AliESDVertex *vtx)
1011 // Add a pileup primary vertex reconstructed with SPD
1012 TClonesArray &ftr = *fTrkPileupVertices;
1013 Char_t n=Char_t(ftr.GetEntriesFast());
1014 AliESDVertex *vertex = new(ftr[n]) AliESDVertex(*vtx);
1019 Int_t AliESDEvent::AddTrack(const AliESDtrack *t)
1022 TClonesArray &ftr = *fTracks;
1023 AliESDtrack * track = new(ftr[fTracks->GetEntriesFast()])AliESDtrack(*t);
1024 track->SetID(fTracks->GetEntriesFast()-1);
1025 return track->GetID();
1028 AliESDtrack* AliESDEvent::NewTrack()
1031 TClonesArray &ftr = *fTracks;
1032 AliESDtrack * track = new(ftr[fTracks->GetEntriesFast()])AliESDtrack();
1033 track->SetID(fTracks->GetEntriesFast()-1);
1037 //______________________________________________________________________________
1038 Bool_t AliESDEvent::MoveMuonObjects()
1040 // move MUON clusters and pads to the new ESD structure in needed.
1041 // to ensure backward compatibility
1043 if (!fOldMuonStructure) return kTRUE;
1045 if (!fMuonTracks || !fMuonClusters || !fMuonPads) return kFALSE;
1047 Bool_t reset = kTRUE;
1048 Bool_t containTrackerData = kFALSE;
1049 for (Int_t i = 0; i < fMuonTracks->GetEntriesFast(); i++) {
1051 AliESDMuonTrack *track = (AliESDMuonTrack*) fMuonTracks->UncheckedAt(i);
1053 if (track->ContainTrackerData()) containTrackerData = kTRUE;
1056 if (!track->IsOldTrack()) continue;
1058 // remove objects connected to previous event if needed
1060 if (fMuonClusters->GetEntriesFast() > 0) fMuonClusters->Clear("C");
1061 if (fMuonPads->GetEntriesFast() > 0) fMuonPads->Clear("C");
1065 track->MoveClustersToESD(*this);
1069 // remove objects connected to previous event if needed
1070 if (!containTrackerData) {
1071 if (fMuonClusters->GetEntriesFast() > 0) fMuonClusters->Clear("C");
1072 if (fMuonPads->GetEntriesFast() > 0) fMuonPads->Clear("C");
1078 //______________________________________________________________________________
1079 AliESDMuonTrack* AliESDEvent::GetMuonTrack(Int_t i)
1081 // get the MUON track at the position i in the internal array of track
1082 if (!fMuonTracks) return 0x0;
1083 if (!MoveMuonObjects()) return 0x0;
1084 AliESDMuonTrack *track = (AliESDMuonTrack*) fMuonTracks->UncheckedAt(i);
1085 track->SetESDEvent(this);
1089 //______________________________________________________________________________
1090 void AliESDEvent::AddMuonTrack(const AliESDMuonTrack *t)
1093 TClonesArray &fmu = *fMuonTracks;
1094 AliESDMuonTrack *track = new(fmu[fMuonTracks->GetEntriesFast()]) AliESDMuonTrack(*t);
1095 track->MoveClustersToESD(*this);
1098 //______________________________________________________________________________
1099 AliESDMuonTrack* AliESDEvent::NewMuonTrack()
1101 // create a new MUON track at the end of the internal array of track
1102 TClonesArray &fmu = *fMuonTracks;
1103 return new(fmu[fMuonTracks->GetEntriesFast()]) AliESDMuonTrack();
1106 //______________________________________________________________________________
1107 Int_t AliESDEvent::GetNumberOfMuonClusters()
1109 // get the number of MUON clusters
1110 if (!fMuonClusters) return 0;
1111 if (!MoveMuonObjects()) return 0;
1112 return fMuonClusters->GetEntriesFast();
1115 //______________________________________________________________________________
1116 AliESDMuonCluster* AliESDEvent::GetMuonCluster(Int_t i)
1118 // get the MUON cluster at the position i in the internal array of cluster
1119 if (!fMuonClusters) return 0x0;
1120 if (!MoveMuonObjects()) return 0x0;
1121 return (AliESDMuonCluster*) fMuonClusters->UncheckedAt(i);
1124 //______________________________________________________________________________
1125 AliESDMuonCluster* AliESDEvent::FindMuonCluster(UInt_t clusterId)
1127 // find the MUON cluster with this Id in the internal array of cluster
1128 if (!fMuonClusters) return 0x0;
1129 if (!MoveMuonObjects()) return 0x0;
1130 for (Int_t i = 0; i < fMuonClusters->GetEntriesFast(); i++) {
1131 AliESDMuonCluster *cluster = (AliESDMuonCluster*) fMuonClusters->UncheckedAt(i);
1132 if (cluster->GetUniqueID() == clusterId) return cluster;
1137 //______________________________________________________________________________
1138 AliESDMuonCluster* AliESDEvent::NewMuonCluster()
1140 // create a new MUON cluster at the end of the internal array of cluster
1141 TClonesArray &fmu = *fMuonClusters;
1142 return new(fmu[fMuonClusters->GetEntriesFast()]) AliESDMuonCluster();
1145 //______________________________________________________________________________
1146 Int_t AliESDEvent::GetNumberOfMuonPads()
1148 // get the number of MUON pads
1149 if (!fMuonPads) return 0;
1150 if (!MoveMuonObjects()) return 0;
1151 return fMuonPads->GetEntriesFast();
1154 //______________________________________________________________________________
1155 AliESDMuonPad* AliESDEvent::GetMuonPad(Int_t i)
1157 // get the MUON pad at the position i in the internal array of pad
1158 if (!fMuonPads) return 0x0;
1159 if (!MoveMuonObjects()) return 0x0;
1160 return (AliESDMuonPad*) fMuonPads->UncheckedAt(i);
1163 //______________________________________________________________________________
1164 AliESDMuonPad* AliESDEvent::FindMuonPad(UInt_t padId)
1166 // find the MUON pad with this Id in the internal array of pad
1167 if (!fMuonPads) return 0x0;
1168 if (!MoveMuonObjects()) return 0x0;
1169 for (Int_t i = 0; i < fMuonPads->GetEntriesFast(); i++) {
1170 AliESDMuonPad *pad = (AliESDMuonPad*) fMuonPads->UncheckedAt(i);
1171 if (pad->GetUniqueID() == padId) return pad;
1176 //______________________________________________________________________________
1177 AliESDMuonPad* AliESDEvent::NewMuonPad()
1179 // create a new MUON pad at the end of the internal array of pad
1180 TClonesArray &fmu = *fMuonPads;
1181 return new(fmu[fMuonPads->GetEntriesFast()]) AliESDMuonPad();
1184 void AliESDEvent::AddPmdTrack(const AliESDPmdTrack *t)
1186 TClonesArray &fpmd = *fPmdTracks;
1187 new(fpmd[fPmdTracks->GetEntriesFast()]) AliESDPmdTrack(*t);
1190 void AliESDEvent::SetTrdTrigger(const AliESDTrdTrigger *t)
1195 void AliESDEvent::AddTrdTrack(const AliESDTrdTrack *t)
1197 TClonesArray &ftrd = *fTrdTracks;
1198 new(ftrd[fTrdTracks->GetEntriesFast()]) AliESDTrdTrack(*t);
1201 void AliESDEvent::AddTrdTracklet(const AliESDTrdTracklet *trkl)
1203 new ((*fTrdTracklets)[fTrdTracklets->GetEntriesFast()]) AliESDTrdTracklet(*trkl);
1206 Int_t AliESDEvent::AddKink(const AliESDkink *c)
1209 TClonesArray &fk = *fKinks;
1210 AliESDkink * kink = new(fk[fKinks->GetEntriesFast()]) AliESDkink(*c);
1211 kink->SetID(fKinks->GetEntriesFast()); // CKB different from the other imps..
1212 return fKinks->GetEntriesFast()-1;
1216 void AliESDEvent::AddCascade(const AliESDcascade *c)
1218 TClonesArray &fc = *fCascades;
1219 new(fc[fCascades->GetEntriesFast()]) AliESDcascade(*c);
1222 void AliESDEvent::AddCosmicTrack(const AliESDCosmicTrack *t)
1224 TClonesArray &ft = *fCosmicTracks;
1225 new(ft[fCosmicTracks->GetEntriesFast()]) AliESDCosmicTrack(*t);
1229 Int_t AliESDEvent::AddCaloCluster(const AliESDCaloCluster *c)
1232 TClonesArray &fc = *fCaloClusters;
1233 AliESDCaloCluster *clus = new(fc[fCaloClusters->GetEntriesFast()]) AliESDCaloCluster(*c);
1234 clus->SetID(fCaloClusters->GetEntriesFast()-1);
1235 return fCaloClusters->GetEntriesFast()-1;
1239 void AliESDEvent::AddRawDataErrorLog(const AliRawDataErrorLog *log) const {
1240 TClonesArray &errlogs = *fErrorLogs;
1241 new(errlogs[errlogs.GetEntriesFast()]) AliRawDataErrorLog(*log);
1244 void AliESDEvent::SetZDCData(const AliESDZDC * obj)
1246 // use already allocated space
1251 void AliESDEvent::SetPrimaryVertexTPC(const AliESDVertex *vertex)
1253 // Set the TPC vertex
1254 // use already allocated space
1256 *fTPCVertex = *vertex;
1257 fTPCVertex->SetName(fgkESDListName[kTPCVertex]);
1261 void AliESDEvent::SetPrimaryVertexSPD(const AliESDVertex *vertex)
1263 // Set the SPD vertex
1264 // use already allocated space
1266 *fSPDVertex = *vertex;
1267 fSPDVertex->SetName(fgkESDListName[kSPDVertex]);
1271 void AliESDEvent::SetPrimaryVertexTracks(const AliESDVertex *vertex)
1273 // Set the primary vertex reconstructed using he ESD tracks.
1274 // use already allocated space
1276 *fPrimaryVertex = *vertex;
1277 fPrimaryVertex->SetName(fgkESDListName[kPrimaryVertex]);
1281 const AliESDVertex * AliESDEvent::GetPrimaryVertex() const
1284 // Get the "best" available reconstructed primary vertex.
1287 if (fPrimaryVertex->GetStatus()) return fPrimaryVertex;
1290 if (fSPDVertex->GetStatus()) return fSPDVertex;
1292 if(fTPCVertex) return fTPCVertex;
1294 AliWarning("No primary vertex available. Returning the \"default\"...");
1298 AliESDVertex * AliESDEvent::PrimaryVertexTracksUnconstrained() const
1301 // Removes diamond constraint from fPrimaryVertex (reconstructed with tracks)
1302 // Returns a AliESDVertex which has to be deleted by the user
1304 if(!fPrimaryVertex) {
1305 AliWarning("No primary vertex from tracks available.");
1308 if(!fPrimaryVertex->GetStatus()) {
1309 AliWarning("No primary vertex from tracks available.");
1313 AliVertexerTracks vertexer(GetMagneticField());
1314 Float_t diamondxyz[3]={(Float_t)GetDiamondX(),(Float_t)GetDiamondY(),0.};
1315 Float_t diamondcovxy[3]; GetDiamondCovXY(diamondcovxy);
1316 Float_t diamondcov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,7.};
1317 AliESDVertex *vertex =
1318 (AliESDVertex*)vertexer.RemoveConstraintFromVertex(fPrimaryVertex,diamondxyz,diamondcov);
1323 void AliESDEvent::SetMultiplicity(const AliMultiplicity *mul)
1325 // Set the SPD Multiplicity
1332 void AliESDEvent::SetFMDData(AliESDFMD * obj)
1334 // use already allocated space
1340 void AliESDEvent::SetVZEROData(const AliESDVZERO * obj)
1342 // use already allocated space
1347 void AliESDEvent::SetTZEROData(const AliESDTZERO * obj)
1349 // use already allocated space
1355 //void AliESDEvent::SetMFTData(AliESDMFT * obj)
1362 void AliESDEvent::SetACORDEData(AliESDACORDE * obj)
1369 void AliESDEvent::GetESDfriend(AliESDfriend *ev) const
1372 // Extracts the complementary info from the ESD
1376 Int_t ntrk=GetNumberOfTracks();
1378 for (Int_t i=0; i<ntrk; i++) {
1379 AliESDtrack *t=GetTrack(i);
1380 if (!t) {AliFatal(Form("NULL pointer for ESD track %d",i));}
1381 const AliESDfriendTrack *f=t->GetFriendTrack();
1384 t->ReleaseESDfriendTrack();// Not to have two copies of "friendTrack"
1388 AliESDfriend *fr = (AliESDfriend*)(const_cast<AliESDEvent*>(this)->FindListObject("AliESDfriend"));
1389 if (fr) ev->SetVZEROfriend(fr->GetVZEROfriend());
1392 void AliESDEvent::AddObject(TObject* obj)
1394 // Add an object to the list of object.
1395 // Please be aware that in order to increase performance you should
1396 // refrain from using TObjArrays (if possible). Use TClonesArrays, instead.
1397 fESDObjects->SetOwner(kTRUE);
1398 fESDObjects->AddLast(obj);
1402 void AliESDEvent::GetStdContent()
1404 // set pointers for standard content
1405 // get by name much safer and not a big overhead since not called very often
1407 fESDRun = (AliESDRun*)fESDObjects->FindObject(fgkESDListName[kESDRun]);
1408 fHeader = (AliESDHeader*)fESDObjects->FindObject(fgkESDListName[kHeader]);
1409 fESDZDC = (AliESDZDC*)fESDObjects->FindObject(fgkESDListName[kESDZDC]);
1410 fESDFMD = (AliESDFMD*)fESDObjects->FindObject(fgkESDListName[kESDFMD]);
1411 fESDVZERO = (AliESDVZERO*)fESDObjects->FindObject(fgkESDListName[kESDVZERO]);
1412 fESDTZERO = (AliESDTZERO*)fESDObjects->FindObject(fgkESDListName[kESDTZERO]);
1413 fTPCVertex = (AliESDVertex*)fESDObjects->FindObject(fgkESDListName[kTPCVertex]);
1414 fSPDVertex = (AliESDVertex*)fESDObjects->FindObject(fgkESDListName[kSPDVertex]);
1415 fPrimaryVertex = (AliESDVertex*)fESDObjects->FindObject(fgkESDListName[kPrimaryVertex]);
1416 fSPDMult = (AliMultiplicity*)fESDObjects->FindObject(fgkESDListName[kSPDMult]);
1417 fPHOSTrigger = (AliESDCaloTrigger*)fESDObjects->FindObject(fgkESDListName[kPHOSTrigger]);
1418 fEMCALTrigger = (AliESDCaloTrigger*)fESDObjects->FindObject(fgkESDListName[kEMCALTrigger]);
1419 fSPDPileupVertices = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kSPDPileupVertices]);
1420 fTrkPileupVertices = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrkPileupVertices]);
1421 fTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTracks]);
1422 fMuonTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonTracks]);
1423 fMuonClusters = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonClusters]);
1424 fMuonPads = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonPads]);
1425 fPmdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kPmdTracks]);
1426 fTrdTrigger = (AliESDTrdTrigger*)fESDObjects->FindObject(fgkESDListName[kTrdTrigger]);
1427 fTrdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrdTracks]);
1428 fTrdTracklets = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrdTracklets]);
1429 fV0s = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kV0s]);
1430 fCascades = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCascades]);
1431 fKinks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kKinks]);
1432 fCaloClusters = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCaloClusters]);
1433 fEMCALCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kEMCALCells]);
1434 fPHOSCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kPHOSCells]);
1435 fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]);
1436 fESDACORDE = (AliESDACORDE*)fESDObjects->FindObject(fgkESDListName[kESDACORDE]);
1437 fTOFHeader = (AliTOFHeader*)fESDObjects->FindObject(fgkESDListName[kTOFHeader]);
1438 fCosmicTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCosmicTracks]);
1440 // fESDMFT = (AliESDMFT*)fESDObjects->FindObject(fgkESDListName[kESDMFT]);
1444 void AliESDEvent::SetStdNames(){
1445 // Set the names of the standard contents
1447 if(fESDObjects->GetEntries()>=kESDListN){
1448 for(int i = 0;i < fESDObjects->GetEntries() && i<kESDListN;i++){
1449 TObject *fObj = fESDObjects->At(i);
1450 if(fObj->InheritsFrom("TNamed")){
1451 ((TNamed*)fObj)->SetName(fgkESDListName[i]);
1453 else if(fObj->InheritsFrom("TClonesArray")){
1454 ((TClonesArray*)fObj)->SetName(fgkESDListName[i]);
1459 AliWarning("Std Entries missing");
1464 void AliESDEvent::CreateStdContent(Bool_t bUseThisList){
1465 fUseOwnList = bUseThisList;
1469 void AliESDEvent::CreateStdContent()
1471 // create the standard AOD content and set pointers
1473 // create standard objects and add them to the TList of objects
1474 AddObject(new AliESDRun());
1475 AddObject(new AliESDHeader());
1476 AddObject(new AliESDZDC());
1477 AddObject(new AliESDFMD());
1478 AddObject(new AliESDVZERO());
1479 AddObject(new AliESDTZERO());
1480 AddObject(new AliESDVertex());
1481 AddObject(new AliESDVertex());
1482 AddObject(new AliESDVertex());
1483 AddObject(new AliMultiplicity());
1484 AddObject(new AliESDCaloTrigger());
1485 AddObject(new AliESDCaloTrigger());
1486 AddObject(new TClonesArray("AliESDVertex",0));
1487 AddObject(new TClonesArray("AliESDVertex",0));
1488 AddObject(new TClonesArray("AliESDtrack",0));
1489 AddObject(new TClonesArray("AliESDMuonTrack",0));
1490 AddObject(new TClonesArray("AliESDMuonCluster",0));
1491 AddObject(new TClonesArray("AliESDMuonPad",0));
1492 AddObject(new TClonesArray("AliESDPmdTrack",0));
1493 AddObject(new AliESDTrdTrigger());
1494 AddObject(new TClonesArray("AliESDTrdTrack",0));
1495 AddObject(new TClonesArray("AliESDTrdTracklet",0));
1496 AddObject(new TClonesArray("AliESDv0",0));
1497 AddObject(new TClonesArray("AliESDcascade",0));
1498 AddObject(new TClonesArray("AliESDkink",0));
1499 AddObject(new TClonesArray("AliESDCaloCluster",0));
1500 AddObject(new AliESDCaloCells());
1501 AddObject(new AliESDCaloCells());
1502 AddObject(new TClonesArray("AliRawDataErrorLog",0));
1503 AddObject(new AliESDACORDE());
1504 AddObject(new AliTOFHeader());
1505 AddObject(new TClonesArray("AliESDCosmicTrack",0));
1507 //AddObject(new AliESDMFT());
1510 // check the order of the indices against enum...
1514 // read back pointers
1518 void AliESDEvent::CompleteStdContent()
1520 // Create missing standard objects and add them to the TList of objects
1522 // Add cosmic tracks for cases where esd files were created
1523 // before adding them to the std content
1524 if (!fESDObjects->FindObject(fgkESDListName[kCosmicTracks])) {
1525 TClonesArray* cosmics = new TClonesArray("AliESDCosmicTrack",0);
1526 fESDObjects->AddAt(cosmics, kCosmicTracks);
1527 fESDObjects->SetOwner(kTRUE);
1529 // Add new MUON containers if missing (for backward compatibility)
1530 if (!fESDObjects->FindObject(fgkESDListName[kMuonClusters])) {
1531 TClonesArray* muonClusters = new TClonesArray("AliESDMuonCluster",0);
1532 muonClusters->SetName(fgkESDListName[kMuonClusters]);
1533 fESDObjects->AddAt(muonClusters, kMuonClusters);
1534 fESDObjects->SetOwner(kTRUE);
1536 if (!fESDObjects->FindObject(fgkESDListName[kMuonPads])) {
1537 TClonesArray* muonPads = new TClonesArray("AliESDMuonPad",0);
1538 muonPads->SetName(fgkESDListName[kMuonPads]);
1539 fESDObjects->AddAt(muonPads, kMuonPads);
1540 fESDObjects->SetOwner(kTRUE);
1544 TObject* AliESDEvent::FindListObject(const char *name) const {
1546 // Find object with name "name" in the list of branches
1549 return fESDObjects->FindObject(name);
1554 Int_t AliESDEvent::GetPHOSClusters(TRefArray *clusters) const
1556 // fills the provided TRefArray with all found phos clusters
1560 AliESDCaloCluster *cl = 0;
1561 for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) {
1563 if ( (cl = GetCaloCluster(i)) ) {
1566 AliDebug(1,Form("IsPHOS cluster %d Size: %d \n",i,clusters->GetEntriesFast()));
1570 return clusters->GetEntriesFast();
1573 Int_t AliESDEvent::GetEMCALClusters(TRefArray *clusters) const
1575 // fills the provided TRefArray with all found emcal clusters
1579 AliESDCaloCluster *cl = 0;
1580 for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) {
1582 if ( (cl = GetCaloCluster(i)) ) {
1585 AliDebug(1,Form("IsEMCAL cluster %d Size: %d \n",i,clusters->GetEntriesFast()));
1589 return clusters->GetEntriesFast();
1592 void AliESDEvent::WriteToTree(TTree* tree) const {
1593 // Book the branches as in TTree::Branch(TCollection*)
1594 // but add a "." at the end of top level branches which are
1595 // not a TClonesArray
1599 TIter next(fESDObjects);
1600 const Int_t kSplitlevel = 99; // default value in TTree::Branch()
1601 const Int_t kBufsize = 32000; // default value in TTree::Branch()
1604 while ((obj = next())) {
1605 branchname.Form("%s", obj->GetName());
1606 if(branchname.CompareTo("AliESDfriend")==0)branchname = "ESDfriend.";
1607 if ((kSplitlevel > 1) && !obj->InheritsFrom(TClonesArray::Class())) {
1608 if(!branchname.EndsWith("."))branchname += ".";
1610 if (!tree->FindBranch(branchname)) {
1611 // For the custom streamer to be called splitlevel
1612 // has to be negative, only needed for HLT
1613 Int_t splitLevel = (TString(obj->ClassName()) == "AliHLTGlobalTriggerDecision") ? -1 : kSplitlevel - 1;
1614 tree->Bronch(branchname, obj->ClassName(), fESDObjects->GetObjectRef(obj),kBufsize, splitLevel);
1617 tree->Branch("fDetectorStatus",(void*)&fDetectorStatus,"fDetectorStatus/l");
1618 tree->Branch("fDAQDetectorPattern",(void*)&fDAQDetectorPattern,"fDAQDetectorPattern/i");
1619 tree->Branch("fDAQAttributes",(void*)&fDAQAttributes,"fDAQAttributes/i");
1623 void AliESDEvent::ReadFromTree(TTree *tree, Option_t* opt){
1625 // Connect the ESDEvent to a tree
1628 AliWarning("AliESDEvent::ReadFromTree() Zero Pointer to Tree \n");
1632 if(!tree->GetTree())tree->LoadTree(0);
1634 // if we find the "ESD" branch on the tree we do have the old structure
1635 if(tree->GetBranch("ESD")) {
1636 fOldMuonStructure = kFALSE;
1637 char ** address = (char **)(tree->GetBranch("ESD")->GetAddress());
1638 // do we have the friend branch
1639 TBranch * esdFB = tree->GetBranch("ESDfriend.");
1640 char ** addressF = 0;
1641 if(esdFB)addressF = (char **)(esdFB->GetAddress());
1643 AliInfo("AliESDEvent::ReadFromTree() Reading old Tree");
1644 tree->SetBranchAddress("ESD", &fESDOld);
1646 tree->SetBranchAddress("ESDfriend.",&fESDFriendOld);
1649 AliInfo("AliESDEvent::ReadFromTree() Reading old Tree");
1650 AliInfo("Branch already connected. Using existing branch address.");
1651 fESDOld = (AliESD*) (*address);
1652 // addressF can still be 0, since branch needs to switched on
1653 if(addressF)fESDFriendOld = (AliESDfriend*) (*addressF);
1656 // have already connected the old ESD structure... ?
1657 // reuse also the pointer of the AlliESDEvent
1658 // otherwise create new ones
1659 TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("ESDObjectsConnectedToTree"));
1662 // If connected use the connected list of objects
1663 if(fESDObjects!= connectedList){
1664 // protect when called twice
1665 fESDObjects->Delete();
1666 fESDObjects = connectedList;
1671 // The pointer to the friend changes when called twice via InitIO
1672 // since AliESDEvent is deleted
1673 TObject* oldf = FindListObject("AliESDfriend");
1676 newf = (TObject*)*addressF;
1678 if(newf!=0&&oldf!=newf){
1679 // remove the old reference
1680 // Should we also delete it? Or is this handled in TTree I/O
1681 // since it is created by the first SetBranchAddress
1682 fESDObjects->Remove(oldf);
1684 fESDObjects->Add(newf);
1691 CreateStdContent(); // create for copy
1692 // if we have the esdfriend add it, so we always can access it via the userinfo
1693 if(fESDFriendOld)AddObject(fESDFriendOld);
1694 // we are not owner of the list objects
1695 // must not delete it
1696 fESDObjects->SetOwner(kTRUE);
1697 fESDObjects->SetName("ESDObjectsConnectedToTree");
1698 tree->GetUserInfo()->Add(fESDObjects);
1706 // Try to find AliESDEvent
1707 AliESDEvent *esdEvent = 0;
1708 esdEvent = (AliESDEvent*)tree->GetTree()->GetUserInfo()->FindObject("AliESDEvent");
1710 // Check if already connected to tree
1712 TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("ESDObjectsConnectedToTree"));
1715 if (connectedList && (strcmp(opt, "reconnect"))) {
1716 // If connected use the connected list if objects
1717 fESDObjects->Delete();
1718 fESDObjects = connectedList;
1719 tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus); //PH probably redundant
1720 tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
1721 tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
1723 fOldMuonStructure = fESDObjects->TestBit(BIT(23));
1729 // prevent a memory leak when reading back the TList
1730 // if (!(strcmp(opt, "reconnect"))) fESDObjects->Delete();
1733 // create a new TList from the UserInfo TList...
1734 // copy constructor does not work...
1735 fESDObjects = (TList*)(esdEvent->GetList()->Clone());
1736 fESDObjects->SetOwner(kTRUE);
1738 else if ( fESDObjects->GetEntries()==0){
1739 // at least create the std content if we want to read to our list
1744 // we only need new things in the list if we do no already have it..
1745 // TODO just add new entries
1746 CompleteStdContent();
1748 if(fESDObjects->GetEntries()<kESDListN){
1749 AliWarning(Form("AliESDEvent::ReadFromTree() TList contains less than the standard contents %d < %d \n",
1750 fESDObjects->GetEntries(),kESDListN));
1752 // set the branch addresses
1753 fOldMuonStructure = kFALSE;
1754 TIter next(fESDObjects);
1756 while((el=(TNamed*)next())){
1757 TString bname(el->GetName());
1758 if(bname.CompareTo("AliESDfriend")==0)
1760 // AliESDfriend does not have a name ...
1761 TBranch *br = tree->GetBranch("ESDfriend.");
1762 if (br) tree->SetBranchAddress("ESDfriend.",fESDObjects->GetObjectRef(el));
1765 // check if branch exists under this Name
1766 TBranch *br = tree->GetBranch(bname.Data());
1768 tree->SetBranchAddress(bname.Data(),fESDObjects->GetObjectRef(el));
1771 br = tree->GetBranch(Form("%s.",bname.Data()));
1773 tree->SetBranchAddress(Form("%s.",bname.Data()),fESDObjects->GetObjectRef(el));
1776 AliWarning(Form("AliESDEvent::ReadFromTree() No Branch found with Name %s or %s.",bname.Data(),bname.Data()));
1777 if (bname == fgkESDListName[kMuonClusters]) {
1778 fOldMuonStructure = kTRUE;
1785 tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus);
1786 tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
1787 tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
1789 // when reading back we are not owner of the list
1790 // must not delete it
1791 fESDObjects->SetOwner(kTRUE);
1792 fESDObjects->SetName("ESDObjectsConnectedToTree");
1793 fESDObjects->SetBit(BIT(23), fOldMuonStructure);
1794 // we are not owner of the list objects
1795 // must not delete it
1796 tree->GetUserInfo()->Add(fESDObjects);
1797 tree->GetUserInfo()->SetOwner(kFALSE);
1801 // we can't get the list from the user data, create standard content
1802 // and set it by hand (no ESDfriend at the moment
1804 fOldMuonStructure = kFALSE;
1805 TIter next(fESDObjects);
1807 while((el=(TNamed*)next())){
1808 TString bname(el->GetName());
1809 TBranch *br = tree->GetBranch(bname.Data());
1811 tree->SetBranchAddress(bname.Data(),fESDObjects->GetObjectRef(el));
1814 br = tree->GetBranch(Form("%s.",bname.Data()));
1816 tree->SetBranchAddress(Form("%s.",bname.Data()),fESDObjects->GetObjectRef(el));
1818 else if (bname == fgkESDListName[kMuonClusters]) {
1819 fOldMuonStructure = kTRUE;
1823 tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus);
1824 tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
1825 tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
1827 // when reading back we are not owner of the list
1828 // must not delete it
1829 fESDObjects->SetOwner(kTRUE);
1834 void AliESDEvent::CopyFromOldESD()
1836 // Method which copies over everthing from the old esd structure to the
1841 SetRunNumber(fESDOld->GetRunNumber());
1842 SetPeriodNumber(fESDOld->GetPeriodNumber());
1843 SetMagneticField(fESDOld->GetMagneticField());
1845 // leave out diamond ...
1846 // SetDiamond(const AliESDVertex *vertex) { fESDRun->SetDiamond(vertex);}
1849 SetTriggerMask(fESDOld->GetTriggerMask());
1850 SetOrbitNumber(fESDOld->GetOrbitNumber());
1851 SetTimeStamp(fESDOld->GetTimeStamp());
1852 SetEventType(fESDOld->GetEventType());
1853 SetEventNumberInFile(fESDOld->GetEventNumberInFile());
1854 SetBunchCrossNumber(fESDOld->GetBunchCrossNumber());
1855 SetTriggerCluster(fESDOld->GetTriggerCluster());
1859 SetZDC(fESDOld->GetZDCN1Energy(),
1860 fESDOld->GetZDCP1Energy(),
1861 fESDOld->GetZDCEMEnergy(),
1863 fESDOld->GetZDCN2Energy(),
1864 fESDOld->GetZDCP2Energy(),
1865 fESDOld->GetZDCParticipants(),
1875 if(fESDOld->GetFMDData())SetFMDData(fESDOld->GetFMDData());
1879 SetT0zVertex(fESDOld->GetT0zVertex());
1880 SetT0(fESDOld->GetT0());
1884 if (fESDOld->GetVZEROData()) SetVZEROData(fESDOld->GetVZEROData());
1886 if(fESDOld->GetVertex())SetPrimaryVertexSPD(fESDOld->GetVertex());
1888 if(fESDOld->GetPrimaryVertex())SetPrimaryVertexTracks(fESDOld->GetPrimaryVertex());
1890 if(fESDOld->GetMultiplicity())SetMultiplicity(fESDOld->GetMultiplicity());
1892 for(int i = 0;i<fESDOld->GetNumberOfTracks();i++){
1893 AddTrack(fESDOld->GetTrack(i));
1896 for(int i = 0;i<fESDOld->GetNumberOfMuonTracks();i++){
1897 AddMuonTrack(fESDOld->GetMuonTrack(i));
1900 for(int i = 0;i<fESDOld->GetNumberOfPmdTracks();i++){
1901 AddPmdTrack(fESDOld->GetPmdTrack(i));
1904 for(int i = 0;i<fESDOld->GetNumberOfTrdTracks();i++){
1905 AddTrdTrack(fESDOld->GetTrdTrack(i));
1908 for(int i = 0;i<fESDOld->GetNumberOfV0s();i++){
1909 AddV0(fESDOld->GetV0(i));
1912 for(int i = 0;i<fESDOld->GetNumberOfCascades();i++){
1913 AddCascade(fESDOld->GetCascade(i));
1916 for(int i = 0;i<fESDOld->GetNumberOfKinks();i++){
1917 AddKink(fESDOld->GetKink(i));
1921 for(int i = 0;i<fESDOld->GetNumberOfCaloClusters();i++){
1922 AddCaloCluster(fESDOld->GetCaloCluster(i));
1927 // if (fESDOld->GetMFTData()) SetMFTData(fESDOld->GetMFTData());
1933 Bool_t AliESDEvent::IsEventSelected(const char *trigExpr) const
1935 // Check if the event satisfies the trigger
1936 // selection expression trigExpr.
1937 // trigExpr can be any logical expression
1938 // of the trigger classes defined in AliESDRun
1939 // In case of wrong syntax return kTRUE.
1941 TString expr(trigExpr);
1942 if (expr.IsNull()) return kTRUE;
1944 ULong64_t mask = GetTriggerMask();
1945 for(Int_t itrig = 0; itrig < AliESDRun::kNTriggerClasses; itrig++) {
1946 if (mask & (1ull << itrig)) {
1947 expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig),"1");
1950 expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig),"0");
1955 if ((gROOT->ProcessLineFast(expr.Data(),&error) == 0) &&
1956 (error == TInterpreter::kNoError)) {
1964 TObject* AliESDEvent::GetHLTTriggerDecision() const
1966 // get the HLT trigger decission object
1968 // cast away const'nes because the FindListObject method
1970 AliESDEvent* pNonConst=const_cast<AliESDEvent*>(this);
1971 return pNonConst->FindListObject("HLTGlobalTrigger");
1974 TString AliESDEvent::GetHLTTriggerDescription() const
1976 // get the HLT trigger decission description
1977 TString description;
1978 TObject* pDecision=GetHLTTriggerDecision();
1980 description=pDecision->GetTitle();
1986 Bool_t AliESDEvent::IsHLTTriggerFired(const char* name) const
1988 // get the HLT trigger decission description
1989 TObject* pDecision=GetHLTTriggerDecision();
1990 if (!pDecision) return kFALSE;
1992 Option_t* option=pDecision->GetOption();
1993 if (option==NULL || *option!='1') return kFALSE;
1996 TString description=GetHLTTriggerDescription();
1997 Int_t index=description.Index(name);
1998 if (index<0) return kFALSE;
1999 index+=strlen(name);
2000 if (index>=description.Length()) return kFALSE;
2001 if (description[index]!=0 && description[index]!=' ') return kFALSE;
2006 //______________________________________________________________________________
2007 Bool_t AliESDEvent::IsPileupFromSPD(Int_t minContributors,
2009 Double_t nSigmaZdist,
2010 Double_t nSigmaDiamXY,
2011 Double_t nSigmaDiamZ) const{
2013 // This function checks if there was a pile up
2014 // reconstructed with SPD
2016 Int_t nc1=fSPDVertex->GetNContributors();
2017 if(nc1<1) return kFALSE;
2018 Int_t nPileVert=GetNumberOfPileupVerticesSPD();
2019 if(nPileVert==0) return kFALSE;
2021 for(Int_t i=0; i<nPileVert;i++){
2022 const AliESDVertex* pv=GetPileupVertexSPD(i);
2023 Int_t nc2=pv->GetNContributors();
2024 if(nc2>=minContributors){
2025 Double_t z1=fSPDVertex->GetZ();
2026 Double_t z2=pv->GetZ();
2027 Double_t distZ=TMath::Abs(z2-z1);
2028 Double_t distZdiam=TMath::Abs(z2-GetDiamondZ());
2029 Double_t cutZdiam=nSigmaDiamZ*TMath::Sqrt(GetSigma2DiamondZ());
2030 if(GetSigma2DiamondZ()<0.0001)cutZdiam=99999.; //protection for missing z diamond information
2031 if(distZ>minZdist && distZdiam<cutZdiam){
2032 Double_t x2=pv->GetX();
2033 Double_t y2=pv->GetY();
2034 Double_t distXdiam=TMath::Abs(x2-GetDiamondX());
2035 Double_t distYdiam=TMath::Abs(y2-GetDiamondY());
2036 Double_t cov1[6],cov2[6];
2037 fSPDVertex->GetCovarianceMatrix(cov1);
2038 pv->GetCovarianceMatrix(cov2);
2039 Double_t errxDist=TMath::Sqrt(cov2[0]+GetSigma2DiamondX());
2040 Double_t erryDist=TMath::Sqrt(cov2[2]+GetSigma2DiamondY());
2041 Double_t errzDist=TMath::Sqrt(cov1[5]+cov2[5]);
2042 Double_t cutXdiam=nSigmaDiamXY*errxDist;
2043 if(GetSigma2DiamondX()<0.0001)cutXdiam=99999.; //protection for missing diamond information
2044 Double_t cutYdiam=nSigmaDiamXY*erryDist;
2045 if(GetSigma2DiamondY()<0.0001)cutYdiam=99999.; //protection for missing diamond information
2046 if( (distXdiam<cutXdiam) && (distYdiam<cutYdiam) && (distZ>nSigmaZdist*errzDist) ){
2055 //______________________________________________________________________________
2056 void AliESDEvent::EstimateMultiplicity(Int_t &tracklets, Int_t &trITSTPC, Int_t &trITSSApure, Double_t eta, Bool_t useDCAFlag,Bool_t useV0Flag) const
2059 // calculates 3 estimators for the multiplicity in the -eta:eta range
2060 // tracklets : using SPD tracklets only
2061 // trITSTPC : using TPC/ITS + complementary ITS SA tracks + tracklets from clusters not used by tracks
2062 // trITSSApure : using ITS standalone tracks + tracklets from clusters not used by tracks
2063 // if useDCAFlag is true: account for the ESDtrack flag marking the tracks with large DCA
2064 // if useV0Flag is true: account for the ESDtrack flag marking conversion and K0's V0s
2066 AliWarning("This obsolete method will be eliminated soon. Use AliESDtrackCuts::GetReferenceMultiplicity");
2068 tracklets = trITSSApure = trITSTPC = 0;
2069 int ntr = fSPDMult ? fSPDMult->GetNumberOfTracklets() : 0;
2072 for (int itr=ntr;itr--;) {
2073 if (TMath::Abs(fSPDMult->GetEta(itr))>eta) continue;
2075 if (fSPDMult->FreeClustersTracklet(itr,0)) trITSTPC++; // not used in ITS/TPC or ITS_SA track
2076 if (fSPDMult->FreeClustersTracklet(itr,1)) trITSSApure++; // not used in ITS_SA_Pure track
2079 // count real tracks
2080 ntr = GetNumberOfTracks();
2081 for (int itr=ntr;itr--;) {
2082 AliESDtrack *t = GetTrack(itr);
2083 if (!t) {AliFatal(Form("NULL pointer for ESD track %d",itr));}
2084 if (TMath::Abs(t->Eta())>eta) continue;
2085 if (!t->IsOn(AliESDtrack::kITSin)) continue;
2086 if (useDCAFlag && t->IsOn(AliESDtrack::kMultSec)) continue;
2087 if (useV0Flag && t->IsOn(AliESDtrack::kMultInV0)) continue;
2088 if (t->IsOn(AliESDtrack::kITSpureSA)) trITSSApure++;
2094 Bool_t AliESDEvent::IsPileupFromSPDInMultBins() const {
2095 Int_t nTracklets=GetMultiplicity()->GetNumberOfTracklets();
2096 if(nTracklets<20) return IsPileupFromSPD(3,0.8);
2097 else if(nTracklets<50) return IsPileupFromSPD(4,0.8);
2098 else return IsPileupFromSPD(5,0.8);
2101 void AliESDEvent::SetTOFHeader(const AliTOFHeader *header)
2104 // Set the TOF event_time
2108 *fTOFHeader=*header;
2109 //fTOFHeader->SetName(fgkESDListName[kTOFHeader]);
2112 // for analysis of reconstructed events
2113 // when this information is not avaliable
2114 fTOFHeader = new AliTOFHeader(*header);
2115 //AddObject(fTOFHeader);
2120 AliCentrality* AliESDEvent::GetCentrality()
2122 if (!fCentrality) fCentrality = new AliCentrality();
2126 AliEventplane* AliESDEvent::GetEventplane()
2128 if (!fEventplane) fEventplane = new AliEventplane();
2132 Float_t AliESDEvent::GetVZEROEqMultiplicity(Int_t i) const
2134 // Get VZERO Multiplicity for channel i
2135 // Themethod uses the equalization factors
2136 // stored in the ESD-run object in order to
2137 // get equal multiplicities within a VZERO rins (1/8 of VZERO)
2138 if (!fESDVZERO || !fESDRun) return -1;
2141 Float_t factorSum = 0;
2142 for(Int_t j = 8*ring; j < (8*ring+8); ++j) {
2143 factorSum += fESDRun->GetVZEROEqFactors(j);
2145 Float_t factor = fESDRun->GetVZEROEqFactors(i)*8./factorSum;
2147 return (fESDVZERO->GetMultiplicity(i)/factor);