void AliMCEvent::InitEvent()
{
+//
+// Initialize the subsidiary event structure
if (fSubsidiaryEvents) {
TIter next(fSubsidiaryEvents);
AliMCEvent* evt;
}
}
}
+void AliMCEvent::PreReadAll()
+{
+ // Preread the MC information
+ Int_t i;
+ // secondaries
+ for (i = fStack->GetNprimary(); i < fStack->GetNtrack(); i++)
+ {
+ GetTrack(i);
+ }
+ // primaries
+ for (i = 0; i < fStack->GetNprimary(); i++)
+ {
+ GetTrack(i);
+ }
+
+
+}
ClassImp(AliMCEvent)
virtual void SetStdNames() {;}
virtual void Print(Option_t */*option=""*/) const {;}
-
+ virtual void PreReadAll();
// Header
virtual AliVHeader* GetHeader() const {return 0;}
fReadTR(kTRUE),
fInitOk(kFALSE),
fSubsidiaryHandlers(0),
- fEventsInContainer(0)
+ fEventsInContainer(0),
+ fPreReadMode(kNoPreRead)
{
//
// Default constructor
fReadTR(kTRUE),
fInitOk(kFALSE),
fSubsidiaryHandlers(0),
- fEventsInContainer(0)
+ fEventsInContainer(0),
+ fPreReadMode(kNoPreRead)
{
//
// Constructor
}
fMCEvent->InitEvent();
}
+
+ if (fPreReadMode == kLmPreRead) {
+ fMCEvent->PreReadAll();
+ }
+
return result;
}
class AliMCEventHandler : public AliVEventHandler
{
public:
+
+ enum PreReadMode_t {kNoPreRead = 0, kLmPreRead = 1, kHmPreRead = 2};
+
AliMCEventHandler();
AliMCEventHandler(const char* name, const char* title);
virtual ~AliMCEventHandler();
virtual void SetReadTR(Bool_t flag) { fReadTR = flag; }
virtual void AddSubsidiaryHandler(AliMCEventHandler* handler);
virtual void SetNumberOfEventsInContainer(Int_t nev) {fEventsInContainer = nev;}
+ virtual void SetPreReadMode(PreReadMode_t mode) {fPreReadMode = mode;}
//
AliMCEvent* MCEvent() const {return fMCEvent;}
TTree* TreeTR() const {return fTreeTR;}
Bool_t fReadTR; // determines if TR shall be read
Bool_t fInitOk; // Initialization ok
TList *fSubsidiaryHandlers; //! List of subsidiary MC handlers (for example for Background)
- Int_t fEventsInContainer; //! Number of events in container class
+ Int_t fEventsInContainer; //! Number of events in container class
+ PreReadMode_t fPreReadMode; //! Pre reading mode
+
ClassDef(AliMCEventHandler,1) //MC Truth EventHandler class
};
#endif