]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/STEERBase/AliMCEventHandler.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliMCEventHandler.h
index 0b6a10cd25c88b94d46ad4cec18cecbe5ba28444..65ceececf49dc2f2fd7ee3a37f5b104fa7892bf4 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. *
 //      
 // Origin: Andreas Morsch, CERN, andreas.morsch@cern.ch 
 //-------------------------------------------------------------------------
-#include "AliVEventHandler.h"
+#include "AliInputEventHandler.h"
 #include "AliHeader.h"
 #include <TExMap.h>
 
 class TFile;
 class TTree;
 class TList;
+class TTreeCache;
 
 class TParticle;
 class TString;
@@ -32,7 +33,7 @@ class AliMCEvent;
 
 
 
-class AliMCEventHandler : public AliVEventHandler
+class AliMCEventHandler : public AliInputEventHandler
 {
 public:
 
@@ -42,7 +43,7 @@ public:
     AliMCEventHandler(const char* name, const char* title);
     virtual ~AliMCEventHandler();
     virtual void         SetOutputFileName(const char* /* fname */) {;}
-    virtual const char*  GetOutputFileName() {return 0;}
+    virtual const char*  GetOutputFileName() const {return 0;}
     virtual void         SetInputPath(const char* fname); 
     virtual void         SetInputTree(TTree* /*tree*/) {;}
     virtual TString*     GetInputPath() const {return fPathName;}
@@ -57,13 +58,14 @@ public:
     virtual Bool_t       Terminate();
     virtual Bool_t       TerminateIO();
     virtual void         ResetIO();
-    virtual Bool_t       GetEvent(Int_t iev);
-    virtual void         SetReadTR(Bool_t flag) { fReadTR = flag; }
+    virtual Bool_t       LoadEvent(Int_t iev);
+    virtual void         SetReadTR(Bool_t flag) { Changed(); fReadTR = flag; }
     virtual void         AddSubsidiaryHandler(AliMCEventHandler* handler);
     virtual void         SetNumberOfEventsInContainer(Int_t nev) {fEventsInContainer = nev;}
-    virtual void         SetPreReadMode(PreReadMode_t mode) {fPreReadMode = mode;}
+    virtual void         SetPreReadMode(PreReadMode_t mode) {Changed(); fPreReadMode = mode;}
+    virtual void         SetCacheSize(Long64_t size) {if (fCacheSize==0) fCacheSize = size;}
     //
-    AliMCEvent* MCEvent() const {return fMCEvent;} 
+    AliMCEvent* MCEvent() const {return fMCEvent;}
     TTree*      TreeTR()  const {return fTreeTR;}
     TTree*      TreeK()   const {return fTreeK;}
     virtual TTree*      GetTree() const {return fTreeE;}
@@ -96,16 +98,19 @@ private:
     Int_t                  fNEvent;             //! Number of events
     Int_t                  fEvent;              //! Current event
     TString               *fPathName;           //! Input file path 
-    const Char_t          *fExtension;          //! File name extension 
+    const Char_t          *fkExtension;         //! File name extension 
     Int_t                  fFileNumber;         //! Input file number
     Int_t                  fEventsPerFile;      //! Number of events per file
     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
-    PreReadMode_t          fPreReadMode;        //! Pre reading mode
+    PreReadMode_t          fPreReadMode;        // Pre reading mode
+    Long64_t               fCacheSize;          // Cache size for kinematics tree
+    TTreeCache            *fCacheTK;            //! Cache for kinematics tree
+    TTreeCache            *fCacheTR;            //! Cache for track references tree
     
-    ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class
+    ClassDef(AliMCEventHandler,3)  //MC Truth EventHandler class
 };
 #endif