]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMCEventHandler.h
Getters for header and generated event header.
[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 containe 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
19 #include "AliVEventHandler.h"
20 #include "AliHeader.h"
21 class TFile;
22 class TTree;
23 class TParticle;
24 class TClonesArray;
25 class AliHeader;
26 class AliGenEventHeader;
27 class AliStack;
28
29
30 class AliMCEventHandler : public AliVEventHandler 
31 {
32 public:
33     AliMCEventHandler();
34     AliMCEventHandler(const char* name, const char* title);
35     virtual ~AliMCEventHandler();
36     virtual void         SetOutputFileName(char* /* fname */) {;}
37     virtual char*        GetOutputFileName() {return 0;}
38     virtual void         SetInputPath(char* fname) {fPathName = fname;}
39     virtual char*        GetInputPath() {return fPathName;}
40     virtual Bool_t       InitIO(Option_t* opt);
41     virtual Bool_t       BeginEvent();
42     virtual Bool_t       Notify(const char* path);
43     virtual Bool_t       FinishEvent();
44     virtual Bool_t       Terminate();
45     virtual Bool_t       TerminateIO();
46     virtual void         ResetIO();
47     virtual Bool_t       GetEvent(Int_t iev);
48     //
49     AliStack*    Stack()   {return fStack;}
50     AliHeader*   Header()  {return fHeader;}
51     AliGenEventHeader* GenEventHeader() {return (fHeader->GenEventHeader());}
52     TTree*    TreeTR() {return fTreeTR;}
53     Int_t     GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
54     void      DrawCheck(Int_t i, Bool_t search=kFALSE);
55 private:
56     Bool_t    OpenFile(Int_t i);
57     void      ReorderAndExpandTreeTR();
58     
59 private:
60     TFile            *fFileE;            //! File with TreeE
61     TFile            *fFileK;            //! File with TreeK
62     TFile            *fFileTR;           //! File with TreeTR
63     TFile            *fTmpFileTR;        //! Temporary file with TreeTR to read old format
64     TTree            *fTreeE;            //! TreeE  (Event Headers)
65     TTree            *fTreeK;            //! TreeK  (kinematics tree)
66     TTree            *fTreeTR;           //! TreeTR (track references tree)
67     TTree            *fTmpTreeTR;        //! Temporary tree TR to read old format
68     AliStack         *fStack;            //! Current pointer to stack
69     AliHeader        *fHeader;           //! Current pointer to header
70     TClonesArray     *fTrackReferences;  //! Current list of track references
71     Int_t             fNEvent;           //! Number of events
72     Int_t             fEvent;            //! Current event
73     Int_t             fNprimaries;       //! Number of primaries
74     Int_t             fNparticles;       //! Number of particles
75     char             *fPathName;         //! Input file path 
76     char             *fExtension;        //! File name extension 
77     Int_t             fFileNumber;       //! Input file number
78     Int_t             fEventsPerFile;    //! Number of events per file
79     ClassDef(AliMCEventHandler,1)  //MC Truth EventHandler class 
80 };
81 #endif 
82