HLT TRD bugfix: correct calculation of the total charge of the cluster (Theo)
[u/mrichter/AliRoot.git] / ANALYSIS / AliMultiEventInputHandler.h
CommitLineData
fab17817 1#ifndef ALIMULTIEVENTINPUTHANDLER_H
2#define ALIMULTIEVENTINPUTHANDLER_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// Multi VEvent 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"
15class AliVEventPool;
16class AliVEvent;
17
18class AliMultiEventInputHandler : public AliInputEventHandler {
19
20 public:
21 AliMultiEventInputHandler();
22 AliMultiEventInputHandler(Int_t size, Int_t format = 1);
23 AliMultiEventInputHandler(const char* name, const char* title, Int_t size, Int_t format = 1);
24 virtual ~AliMultiEventInputHandler();
25 void SetBufferSize(Int_t size) {fBufferSize = size;}
26 void SetEventPool(AliVEventPool* pool) {fEventPool = pool;}
27 Int_t GetBufferSize() const {return fBufferSize;}
28 Int_t GetNBuffered() const {return fNBuffered;}
29 Bool_t IsBufferReady() const {return (fNBuffered >= (fBufferSize -1));}
30 Bool_t IsFreshBuffer() const {return (fIndex == (fBufferSize - 1));}
31 AliVEventPool *GetEventPool() const {return fEventPool;}
44e301c6 32 virtual AliVEvent *GetEvent() const {return GetLatestEvent();}
fab17817 33 virtual AliVEvent *GetEvent(Int_t iev) const;
34 AliVEvent *GetLatestEvent() const {return fEventBuffer[fIndex];}
c8fe2783 35 Int_t GetFormat() { return fFormat ;}
fab17817 36 // From the interface
37 virtual Bool_t Init(Option_t* /*opt*/) {return kTRUE;}
38 virtual Bool_t Init(TTree* tree, Option_t* /*opt*/);
39 virtual Bool_t FinishEvent();
40 virtual Bool_t BeginEvent(Long64_t /*entry*/);
47482059 41 virtual Bool_t Notify() { return AliInputEventHandler::Notify();}
42 virtual Bool_t Notify(const char */*path*/);
fab17817 43 private:
44 AliMultiEventInputHandler(const AliMultiEventInputHandler& handler);
45 AliMultiEventInputHandler& operator=(const AliMultiEventInputHandler& handler);
46 private:
47 Int_t fBufferSize; // Size of the buffer
48 Int_t fFormat; // 0: ESD 1: AOD
49 Int_t fNBuffered; // Number of events actually buffered
50 Int_t fIndex; // Pointer to most recent event
51 Int_t fCurrentBin; // Current bin from the pool
fab17817 52 AliVEventPool* fEventPool; // Pointer to the pool
67b28e0a 53 AliVEvent** fEventBuffer; //! The event buffer
fab17817 54 ClassDef(AliMultiEventInputHandler, 1);
55};
56
57#endif