]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODInputHandler.h
Protection against div. by 0 in the Set(xyz,p..) for tracks with momentum along X...
[u/mrichter/AliRoot.git] / STEER / AliAODInputHandler.h
1 #ifndef ALIAODINPUTHANDLER_H
2 #define ALIAODINPUTHANDLER_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 //     Author: Andreas Morsch, CERN
11 //-------------------------------------------------------------------------
12
13 #include "AliInputEventHandler.h"
14 #include "AliAODEvent.h"
15 #include "AliMCEvent.h"
16 class TList;
17 class AliMCEvent;
18 class TH2F;
19 class AliMCEvent;
20 class AliAODpidUtil;
21 class AliPIDResponse;
22
23
24 class AliAODInputHandler : public AliInputEventHandler {
25
26  public:
27     AliAODInputHandler();
28     AliAODInputHandler(const char* name, const char* title);
29     virtual ~AliAODInputHandler();
30     virtual Bool_t       Init(Option_t* /*opt*/) {return kTRUE;}
31     virtual Bool_t       Init(TTree* tree, Option_t* opt);
32     AliAODEvent         *GetEvent() const {return fEvent;}
33     AliMCEvent          *MCEvent()  const {return fMCEvent;}
34     virtual void         AddFriend(char* filename);
35     virtual Bool_t       BeginEvent(Long64_t entry);
36     virtual Bool_t       Notify() { return AliVEventHandler::Notify();};
37     virtual Bool_t       Notify(const char* path);
38     virtual Bool_t       FinishEvent();
39     Option_t            *GetDataType() const;
40     // Get the statistics object (currently TH2). Option can be BIN0.
41     virtual TObject     *GetStatistics(Option_t *option="") const;
42     // Provisions for event merging
43     void                 SetMergeEvents(Bool_t flag) {fMergeEvents = flag;}
44     Bool_t               GetMergeEvents() const {return fMergeEvents;}
45     AliAODEvent*         GetEventToMerge() {return fAODEventToMerge;}
46     void                 SetMergeOffset(Int_t ioff) {fMergeOffset = ioff;}
47   
48     //PID response
49     virtual AliPIDResponse* GetPIDResponse() {return (AliPIDResponse*)fAODpidUtil;}
50     virtual void CreatePIDResponse(Bool_t isMC=kFALSE);
51     AliAODpidUtil *GetAODpidUtil() const { return fAODpidUtil; }
52   
53  private:
54     void ConnectFriends();
55     AliAODInputHandler(const AliAODInputHandler& handler);             
56     AliAODInputHandler& operator=(const AliAODInputHandler& handler);  
57  private:
58     AliAODEvent    *fEvent;   //! Pointer to the event
59     AliMCEvent     *fMCEvent; //! Pointer to the MCEvent
60     TList          *fFriends; //  List of friend trees
61     AliAODpidUtil  *fAODpidUtil; //! Pointer to PID information
62   
63 // Support for merged events
64     Bool_t          fMergeEvents;     // Flag for event merging
65     Bool_t          fFriendsConnected;// Friends are connected
66     TFile          *fFileToMerge;     //! File for merging
67     TTree          *fTreeToMerge;     //! Tree for merging
68     AliAODEvent    *fAODEventToMerge; //! Event for merging
69     Int_t           fMergeOffset;     //! Event offset for merging
70     TH2F*           fHistStatistics[2]; //! how many events are cut away why {all,bin 0}
71     ClassDef(AliAODInputHandler, 3);
72 };
73
74 #endif