Fix: Added config file for MC
[u/mrichter/AliRoot.git] / STEER / AliMCEventHandler.h
CommitLineData
969c7896 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.
415d9f5c 13// Monte Carlo truth is contained in the kinematics tree (produced particles) and
033693d3 14// the tree of reference hits.
15//
16// Origin: Andreas Morsch, CERN, andreas.morsch@cern.ch
17//-------------------------------------------------------------------------
d2f1d9ef 18#include "AliVEventHandler.h"
47b95647 19#include "AliHeader.h"
033693d3 20class TFile;
21class TTree;
22class TParticle;
0a05cd41 23class TString;
033693d3 24class TClonesArray;
5efedd31 25class TDirectoryFile;
26
415d9f5c 27class AliMCEvent;
28
033693d3 29
30
276be602 31class AliMCEventHandler : public AliVEventHandler
033693d3 32{
33public:
5fe09262 34 AliMCEventHandler();
35 AliMCEventHandler(const char* name, const char* title);
36 virtual ~AliMCEventHandler();
0931e76a 37 virtual void SetOutputFileName(const char* /* fname */) {;}
38 virtual const char* GetOutputFileName() {return 0;}
39 virtual void SetInputPath(const char* fname);
933fd60f 40 virtual void SetInputTree(TTree* /*tree*/) {;}
d0916b2f 41 virtual TString* GetInputPath() const {return fPathName;}
300d5701 42 virtual Bool_t Init(Option_t* opt);
43 virtual Bool_t InitIO(Option_t* opt) {return Init(opt);};
44 virtual Bool_t Init(TTree* /*tree*/, Option_t* /*opt*/) {return kTRUE;}
ed97dc98 45 virtual Bool_t BeginEvent(Long64_t entry);
24e577e5 46 virtual Bool_t Notify() { return AliVEventHandler::Notify(); };
890126ab 47 virtual Bool_t Notify(const char* path);
033693d3 48 virtual Bool_t FinishEvent();
49 virtual Bool_t Terminate();
50 virtual Bool_t TerminateIO();
5fe09262 51 virtual void ResetIO();
9aea8469 52 virtual Bool_t GetEvent(Int_t iev);
969c7896 53 virtual void SetReadTR(Bool_t flag) { fReadTR = flag; }
033693d3 54 //
2bb794ba 55 AliMCEvent* MCEvent() const {return fMCEvent;}
d0916b2f 56 TTree* TreeTR() const {return fTreeTR;}
57 TTree* TreeK() const {return fTreeK;}
415d9f5c 58 Int_t GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
59 void DrawCheck(Int_t i, Int_t search=0);
5fe09262 60private:
415d9f5c 61 Bool_t OpenFile(Int_t i);
87d395bd 62 AliMCEventHandler(const AliMCEventHandler& handler);
63 AliMCEventHandler& operator=(const AliMCEventHandler& handler);
033693d3 64private:
415d9f5c 65 AliMCEvent *fMCEvent; //! MC Event
033693d3 66 TFile *fFileE; //! File with TreeE
67 TFile *fFileK; //! File with TreeK
68 TFile *fFileTR; //! File with TreeTR
69 TTree *fTreeE; //! TreeE (Event Headers)
70 TTree *fTreeK; //! TreeK (kinematics tree)
71 TTree *fTreeTR; //! TreeTR (track references tree)
5efedd31 72 TDirectoryFile *fDirK; //! Directory for Kine Tree
73 TDirectoryFile *fDirTR; //! Directory for TR Tree
033693d3 74 Int_t fNEvent; //! Number of events
75 Int_t fEvent; //! Current event
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
969c7896 80 Bool_t fReadTR; // determines if TR shall be read
c8b7b5d3 81 Bool_t fInitOk; // Initialization ok
969c7896 82 ClassDef(AliMCEventHandler,1) //MC Truth EventHandler class
033693d3 83};
84#endif
85