Small bug fixes to TPC files
[u/mrichter/AliRoot.git] / STEER / AliRun.h
... / ...
1#ifndef AliRun_H
2#define AliRun_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6/* $Id$ */
8#include <TROOT.h>
9#include <TBrowser.h>
10#include <TList.h>
11#include <TStopwatch.h>
12#include <TTree.h>
13#include <TGeometry.h>
14#include <TDatabasePDG.h>
16#include "AliDetector.h"
17#include "AliHeader.h"
18#include "AliMagF.h"
19#include "AliMC.h"
20#include "AliGenerator.h"
21#include "AliLego.h"
23enum {Keep_Bit=1, Daughters_Bit=2, Done_Bit=4};
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
42 TObjArray *fModules; //List of Detectors
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
48 AliMC *fMC; //pointer to MonteCarlo object
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
54 Bool_t fInitDone; //true when initialisation done
55 AliLego *fLego; //pointer to aliLego object if it exists
56 TDatabasePDG *fPDGDB; //Particle factory object!
57 TList *fHitLists; //Lists of hits to be remapped by PurifyKine
58 TArrayF fEventEnergy; //Energy deposit for current event
59 TArrayF fSummEnergy; //Energy per event in each volume
60 TArrayF fSum2Energy; //Energy squared per event in each volume
64 // Creators - distructors
65 AliRun();
66 AliRun(const char *name, const char *title);
67 virtual ~AliRun();
69 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
70 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
71 virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
72 virtual void Browse(TBrowser *b);
73 virtual void Build();
74 virtual void BuildSimpleGeometry();
75 virtual void CleanDetectors();
76 virtual void CleanParents();
77 TObjArray *Detectors() const {return fModules;}
78 TObjArray *Modules() const {return fModules;}
79 Int_t CurrentTrack() const {return fCurrent;}
80 AliDisplay *Display() { return fDisplay;}
81 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
82 virtual void DumpPart (Int_t i);
83 virtual void DumpPStack ();
84 virtual AliMagF *Field() const {return fField;}
85 virtual void FillTree();
86 virtual void FinishPrimary();
87 virtual void FinishEvent();
88 virtual void FinishRun();
89 virtual void FlagTrack(Int_t track);
90 void AddEnergyDeposit(Int_t id, Float_t edep)
91 {fEventEnergy[id]+=edep;}
92 Int_t GetEvNumber() const {return fEvent;}
93 Int_t GetRunNumber() const {return fRun;}
94 void SetRunNumber(Int_t run) {fRun=run;}
95 Int_t GetDebug() const {return fDebug;}
96 AliModule *GetModule(const char *name);
97 AliDetector *GetDetector(const char *name);
98 Int_t GetModuleID(const char *name);
99 virtual Int_t GetEvent(Int_t event);
100 virtual void SetEvent(Int_t event) {fEvent=event;}
101 TGeometry *GetGeometry();
102 AliHeader *GetHeader() {return &fHeader;}
103 virtual void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof);
104 Int_t GetNtrack() {return fNtrack;}
105 virtual Int_t GetPrimary(Int_t track);
106 virtual void InitMC(const char *setup="Config.C");
107 virtual void Init(const char *setup="Config.C") {InitMC(setup);}
108 Bool_t IsFolder() {return kTRUE;}
109 virtual void MakeTree(Option_t *option="KH");
110 TClonesArray *Particles() {return fParticles;};
111 virtual void PurifyKine();
112 virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks);
113 virtual void Reset();
114 virtual void ResetDigits();
115 virtual void ResetHits();
116 virtual void ResetPoints();
117 virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
118 virtual void ResetStack() {fCurrent=-1;fHgwmk=0;fNtrack=0;fParticles->Clear();}
119 virtual void RunMC(Int_t nevent=1, const char *setup="Config.C");
120 virtual void Run(Int_t nevent=1, const char *setup="Config.C")
121 {RunMC(nevent,setup);}
122 virtual void RunLego(const char *setup="Config.C",Int_t ntheta=60,Float_t themin=2,Float_t themax=178,
123 Int_t nphi=60,Float_t phimin=0,Float_t phimax=360,Float_t rmin=0,
124 Float_t rmax=570,Float_t zmax=10000);
125 virtual void SetCurrentTrack(Int_t track);
126 virtual void SetDebug(const Int_t level=1) {fDebug = level;}
127 virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
128 virtual void StepManager(Int_t id);
129 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");
130 virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
131 Float_t *pmom, Float_t *vpos, Float_t *polar,
132 Float_t tof, const char *mecha, Int_t &ntr,
133 Float_t weight=1);
134 virtual void KeepTrack(const Int_t);
135 virtual void MediaTable();
136 virtual Float_t TrackingZmax() const {return fTrZmax;}
137 virtual Float_t TrackingRmax() const {return fTrRmax;}
138 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10) {fTrRmax=rmax; fTrZmax=zmax;}
139 virtual Int_t DetFromMate(Int_t i) { return (*fImedia)[i];}
140 virtual AliGenerator* Generator() {return fGenerator;}
141 virtual void SetGenerator(AliGenerator *generator);
142 virtual void ResetGenerator(AliGenerator *generator);
143 virtual void EnergySummary();
144 virtual const TDatabasePDG* PDGDB() const {return fPDGDB;}
147 TTree *TreeD() {return fTreeD;}
148 TTree *TreeE() {return fTreeE;}
149 TTree *TreeH() {return fTreeH;}
150 TTree *TreeK() {return fTreeK;}
151 TTree *TreeR() {return fTreeR;}
153 // --------------------------- commons -------------------------------------
155 ClassDef(AliRun,2) //Supervisor class for all Alice detectors
158R__EXTERN AliRun *gAlice;