]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliVEventHandler.h
HMPID module
[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 class TObjArray;
17 class AliVEvent;
18 class AliVfriendEvent;
19
20 class AliVEventHandler : public TNamed {
21
22  public:
23 enum EEventHandlerFlags {
24    kHandlerLocked       = BIT(14)
25 };
26     AliVEventHandler();
27     AliVEventHandler(const char* name, const char* title);
28     virtual ~AliVEventHandler();
29     // Handled tree
30     virtual TTree       *GetTree() const { return NULL; }
31     virtual Option_t    *GetDataType() const { return NULL; }
32     virtual Bool_t       GetFillAOD() const {return kTRUE;}
33     virtual Bool_t       GetFillExtension() const {return kTRUE;}
34     virtual void         SetFillAOD(Bool_t) {}
35     virtual void         SetFillExtension(Bool_t) {}
36     // Input
37     virtual void         SetInputFileName(const char*) {}
38     virtual const char*  GetInputFileName() const {return 0;}
39     // Output
40     virtual void         SetOutputFileName(const char* fname)   = 0;
41     virtual const char*  GetOutputFileName() const        = 0;
42     // Extra outputs as a string separated by commas
43     virtual const char*  GetExtraOutputs(Bool_t merge=kFALSE) const;
44     // Input
45     virtual void         SetInputTree(TTree* tree)        = 0;
46     // Steering 
47     virtual Bool_t       Init(Option_t* opt)              = 0;
48     virtual Bool_t       Init(TTree* tree, Option_t* opt) = 0;
49     virtual Bool_t       BeginEvent(Long64_t entry)       = 0;
50     virtual Bool_t       GetEntry()                       = 0;
51     virtual Bool_t       Notify(const char *path)         = 0;
52     virtual Bool_t       FinishEvent()                    = 0;
53     virtual Bool_t       Terminate()                      = 0;
54     virtual Bool_t       TerminateIO()                    = 0;
55     //
56     virtual Bool_t       Notify() { return TNamed::Notify(); };
57     // Security
58     Bool_t               IsLocked() const {return TObject::TestBit(kHandlerLocked);}
59     void                 Lock();
60     void                 UnLock();
61     void                 Changed();
62     virtual void         SetCacheSize(Long64_t) {}
63     virtual TList        *GetUserInfo() const {return 0x0;};
64
65     // HLT
66     virtual Bool_t              InitTaskInputData(AliVEvent* /*event*/, AliVfriendEvent* /*esdFriend*/, TObjArray* /*arrTasks*/) {return kTRUE;};
67     virtual AliVEvent*          GetEvent() const {return 0x0;};
68     virtual AliVfriendEvent*   GetVfriendEvent() const {return 0x0;};
69
70  private :
71   ClassDef(AliVEventHandler, 1);
72 };
73
74 #endif