#include <TTree.h>
#include <TFolder.h>
#include <TFriendElement.h>
-
+#include <TProcessID.h>
+#include <TCollection.h>
#include "AliAODEvent.h"
#include "AliAODHeader.h"
return;
}
+void AliAODEvent::MakeEntriesReferencable()
+{
+ // Make all entries referencable in a subsequent process
+ //
+ TIter next(fAODObjects);
+ TObject* obj;
+ while (obj = next())
+ {
+ if(obj->InheritsFrom("TCollection"))
+ {
+ AssignIDtoCollection((TCollection*)obj);
+ }
+ }
+}
+
//______________________________________________________________________________
void AliAODEvent::SetStdNames()
{
return;
}
+
+void AliAODEvent::AssignIDtoCollection(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
+ // an ID. This has the advantage that TRefs to this objects can be
+ // written by a subsequent process.
+ TIter next(col);
+ TObject* obj;
+ while (obj = next())
+ TProcessID::AssignID(obj);
+}
const void WriteToTree(TTree* tree) const {tree->Branch(fAODObjects);}
void Print(Option_t *option="") const;
-
+ void MakeEntriesReferencable();
+ static void AssignIDtoCollection(TCollection* col);
private :
TList *fAODObjects; // list of AODObjects