1 /**************************************************************************
2 * Copyright(c) 1998-2007, 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 //-------------------------------------------------------------------------
20 // Author: Markus Oldenburg, CERN
21 //-------------------------------------------------------------------------
26 #include <TFriendElement.h>
27 #include <TProcessID.h>
28 #include <TCollection.h>
29 #include "Riostream.h"
30 #include "AliAODEvent.h"
31 #include "AliAODHeader.h"
32 #include "AliAODTrack.h"
33 #include "AliAODDimuon.h"
37 // definition of std AOD member names
38 const char* AliAODEvent::fAODListName[kAODListN] = {"header",
59 //______________________________________________________________________________
60 AliAODEvent::AliAODEvent() :
85 // default constructor
88 //______________________________________________________________________________
89 AliAODEvent::AliAODEvent(const AliAODEvent& aod):
91 fAODObjects(new TList()),
94 fHeader(new AliAODHeader(*aod.fHeader)),
95 fTracks(new TClonesArray(*aod.fTracks)),
96 fVertices(new TClonesArray(*aod.fVertices)),
97 fV0s(new TClonesArray(*aod.fV0s)),
98 fCascades(new TClonesArray(*aod.fCascades)),
99 fTracklets(new AliAODTracklets(*aod.fTracklets)),
100 fJets(new TClonesArray(*aod.fJets)),
101 fEmcalCells(new AliAODCaloCells(*aod.fEmcalCells)),
102 fPhosCells(new AliAODCaloCells(*aod.fPhosCells)),
103 fCaloClusters(new TClonesArray(*aod.fCaloClusters)),
104 fFmdClusters(new TClonesArray(*aod.fFmdClusters)),
105 fPmdClusters(new TClonesArray(*aod.fPmdClusters)),
106 fDimuons(new TClonesArray(*aod.fDimuons)),
107 fAODTZERO(new AliAODTZERO(*aod.fAODTZERO)),
108 fAODVZERO(new AliAODVZERO(*aod.fAODVZERO)),
109 fAODZDC(new AliAODZDC(*aod.fAODZDC))
111 ,fAODMFT(new AliAODMFT(*aod.fAODMFT))
117 AddObject(fVertices);
119 AddObject(fCascades);
120 AddObject(fTracklets);
122 AddObject(fEmcalCells);
123 AddObject(fPhosCells);
124 AddObject(fCaloClusters);
125 AddObject(fFmdClusters);
126 AddObject(fPmdClusters);
128 AddObject(fAODTZERO);
129 AddObject(fAODVZERO);
132 AddObject(fAODVZERO);
134 fConnected = aod.fConnected;
139 //______________________________________________________________________________
140 AliAODEvent & AliAODEvent::operator=(const AliAODEvent& aod) {
142 // Assignment operator
144 if(&aod == this) return *this;
145 AliVEvent::operator=(aod);
147 // This assumes that the list is already created
148 // and that the virtual void Copy(Tobject&) function
149 // is correctly implemented in the derived class
150 // otherwise only TObject::Copy() will be used
152 if((fAODObjects->GetSize()==0)&&(aod.fAODObjects->GetSize()>=kAODListN)){
153 // We cover the case that we do not yet have the
154 // standard content but the source has it
158 // Here we have the standard content without user additions, but the content is
159 // not matching the aod source.
161 // Iterate the list of source objects
162 TIter next(aod.GetList());
165 while ((its = next())) {
166 name = its->GetName();
167 // Check if we have this object type in out list
168 TObject *mine = fAODObjects->FindObject(name);
170 // We have to create the same type of object.
171 TClass* pClass=TClass::GetClass(its->ClassName());
173 AliWarning(Form("Can not find class description for entry %s (%s)\n",
174 its->ClassName(), name.Data()));
177 mine=(TObject*)pClass->New();
179 // not in this: can be added to list
180 AliWarning(Form("%s:%d Could not find %s for copying \n",
181 (char*)__FILE__,__LINE__,name.Data()));
184 if(mine->InheritsFrom("TNamed")) {
185 ((TNamed*)mine)->SetName(name);
186 } else if(mine->InheritsFrom("TCollection")){
187 if(mine->InheritsFrom("TClonesArray")) {
188 TClonesArray *itscl = dynamic_cast<TClonesArray*>(its);
190 AliWarning(Form("Class description for entry %s (%s) not TClonesArray\n",
191 its->ClassName(), name.Data()));
195 dynamic_cast<TClonesArray*>(mine)->SetClass(itscl->GetClass(), itscl->GetSize());
197 dynamic_cast<TCollection*>(mine)->SetName(name);
199 AliDebug(1, Form("adding object %s of type %s", mine->GetName(), mine->ClassName()));
202 // Now we have an object of the same type and name, but different content.
203 if(!its->InheritsFrom("TCollection")){
204 // simple objects (do they have a Copy method that calls operator= ?)
206 } else if (its->InheritsFrom("TClonesArray")) {
207 // Create or expand the tclonesarray pointers
208 // so we can directly copy to the object
209 TClonesArray *its_tca = (TClonesArray*)its;
210 TClonesArray *mine_tca = (TClonesArray*)mine;
211 // this leaves the capacity of the TClonesArray the same
212 // except for a factor of 2 increase when size > capacity
213 // does not release any memory occupied by the tca
214 Int_t its_entries = its_tca->GetEntriesFast();
215 mine_tca->ExpandCreate(its_entries);
216 for(int i=0; i<its_entries; i++){
218 TObject *mine_tca_obj = mine_tca->At(i);
219 TObject *its_tca_obj = its_tca->At(i);
220 // no need to delete first
221 // pointers within the class should be handled by Copy()...
222 // Can there be Empty slots?
223 its_tca_obj->Copy(*mine_tca_obj);
226 AliWarning(Form("%s:%d cannot copy TCollection \n",
227 (char*)__FILE__,__LINE__));
230 fConnected = aod.fConnected;
235 //______________________________________________________________________________
236 AliAODEvent::~AliAODEvent()
240 fAODObjects->Delete("slow");
246 //______________________________________________________________________________
247 void AliAODEvent::AddObject(TObject* obj)
249 // Add an object to the list of objects.
250 // Please be aware that in order to increase performance you should
251 // refrain from using TObjArrays (if possible). Use TClonesArrays, instead.
253 if ( !fAODObjects->FindObject(obj) )
255 fAODObjects->AddLast(obj);
259 //______________________________________________________________________________
260 void AliAODEvent::RemoveObject(TObject* obj)
262 // Removes an object from the list of objects.
264 fAODObjects->Remove(obj);
267 //______________________________________________________________________________
268 TObject *AliAODEvent::FindListObject(const char *objName) const
270 // Return the pointer to the object with the given name.
272 return fAODObjects->FindObject(objName);
275 //______________________________________________________________________________
276 void AliAODEvent::CreateStdContent()
278 // create the standard AOD content and set pointers
280 // create standard objects and add them to the TList of objects
281 AddObject(new AliAODHeader());
282 AddObject(new TClonesArray("AliAODTrack", 0));
283 AddObject(new TClonesArray("AliAODVertex", 0));
284 AddObject(new TClonesArray("AliAODv0", 0));
285 AddObject(new TClonesArray("AliAODcascade", 0));
286 AddObject(new AliAODTracklets());
287 AddObject(new TClonesArray("AliAODJet", 0));
288 AddObject(new AliAODCaloCells());
289 AddObject(new AliAODCaloCells());
290 AddObject(new TClonesArray("AliAODCaloCluster", 0));
291 AddObject(new TClonesArray("AliAODFmdCluster", 0));
292 AddObject(new TClonesArray("AliAODPmdCluster", 0));
293 AddObject(new TClonesArray("AliAODDimuon", 0));
294 AddObject(new AliAODTZERO());
295 AddObject(new AliAODVZERO());
296 AddObject(new AliAODZDC());
298 AddObject(new AliAODMFT());
303 // read back pointers
309 void AliAODEvent::MakeEntriesReferencable()
311 // Make all entries referencable in a subsequent process
313 TIter next(fAODObjects);
315 while ((obj = next()))
317 if(obj->InheritsFrom("TCollection"))
319 AssignIDtoCollection((TCollection*)obj);
324 //______________________________________________________________________________
325 void AliAODEvent::SetStdNames()
327 // introduce the standard naming
329 if(fAODObjects->GetEntries()==kAODListN){
330 for(int i = 0;i < fAODObjects->GetEntries();i++){
331 TObject *fObj = fAODObjects->At(i);
332 if(fObj->InheritsFrom("TNamed")){
333 ((TNamed*)fObj)->SetName(fAODListName[i]);
335 else if(fObj->InheritsFrom("TClonesArray")){
336 ((TClonesArray*)fObj)->SetName(fAODListName[i]);
341 printf("%s:%d SetStdNames() Wrong number of Std Entries \n",(char*)__FILE__,__LINE__);
345 void AliAODEvent::CreateStdFolders()
347 // Create the standard folder structure
348 if(fAODFolder)delete fAODFolder;
349 fAODFolder = gROOT->GetRootFolder()->AddFolder("AOD", "AOD");
350 if(fAODObjects->GetEntries()==kAODListN){
351 for(int i = 0;i < fAODObjects->GetEntries();i++){
352 TObject *fObj = fAODObjects->At(i);
353 if(fObj->InheritsFrom("TClonesArray")){
354 fAODFolder->AddFolder(fAODListName[i], fAODListName[i], (TCollection*) fObj);
356 fAODFolder->AddFolder(fAODListName[i], fAODListName[i], 0);
361 printf("%s:%d CreateStdFolders() Wrong number of Std Entries \n",(char*)__FILE__,__LINE__);
365 //______________________________________________________________________________
366 void AliAODEvent::GetStdContent()
368 // set pointers for standard content
370 fHeader = (AliAODHeader*)fAODObjects->FindObject("header");
371 fTracks = (TClonesArray*)fAODObjects->FindObject("tracks");
372 fVertices = (TClonesArray*)fAODObjects->FindObject("vertices");
373 fV0s = (TClonesArray*)fAODObjects->FindObject("v0s");
374 fCascades = (TClonesArray*)fAODObjects->FindObject("cascades");
375 fTracklets = (AliAODTracklets*)fAODObjects->FindObject("tracklets");
376 fJets = (TClonesArray*)fAODObjects->FindObject("jets");
377 fEmcalCells = (AliAODCaloCells*)fAODObjects->FindObject("emcalCells");
378 fPhosCells = (AliAODCaloCells*)fAODObjects->FindObject("phosCells");
379 fCaloClusters = (TClonesArray*)fAODObjects->FindObject("caloClusters");
380 fFmdClusters = (TClonesArray*)fAODObjects->FindObject("fmdClusters");
381 fPmdClusters = (TClonesArray*)fAODObjects->FindObject("pmdClusters");
382 fDimuons = (TClonesArray*)fAODObjects->FindObject("dimuons");
383 fAODTZERO = (AliAODTZERO*)fAODObjects->FindObject("AliAODTZERO");
384 fAODVZERO = (AliAODVZERO*)fAODObjects->FindObject("AliAODVZERO");
385 fAODZDC = (AliAODZDC*)fAODObjects->FindObject("AliAODZDC");
387 fAODMFT = (AliAODMFT*)fAODObjects->FindObject("AliAODMFT");
391 //______________________________________________________________________________
392 void AliAODEvent::ResetStd(Int_t trkArrSize,
395 Int_t cascadeArrSize,
403 // deletes content of standard arrays and resets size
407 if (trkArrSize > fTracks->GetSize())
408 fTracks->Expand(trkArrSize);
412 if (vtxArrSize > fVertices->GetSize())
413 fVertices->Expand(vtxArrSize);
417 if (v0ArrSize > fV0s->GetSize())
418 fV0s->Expand(v0ArrSize);
422 if (cascadeArrSize > fCascades->GetSize())
423 fCascades->Expand(cascadeArrSize);
427 if (jetSize > fJets->GetSize())
428 fJets->Expand(jetSize);
431 fCaloClusters->Delete();
432 if (caloClusSize > fCaloClusters->GetSize())
433 fCaloClusters->Expand(caloClusSize);
436 fFmdClusters->Delete();
437 if (fmdClusSize > fFmdClusters->GetSize())
438 fFmdClusters->Expand(fmdClusSize);
441 fPmdClusters->Delete();
442 if (pmdClusSize > fPmdClusters->GetSize())
443 fPmdClusters->Expand(pmdClusSize);
447 if (dimuonArrSize > fDimuons->GetSize())
448 fDimuons->Expand(dimuonArrSize);
451 fTracklets->DeleteContainer();
453 fPhosCells->DeleteContainer();
455 fEmcalCells->DeleteContainer();
458 void AliAODEvent::ClearStd()
460 // clears the standard arrays
466 fVertices ->Delete();
470 fCascades ->Delete();
472 fTracklets ->DeleteContainer();
476 fEmcalCells ->DeleteContainer();
478 fPhosCells ->DeleteContainer();
480 fCaloClusters ->Delete();
482 fFmdClusters ->Clear();
484 fPmdClusters ->Clear();
489 //_________________________________________________________________
490 Int_t AliAODEvent::GetPHOSClusters(TRefArray *clusters) const
492 // fills the provided TRefArray with all found phos clusters
496 AliAODCaloCluster *cl = 0;
497 Bool_t first = kTRUE;
498 for (Int_t i = 0; i < GetNumberOfCaloClusters() ; i++) {
499 if ( (cl = GetCaloCluster(i)) ) {
502 new (clusters) TRefArray(TProcessID::GetProcessWithUID(cl));
506 //printf("IsPHOS cluster %d, E %2.3f Size: %d \n",i,cl->E(),clusters->GetEntriesFast());
510 return clusters->GetEntriesFast();
513 //_________________________________________________________________
514 Int_t AliAODEvent::GetEMCALClusters(TRefArray *clusters) const
516 // fills the provided TRefArray with all found emcal clusters
519 AliAODCaloCluster *cl = 0;
520 Bool_t first = kTRUE;
521 for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) {
522 if ( (cl = GetCaloCluster(i)) ) {
525 new (clusters) TRefArray(TProcessID::GetProcessWithUID(cl));
529 //printf("IsEMCal cluster %d, E %2.3f Size: %d \n",i,cl->E(),clusters->GetEntriesFast());
533 return clusters->GetEntriesFast();
537 //______________________________________________________________________________
538 Int_t AliAODEvent::GetMuonTracks(TRefArray *muonTracks) const
540 // fills the provided TRefArray with all found muon tracks
544 AliAODTrack *track = 0;
545 for (Int_t iTrack = 0; iTrack < GetNTracks(); iTrack++) {
546 track = GetTrack(iTrack);
547 if (track->IsMuonTrack()) {
548 muonTracks->Add(track);
552 return muonTracks->GetEntriesFast();
556 //______________________________________________________________________________
557 Int_t AliAODEvent::GetNumberOfMuonTracks() const
559 // get number of muon tracks
561 for (Int_t iTrack = 0; iTrack < GetNTracks(); iTrack++) {
562 if ((GetTrack(iTrack))->IsMuonTrack()) {
570 //______________________________________________________________________________
571 void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
573 // Connects aod event to tree
576 AliWarning("Zero Pointer to Tree \n");
580 if(!tree->GetTree())tree->LoadTree(0);
582 // Try to find AliAODEvent
583 AliAODEvent *aodEvent = 0;
584 aodEvent = (AliAODEvent*)tree->GetTree()->GetUserInfo()->FindObject("AliAODEvent");
586 // This event is connected to the tree by definition, just say so
587 aodEvent->SetConnected();
588 // Check if already connected to tree
589 TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("AODObjectsConnectedToTree"));
590 if (connectedList && (strcmp(opt, "reconnect"))) {
591 // If connected use the connected list of objects
593 fAODObjects = connectedList;
599 // prevent a memory leak when reading back the TList
600 // if (!(strcmp(opt, "reconnect"))) fAODObjects->Delete();
602 // create a new TList from the UserInfo TList...
603 // copy constructor does not work...
604 // fAODObjects = (TList*)(aodEvent->GetList()->Clone());
605 fAODObjects = (TList*)aodEvent->GetList();
606 fAODObjects->SetOwner(kTRUE);
607 if(fAODObjects->GetEntries()<kAODListN)
609 AliWarning(Form("AliAODEvent::ReadFromTree() TList contains less than the standard contents %d < %d"
610 " That might be fine though (at least for filtered AODs)",fAODObjects->GetEntries(),kAODListN));
613 // Let's find out whether we have friends
614 TList* friendL = tree->GetTree()->GetListOfFriends();
619 while ((fe = (TFriendElement*)next())){
620 aodEvent = (AliAODEvent*)(fe->GetTree()->GetUserInfo()->FindObject("AliAODEvent"));
622 printf("No UserInfo on tree \n");
625 // TList* objL = (TList*)(aodEvent->GetList()->Clone());
626 TList* objL = (TList*)aodEvent->GetList();
627 printf("Get list of object from tree %d !!\n", objL->GetEntries());
628 TIter nextobject(objL);
630 while((obj = nextobject()))
632 printf("Adding object from friend %s !\n", obj->GetName());
633 fAODObjects->Add(obj);
634 } // object "branch" loop
638 // set the branch addresses
639 TIter next(fAODObjects);
641 while((el=(TNamed*)next())){
642 TString bname(el->GetName());
643 // check if branch exists under this Name
644 TBranch *br = tree->GetTree()->GetBranch(bname.Data());
646 tree->SetBranchAddress(bname.Data(),fAODObjects->GetObjectRef(el));
648 br = tree->GetBranch(Form("%s.",bname.Data()));
650 tree->SetBranchAddress(Form("%s.",bname.Data()),fAODObjects->GetObjectRef(el));
653 printf("%s %d AliAODEvent::ReadFromTree() No Branch found with Name %s. \n",
654 (char*)__FILE__,__LINE__,bname.Data());
659 // when reading back we are not owner of the list
660 // must not delete it
661 fAODObjects->SetOwner(kTRUE);
662 fAODObjects->SetName("AODObjectsConnectedToTree");
663 // we are not owner of the list objects
664 // must not delete it
665 tree->GetUserInfo()->Add(fAODObjects);
669 // we can't get the list from the user data, create standard content
670 // and set it by hand
672 TIter next(fAODObjects);
674 while((el=(TNamed*)next())){
675 TString bname(el->GetName());
676 tree->SetBranchAddress(bname.Data(),fAODObjects->GetObjectRef(el));
679 // when reading back we are not owner of the list
680 // must not delete it
681 fAODObjects->SetOwner(kTRUE);
684 //______________________________________________________________________________
685 Int_t AliAODEvent::GetNumberOfPileupVerticesSPD() const{
686 // count number of SPD pileup vertices
687 Int_t nVertices=GetNumberOfVertices();
688 Int_t nPileupVertices=0;
689 for(Int_t iVert=0; iVert<nVertices; iVert++){
690 AliAODVertex *v=GetVertex(iVert);
691 if(v->GetType()==AliAODVertex::kPileupSPD) nPileupVertices++;
693 return nPileupVertices;
695 //______________________________________________________________________________
696 Int_t AliAODEvent::GetNumberOfPileupVerticesTracks() const{
697 // count number of track pileup vertices
698 Int_t nVertices=GetNumberOfVertices();
699 Int_t nPileupVertices=0;
700 for(Int_t iVert=0; iVert<nVertices; iVert++){
701 AliAODVertex *v=GetVertex(iVert);
702 if(v->GetType()==AliAODVertex::kPileupTracks) nPileupVertices++;
704 return nPileupVertices;
706 //______________________________________________________________________________
707 AliAODVertex* AliAODEvent::GetPrimaryVertexSPD() const{
708 // Get SPD primary vertex
709 Int_t nVertices=GetNumberOfVertices();
710 for(Int_t iVert=0; iVert<nVertices; iVert++){
711 AliAODVertex *v=GetVertex(iVert);
712 if(v->GetType()==AliAODVertex::kMainSPD) return v;
716 //______________________________________________________________________________
717 AliAODVertex* AliAODEvent::GetPileupVertexSPD(Int_t iV) const{
718 // Get pile-up vertex iV
719 Int_t nVertices=GetNumberOfVertices();
721 for(Int_t iVert=0; iVert<nVertices; iVert++){
722 AliAODVertex *v=GetVertex(iVert);
723 if(v->GetType()==AliAODVertex::kPileupSPD){
724 if(counter==iV) return v;
730 //______________________________________________________________________________
731 AliAODVertex* AliAODEvent::GetPileupVertexTracks(Int_t iV) const{
732 // Get pile-up vertex iV
733 Int_t nVertices=GetNumberOfVertices();
735 for(Int_t iVert=0; iVert<nVertices; iVert++){
736 AliAODVertex *v=GetVertex(iVert);
737 if(v->GetType()==AliAODVertex::kPileupTracks){
738 if(counter==iV) return v;
744 //______________________________________________________________________________
745 Bool_t AliAODEvent::IsPileupFromSPD(Int_t minContributors,
747 Double_t nSigmaZdist,
748 Double_t nSigmaDiamXY,
749 Double_t nSigmaDiamZ) const{
751 // This function checks if there was a pile up
752 // reconstructed with SPD
754 AliAODVertex *mainV=GetPrimaryVertexSPD();
755 if(!mainV) return kFALSE;
756 Int_t nc1=mainV->GetNContributors();
757 if(nc1<1) return kFALSE;
758 Int_t nPileVert=GetNumberOfPileupVerticesSPD();
759 if(nPileVert==0) return kFALSE;
760 Int_t nVertices=GetNumberOfVertices();
762 for(Int_t iVert=0; iVert<nVertices; iVert++){
763 AliAODVertex *pv=GetVertex(iVert);
764 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
765 Int_t nc2=pv->GetNContributors();
766 if(nc2>=minContributors){
767 Double_t z1=mainV->GetZ();
768 Double_t z2=pv->GetZ();
769 Double_t distZ=TMath::Abs(z2-z1);
770 Double_t distZdiam=TMath::Abs(z2-GetDiamondZ());
771 Double_t cutZdiam=nSigmaDiamZ*TMath::Sqrt(GetSigma2DiamondZ());
772 if(GetSigma2DiamondZ()<0.0001)cutZdiam=99999.; //protection for missing z diamond information
773 if(distZ>minZdist && distZdiam<cutZdiam){
774 Double_t x2=pv->GetX();
775 Double_t y2=pv->GetY();
776 Double_t distXdiam=TMath::Abs(x2-GetDiamondX());
777 Double_t distYdiam=TMath::Abs(y2-GetDiamondY());
778 Double_t cov1[6],cov2[6];
779 mainV->GetCovarianceMatrix(cov1);
780 pv->GetCovarianceMatrix(cov2);
781 Double_t errxDist=TMath::Sqrt(cov2[0]+GetSigma2DiamondX());
782 Double_t erryDist=TMath::Sqrt(cov2[2]+GetSigma2DiamondY());
783 Double_t errzDist=TMath::Sqrt(cov1[5]+cov2[5]);
784 Double_t cutXdiam=nSigmaDiamXY*errxDist;
785 if(GetSigma2DiamondX()<0.0001)cutXdiam=99999.; //protection for missing diamond information
786 Double_t cutYdiam=nSigmaDiamXY*erryDist;
787 if(GetSigma2DiamondY()<0.0001)cutYdiam=99999.; //protection for missing diamond information
788 if( (distXdiam<cutXdiam) && (distYdiam<cutYdiam) && (distZ>nSigmaZdist*errzDist) ){
797 //______________________________________________________________________________
798 void AliAODEvent::Print(Option_t *) const
800 // Print the names of the all branches
801 TIter next(fAODObjects);
803 Printf(">>>>> AOD Content <<<<<");
804 while((el=(TNamed*)next())){
805 Printf(">> %s ",el->GetName());
807 Printf(">>>>> <<<<<");
812 void AliAODEvent::AssignIDtoCollection(const TCollection* col)
814 // Static method which assigns a ID to each object in a collection
815 // In this way the objects are marked as referenced and written with
816 // an ID. This has the advantage that TRefs to this objects can be
817 // written by a subsequent process.
820 while ((obj = next()))
821 TProcessID::AssignID(obj);
824 Bool_t AliAODEvent::IsPileupFromSPDInMultBins() const {
825 Int_t nTracklets=GetTracklets()->GetNumberOfTracklets();
826 if(nTracklets<20) return IsPileupFromSPD(3,0.8);
827 else if(nTracklets<50) return IsPileupFromSPD(4,0.8);
828 else return IsPileupFromSPD(5,0.8);
831 Float_t AliAODEvent::GetVZEROEqMultiplicity(Int_t i) const
833 // Get VZERO Multiplicity for channel i
834 // Themethod uses the equalization factors
835 // stored in the ESD-run object in order to
836 // get equal multiplicities within a VZERO rins (1/8 of VZERO)
837 if (!fAODVZERO || !fHeader) return -1;
840 Float_t factorSum = 0;
841 for(Int_t j = 8*ring; j < (8*ring+8); ++j) {
842 factorSum += fHeader->GetVZEROEqFactors(j);
844 Float_t factor = fHeader->GetVZEROEqFactors(i)*8./factorSum;
846 return (fAODVZERO->GetMultiplicity(i)/factor);