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