]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliVEventHandler.h
Introduced tree caching and async reading for data (ESD and AOD) and MC. An read...
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliVEventHandler.h
1 #ifndef ALIVEVENTHANDLER_H
2 #define ALIVEVENTHANDLER_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     Event Handler base class
10 //     Author: Andreas Morsch, CERN
11 //-------------------------------------------------------------------------
12
13 #include <TNamed.h>
14
15 class TTree;
16
17 class AliVEventHandler : public TNamed {
18
19  public:
20 enum EEventHandlerFlags {
21    kHandlerLocked       = BIT(14)
22 };
23     AliVEventHandler();
24     AliVEventHandler(const char* name, const char* title);
25     virtual ~AliVEventHandler();
26     // Handled tree
27     virtual TTree       *GetTree() const { return NULL; }
28     virtual Option_t    *GetDataType() const { return NULL; }
29     virtual void         SetFillAOD(Bool_t) {}
30     virtual void         SetFillExtension(Bool_t) {}
31     // Output
32     virtual void         SetOutputFileName(const char* fname)   = 0;
33     virtual const char*  GetOutputFileName()              = 0;
34     // Extra outputs as a string separated by commas
35     virtual const char*  GetExtraOutputs() const {return NULL;}
36     // Input
37     virtual void         SetInputTree(TTree* tree)        = 0;
38     // Steering 
39     virtual Bool_t       Init(Option_t* opt)              = 0;
40     virtual Bool_t       Init(TTree* tree, Option_t* opt) = 0;
41     virtual Bool_t       BeginEvent(Long64_t entry)       = 0;
42     virtual Bool_t       GetEntry()                       = 0;
43     virtual Bool_t       Notify(const char *path)         = 0;
44     virtual Bool_t       FinishEvent()                    = 0;
45     virtual Bool_t       Terminate()                      = 0;
46     virtual Bool_t       TerminateIO()                    = 0;
47     //
48     virtual Bool_t       Notify() { return TNamed::Notify(); };
49     // Security
50     Bool_t               IsLocked() const {return TObject::TestBit(kHandlerLocked);}
51     void                 Lock();
52     void                 UnLock();
53     void                 Changed();
54     virtual void         SetCacheSize(Long64_t) {}
55  private :
56   ClassDef(AliVEventHandler, 1);
57 };
58
59 #endif