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",
61 //______________________________________________________________________________
62 AliAODEvent::AliAODEvent() :
89 // default constructor
92 //______________________________________________________________________________
93 AliAODEvent::AliAODEvent(const AliAODEvent& aod):
95 fAODObjects(new TList()),
98 fHeader(new AliAODHeader(*aod.fHeader)),
99 fTracks(new TClonesArray(*aod.fTracks)),
100 fVertices(new TClonesArray(*aod.fVertices)),
101 fV0s(new TClonesArray(*aod.fV0s)),
102 fCascades(new TClonesArray(*aod.fCascades)),
103 fTracklets(new AliAODTracklets(*aod.fTracklets)),
104 fJets(new TClonesArray(*aod.fJets)),
105 fEmcalCells(new AliAODCaloCells(*aod.fEmcalCells)),
106 fPhosCells(new AliAODCaloCells(*aod.fPhosCells)),
107 fCaloClusters(new TClonesArray(*aod.fCaloClusters)),
108 fEMCALTrigger(new AliAODCaloTrigger(*aod.fEMCALTrigger)),
109 fPHOSTrigger(new AliAODCaloTrigger(*aod.fPHOSTrigger)),
110 fFmdClusters(new TClonesArray(*aod.fFmdClusters)),
111 fPmdClusters(new TClonesArray(*aod.fPmdClusters)),
112 fDimuons(new TClonesArray(*aod.fDimuons)),
113 fAODTZERO(new AliAODTZERO(*aod.fAODTZERO)),
114 fAODVZERO(new AliAODVZERO(*aod.fAODVZERO)),
115 fAODZDC(new AliAODZDC(*aod.fAODZDC))
117 ,fAODMFT(new AliAODMFT(*aod.fAODMFT))
123 AddObject(fVertices);
125 AddObject(fCascades);
126 AddObject(fTracklets);
128 AddObject(fEmcalCells);
129 AddObject(fPhosCells);
130 AddObject(fCaloClusters);
131 AddObject(fEMCALTrigger);
132 AddObject(fPHOSTrigger);
133 AddObject(fFmdClusters);
134 AddObject(fPmdClusters);
136 AddObject(fAODTZERO);
137 AddObject(fAODVZERO);
140 AddObject(fAODVZERO);
142 fConnected = aod.fConnected;
147 //______________________________________________________________________________
148 AliAODEvent & AliAODEvent::operator=(const AliAODEvent& aod) {
150 // Assignment operator
152 if(&aod == this) return *this;
153 AliVEvent::operator=(aod);
155 // This assumes that the list is already created
156 // and that the virtual void Copy(Tobject&) function
157 // is correctly implemented in the derived class
158 // otherwise only TObject::Copy() will be used
160 if((fAODObjects->GetSize()==0)&&(aod.fAODObjects->GetSize()>=kAODListN)){
161 // We cover the case that we do not yet have the
162 // standard content but the source has it
166 // Here we have the standard content without user additions, but the content is
167 // not matching the aod source.
169 // Iterate the list of source objects
170 TIter next(aod.GetList());
173 while ((its = next())) {
174 name = its->GetName();
175 // Check if we have this object type in out list
176 TObject *mine = fAODObjects->FindObject(name);
178 // We have to create the same type of object.
179 TClass* pClass=TClass::GetClass(its->ClassName());
181 AliWarning(Form("Can not find class description for entry %s (%s)\n",
182 its->ClassName(), name.Data()));
185 mine=(TObject*)pClass->New();
187 // not in this: can be added to list
188 AliWarning(Form("%s:%d Could not find %s for copying \n",
189 (char*)__FILE__,__LINE__,name.Data()));
192 if(mine->InheritsFrom("TNamed")) {
193 ((TNamed*)mine)->SetName(name);
194 } else if(mine->InheritsFrom("TCollection")){
195 if(mine->InheritsFrom("TClonesArray")) {
196 TClonesArray *itscl = dynamic_cast<TClonesArray*>(its);
198 AliWarning(Form("Class description for entry %s (%s) not TClonesArray\n",
199 its->ClassName(), name.Data()));
203 dynamic_cast<TClonesArray*>(mine)->SetClass(itscl->GetClass(), itscl->GetSize());
205 dynamic_cast<TCollection*>(mine)->SetName(name);
207 AliDebug(1, Form("adding object %s of type %s", mine->GetName(), mine->ClassName()));
210 // Now we have an object of the same type and name, but different content.
211 if(!its->InheritsFrom("TCollection")){
212 // simple objects (do they have a Copy method that calls operator= ?)
214 } else if (its->InheritsFrom("TClonesArray")) {
215 // Create or expand the tclonesarray pointers
216 // so we can directly copy to the object
217 TClonesArray *its_tca = (TClonesArray*)its;
218 TClonesArray *mine_tca = (TClonesArray*)mine;
219 // this leaves the capacity of the TClonesArray the same
220 // except for a factor of 2 increase when size > capacity
221 // does not release any memory occupied by the tca
222 Int_t its_entries = its_tca->GetEntriesFast();
223 mine_tca->ExpandCreate(its_entries);
224 for(int i=0; i<its_entries; i++){
226 TObject *mine_tca_obj = mine_tca->At(i);
227 TObject *its_tca_obj = its_tca->At(i);
228 // no need to delete first
229 // pointers within the class should be handled by Copy()...
230 // Can there be Empty slots?
231 its_tca_obj->Copy(*mine_tca_obj);
234 AliWarning(Form("%s:%d cannot copy TCollection \n",
235 (char*)__FILE__,__LINE__));
238 fConnected = aod.fConnected;
243 //______________________________________________________________________________
244 AliAODEvent::~AliAODEvent()
248 fAODObjects->Delete("slow");
254 //______________________________________________________________________________
255 void AliAODEvent::AddObject(TObject* obj)
257 // Add an object to the list of objects.
258 // Please be aware that in order to increase performance you should
259 // refrain from using TObjArrays (if possible). Use TClonesArrays, instead.
261 if ( !fAODObjects ) {
262 fAODObjects = new TList();
263 fAODObjects->SetOwner();
265 if ( !fAODObjects->FindObject(obj) )
267 fAODObjects->AddLast(obj);
271 //______________________________________________________________________________
272 void AliAODEvent::RemoveObject(TObject* obj)
274 // Removes an object from the list of objects.
276 fAODObjects->Remove(obj);
279 //______________________________________________________________________________
280 TObject *AliAODEvent::FindListObject(const char *objName) const
282 // Return the pointer to the object with the given name.
284 return fAODObjects->FindObject(objName);
287 //______________________________________________________________________________
288 void AliAODEvent::CreateStdContent()
290 // create the standard AOD content and set pointers
292 // create standard objects and add them to the TList of objects
293 AddObject(new AliAODHeader());
294 AddObject(new TClonesArray("AliAODTrack", 0));
295 AddObject(new TClonesArray("AliAODVertex", 0));
296 AddObject(new TClonesArray("AliAODv0", 0));
297 AddObject(new TClonesArray("AliAODcascade", 0));
298 AddObject(new AliAODTracklets());
299 AddObject(new TClonesArray("AliAODJet", 0));
300 AddObject(new AliAODCaloCells());
301 AddObject(new AliAODCaloCells());
302 AddObject(new TClonesArray("AliAODCaloCluster", 0));
303 AddObject(new AliAODCaloTrigger()); // EMCAL
304 AddObject(new AliAODCaloTrigger()); // PHOS
305 AddObject(new TClonesArray("AliAODFmdCluster", 0));
306 AddObject(new TClonesArray("AliAODPmdCluster", 0));
307 AddObject(new TClonesArray("AliAODDimuon", 0));
308 AddObject(new AliAODTZERO());
309 AddObject(new AliAODVZERO());
310 AddObject(new AliAODZDC());
312 AddObject(new AliAODMFT());
317 // read back pointers
323 void AliAODEvent::MakeEntriesReferencable()
325 // Make all entries referencable in a subsequent process
327 TIter next(fAODObjects);
329 while ((obj = next()))
331 if(obj->InheritsFrom("TCollection"))
333 AssignIDtoCollection((TCollection*)obj);
338 //______________________________________________________________________________
339 void AliAODEvent::SetStdNames()
341 // introduce the standard naming
343 if(fAODObjects->GetEntries()==kAODListN){
344 for(int i = 0;i < fAODObjects->GetEntries();i++){
345 TObject *fObj = fAODObjects->At(i);
346 if(fObj->InheritsFrom("TNamed")){
347 ((TNamed*)fObj)->SetName(fAODListName[i]);
349 else if(fObj->InheritsFrom("TClonesArray")){
350 ((TClonesArray*)fObj)->SetName(fAODListName[i]);
355 printf("%s:%d SetStdNames() Wrong number of Std Entries \n",(char*)__FILE__,__LINE__);
359 void AliAODEvent::CreateStdFolders()
361 // Create the standard folder structure
362 if(fAODFolder)delete fAODFolder;
363 fAODFolder = gROOT->GetRootFolder()->AddFolder("AOD", "AOD");
364 if(fAODObjects->GetEntries()==kAODListN){
365 for(int i = 0;i < fAODObjects->GetEntries();i++){
366 TObject *fObj = fAODObjects->At(i);
367 if(fObj->InheritsFrom("TClonesArray")){
368 fAODFolder->AddFolder(fAODListName[i], fAODListName[i], (TCollection*) fObj);
370 fAODFolder->AddFolder(fAODListName[i], fAODListName[i], 0);
375 printf("%s:%d CreateStdFolders() Wrong number of Std Entries \n",(char*)__FILE__,__LINE__);
379 //______________________________________________________________________________
380 void AliAODEvent::GetStdContent()
382 // set pointers for standard content
384 fHeader = (AliAODHeader*)fAODObjects->FindObject("header");
385 fTracks = (TClonesArray*)fAODObjects->FindObject("tracks");
386 fVertices = (TClonesArray*)fAODObjects->FindObject("vertices");
387 fV0s = (TClonesArray*)fAODObjects->FindObject("v0s");
388 fCascades = (TClonesArray*)fAODObjects->FindObject("cascades");
389 fTracklets = (AliAODTracklets*)fAODObjects->FindObject("tracklets");
390 fJets = (TClonesArray*)fAODObjects->FindObject("jets");
391 fEmcalCells = (AliAODCaloCells*)fAODObjects->FindObject("emcalCells");
392 fPhosCells = (AliAODCaloCells*)fAODObjects->FindObject("phosCells");
393 fCaloClusters = (TClonesArray*)fAODObjects->FindObject("caloClusters");
394 fEMCALTrigger = (AliAODCaloTrigger*)fAODObjects->FindObject("emcalTrigger");
395 fPHOSTrigger = (AliAODCaloTrigger*)fAODObjects->FindObject("phosTrigger");
396 fFmdClusters = (TClonesArray*)fAODObjects->FindObject("fmdClusters");
397 fPmdClusters = (TClonesArray*)fAODObjects->FindObject("pmdClusters");
398 fDimuons = (TClonesArray*)fAODObjects->FindObject("dimuons");
399 fAODTZERO = (AliAODTZERO*)fAODObjects->FindObject("AliAODTZERO");
400 fAODVZERO = (AliAODVZERO*)fAODObjects->FindObject("AliAODVZERO");
401 fAODZDC = (AliAODZDC*)fAODObjects->FindObject("AliAODZDC");
403 fAODMFT = (AliAODMFT*)fAODObjects->FindObject("AliAODMFT");
407 //______________________________________________________________________________
408 void AliAODEvent::ResetStd(Int_t trkArrSize,
411 Int_t cascadeArrSize,
419 // deletes content of standard arrays and resets size
423 if (trkArrSize > fTracks->GetSize())
424 fTracks->Expand(trkArrSize);
428 if (vtxArrSize > fVertices->GetSize())
429 fVertices->Expand(vtxArrSize);
433 if (v0ArrSize > fV0s->GetSize())
434 fV0s->Expand(v0ArrSize);
438 if (cascadeArrSize > fCascades->GetSize())
439 fCascades->Expand(cascadeArrSize);
443 if (jetSize > fJets->GetSize())
444 fJets->Expand(jetSize);
447 fCaloClusters->Delete();
448 if (caloClusSize > fCaloClusters->GetSize())
449 fCaloClusters->Expand(caloClusSize);
452 fFmdClusters->Delete();
453 if (fmdClusSize > fFmdClusters->GetSize())
454 fFmdClusters->Expand(fmdClusSize);
457 fPmdClusters->Delete();
458 if (pmdClusSize > fPmdClusters->GetSize())
459 fPmdClusters->Expand(pmdClusSize);
463 if (dimuonArrSize > fDimuons->GetSize())
464 fDimuons->Expand(dimuonArrSize);
467 fTracklets->DeleteContainer();
469 fPhosCells->DeleteContainer();
471 fEmcalCells->DeleteContainer();
474 fEMCALTrigger->DeAllocate();
476 fPHOSTrigger->DeAllocate();
479 void AliAODEvent::ClearStd()
481 // clears the standard arrays
487 fVertices ->Delete();
491 fCascades ->Delete();
493 fTracklets ->DeleteContainer();
497 fEmcalCells ->DeleteContainer();
499 fPhosCells ->DeleteContainer();
501 fCaloClusters ->Delete();
503 fFmdClusters ->Clear();
505 fPmdClusters ->Clear();
510 fEMCALTrigger->DeAllocate();
512 fPHOSTrigger->DeAllocate();
515 //_________________________________________________________________
516 Int_t AliAODEvent::GetPHOSClusters(TRefArray *clusters) const
518 // fills the provided TRefArray with all found phos clusters
522 AliAODCaloCluster *cl = 0;
523 Bool_t first = kTRUE;
524 for (Int_t i = 0; i < GetNumberOfCaloClusters() ; i++) {
525 if ( (cl = GetCaloCluster(i)) ) {
528 new (clusters) TRefArray(TProcessID::GetProcessWithUID(cl));
532 //printf("IsPHOS cluster %d, E %2.3f Size: %d \n",i,cl->E(),clusters->GetEntriesFast());
536 return clusters->GetEntriesFast();
539 //_________________________________________________________________
540 Int_t AliAODEvent::GetEMCALClusters(TRefArray *clusters) const
542 // fills the provided TRefArray with all found emcal clusters
545 AliAODCaloCluster *cl = 0;
546 Bool_t first = kTRUE;
547 for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) {
548 if ( (cl = GetCaloCluster(i)) ) {
551 new (clusters) TRefArray(TProcessID::GetProcessWithUID(cl));
555 //printf("IsEMCal cluster %d, E %2.3f Size: %d \n",i,cl->E(),clusters->GetEntriesFast());
559 return clusters->GetEntriesFast();
563 //______________________________________________________________________________
564 Int_t AliAODEvent::GetMuonTracks(TRefArray *muonTracks) const
566 // fills the provided TRefArray with all found muon tracks
570 AliAODTrack *track = 0;
571 for (Int_t iTrack = 0; iTrack < GetNTracks(); iTrack++) {
572 track = GetTrack(iTrack);
573 if (track->IsMuonTrack()) {
574 muonTracks->Add(track);
578 return muonTracks->GetEntriesFast();
582 //______________________________________________________________________________
583 Int_t AliAODEvent::GetNumberOfMuonTracks() const
585 // get number of muon tracks
587 for (Int_t iTrack = 0; iTrack < GetNTracks(); iTrack++) {
588 if ((GetTrack(iTrack))->IsMuonTrack()) {
596 //______________________________________________________________________________
597 void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
599 // Connects aod event to tree
602 AliWarning("Zero Pointer to Tree \n");
606 if(!tree->GetTree())tree->LoadTree(0);
608 // Try to find AliAODEvent
609 AliAODEvent *aodEvent = 0;
610 aodEvent = (AliAODEvent*)tree->GetTree()->GetUserInfo()->FindObject("AliAODEvent");
612 // This event is connected to the tree by definition, just say so
613 aodEvent->SetConnected();
614 // Check if already connected to tree
615 TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("AODObjectsConnectedToTree"));
616 if (connectedList && (strcmp(opt, "reconnect"))) {
617 // If connected use the connected list of objects
619 fAODObjects = connectedList;
625 // prevent a memory leak when reading back the TList
626 // if (!(strcmp(opt, "reconnect"))) fAODObjects->Delete();
628 // create a new TList from the UserInfo TList...
629 // copy constructor does not work...
630 // fAODObjects = (TList*)(aodEvent->GetList()->Clone());
631 fAODObjects = (TList*)aodEvent->GetList();
632 fAODObjects->SetOwner(kTRUE);
633 if(fAODObjects->GetEntries()<kAODListN)
635 AliWarning(Form("AliAODEvent::ReadFromTree() TList contains less than the standard contents %d < %d"
636 " That might be fine though (at least for filtered AODs)",fAODObjects->GetEntries(),kAODListN));
639 // Let's find out whether we have friends
640 TList* friendL = tree->GetTree()->GetListOfFriends();
645 while ((fe = (TFriendElement*)next())){
646 aodEvent = (AliAODEvent*)(fe->GetTree()->GetUserInfo()->FindObject("AliAODEvent"));
648 printf("No UserInfo on tree \n");
651 // TList* objL = (TList*)(aodEvent->GetList()->Clone());
652 TList* objL = (TList*)aodEvent->GetList();
653 printf("Get list of object from tree %d !!\n", objL->GetEntries());
654 TIter nextobject(objL);
656 while((obj = nextobject()))
658 printf("Adding object from friend %s !\n", obj->GetName());
659 fAODObjects->Add(obj);
660 } // object "branch" loop
664 // set the branch addresses
665 TIter next(fAODObjects);
667 while((el=(TNamed*)next())){
668 TString bname(el->GetName());
669 // check if branch exists under this Name
670 TBranch *br = tree->GetTree()->GetBranch(bname.Data());
672 tree->SetBranchAddress(bname.Data(),fAODObjects->GetObjectRef(el));
674 br = tree->GetBranch(Form("%s.",bname.Data()));
676 tree->SetBranchAddress(Form("%s.",bname.Data()),fAODObjects->GetObjectRef(el));
679 printf("%s %d AliAODEvent::ReadFromTree() No Branch found with Name %s. \n",
680 (char*)__FILE__,__LINE__,bname.Data());
685 // when reading back we are not owner of the list
686 // must not delete it
687 fAODObjects->SetOwner(kTRUE);
688 fAODObjects->SetName("AODObjectsConnectedToTree");
689 // we are not owner of the list objects
690 // must not delete it
691 tree->GetUserInfo()->Add(fAODObjects);
695 // we can't get the list from the user data, create standard content
696 // and set it by hand
698 TIter next(fAODObjects);
700 while((el=(TNamed*)next())){
701 TString bname(el->GetName());
702 tree->SetBranchAddress(bname.Data(),fAODObjects->GetObjectRef(el));
705 // when reading back we are not owner of the list
706 // must not delete it
707 fAODObjects->SetOwner(kTRUE);
710 //______________________________________________________________________________
711 Int_t AliAODEvent::GetNumberOfPileupVerticesSPD() const{
712 // count number of SPD pileup vertices
713 Int_t nVertices=GetNumberOfVertices();
714 Int_t nPileupVertices=0;
715 for(Int_t iVert=0; iVert<nVertices; iVert++){
716 AliAODVertex *v=GetVertex(iVert);
717 if(v->GetType()==AliAODVertex::kPileupSPD) nPileupVertices++;
719 return nPileupVertices;
721 //______________________________________________________________________________
722 Int_t AliAODEvent::GetNumberOfPileupVerticesTracks() const{
723 // count number of track pileup vertices
724 Int_t nVertices=GetNumberOfVertices();
725 Int_t nPileupVertices=0;
726 for(Int_t iVert=0; iVert<nVertices; iVert++){
727 AliAODVertex *v=GetVertex(iVert);
728 if(v->GetType()==AliAODVertex::kPileupTracks) nPileupVertices++;
730 return nPileupVertices;
732 //______________________________________________________________________________
733 AliAODVertex* AliAODEvent::GetPrimaryVertexSPD() const{
734 // Get SPD primary vertex
735 Int_t nVertices=GetNumberOfVertices();
736 for(Int_t iVert=0; iVert<nVertices; iVert++){
737 AliAODVertex *v=GetVertex(iVert);
738 if(v->GetType()==AliAODVertex::kMainSPD) return v;
742 //______________________________________________________________________________
743 AliAODVertex* AliAODEvent::GetPileupVertexSPD(Int_t iV) const{
744 // Get pile-up vertex iV
745 Int_t nVertices=GetNumberOfVertices();
747 for(Int_t iVert=0; iVert<nVertices; iVert++){
748 AliAODVertex *v=GetVertex(iVert);
749 if(v->GetType()==AliAODVertex::kPileupSPD){
750 if(counter==iV) return v;
756 //______________________________________________________________________________
757 AliAODVertex* AliAODEvent::GetPileupVertexTracks(Int_t iV) const{
758 // Get pile-up vertex iV
759 Int_t nVertices=GetNumberOfVertices();
761 for(Int_t iVert=0; iVert<nVertices; iVert++){
762 AliAODVertex *v=GetVertex(iVert);
763 if(v->GetType()==AliAODVertex::kPileupTracks){
764 if(counter==iV) return v;
770 //______________________________________________________________________________
771 Bool_t AliAODEvent::IsPileupFromSPD(Int_t minContributors,
773 Double_t nSigmaZdist,
774 Double_t nSigmaDiamXY,
775 Double_t nSigmaDiamZ) const{
777 // This function checks if there was a pile up
778 // reconstructed with SPD
780 AliAODVertex *mainV=GetPrimaryVertexSPD();
781 if(!mainV) return kFALSE;
782 Int_t nc1=mainV->GetNContributors();
783 if(nc1<1) return kFALSE;
784 Int_t nPileVert=GetNumberOfPileupVerticesSPD();
785 if(nPileVert==0) return kFALSE;
786 Int_t nVertices=GetNumberOfVertices();
788 for(Int_t iVert=0; iVert<nVertices; iVert++){
789 AliAODVertex *pv=GetVertex(iVert);
790 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
791 Int_t nc2=pv->GetNContributors();
792 if(nc2>=minContributors){
793 Double_t z1=mainV->GetZ();
794 Double_t z2=pv->GetZ();
795 Double_t distZ=TMath::Abs(z2-z1);
796 Double_t distZdiam=TMath::Abs(z2-GetDiamondZ());
797 Double_t cutZdiam=nSigmaDiamZ*TMath::Sqrt(GetSigma2DiamondZ());
798 if(GetSigma2DiamondZ()<0.0001)cutZdiam=99999.; //protection for missing z diamond information
799 if(distZ>minZdist && distZdiam<cutZdiam){
800 Double_t x2=pv->GetX();
801 Double_t y2=pv->GetY();
802 Double_t distXdiam=TMath::Abs(x2-GetDiamondX());
803 Double_t distYdiam=TMath::Abs(y2-GetDiamondY());
804 Double_t cov1[6],cov2[6];
805 mainV->GetCovarianceMatrix(cov1);
806 pv->GetCovarianceMatrix(cov2);
807 Double_t errxDist=TMath::Sqrt(cov2[0]+GetSigma2DiamondX());
808 Double_t erryDist=TMath::Sqrt(cov2[2]+GetSigma2DiamondY());
809 Double_t errzDist=TMath::Sqrt(cov1[5]+cov2[5]);
810 Double_t cutXdiam=nSigmaDiamXY*errxDist;
811 if(GetSigma2DiamondX()<0.0001)cutXdiam=99999.; //protection for missing diamond information
812 Double_t cutYdiam=nSigmaDiamXY*erryDist;
813 if(GetSigma2DiamondY()<0.0001)cutYdiam=99999.; //protection for missing diamond information
814 if( (distXdiam<cutXdiam) && (distYdiam<cutYdiam) && (distZ>nSigmaZdist*errzDist) ){
823 //______________________________________________________________________________
824 void AliAODEvent::Print(Option_t *) const
826 // Print the names of the all branches
827 TIter next(fAODObjects);
829 Printf(">>>>> AOD Content <<<<<");
830 while((el=(TNamed*)next())){
831 Printf(">> %s ",el->GetName());
833 Printf(">>>>> <<<<<");
838 void AliAODEvent::AssignIDtoCollection(const TCollection* col)
840 // Static method which assigns a ID to each object in a collection
841 // In this way the objects are marked as referenced and written with
842 // an ID. This has the advantage that TRefs to this objects can be
843 // written by a subsequent process.
846 while ((obj = next()))
847 TProcessID::AssignID(obj);
850 Bool_t AliAODEvent::IsPileupFromSPDInMultBins() const {
851 Int_t nTracklets=GetTracklets()->GetNumberOfTracklets();
852 if(nTracklets<20) return IsPileupFromSPD(3,0.8);
853 else if(nTracklets<50) return IsPileupFromSPD(4,0.8);
854 else return IsPileupFromSPD(5,0.8);
857 Float_t AliAODEvent::GetVZEROEqMultiplicity(Int_t i) const
859 // Get VZERO Multiplicity for channel i
860 // Themethod uses the equalization factors
861 // stored in the ESD-run object in order to
862 // get equal multiplicities within a VZERO rins (1/8 of VZERO)
863 if (!fAODVZERO || !fHeader) return -1;
866 Float_t factorSum = 0;
867 for(Int_t j = 8*ring; j < (8*ring+8); ++j) {
868 factorSum += fHeader->GetVZEROEqFactors(j);
870 Float_t factor = fHeader->GetVZEROEqFactors(i)*8./factorSum;
872 return (fAODVZERO->GetMultiplicity(i)/factor);