Declare as connected an AODEvent read from tree
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Apr 2011 11:24:37 +0000 (11:24 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Apr 2011 11:24:37 +0000 (11:24 +0000)
STEER/AliAODEvent.cxx
STEER/AliAODEvent.h

index 2a9111c..b1a6bc7 100644 (file)
@@ -534,12 +534,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
@@ -549,6 +550,8 @@ 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"))) {
index 2f6ff5f..6c5aa4a 100644 (file)
@@ -67,6 +67,8 @@ class AliAODEvent : public AliVEvent {
   void          RemoveObject(TObject *obj);
   TObject      *FindListObject(const char *objName) const;
   TList        *GetList()                const { return fAODObjects; }
+  void          SetConnected(Bool_t conn=kTRUE) {fConnected=conn;}
+  Bool_t        GetConnected() const {return fConnected;}
 
   // -- Header
   AliAODHeader *GetHeader()              const { return fHeader; }