]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AOD/AliAODEvent.cxx
Modifications in CMake* files to export all required headers.
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODEvent.cxx
index 833d28bfd8434e79cf4dc6e9bd43357d6b72a4f8..84fb6b38a99161f372403264334ae687febdabad 100644 (file)
@@ -659,16 +659,24 @@ void AliAODEvent::ReadFromTree(TTree *tree, Option_t* opt /*= ""*/)
         } else {
           
          //          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;
-          while((obj = nextobject()))
+          TList* objL = aodEvent->GetList();
+          
+          if(objL == fAODObjects)
           {
-            printf("Adding object from friend %s !\n", obj->GetName());
-            fAODObjects->Add(obj);
+                       AliInfo("Adding object from friend. Same object friend list...skipping\n");
+            
+          } else {
+                                       printf("Get list of object from tree %d !!\n", objL->GetEntries());
+           
+                   TIter nextobject(objL);
+                TObject* obj =  0;
+             while((obj = nextobject()))
+                  {
+                       printf("Adding object from friend %s !\n", obj->GetName());
+                       fAODObjects->Add(obj);
+               }
           } // object "branch" loop
-        } // has userinfo  
+               } // has userinfo  
       } // friend loop
     } // has friends   
       // set the branch addresses