Removed verbose output.
[u/mrichter/AliRoot.git] / STEER / AliRun.h
aee8290b 1#ifndef ALIRUN_H
2#define ALIRUN_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6/* $Id$ */
94de3818 8class TBrowser;
9class TList;
10class TTree;
11class TGeometry;
12class TDatabasePDG;
65fb704d 13class TRandom;
2ab0c725 14class TParticle;
94de3818 15#include <TArrayI.h>
65fb704d 16#include "TClonesArray.h"
94de3818 17#include <TArrayF.h>
fe4da5cc 18#include <TStopwatch.h>
65fb704d 19#include "TNamed.h"
1578254f 20
94de3818 21class AliDetector;
22class AliModule;
23class AliMagF;
24class AliMC;
25class AliLego;
26class AliDisplay;
0a520a66 27class AliLegoGenerator;
fe4da5cc 28#include "AliHeader.h"
65fb704d 29class AliGenerator;
30class AliLegoGenerator;
31#include "AliMCProcess.h"
2ab0c725 32class AliMCQA;
fe4da5cc 33
aee8290b 34enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
1578254f 35
fe4da5cc 36
37class AliRun : public TNamed {
fe4da5cc 38public:
39 // Creators - distructors
40 AliRun();
41 AliRun(const char *name, const char *title);
42 virtual ~AliRun();
44 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
45 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
1cedd08a 46 virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
fe4da5cc 47 virtual void Browse(TBrowser *b);
48 virtual void Build();
49 virtual void BuildSimpleGeometry();
50 virtual void CleanDetectors();
51 virtual void CleanParents();
8494b010 52 TObjArray *Detectors() const {return fModules;}
53 TObjArray *Modules() const {return fModules;}
fe4da5cc 54 Int_t CurrentTrack() const {return fCurrent;}
55 AliDisplay *Display() { return fDisplay;}
56 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
94de3818 57 virtual void DumpPart (Int_t i) const;
58 virtual void DumpPStack () const;
fe4da5cc 59 virtual AliMagF *Field() const {return fField;}
65fb704d 60 virtual void PreTrack();
61 virtual void PostTrack();
fe4da5cc 62 virtual void FinishPrimary();
63 virtual void FinishEvent();
64 virtual void FinishRun();
65 virtual void FlagTrack(Int_t track);
875c717b 66 void AddEnergyDeposit(Int_t id, Float_t edep)
67 {fEventEnergy[id]+=edep;}
fe4da5cc 68 Int_t GetEvNumber() const {return fEvent;}
69 Int_t GetRunNumber() const {return fRun;}
8494b010 70 void SetRunNumber(Int_t run) {fRun=run;}
fe4da5cc 71 Int_t GetDebug() const {return fDebug;}
94de3818 72 AliModule *GetModule(const char *name) const;
73 AliDetector *GetDetector(const char *name) const;
65fb704d 74 AliMCQA *GetMCQA() const {return fMCQA;}
94de3818 75 Int_t GetModuleID(const char *name) const;
39de14fb 76 virtual const char *GetBaseFile() const
77 {return fBaseFileName.Data();}
fe4da5cc 78 virtual Int_t GetEvent(Int_t event);
45189757 79 virtual void SetEvent(Int_t event) {fEvent=event;}
94de3818 80 virtual void SetConfigFunction(const char * config="Config();");
45189757 81 virtual const char *GetConfigFunction() const
82 {return fConfigFunction.Data();}
fe4da5cc 83 TGeometry *GetGeometry();
84 AliHeader *GetHeader() {return &fHeader;}
45189757 85 virtual void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom,
86 Float_t &e, Float_t *vpos, Float_t *polar,
87 Float_t &tof);
94de3818 88 Int_t GetNtrack() const {return fNtrack;}
89 virtual Int_t GetPrimary(Int_t track) const;
2ab0c725 90 virtual void Hits2Digits(const char *detector=0);
91 virtual void Hits2SDigits(const char *detector=0);
92 virtual void SDigits2Digits(const char *detector=0);
875c717b 93 virtual void InitMC(const char *setup="Config.C");
94 virtual void Init(const char *setup="Config.C") {InitMC(setup);}
b21a3d1a 95 Bool_t IsFolder() const {return kTRUE;}
838edcaf 96 virtual AliLego* Lego() const {return fLego;}
2ab0c725 97 virtual void MakeTree(Option_t *option="KH", char *file = 0);
98 virtual void MakeBranchInTree(TTree *tree, const char* cname, void* address, Int_t size=32000, char *file=0);
99 virtual void MakeBranchInTree(TTree *tree, const char* cname, const char* name, void* address, Int_t size=32000, Int_t splitlevel=1, char *file=0);
101 TObjArray *Particles() {return fParticleMap;};
102 TParticle *Particle(Int_t i);
fe4da5cc 103 virtual void PurifyKine();
104 virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks);
dffd31ef 105 virtual void BeginEvent();
fe4da5cc 106 virtual void ResetDigits();
2ab0c725 107 virtual void ResetSDigits();
fe4da5cc 108 virtual void ResetHits();
109 virtual void ResetPoints();
110 virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
2ab0c725 111 virtual void SetBaseFile(char *filename="galice.root");
65fb704d 112 virtual void ReadTransPar();
2ab0c725 113 virtual void ResetStack() {fCurrent=-1;fHgwmk=fNtrack=fLoadPoint=0;fParticles->Clear();}
875c717b 114 virtual void RunMC(Int_t nevent=1, const char *setup="Config.C");
115 virtual void Run(Int_t nevent=1, const char *setup="Config.C")
116 {RunMC(nevent,setup);}
dea76e7a 117 virtual void RunLego(const char *setup="Config.C",Int_t nc1=60,Float_t c1min=2,Float_t c1max=178,
118 Int_t nc2=60,Float_t c2min=0,Float_t c2max=360,Float_t rmin=0,
0a520a66 119 Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL);
dffd31ef 120 virtual Bool_t IsLegoRun() const {return (fLego!=0);}
fe4da5cc 121 virtual void SetCurrentTrack(Int_t track);
122 virtual void SetDebug(const Int_t level=1) {fDebug = level;}
123 virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
875c717b 124 virtual void StepManager(Int_t id);
fe4da5cc 125 virtual void SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, char*filename="$(ALICE_ROOT)/data/field01.dat");
d8408e76 126 virtual void SetField(AliMagF* magField);
1578254f 127 virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
fe4da5cc 128 Float_t *pmom, Float_t *vpos, Float_t *polar,
65fb704d 129 Float_t tof, AliMCProcess mech, Int_t &ntr,
fe4da5cc 130 Float_t weight=1);
89bbad6f 131 virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
132 Double_t px, Double_t py, Double_t pz, Double_t e,
133 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
134 Double_t polx, Double_t poly, Double_t polz,
135 AliMCProcess mech, Int_t &ntr, Float_t weight=1);
caaac55b 136 virtual void SetHighWaterMark(const Int_t nt);
4d69d91e 137
138 virtual void KeepTrack(const Int_t itra);
fe4da5cc 139 virtual void MediaTable();
140 virtual Float_t TrackingZmax() const {return fTrZmax;}
141 virtual Float_t TrackingRmax() const {return fTrRmax;}
142 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10) {fTrRmax=rmax; fTrZmax=zmax;}
94de3818 143 virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
144 virtual AliGenerator* Generator() const {return fGenerator;}
fe4da5cc 145 virtual void SetGenerator(AliGenerator *generator);
ee1dd322 146 virtual void ResetGenerator(AliGenerator *generator);
fe4da5cc 147 virtual void EnergySummary();
94de3818 148 virtual TDatabasePDG* PDGDB() const {return fPDGDB;}
fe4da5cc 149
875c717b 150
fe4da5cc 151 TTree *TreeD() {return fTreeD;}
2ab0c725 152 TTree *TreeS() {return fTreeS;}
fe4da5cc 153 TTree *TreeE() {return fTreeE;}
154 TTree *TreeH() {return fTreeH;}
155 TTree *TreeK() {return fTreeK;}
156 TTree *TreeR() {return fTreeR;}
aee8290b 158protected:
2ab0c725 159 Int_t fRun; //! Current run number
160 Int_t fEvent; //! Current event number (from 1)
161 Int_t fNtrack; // Number of tracks
162 Int_t fHgwmk; //! Last track purified
163 Int_t fLoadPoint; //! Next free position in the particle buffer
164 Int_t fCurrent; //! Last track returned from the stack
165 Int_t fDebug; // Debug flag
166 AliHeader fHeader; // Header information
167 TTree *fTreeD; //! Pointer to Tree for Digits
168 TTree *fTreeS; //! Pointer to Tree for SDigits
169 TTree *fTreeK; //! Pointer to Tree for Kinematics
170 TTree *fTreeH; //! Pointer to Tree for Hits
171 TTree *fTreeE; //! Pointer to Tree for Header
172 TTree *fTreeR; //! Pointer to Tree for Reconstructed Objects
173 TObjArray *fModules; // List of Detectors
174 TClonesArray *fParticles; //! Pointer to list of particles
175 TGeometry *fGeometry; // Pointer to geometry
176 AliDisplay *fDisplay; //! Pointer to event display
177 TStopwatch fTimer; // Timer object
178 AliMagF *fField; // Magnetic Field Map
179 AliMC *fMC; //! Pointer to MonteCarlo object
180 TArrayI *fImedia; //! Array of correspondence between media and detectors
181 Int_t fNdets; // Number of detectors
182 Float_t fTrRmax; // Maximum radius for tracking
183 Float_t fTrZmax; // Maximu z for tracking
184 AliGenerator *fGenerator; // Generator used in the MC
185 Bool_t fInitDone; //! True when initialisation done
186 AliLego *fLego; //! Pointer to aliLego object if it exists
187 TDatabasePDG *fPDGDB; // Particle factory object
188 TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
189 TArrayF fEventEnergy; //! Energy deposit for current event
190 TArrayF fSummEnergy; //! Energy per event in each volume
191 TArrayF fSum2Energy; //! Energy squared per event in each volume
192 TString fConfigFunction; // Configuration file to be executed
193 TRandom *fRandom; // Pointer to the random number generator
194 AliMCQA *fMCQA; // Pointer to MC Quality assurance class
195 TString fTransParName; // Name of the transport parameters file
196 TString fBaseFileName; // Name of the base root file
197 TParticle *fParticleBuffer; //! Pointer to current particle for writing
198 TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
199 TArrayI fParticleFileMap; // Map of particles in the file
fe4da5cc 200
ef42d733 201private:
203 AliRun(const AliRun &) {}
204 AliRun& operator = (const AliRun &) {return *this;}
65fb704d 206 ClassDef(AliRun,4) //Supervisor class for all Alice detectors
fe4da5cc 207};
75a25b1b 209R__EXTERN AliRun *gAlice;
fe4da5cc 210