]>
Commit | Line | Data |
---|---|---|
4338f373 | 1 | #ifndef ALIMULTIAODINPUTHANDLER_H |
2 | #define ALIMULTIAODINPUTHANDLER_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 | // AOD Input Handler realisation of the AliVEventHandler interface. | |
10 | // This class handles multiple events for mixing. | |
11 | // Author: Andreas Morsch, CERN | |
12 | //------------------------------------------------------------------------- | |
13 | ||
14 | #include "AliInputEventHandler.h" | |
15 | class TObject; | |
16 | class AliAODEvent; | |
17 | ||
18 | class AliMultiAODInputHandler : public AliInputEventHandler { | |
19 | ||
20 | public: | |
21 | AliMultiAODInputHandler(Int_t size); | |
22 | AliMultiAODInputHandler(const char* name, const char* title, Int_t size); | |
23 | virtual ~AliMultiAODInputHandler(); | |
24 | void SetBufferSize(Int_t size) {fBufferSize = size;} | |
25 | void SetEventPool(TObject* pool) {fEventPool = pool;} | |
26 | Int_t GetBufferSize() const {return fBufferSize;} | |
27 | Int_t GetNBuffered() const {return fNBuffered;} | |
28 | Bool_t IsBufferReady() const {return (fNBuffered >= fBufferSize);} | |
29 | Bool_t IsFreshBuffer() const {return (fIndex == (fBufferSize - 1));} | |
30 | ||
c9f05157 | 31 | TObject *GetEventPool() const {return fEventPool;} |
32 | virtual AliVEvent *GetEvent() const {return 0;} | |
33 | virtual AliAODEvent *GetEvent(Int_t iev) const; | |
4338f373 | 34 | // From the interface |
c9f05157 | 35 | virtual Bool_t Init(Option_t* /*opt*/) {return kTRUE;} |
4338f373 | 36 | virtual Bool_t Init(TTree* tree, Option_t* /*opt*/); |
37 | virtual Bool_t FinishEvent(); | |
38 | private: | |
39 | AliMultiAODInputHandler(const AliMultiAODInputHandler& handler); | |
40 | AliMultiAODInputHandler& operator=(const AliMultiAODInputHandler& handler); | |
41 | private: | |
42 | Int_t fBufferSize; // Size of the buffer | |
43 | Int_t fNBuffered; // Number of events actually buffered | |
44 | Int_t fIndex; // Pointer to most recent event | |
45 | TTree* fTree; // Pointer to the tree | |
46 | TObject* fEventPool; // Pointer to the pool | |
47 | AliAODEvent** fEventBuffer; // The event buffer | |
48 | ClassDef(AliMultiAODInputHandler, 1); | |
49 | }; | |
50 | ||
51 | #endif |