]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/EventMixing/AliMixEventInputHandler.h
8fb4920c6f6839891af59a2b523a0aed9d367dc2
[u/mrichter/AliRoot.git] / ANALYSIS / EventMixing / AliMixEventInputHandler.h
1 //
2 // Class AliMixEventInputHandler
3 //
4 // Mixing input handler prepare N events before UserExec
5 // TODO example
6 // author:
7 //        Martin Vala (martin.vala@cern.ch)
8 //
9
10 #ifndef ALIMIXEVENTINPUTHANDLER_H
11 #define ALIMIXEVENTINPUTHANDLER_H
12
13 #include <TObjArray.h>
14
15 #include "AliInputEventHandler.h"
16 #include <TArrayI.h>
17
18 class TChain;
19 class AliMixEventPool;
20 class AliMixInputHandlerInfo;
21 class AliMixEventInputHandler : public AliInputEventHandler {
22
23 public:
24    AliMixEventInputHandler(const Int_t size=1);
25    virtual ~AliMixEventInputHandler() {;};
26
27    // From the interface
28    virtual Bool_t  Init(Option_t *opt /*opt*/);
29    virtual Bool_t  Init(TTree *tree, Option_t* /*opt*/);
30    virtual Bool_t  BeginEvent(Long64_t entry /*entry*/);
31    virtual Bool_t  GetEntry();
32    virtual Bool_t  FinishEvent();
33    virtual Bool_t  Notify();
34    virtual Bool_t  Notify(const char *path);
35
36
37    void SetInputHandlerForMixing(const AliInputEventHandler *const inHandler);
38    void SetEventPool(AliMixEventPool *const evPool) {fEventPool = evPool;}
39
40    AliInputEventHandler *InputEventHandler(const Int_t index);
41    AliMixEventPool *GetEventPool() const { return fEventPool;}
42    Int_t           BufferSize() const {return fBufferSize;}
43    Int_t           MixedEventNumber() const {return fMixEventNumber;}
44    Long64_t        EntryAll() const { return fEntryCounter;}
45 protected:
46
47    Int_t             fBufferSize;          // Size of the buffer
48    TObjArray         fInputHandlers;       // buffer of input handlers
49    TObjArray         fMixTrees;            // buffer of input handlers
50    TArrayI           fTreeMap;             // tree map
51    AliMixInputHandlerInfo *fMixIntupHandlerInfoTmp;    //! mix input handler info full chain
52    Long64_t          fEntryCounter;        // entry counter
53    AliMixEventPool  *fEventPool;           // event pool
54
55    Int_t             fMixEventNumber;      // number mix
56
57 private:
58
59    AliMixEventInputHandler(const AliMixEventInputHandler &handler);
60    AliMixEventInputHandler &operator=(const AliMixEventInputHandler &handler);
61
62    ClassDef(AliMixEventInputHandler, 1)
63 };
64
65 #endif