]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDInputHandler.h
Adding a MC/real data switch in the constructor (Ch.Baumann)
[u/mrichter/AliRoot.git] / STEER / AliESDInputHandler.h
1 #ifndef ALIESDINPUTHANDLER_H
2 #define ALIESDINPUTHANDLER_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 //     ESD Input Handler realisation of the AliVEventHandler interface
10 //     Author: Andreas Morsch, CERN
11 //-------------------------------------------------------------------------
12
13 #include "AliInputEventHandler.h"
14 #include "AliESDEvent.h"
15 class TChain;
16 class TTree;
17 class AliRunTag;
18 class AliEventTag;
19 class TMap;
20 class AliESDfriend;
21 class AliESDpid;
22
23
24 class AliESDInputHandler : public AliInputEventHandler {
25
26  public:
27     AliESDInputHandler();
28     AliESDInputHandler(const char* name, const char* title);
29     virtual ~AliESDInputHandler();
30     virtual Bool_t       Init(Option_t* opt) {return AliInputEventHandler::Init(opt);}
31     virtual Bool_t       Init(TTree* tree, Option_t* opt);
32     virtual Bool_t       BeginEvent(Long64_t entry);
33     virtual Bool_t       Notify() { return AliInputEventHandler::Notify(); };
34     virtual Bool_t       Notify(const char* path);
35     virtual Bool_t       FinishEvent();
36     void                 CheckSelectionMask();
37     AliESDEvent         *GetEvent()        const {return fEvent;}
38     Option_t            *GetAnalysisType() const {return fAnalysisType;}
39     Option_t            *GetDataType() const;
40     // Tag cut summary analysis
41     Int_t                GetNEventAcceptedInFile();
42     Int_t                GetNEventRejectedInFile();
43     Bool_t               GetCutSummaryForChain(Int_t *aTotal, Int_t *aAccepted, Int_t *aRejected);
44     Int_t                GetNFilesEmpty();
45     // HLT  analysis
46     AliESDEvent         *GetHLTEvent()     const {return fHLTEvent;}
47     TTree               *GetHLTTree()      const {return fHLTTree;}    
48     void                 SetReadHLT()            {fUseHLT = kTRUE;}
49     // Friends&Co
50     AliESDfriend        *GetESDfriend()    const {return fFriend;}
51     AliESDpid           *GetESDpid()       const {return fESDpid;}
52     void                 SetESDpid(AliESDpid* pid)     {fESDpid = pid;}
53     void                 SetReadFriends(Bool_t flag)   {fReadFriends = flag;}
54     void                 SetFriendFileName(const char *fname)  {fFriendFileName = fname;}
55     // Tag analysis
56     void                 SetReadTags()           {fUseTags = kTRUE;}
57     AliRunTag           *GetRunTag() const       {return fRunTag;}
58     const AliEventTag   *GetEventTag() const     {return fEventTag;}
59     // Get the statistics object (currently TH2). Option can be BIN0.
60     virtual TObject     *GetStatistics(Option_t *option="") const;
61  private:
62     AliESDInputHandler(const AliESDInputHandler& handler);             
63     AliESDInputHandler& operator=(const AliESDInputHandler& handler);  
64  protected:
65     // ESD event
66     AliESDEvent    *fEvent;         //! Pointer to the event
67     AliESDfriend   *fFriend;        //! Pointer to the esd friend
68     AliESDpid      *fESDpid;        //! Pointer to PID information
69     Option_t       *fAnalysisType;  //! local, proof, grid
70     Int_t           fNEvents;       //! Number of events in the current tree
71     // HLT event
72     AliESDEvent    *fHLTEvent;      //! Pointer to the HLT Event (if present)
73     TTree          *fHLTTree;       //! Pointer to the HLT Event (if present)
74     Bool_t          fUseHLT;        //  Flag to access HLT Events
75     // ESD Tag Cut Summary
76     TMap           *fTagCutSumm;    //! Tag cut summary map
77     // ESD Tags (optional)
78     Bool_t          fUseTags;       //  Flag to use tags
79     TChain         *fChainT;        //! File with event tags
80     TTree          *fTreeT;         //! Tree of tags
81     AliRunTag      *fRunTag;        //! Pointer to the run tag
82     const AliEventTag *fEventTag;      //! Current event tag
83     // Friends
84     Bool_t          fReadFriends;   //  Flag for friends reading 
85     TString         fFriendFileName;//  Name of the file containing the frien tree (branch)
86     ClassDef(AliESDInputHandler, 6);
87 };
88
89 #endif