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