]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODEvent.cxx
Number of sigma pedestal cut increased to 4
[u/mrichter/AliRoot.git] / STEER / AliAODEvent.cxx
index 94208a169f43892686c3e1723fc06930324f1b65..65dbf72e3e0c853725eb35c5c09e8d1f4f3c12cc 100644 (file)
@@ -48,7 +48,8 @@ ClassImp(AliAODEvent)
                                                      "fmdClusters",
                                                      "pmdClusters",
                                                      "dimuons",
-                                                     "AliAODVZERO"
+                                                     "AliAODVZERO",
+                                                     "AliAODZDC"
                                                      
 };
 //______________________________________________________________________________
@@ -70,7 +71,8 @@ AliAODEvent::AliAODEvent() :
   fFmdClusters(0),
   fPmdClusters(0),
   fDimuons(0),
-  fAODVZERO(0)
+  fAODVZERO(0),
+  fAODZDC(0)
 {
   // default constructor
 }
@@ -94,7 +96,8 @@ AliAODEvent::AliAODEvent(const AliAODEvent& aod):
   fFmdClusters(new TClonesArray(*aod.fFmdClusters)),
   fPmdClusters(new TClonesArray(*aod.fPmdClusters)),
   fDimuons(new TClonesArray(*aod.fDimuons)),
-  fAODVZERO(new AliAODVZERO(*aod.fAODVZERO))
+  fAODVZERO(new AliAODVZERO(*aod.fAODVZERO)),
+  fAODZDC(new AliAODZDC(*aod.fAODZDC))
 {
   // Copy constructor
   AddObject(fHeader);
@@ -111,6 +114,7 @@ AliAODEvent::AliAODEvent(const AliAODEvent& aod):
   AddObject(fPmdClusters);
   AddObject(fDimuons);
   AddObject(fAODVZERO);
+  AddObject(fAODZDC);
   fConnected = aod.fConnected;
   GetStdContent();
   CreateStdFolders();
@@ -216,14 +220,8 @@ AliAODEvent & AliAODEvent::operator=(const AliAODEvent& aod) {
 AliAODEvent::~AliAODEvent() 
 {
 // destructor
-    if(fAODObjects&&!fConnected)
-    {
-       delete fAODObjects;
-       fAODObjects = 0;
-    }
-
+    if(!fConnected) delete fAODObjects;
     delete fAODFolder;
-    fAODFolder = 0;
 }
 
 //______________________________________________________________________________
@@ -275,6 +273,7 @@ void AliAODEvent::CreateStdContent()
   AddObject(new TClonesArray("AliAODPmdCluster", 0));
   AddObject(new TClonesArray("AliAODDimuon", 0));
   AddObject(new AliAODVZERO());
+  AddObject(new AliAODZDC());
   // set names
   SetStdNames();
 
@@ -359,6 +358,7 @@ void AliAODEvent::GetStdContent()
   fPmdClusters   = (TClonesArray*)fAODObjects->FindObject("pmdClusters");
   fDimuons       = (TClonesArray*)fAODObjects->FindObject("dimuons");
   fAODVZERO      = (AliAODVZERO*)fAODObjects->FindObject("AliAODVZERO");
+  fAODZDC        = (AliAODZDC*)fAODObjects->FindObject("AliAODZDC");
 }
 
 //______________________________________________________________________________
@@ -540,12 +540,13 @@ Int_t AliAODEvent::GetNumberOfMuonTracks() const
   return nMuonTracks;
 }
 
+//______________________________________________________________________________
 void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
 {
     // Connects aod event to tree
   
   if(!tree){
-    Printf("%s %d AliAODEvent::ReadFromTree() Zero Pointer to Tree \n",(char*)__FILE__,__LINE__);
+    AliWarning("Zero Pointer to Tree \n");
     return;
   }
     // load the TTree
@@ -555,11 +556,13 @@ void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
   AliAODEvent *aodEvent = 0;
   aodEvent = (AliAODEvent*)tree->GetTree()->GetUserInfo()->FindObject("AliAODEvent");
   if(aodEvent){
+    // This event is connected to the tree by definition, just say so
+    aodEvent->SetConnected();
       // Check if already connected to tree
     TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("AODObjectsConnectedToTree"));
     if (connectedList && (strcmp(opt, "reconnect"))) {
         // If connected use the connected list of objects
-       fAODObjects->Delete();
+        delete fAODObjects;
        fAODObjects = connectedList;
        GetStdContent(); 
        fConnected = kTRUE;
@@ -571,7 +574,8 @@ void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
     
       // create a new TList from the UserInfo TList... 
       // copy constructor does not work...
-    fAODObjects = (TList*)(aodEvent->GetList()->Clone());
+    //    fAODObjects = (TList*)(aodEvent->GetList()->Clone());
+    fAODObjects = (TList*)aodEvent->GetList();
     fAODObjects->SetOwner(kTRUE);
     if(fAODObjects->GetEntries()<kAODListN)
     {
@@ -591,7 +595,8 @@ void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
           printf("No UserInfo on tree \n");
         } else {
           
-          TList* objL = (TList*)(aodEvent->GetList()->Clone());
+         //          TList* objL = (TList*)(aodEvent->GetList()->Clone());
+          TList* objL = (TList*)aodEvent->GetList();
           printf("Get list of object from tree %d !!\n", objL->GetEntries());
           TIter nextobject(objL);
           TObject* obj =  0;
@@ -673,7 +678,7 @@ Int_t  AliAODEvent::GetNumberOfPileupVerticesTracks() const{
 }
 //______________________________________________________________________________
 AliAODVertex* AliAODEvent::GetPrimaryVertexSPD() const{
-  //
+  // Get SPD primary vertex
   Int_t nVertices=GetNumberOfVertices();
   for(Int_t iVert=0; iVert<nVertices; iVert++){
     AliAODVertex *v=GetVertex(iVert);
@@ -683,7 +688,7 @@ AliAODVertex* AliAODEvent::GetPrimaryVertexSPD() const{
 }
 //______________________________________________________________________________
 AliAODVertex* AliAODEvent::GetPileupVertexSPD(Int_t iV) const{
-  //
+  // Get pile-up vertex iV
   Int_t nVertices=GetNumberOfVertices();
   Int_t counter=0;
   for(Int_t iVert=0; iVert<nVertices; iVert++){
@@ -697,7 +702,7 @@ AliAODVertex* AliAODEvent::GetPileupVertexSPD(Int_t iV) const{
 }
 //______________________________________________________________________________
 AliAODVertex* AliAODEvent::GetPileupVertexTracks(Int_t iV) const{
-  //
+  // Get pile-up vertex iV
   Int_t nVertices=GetNumberOfVertices();
   Int_t counter=0;
   for(Int_t iVert=0; iVert<nVertices; iVert++){
@@ -777,7 +782,7 @@ void AliAODEvent::Print(Option_t *) const
   return;
 }
 
-void AliAODEvent::AssignIDtoCollection(TCollection* col)
+void AliAODEvent::AssignIDtoCollection(const TCollection* col)
 {
     // Static method which assigns a ID to each object in a collection
     // In this way the objects are marked as referenced and written with