]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
introduction flag to skip the reading of track references (default: on)
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2007 18:00:51 +0000 (18:00 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2007 18:00:51 +0000 (18:00 +0000)
STEER/AliMCEventHandler.cxx
STEER/AliMCEventHandler.h

index 03da0d9a51a69699b711d3a2f57c319cc4d589cb..6c6470ebb081b7b00bd0aeea9615902b2dbfde87 100644 (file)
@@ -57,7 +57,8 @@ AliMCEventHandler::AliMCEventHandler() :
     fPathName(new TString("./")),
     fExtension(""),
     fFileNumber(0),
-    fEventsPerFile(0)
+    fEventsPerFile(0),
+    fReadTR(kTRUE)
 {
     // Default constructor
 }
@@ -91,7 +92,7 @@ AliMCEventHandler::~AliMCEventHandler()
     delete fFileTR;
 }
 
-Bool_t AliMCEventHandler::InitIO(Option_t* opt) 
+Bool_t AliMCEventHandler::InitIO(Option_t* opt)
 { 
     // Initialize input
     //
@@ -114,8 +115,10 @@ Bool_t AliMCEventHandler::InitIO(Option_t* opt)
     fEventsPerFile = fFileK->GetNkeys() - fFileK->GetNProcessIDs();
     //
     // Tree TR
-    fFileTR = TFile::Open(Form("%sTrackRefs%s.root", fPathName->Data(), fExtension));
-    if (!fFileTR) AliWarning(Form("AliMCEventHandler:TrackRefs.root not found in directory %s ! \n", fPathName->Data()));
+    if (fReadTR) {
+      fFileTR = TFile::Open(Form("%sTrackRefs%s.root", fPathName->Data(), fExtension));
+      if (!fFileTR) AliWarning(Form("AliMCEventHandler:TrackRefs.root not found in directory %s ! \n", fPathName->Data()));
+    }
     //
     // Reset the event number
     fEvent      = -1;
index 001b5cc07e201c8fac50efd85fd7d12e5b89ebd9..c1655309e61c21f6f144abc0f35c7c0f0d5ac192 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode: C++ -*- 
+// -*- mode: C++ -*-
 #ifndef ALIMCEVENTHANDLER_H
 #define ALIMCEVENTHANDLER_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
@@ -47,6 +47,7 @@ public:
     virtual Bool_t       TerminateIO();
     virtual void         ResetIO();
     virtual Bool_t       GetEvent(Int_t iev);
+    virtual void         SetReadTR(Bool_t flag) { fReadTR = flag; }
     //
     AliMCEvent* MCEvent() {return fMCEvent;}
     TTree*      TreeTR() {return fTreeTR;}
@@ -70,7 +71,8 @@ private:
     char             *fExtension;        //! File name extension 
     Int_t             fFileNumber;       //! Input file number
     Int_t             fEventsPerFile;    //! Number of events per file
-    ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class 
+    Bool_t            fReadTR;           // determines if TR shall be read
+    ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class
 };
 #endif