Make destructor virtual
[u/mrichter/AliRoot.git] / STEER / AliRun.h
fe4da5cc 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$ */
fe4da5cc 8#include <TROOT.h>
9#include <TBrowser.h>
10#include <TList.h>
11#include <TStopwatch.h>
12#include <TTree.h>
13#include <TGeometry.h>
1578254f 14#include <TDatabasePDG.h>
c411211e 16#include "AliDetector.h"
fe4da5cc 17#include "AliHeader.h"
18#include "AliMagF.h"
80762cb1 19#include "AliVMC.h"
fe4da5cc 20#include "AliGenerator.h"
21#include "AliLego.h"
1578254f 23enum {Keep_Bit=1, Daughters_Bit=2, Done_Bit=4};
fe4da5cc 25class AliDisplay;
27class AliRun : public TNamed {
30 Int_t fRun; //Current run number
31 Int_t fEvent; //Current event number (from 1)
32 Int_t fNtrack; //Number of tracks
33 Int_t fHgwmk; //Last track purified
34 Int_t fCurrent; //Last track returned from the stack
35 Int_t fDebug; //Debug flag
36 AliHeader fHeader; //Header information
37 TTree *fTreeD; //Pointer to Tree for Digits
38 TTree *fTreeK; //Pointer to Tree for Kinematics
39 TTree *fTreeH; //Pointer to Tree for Hits
40 TTree *fTreeE; //Pointer to Tree for Header
41 TTree *fTreeR; //Pointer to Tree for Reconstructed Objects
02ca2762 42 TObjArray *fModules; //List of Detectors
fe4da5cc 43 TClonesArray *fParticles; //Pointer to list of particles
44 TGeometry *fGeometry; //Pointer to geometry
45 AliDisplay *fDisplay; //Pointer to event display
46 TStopwatch fTimer; //Timer object
47 AliMagF *fField; //Magnetic Field Map
80762cb1 48 AliVMC *fVMC; //pointer to MonteCarlo object
fe4da5cc 49 TArrayI *fImedia; //Array of correspondence between media and detectors
50 Int_t fNdets; //Number of detectors
51 Float_t fTrRmax; //Maximum radius for tracking
52 Float_t fTrZmax; //Maximu z for tracking
53 AliGenerator *fGenerator; //Generator used in the MC
fe4da5cc 54 Bool_t fInitDone; //true when initialisation done
55 AliLego *fLego; //pointer to aliLego object if it exists
1578254f 56 TDatabasePDG *fPDGDB; //Particle factory object!
1cedd08a 57 TList *fHitLists; //Lists of hits to be remapped by PurifyKine
fe4da5cc 58
60 // Creators - distructors
61 AliRun();
62 AliRun(const char *name, const char *title);
63 virtual ~AliRun();
65 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
66 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
1cedd08a 67 virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
fe4da5cc 68 virtual void Browse(TBrowser *b);
69 virtual void Build();
70 virtual void BuildSimpleGeometry();
71 virtual void CleanDetectors();
72 virtual void CleanParents();
8494b010 73 TObjArray *Detectors() const {return fModules;}
74 TObjArray *Modules() const {return fModules;}
fe4da5cc 75 Int_t CurrentTrack() const {return fCurrent;}
76 AliDisplay *Display() { return fDisplay;}
77 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
78 virtual void DumpPart (Int_t i);
79 virtual void DumpPStack ();
80 virtual AliMagF *Field() const {return fField;}
81 virtual void FillTree();
82 virtual void FinishPrimary();
83 virtual void FinishEvent();
84 virtual void FinishRun();
85 virtual void FlagTrack(Int_t track);
86 Int_t GetEvNumber() const {return fEvent;}
87 Int_t GetRunNumber() const {return fRun;}
8494b010 88 void SetRunNumber(Int_t run) {fRun=run;}
fe4da5cc 89 Int_t GetDebug() const {return fDebug;}
8494b010 90 AliModule *GetModule(const char *name);
a68348e9 91 AliDetector *GetDetector(const char *name);
8494b010 92 Int_t GetModuleID(const char *name);
fe4da5cc 93 virtual Int_t GetEvent(Int_t event);
94 TGeometry *GetGeometry();
95 AliHeader *GetHeader() {return &fHeader;}
96 virtual void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof);
97 Int_t GetNtrack() {return fNtrack;}
98 virtual Int_t GetPrimary(Int_t track);
99 virtual void Init(const char *setup="Config.C");
100 Bool_t IsFolder() {return kTRUE;}
101 virtual void MakeTree(Option_t *option="KH");
102 TClonesArray *Particles() {return fParticles;};
103 virtual void PurifyKine();
104 virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks);
105 virtual void Reset(Int_t run, Int_t idevent);
106 virtual void ResetDigits();
107 virtual void ResetHits();
108 virtual void ResetPoints();
109 virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
110 virtual void ResetStack() {fCurrent=-1;fHgwmk=0;fNtrack=0;fParticles->Clear();}
111 virtual void Run(Int_t nevent=1, const char *setup="Config.C");
112 virtual void RunLego(const char *setup="Config.C",Int_t ntheta=60,Float_t themin=2,Float_t themax=178,
113 Int_t nphi=60,Float_t phimin=0,Float_t phimax=360,Float_t rmin=0,
114 Float_t rmax=570,Float_t zmax=10000);
115 virtual void SetCurrentTrack(Int_t track);
116 virtual void SetDebug(const Int_t level=1) {fDebug = level;}
117 virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
118 virtual void StepManager(Int_t id) const;
119 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");
1578254f 120 virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
fe4da5cc 121 Float_t *pmom, Float_t *vpos, Float_t *polar,
122 Float_t tof, const char *mecha, Int_t &ntr,
123 Float_t weight=1);
124 virtual void KeepTrack(const Int_t);
125 virtual void MediaTable();
126 virtual Float_t TrackingZmax() const {return fTrZmax;}
127 virtual Float_t TrackingRmax() const {return fTrRmax;}
128 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10) {fTrRmax=rmax; fTrZmax=zmax;}
129 virtual Int_t DetFromMate(Int_t i) { return (*fImedia)[i];}
130 virtual AliGenerator* Generator() {return fGenerator;}
131 virtual void SetGenerator(AliGenerator *generator);
ee1dd322 132 virtual void ResetGenerator(AliGenerator *generator);
fe4da5cc 133 virtual void EnergySummary();
1578254f 134 virtual const TDatabasePDG* PDGDB() const {return fPDGDB;}
fe4da5cc 135
fe4da5cc 136 TTree *TreeD() {return fTreeD;}
137 TTree *TreeE() {return fTreeE;}
138 TTree *TreeH() {return fTreeH;}
139 TTree *TreeK() {return fTreeK;}
140 TTree *TreeR() {return fTreeR;}
142 // --------------------------- commons -------------------------------------
59fe9bd2 144 ClassDef(AliRun,2) //Supervisor class for all Alice detectors
fe4da5cc 145};
75a25b1b 147R__EXTERN AliRun *gAlice;
fe4da5cc 148