]>
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" |
85a5290f | 19 | |
e8d02863 | 20 | class AliCDBId; |
21 | class AliCDBParam; | |
85a5290f | 22 | class AliRunLoader; |
a1b90a73 | 23 | class AliQADataMakerSteer ; |
85a5290f | 24 | |
25 | class AliSimulation: public TNamed { | |
26 | public: | |
95601147 | 27 | AliSimulation(const char* configFileName = "Config.C", |
024cf675 | 28 | const char* cdbUri = "local://$ALICE_ROOT", |
95601147 | 29 | const char* name = "AliSimulation", |
85a5290f | 30 | const char* title = "generation, simulation and digitization"); |
31 | AliSimulation(const AliSimulation& sim); | |
32 | AliSimulation& operator = (const AliSimulation& sim); | |
33 | virtual ~AliSimulation(); | |
34 | ||
b856a511 | 35 | static AliSimulation *GetInstance() {return fgInstance;} |
36 | ||
85a5290f | 37 | void SetNumberOfEvents(Int_t nEvents); |
38 | void SetConfigFile(const char* fileName); | |
0421c3d1 | 39 | void SetGAliceFile(const char* fileName); |
18b43626 | 40 | void SetEventsPerFile(const char* detector, const char* type, |
41 | Int_t nEvents); | |
85a5290f | 42 | |
43 | void SetRunGeneration(Bool_t run) {fRunGeneration = run;}; | |
44 | void SetRunSimulation(Bool_t run) {fRunSimulation = run;}; | |
024cf675 | 45 | void SetLoadAlignFromCDB(Bool_t load) {fLoadAlignFromCDB = load;}; |
46 | void SetLoadAlignData(const char* detectors) | |
25be1e5c | 47 | {fLoadAlObjsListOfDets = detectors;}; |
85a5290f | 48 | void SetMakeSDigits(const char* detectors) |
49 | {fMakeSDigits = detectors;}; | |
05526d44 | 50 | void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0); |
ca30848f | 51 | void EmbedInto(const char* fileName, Int_t nSignalPerBkgrd = 0); |
04bae0a0 | 52 | void SetUseBkgrdVertex(Bool_t useBkgrdVertex) |
53 | {fUseBkgrdVertex = useBkgrdVertex;}; | |
4df28b43 | 54 | void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;}; |
85a5290f | 55 | void SetMakeDigits(const char* detectors) |
56 | {fMakeDigits = detectors;}; | |
a5a091ce | 57 | void SetMakeTrigger(const char* descriptors) |
58 | {fMakeTrigger = descriptors;}; | |
85a5290f | 59 | void SetMakeDigitsFromHits(const char* detectors) |
60 | {fMakeDigitsFromHits = detectors;}; | |
06c7e392 | 61 | void SetWriteRawData(const char* detectors, |
62 | const char* fileName = NULL, | |
63 | Bool_t deleteIntermediateFiles = kFALSE) | |
64 | {fWriteRawData = detectors; fRawDataFileName = fileName; | |
65 | fDeleteIntermediateFiles = deleteIntermediateFiles;}; | |
024cf675 | 66 | void SetAlignObjArray(TObjArray *array) |
6bae477a | 67 | {fAlignObjArray = array; |
68 | fLoadAlignFromCDB = kFALSE;} | |
024cf675 | 69 | |
6bae477a | 70 | Bool_t MisalignGeometry(AliRunLoader *runLoader = NULL); |
71 | ||
72 | Bool_t SetRunNumber(); | |
024cf675 | 73 | |
74 | // CDB storage activation | |
ec92bee0 | 75 | void InitCDBStorage(); |
76 | void SetDefaultStorage(const char* uri); | |
00aa02d5 | 77 | void SetRemoteStorage(const char* uri); |
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"); | |
a5a091ce | 84 | virtual Bool_t RunTrigger(const char* descriptors ="" ); |
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, | |
91 | Bool_t deleteIntermediateFiles = kFALSE); | |
92 | virtual Bool_t WriteRawFiles(const char* detectors = "ALL"); | |
93 | virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date"); | |
94 | virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date", | |
95 | const char* rootFileName = "raw.root"); | |
ca30848f | 96 | virtual Bool_t ConvertRaw2SDigits(const char* rawDirectory, const char* esdFile = ""); |
5b188f2f | 97 | |
cae21299 | 98 | // HLT |
99 | void SetRunHLT(const char* options) {fRunHLT=options;} | |
100 | virtual Bool_t RunHLT(); | |
101 | ||
5b188f2f | 102 | //Quality Assurance |
103 | Int_t GetDetIndex(const char * detector); | |
104 | const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; } | |
105 | void SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; } | |
a1b90a73 | 106 | Bool_t RunQA() ; |
759c1df1 | 107 | void SetQA(const Bool_t val) { fRunQA = val ; } |
108 | ||
95601147 | 109 | private: |
06c7e392 | 110 | AliRunLoader* LoadRun(const char* mode = "UPDATE") const; |
05526d44 | 111 | Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const; |
85a5290f | 112 | Bool_t IsSelected(TString detName, TString& detectors) const; |
113 | ||
b856a511 | 114 | static AliSimulation *fgInstance; // Static pointer to object |
115 | ||
85a5290f | 116 | Bool_t fRunGeneration; // generate prim. particles or not |
117 | Bool_t fRunSimulation; // simulate detectors (hits) or not | |
024cf675 | 118 | Bool_t fLoadAlignFromCDB; // Load alignment data from CDB and apply it to geometry or not |
25be1e5c | 119 | TString fLoadAlObjsListOfDets; // Load alignment data from CDB for these detectors |
85a5290f | 120 | TString fMakeSDigits; // create sdigits for these detectors |
121 | TString fMakeDigits; // create digits for these detectors | |
a5a091ce | 122 | TString fMakeTrigger; // run trigger for these descriptors |
85a5290f | 123 | TString fMakeDigitsFromHits; // create digits from hits for these detectors |
0421c3d1 | 124 | TString fWriteRawData; // write raw data for these detectors |
06c7e392 | 125 | TString fRawDataFileName; // file name for the raw data file |
126 | Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files | |
85a5290f | 127 | Bool_t fStopOnError; // stop or continue on errors |
128 | ||
129 | Int_t fNEvents; // number of events | |
130 | TString fConfigFileName; // name of the config file | |
131 | TString fGAliceFileName; // name of the galice file | |
18b43626 | 132 | TObjArray fEventsPerFile; // number of events per file for given detectors and data types |
133 | ||
85a5290f | 134 | TObjArray* fBkgrdFileNames; // names of background files for merging |
024cf675 | 135 | TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry |
04bae0a0 | 136 | Bool_t fUseBkgrdVertex; // use vertex from background in case of merging |
4df28b43 | 137 | Bool_t fRegionOfInterest; // digitization in region of interest |
85a5290f | 138 | |
024cf675 | 139 | TString fCDBUri; // Uri of the default CDB storage |
00aa02d5 | 140 | TString fRemoteCDBUri; // Uri of the remote CDB storage |
ec92bee0 | 141 | TObjArray fSpecCDBUri; // Array with detector specific CDB storages |
ca30848f | 142 | Bool_t fEmbeddingFlag; // Flag for embedding |
5b188f2f | 143 | |
144 | //QA stuff | |
a1b90a73 | 145 | static const Int_t fgkNDetectors = 15 ; // number of detectors |
146 | static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors | |
147 | Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated | |
148 | Bool_t fRunQA ; // Runs the QA at the end of simulation | |
5b188f2f | 149 | |
cae21299 | 150 | //HLT |
151 | TString fRunHLT; // HLT options, HLT is disabled if empty, default='default' | |
152 | ||
759c1df1 | 153 | ClassDef(AliSimulation, 7) // class for running generation, simulation and digitization |
85a5290f | 154 | }; |
155 | ||
156 | #endif |