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