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