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