]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMCEventHandler.h
Pass event number as argument of AliVEventHandler::BeginEvent
[u/mrichter/AliRoot.git] / STEER / AliMCEventHandler.h
1 // -*- mode: C++ -*-
2 #ifndef ALIMCEVENTHANDLER_H
3 #define ALIMCEVENTHANDLER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7
8 /* $Id$ */
9
10 //-------------------------------------------------------------------------
11 //                          Class AliMCEvent
12 // This class gives access to MC truth during the analysis.
13 // Monte Carlo truth is contained in the kinematics tree (produced particles) and 
14 // the tree of reference hits.
15 //      
16 // Origin: Andreas Morsch, CERN, andreas.morsch@cern.ch 
17 //-------------------------------------------------------------------------
18 #include "AliVEventHandler.h"
19 #include "AliHeader.h"
20 class TFile;
21 class TTree;
22 class TParticle;
23 class TString;
24 class TClonesArray;
25 class TDirectoryFile;
26
27 class AliMCEvent;
28
29
30
31 class AliMCEventHandler : public AliVEventHandler
32 {
33 public:
34     AliMCEventHandler();
35     AliMCEventHandler(const char* name, const char* title);
36     virtual ~AliMCEventHandler();
37     virtual void         SetOutputFileName(char* /* fname */) {;}
38     virtual char*        GetOutputFileName() {return 0;}
39     virtual void         SetInputPath(char* fname); 
40     virtual void         SetInputTree(TTree* /*tree*/) {;}
41     virtual TString*     GetInputPath() {return fPathName;}
42     virtual Bool_t       InitIO(Option_t* opt);
43     virtual Bool_t       BeginEvent(Long64_t entry);
44     // needed to prevent warning of hidden virtual Bool_t TObject::Notify()
45     virtual Bool_t       Notify() { return AliVEventHandler::Notify(); };
46     virtual Bool_t       Notify(const char* path);
47     virtual Bool_t       FinishEvent();
48     virtual Bool_t       Terminate();
49     virtual Bool_t       TerminateIO();
50     virtual void         ResetIO();
51     virtual Bool_t       GetEvent(Int_t iev);
52     virtual void         SetReadTR(Bool_t flag) { fReadTR = flag; }
53     //
54     AliMCEvent* MCEvent() {return fMCEvent;}
55     TTree*      TreeTR() {return fTreeTR;}
56     Int_t       GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
57     void        DrawCheck(Int_t i, Int_t search=0);
58 private:
59     Bool_t      OpenFile(Int_t i);
60 private:
61     AliMCEvent       *fMCEvent;          //! MC Event
62     TFile            *fFileE;            //! File with TreeE
63     TFile            *fFileK;            //! File with TreeK
64     TFile            *fFileTR;           //! File with TreeTR
65     TTree            *fTreeE;            //! TreeE  (Event Headers)
66     TTree            *fTreeK;            //! TreeK  (kinematics tree)
67     TTree            *fTreeTR;           //! TreeTR (track references tree)
68     TDirectoryFile   *fDirK;             //! Directory for Kine Tree
69     TDirectoryFile   *fDirTR;            //! Directory for TR Tree
70     Int_t             fNEvent;           //! Number of events
71     Int_t             fEvent;            //! Current event
72     TString          *fPathName;         //! Input file path 
73     char             *fExtension;        //! File name extension 
74     Int_t             fFileNumber;       //! Input file number
75     Int_t             fEventsPerFile;    //! Number of events per file
76     Bool_t            fReadTR;           // determines if TR shall be read
77     ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class
78 };
79 #endif 
80