]>
Commit | Line | Data |
---|---|---|
85a5290f | 1 | #ifndef ALISIMULATION_H |
2 | #define ALISIMULATION_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
af7ba10c | 8 | // |
9 | // class for running generation, simulation and digitization | |
10 | // Hits, sdigits and digits are created for all detectors by typing: | |
af7ba10c | 11 | // AliSimulation sim; |
12 | // sim.Run(); | |
13 | // | |
14 | ||
85a5290f | 15 | #include <TNamed.h> |
16 | #include <TString.h> | |
3c166bf6 | 17 | #include <TObjArray.h> |
cae17938 | 18 | #include "AliQA.h" |
930e6e3e | 19 | #include "AliQADataMakerSteer.h" |
85a5290f | 20 | |
e8d02863 | 21 | class AliCDBId; |
22 | class AliCDBParam; | |
85a5290f | 23 | class AliRunLoader; |
3e2e3ece | 24 | class AliLegoGenerator; |
25 | class AliLego; | |
85a5290f | 26 | |
27 | class AliSimulation: public TNamed { | |
28 | public: | |
95601147 | 29 | AliSimulation(const char* configFileName = "Config.C", |
30 | const char* name = "AliSimulation", | |
85a5290f | 31 | const char* title = "generation, simulation and digitization"); |
85a5290f | 32 | virtual ~AliSimulation(); |
33 | ||
3e2e3ece | 34 | static AliSimulation *Instance() {return fgInstance;} |
b856a511 | 35 | |
85a5290f | 36 | void SetNumberOfEvents(Int_t nEvents); |
37 | void SetConfigFile(const char* fileName); | |
0421c3d1 | 38 | void SetGAliceFile(const char* fileName); |
18b43626 | 39 | void SetEventsPerFile(const char* detector, const char* type, |
40 | Int_t nEvents); | |
85a5290f | 41 | |
42 | void SetRunGeneration(Bool_t run) {fRunGeneration = run;}; | |
43 | void SetRunSimulation(Bool_t run) {fRunSimulation = run;}; | |
024cf675 | 44 | void SetLoadAlignFromCDB(Bool_t load) {fLoadAlignFromCDB = load;}; |
45 | void SetLoadAlignData(const char* detectors) | |
25be1e5c | 46 | {fLoadAlObjsListOfDets = detectors;}; |
85a5290f | 47 | void SetMakeSDigits(const char* detectors) |
48 | {fMakeSDigits = detectors;}; | |
05526d44 | 49 | void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0); |
ca30848f | 50 | void EmbedInto(const char* fileName, Int_t nSignalPerBkgrd = 0); |
04bae0a0 | 51 | void SetUseBkgrdVertex(Bool_t useBkgrdVertex) |
52 | {fUseBkgrdVertex = useBkgrdVertex;}; | |
4df28b43 | 53 | void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;}; |
85a5290f | 54 | void SetMakeDigits(const char* detectors) |
55 | {fMakeDigits = detectors;}; | |
a5a091ce | 56 | void SetMakeTrigger(const char* descriptors) |
57 | {fMakeTrigger = descriptors;}; | |
85a5290f | 58 | void SetMakeDigitsFromHits(const char* detectors) |
59 | {fMakeDigitsFromHits = detectors;}; | |
06c7e392 | 60 | void SetWriteRawData(const char* detectors, |
61 | const char* fileName = NULL, | |
62 | Bool_t deleteIntermediateFiles = kFALSE) | |
63 | {fWriteRawData = detectors; fRawDataFileName = fileName; | |
64 | fDeleteIntermediateFiles = deleteIntermediateFiles;}; | |
67327b72 | 65 | void SetWriteSelRawData(Bool_t sel = kTRUE) |
66 | {fWriteSelRawData = sel;} | |
024cf675 | 67 | void SetAlignObjArray(TObjArray *array) |
6bae477a | 68 | {fAlignObjArray = array; |
69 | fLoadAlignFromCDB = kFALSE;} | |
024cf675 | 70 | |
6bae477a | 71 | Bool_t MisalignGeometry(AliRunLoader *runLoader = NULL); |
72 | ||
795e4a22 | 73 | void SetRunNumber(Int_t run); |
74 | void SetSeed(Int_t seed); | |
75 | ||
76 | void ProcessEnvironmentVars(); | |
024cf675 | 77 | |
78 | // CDB storage activation | |
ec92bee0 | 79 | void SetDefaultStorage(const char* uri); |
00aa02d5 | 80 | void SetSpecificStorage(const char* calibType, const char* uri); |
85a5290f | 81 | |
82 | virtual Bool_t Run(Int_t nEvents = 0); | |
3e2e3ece | 83 | virtual Bool_t RunLego(const char *setup="Config.C",Int_t nc1=60,Float_t c1min=2,Float_t c1max=178, |
84 | Int_t nc2=60,Float_t c2min=0,Float_t c2max=360,Float_t rmin=0, | |
85 | Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL, Int_t nev = -1); | |
85a5290f | 86 | |
95601147 | 87 | virtual Bool_t RunSimulation(Int_t nEvents = 0); |
88 | virtual Bool_t RunSDigitization(const char* detectors = "ALL"); | |
8480396b | 89 | virtual Bool_t RunTrigger(const char* descriptors ="", const char* detectors = "ALL"); |
007155cc | 90 | virtual Bool_t WriteTriggerRawData(); |
95601147 | 91 | virtual Bool_t RunDigitization(const char* detectors = "ALL", |
92 | const char* excludeDetectors = ""); | |
93 | virtual Bool_t RunHitsDigitization(const char* detectors = "ALL"); | |
06c7e392 | 94 | virtual Bool_t WriteRawData(const char* detectors = "ALL", |
95 | const char* fileName = NULL, | |
67327b72 | 96 | Bool_t deleteIntermediateFiles = kFALSE, |
97 | Bool_t selrawdata = kFALSE); | |
06c7e392 | 98 | virtual Bool_t WriteRawFiles(const char* detectors = "ALL"); |
67327b72 | 99 | virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date", |
1b8db7f0 | 100 | const char* rootFileName = ""); |
06c7e392 | 101 | virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date", |
102 | const char* rootFileName = "raw.root"); | |
ca30848f | 103 | virtual Bool_t ConvertRaw2SDigits(const char* rawDirectory, const char* esdFile = ""); |
5b188f2f | 104 | |
cae21299 | 105 | // HLT |
106 | void SetRunHLT(const char* options) {fRunHLT=options;} | |
107 | virtual Bool_t RunHLT(); | |
3e2e3ece | 108 | virtual Bool_t IsLegoRun() const {return (fLego!=0);} |
109 | AliLego* Lego() const {return fLego;} | |
110 | virtual void FinishRun(); | |
cae21299 | 111 | |
5b188f2f | 112 | //Quality Assurance |
113 | Int_t GetDetIndex(const char * detector); | |
930e6e3e | 114 | void SetQACycles(AliQA::DETECTORINDEX_t det, const Int_t cycles) { fQASteer->SetCycleLength(det, cycles) ; } |
a1b90a73 | 115 | Bool_t RunQA() ; |
e3b20d9a | 116 | Bool_t SetRunQA(TString detAndAction="ALL:ALL") ; |
5e597687 | 117 | void SetQAWriteExpert(AliQA::DETECTORINDEX_t det) { fQASteer->SetWriteExpert(det) ; } |
fc7e1b1c | 118 | |
119 | void SetWriteGRPEntry(Bool_t flag = kTRUE) { fWriteGRPEntry = flag; } | |
120 | void WriteGRPEntry(); | |
121 | ||
95601147 | 122 | private: |
7dd2cbe4 | 123 | |
124 | AliSimulation(const AliSimulation&); // Not implemented | |
125 | AliSimulation& operator = (const AliSimulation&); // Not implemented | |
126 | ||
795e4a22 | 127 | void InitCDB(); |
128 | void InitRunNumber(); | |
129 | void SetCDBLock(); | |
130 | Bool_t SetRunNumberFromData(); | |
06c7e392 | 131 | AliRunLoader* LoadRun(const char* mode = "UPDATE") const; |
05526d44 | 132 | Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const; |
85a5290f | 133 | Bool_t IsSelected(TString detName, TString& detectors) const; |
134 | ||
b856a511 | 135 | static AliSimulation *fgInstance; // Static pointer to object |
136 | ||
85a5290f | 137 | Bool_t fRunGeneration; // generate prim. particles or not |
138 | Bool_t fRunSimulation; // simulate detectors (hits) or not | |
024cf675 | 139 | Bool_t fLoadAlignFromCDB; // Load alignment data from CDB and apply it to geometry or not |
25be1e5c | 140 | TString fLoadAlObjsListOfDets; // Load alignment data from CDB for these detectors |
85a5290f | 141 | TString fMakeSDigits; // create sdigits for these detectors |
142 | TString fMakeDigits; // create digits for these detectors | |
a5a091ce | 143 | TString fMakeTrigger; // run trigger for these descriptors |
85a5290f | 144 | TString fMakeDigitsFromHits; // create digits from hits for these detectors |
0421c3d1 | 145 | TString fWriteRawData; // write raw data for these detectors |
06c7e392 | 146 | TString fRawDataFileName; // file name for the raw data file |
147 | Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files | |
67327b72 | 148 | Bool_t fWriteSelRawData; // write detectors raw data in a separate file accoring to the trigger cluster |
85a5290f | 149 | Bool_t fStopOnError; // stop or continue on errors |
150 | ||
151 | Int_t fNEvents; // number of events | |
152 | TString fConfigFileName; // name of the config file | |
153 | TString fGAliceFileName; // name of the galice file | |
18b43626 | 154 | TObjArray fEventsPerFile; // number of events per file for given detectors and data types |
155 | ||
85a5290f | 156 | TObjArray* fBkgrdFileNames; // names of background files for merging |
57acd2d2 | 157 | TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry |
04bae0a0 | 158 | Bool_t fUseBkgrdVertex; // use vertex from background in case of merging |
4df28b43 | 159 | Bool_t fRegionOfInterest; // digitization in region of interest |
85a5290f | 160 | |
57acd2d2 | 161 | TString fCDBUri; //! Uri of the default CDB storage |
162 | TObjArray fSpecCDBUri; //! Array with detector specific CDB storages | |
163 | Int_t fRun; //! Run number, will be passed to CDB and gAlice!! | |
164 | Int_t fSeed; //! Seed for random number generator | |
165 | Bool_t fInitCDBCalled; //! flag to check if CDB storages are already initialized | |
166 | Bool_t fInitRunNumberCalled; //! flag to check if run number is already initialized | |
167 | Bool_t fSetRunNumberFromDataCalled; //! flag to check if run number is already loaded from run loader | |
795e4a22 | 168 | |
57acd2d2 | 169 | Bool_t fEmbeddingFlag; // Flag for embedding |
3e2e3ece | 170 | AliLego *fLego; //! Pointer to aliLego object if it exists |
5b188f2f | 171 | |
172 | //QA stuff | |
a1b90a73 | 173 | static const Int_t fgkNDetectors = 15 ; // number of detectors |
174 | static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors | |
e3b20d9a | 175 | TString fQADetectors ; // list of detectors to be QA'ed |
176 | TString fQATasks ; // list of QA tasks to be performed | |
7dd2cbe4 | 177 | AliQADataMakerSteer * fQASteer ; // steering object to run QA |
04236e67 | 178 | Bool_t fRunQA ; // Runs the QA at the end of simulation |
57acd2d2 | 179 | AliRecoParam::EventSpecie_t fEventSpecie ; // type of event (see AliRecoParam::EventSpecie_t) |
5b188f2f | 180 | |
cae21299 | 181 | //HLT |
182 | TString fRunHLT; // HLT options, HLT is disabled if empty, default='default' | |
183 | ||
fc7e1b1c | 184 | Bool_t fWriteGRPEntry; // Write or not GRP entry corresponding to the settings in Config.C |
185 | ||
67327b72 | 186 | ClassDef(AliSimulation, 8) // class for running generation, simulation and digitization |
85a5290f | 187 | }; |
188 | ||
189 | #endif |