Clean up to correct for the mess introduced by my eratic branching !
[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"
19#include "AliMC.h"
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
48 AliMC *fMC; //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!
fe4da5cc 57
59 // Creators - distructors
60 AliRun();
61 AliRun(const char *name, const char *title);
62 virtual ~AliRun();
64 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
65 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
66 virtual void Browse(TBrowser *b);
67 virtual void Build();
68 virtual void BuildSimpleGeometry();
69 virtual void CleanDetectors();
70 virtual void CleanParents();
8494b010 71 TObjArray *Detectors() const {return fModules;}
72 TObjArray *Modules() const {return fModules;}
fe4da5cc 73 Int_t CurrentTrack() const {return fCurrent;}
74 AliDisplay *Display() { return fDisplay;}
75 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
76 virtual void DumpPart (Int_t i);
77 virtual void DumpPStack ();
78 virtual AliMagF *Field() const {return fField;}
79 virtual void FillTree();
80 virtual void FinishPrimary();
81 virtual void FinishEvent();
82 virtual void FinishRun();
83 virtual void FlagTrack(Int_t track);
84 Int_t GetEvNumber() const {return fEvent;}
85 Int_t GetRunNumber() const {return fRun;}
8494b010 86 void SetRunNumber(Int_t run) {fRun=run;}
fe4da5cc 87 Int_t GetDebug() const {return fDebug;}
8494b010 88 AliModule *GetModule(const char *name);
a68348e9 89 AliDetector *GetDetector(const char *name);
8494b010 90 Int_t GetModuleID(const char *name);
fe4da5cc 91 virtual Int_t GetEvent(Int_t event);
92 TGeometry *GetGeometry();
93 AliHeader *GetHeader() {return &fHeader;}
94 virtual void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof);
95 Int_t GetNtrack() {return fNtrack;}
96 virtual Int_t GetPrimary(Int_t track);
97 virtual void Init(const char *setup="Config.C");
98 Bool_t IsFolder() {return kTRUE;}
99 virtual void MakeTree(Option_t *option="KH");
100 TClonesArray *Particles() {return fParticles;};
101 virtual void PurifyKine();
102 virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks);
103 virtual void Reset(Int_t run, Int_t idevent);
104 virtual void ResetDigits();
105 virtual void ResetHits();
106 virtual void ResetPoints();
107 virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts");
108 virtual void ResetStack() {fCurrent=-1;fHgwmk=0;fNtrack=0;fParticles->Clear();}
109 virtual void Run(Int_t nevent=1, const char *setup="Config.C");
110 virtual void RunLego(const char *setup="Config.C",Int_t ntheta=60,Float_t themin=2,Float_t themax=178,
111 Int_t nphi=60,Float_t phimin=0,Float_t phimax=360,Float_t rmin=0,
112 Float_t rmax=570,Float_t zmax=10000);
113 virtual void SetCurrentTrack(Int_t track);
114 virtual void SetDebug(const Int_t level=1) {fDebug = level;}
115 virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
116 virtual void StepManager(Int_t id) const;
117 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 118 virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg,
fe4da5cc 119 Float_t *pmom, Float_t *vpos, Float_t *polar,
120 Float_t tof, const char *mecha, Int_t &ntr,
121 Float_t weight=1);
122 virtual void KeepTrack(const Int_t);
123 virtual void MediaTable();
124 virtual Float_t TrackingZmax() const {return fTrZmax;}
125 virtual Float_t TrackingRmax() const {return fTrRmax;}
126 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10) {fTrRmax=rmax; fTrZmax=zmax;}
127 virtual Int_t DetFromMate(Int_t i) { return (*fImedia)[i];}
128 virtual AliGenerator* Generator() {return fGenerator;}
129 virtual void SetGenerator(AliGenerator *generator);
130 virtual void EnergySummary();
1578254f 131 virtual const TDatabasePDG* PDGDB() const {return fPDGDB;}
fe4da5cc 132
133 // Functions from GEOCAD
134 //_______________________________________________________________________
6c9704e6 136 virtual void ReadEuclid(const char*, const AliModule*, char*);
02ca2762 137 virtual void ReadEuclidMedia(const char*, const AliModule*);
fe4da5cc 138
139 TTree *TreeD() {return fTreeD;}
140 TTree *TreeE() {return fTreeE;}
141 TTree *TreeH() {return fTreeH;}
142 TTree *TreeK() {return fTreeK;}
143 TTree *TreeR() {return fTreeR;}
145 // --------------------------- commons -------------------------------------
59fe9bd2 147 ClassDef(AliRun,2) //Supervisor class for all Alice detectors
fe4da5cc 148};
75a25b1b 150R__EXTERN AliRun *gAlice;
fe4da5cc 151