]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMCEventHandler.h
The MC Event part has been separated from the AliMCEventHandler.
[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 TString*     GetInputPath() {return fPathName;}
41     virtual Bool_t       InitIO(Option_t* opt);
42     virtual Bool_t       BeginEvent();
43     virtual Bool_t       Notify(const char* path);
44     virtual Bool_t       FinishEvent();
45     virtual Bool_t       Terminate();
46     virtual Bool_t       TerminateIO();
47     virtual void         ResetIO();
48     virtual Bool_t       GetEvent(Int_t iev);
49     //
50     AliMCEvent* MCEvent() {return fMCEvent;}
51     TTree*      TreeTR() {return fTreeTR;}
52     Int_t       GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
53     void        DrawCheck(Int_t i, Int_t search=0);
54 private:
55     Bool_t      OpenFile(Int_t i);
56 private:
57     AliMCEvent       *fMCEvent;          //! MC Event
58     TFile            *fFileE;            //! File with TreeE
59     TFile            *fFileK;            //! File with TreeK
60     TFile            *fFileTR;           //! File with TreeTR
61     TTree            *fTreeE;            //! TreeE  (Event Headers)
62     TTree            *fTreeK;            //! TreeK  (kinematics tree)
63     TTree            *fTreeTR;           //! TreeTR (track references tree)
64     TDirectoryFile   *fDirK;             //! Directory for Kine Tree
65     TDirectoryFile   *fDirTR;            //! Directory for TR Tree
66     Int_t             fNEvent;           //! Number of events
67     Int_t             fEvent;            //! Current event
68     TString          *fPathName;         //! Input file path 
69     char             *fExtension;        //! File name extension 
70     Int_t             fFileNumber;       //! Input file number
71     Int_t             fEventsPerFile;    //! Number of events per file
72     ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class 
73 };
74 #endif 
75