]>
Commit | Line | Data |
---|---|---|
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 TString; | |
25 | class TClonesArray; | |
26 | class TDirectoryFile; | |
27 | ||
28 | class AliHeader; | |
29 | class AliGenEventHeader; | |
30 | class AliStack; | |
31 | ||
32 | ||
33 | class AliMCEventHandler : public AliVEventHandler | |
34 | { | |
35 | public: | |
36 | AliMCEventHandler(); | |
37 | AliMCEventHandler(const char* name, const char* title); | |
38 | virtual ~AliMCEventHandler(); | |
39 | virtual void SetOutputFileName(char* /* fname */) {;} | |
40 | virtual char* GetOutputFileName() {return 0;} | |
41 | virtual void SetInputPath(char* fname); | |
42 | virtual TString* GetInputPath() {return fPathName;} | |
43 | virtual Bool_t InitIO(Option_t* opt); | |
44 | virtual Bool_t BeginEvent(); | |
45 | virtual Bool_t Notify(const char* path); | |
46 | virtual Bool_t FinishEvent(); | |
47 | virtual Bool_t Terminate(); | |
48 | virtual Bool_t TerminateIO(); | |
49 | virtual void ResetIO(); | |
50 | virtual Bool_t GetEvent(Int_t iev); | |
51 | // | |
52 | AliStack* Stack() {return fStack;} | |
53 | AliHeader* Header() {return fHeader;} | |
54 | AliGenEventHeader* GenEventHeader() {return (fHeader->GenEventHeader());} | |
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 | void ReorderAndExpandTreeTR(); | |
61 | ||
62 | private: | |
63 | TFile *fFileE; //! File with TreeE | |
64 | TFile *fFileK; //! File with TreeK | |
65 | TFile *fFileTR; //! File with TreeTR | |
66 | TFile *fTmpFileTR; //! Temporary file with TreeTR to read old format | |
67 | TTree *fTreeE; //! TreeE (Event Headers) | |
68 | TTree *fTreeK; //! TreeK (kinematics tree) | |
69 | TTree *fTreeTR; //! TreeTR (track references tree) | |
70 | TTree *fTmpTreeTR; //! Temporary tree TR to read old format | |
71 | TDirectoryFile *fDirK; //! Directory for Kine Tree | |
72 | TDirectoryFile *fDirTR; //! Directory for TR Tree | |
73 | AliStack *fStack; //! Current pointer to stack | |
74 | AliHeader *fHeader; //! Current pointer to header | |
75 | TClonesArray *fTrackReferences; //! Current list of track references | |
76 | Int_t fNEvent; //! Number of events | |
77 | Int_t fEvent; //! Current event | |
78 | Int_t fNprimaries; //! Number of primaries | |
79 | Int_t fNparticles; //! Number of particles | |
80 | TString *fPathName; //! Input file path | |
81 | char *fExtension; //! File name extension | |
82 | Int_t fFileNumber; //! Input file number | |
83 | Int_t fEventsPerFile; //! Number of events per file | |
84 | ClassDef(AliMCEventHandler,1) //MC Truth EventHandler class | |
85 | }; | |
86 | #endif | |
87 |