3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 // General configuration class for Simulation and Reconstruction
10 // Basic driver for AliRoot runs
11 // Containing pointers to data elements for AliRoot
18 #include "AliRunLoader.h"
19 class AliGenEventHeader;
27 class AliRun : public TNamed {
30 // Creators - distructors
32 AliRun(const char *name, const char *title);
35 TObjArray *Detectors() const {return fModules;}
36 TObjArray *Modules() const {return fModules;}
37 virtual AliMagF *Field() const {return fField;}
38 void AddModule(AliModule* mod);
39 Int_t GetEvNumber() const;
40 Int_t GetRunNumber() const {return fRun;}
41 void SetEventNrInRun(Int_t event) {fEventNrInRun=event;}
42 Int_t GetEventNrInRun() const {return fEventNrInRun;}
43 Int_t GetNdets() const {return fNdets;}
44 AliModule *GetModule(const char *name) const;
45 AliDetector *GetDetector(const char *name) const;
46 Int_t GetModuleID(const char *name) const;
47 virtual const char *GetBaseFile() const
48 {return fBaseFileName.Data();}
49 virtual Int_t GetEvent(Int_t event);
50 virtual void SetEvent(Int_t event) {fEvent=event;}
51 virtual void SetConfigFunction(const char * config="Config();")
52 {fConfigFunction=config;}
53 virtual const char *GetConfigFunction() const
54 {return fConfigFunction.Data();}
55 virtual void SetGenEventHeader(AliGenEventHeader* header);
56 AliMC* GetMCApp() const {return fMCApp;}
57 virtual void Hits2Digits(const char *detector=0);
58 virtual void Hits2SDigits(const char *detector=0) {Tree2Tree("S",detector);}
59 virtual void SDigits2Digits(const char *detector=0) {Tree2Tree("D",detector);}
60 virtual void Digits2Reco(const char *detector=0) {Tree2Tree("R",detector);}
61 Bool_t IsFolder() const {return kTRUE;}
62 Bool_t IsRootGeometry() const {return fIsRootGeometry;}
63 void SetRootGeometry(Bool_t flag=kTRUE);
64 const char* GetGeometryFileName() const {return fGeometryFileName.Data();}
65 void SetGeometryFromFile(const char *filename) {
67 fGeometryFileName = filename;
69 void SetGeometryFromCDB();
70 Bool_t IsGeomFromCDB() const {return fGeometryFromCDB;}
71 const char* GetTriggerDescriptor() const {return fTriggerDescriptor.Data();}
72 void SetTriggerDescriptor(const char *name) {fTriggerDescriptor = name;}
73 virtual void SetBaseFile(const char *filename="galice.root");
74 virtual void SetField(AliMagF* magField);
76 virtual void Field(const Double_t* x, Double_t* b) const;
79 // End of MC Application
81 void SetRunLoader(AliRunLoader* rloader);
83 virtual void Announce() const;
85 virtual void InitLoaders(); //prepares run (i.e. creates getters)
86 void SetRunNumber(Int_t run) {fRun=run;}
89 virtual void Tree2Tree(Option_t *option, const char *detector=0);
90 Int_t fRun; //! Current run number
91 Int_t fEvent; //! Current event number (from 1)
92 Int_t fEventNrInRun; //! Current unique event number in run
93 TObjArray *fModules; // List of Detectors
94 AliMC *fMCApp; // Pointer to virtual MC Application
95 AliMagF *fField; // Magnetic Field Map
96 Int_t fNdets; // Number of detectors
97 TString fConfigFunction; // Configuration file to be executed
98 TRandom *fRandom; // Pointer to the random number generator
99 TString fBaseFileName; // Name of the base root file
100 Bool_t fIsRootGeometry; //! Flag telling if the geometry is loaded from file
101 Bool_t fGeometryFromCDB; //! Flag telling if the geometry is to be loaded from OCDB
102 TString fGeometryFileName; //! Name of the geometry file
103 TString fTriggerDescriptor; // Trigger descriptor identifier
104 AliRunLoader *fRunLoader; //!run getter - written as a separate object
106 AliRun(const AliRun&); // Not implemented
107 AliRun& operator = (const AliRun&); // Not implemented
109 ClassDef(AliRun,12) //Supervisor class for all Alice detectors
112 R__EXTERN AliRun *gAlice;