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 */
9 // class for running generation, simulation and digitization
10 // Hits, sdigits and digits are created for all detectors by typing:
17 #include <TObjArray.h>
19 #include "AliQADataMakerSteer.h"
25 class AliSimulation: public TNamed {
27 AliSimulation(const char* configFileName = "Config.C",
28 const char* name = "AliSimulation",
29 const char* title = "generation, simulation and digitization");
30 virtual ~AliSimulation();
32 static AliSimulation *GetInstance() {return fgInstance;}
34 void SetNumberOfEvents(Int_t nEvents);
35 void SetConfigFile(const char* fileName);
36 void SetGAliceFile(const char* fileName);
37 void SetEventsPerFile(const char* detector, const char* type,
40 void SetRunGeneration(Bool_t run) {fRunGeneration = run;};
41 void SetRunSimulation(Bool_t run) {fRunSimulation = run;};
42 void SetLoadAlignFromCDB(Bool_t load) {fLoadAlignFromCDB = load;};
43 void SetLoadAlignData(const char* detectors)
44 {fLoadAlObjsListOfDets = detectors;};
45 void SetMakeSDigits(const char* detectors)
46 {fMakeSDigits = detectors;};
47 void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
48 void EmbedInto(const char* fileName, Int_t nSignalPerBkgrd = 0);
49 void SetUseBkgrdVertex(Bool_t useBkgrdVertex)
50 {fUseBkgrdVertex = useBkgrdVertex;};
51 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
52 void SetMakeDigits(const char* detectors)
53 {fMakeDigits = detectors;};
54 void SetMakeTrigger(const char* descriptors)
55 {fMakeTrigger = descriptors;};
56 void SetMakeDigitsFromHits(const char* detectors)
57 {fMakeDigitsFromHits = detectors;};
58 void SetWriteRawData(const char* detectors,
59 const char* fileName = NULL,
60 Bool_t deleteIntermediateFiles = kFALSE)
61 {fWriteRawData = detectors; fRawDataFileName = fileName;
62 fDeleteIntermediateFiles = deleteIntermediateFiles;};
63 void SetWriteSelRawData(Bool_t sel = kTRUE)
64 {fWriteSelRawData = sel;}
65 void SetAlignObjArray(TObjArray *array)
66 {fAlignObjArray = array;
67 fLoadAlignFromCDB = kFALSE;}
69 Bool_t MisalignGeometry(AliRunLoader *runLoader = NULL);
71 void SetRunNumber(Int_t run);
72 void SetSeed(Int_t seed);
74 void ProcessEnvironmentVars();
76 // CDB storage activation
77 void SetDefaultStorage(const char* uri);
78 void SetSpecificStorage(const char* calibType, const char* uri);
80 virtual Bool_t Run(Int_t nEvents = 0);
82 virtual Bool_t RunSimulation(Int_t nEvents = 0);
83 virtual Bool_t RunSDigitization(const char* detectors = "ALL");
84 virtual Bool_t RunTrigger(const char* descriptors ="", const char* detectors = "ALL");
85 virtual Bool_t WriteTriggerRawData();
86 virtual Bool_t RunDigitization(const char* detectors = "ALL",
87 const char* excludeDetectors = "");
88 virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
89 virtual Bool_t WriteRawData(const char* detectors = "ALL",
90 const char* fileName = NULL,
91 Bool_t deleteIntermediateFiles = kFALSE,
92 Bool_t selrawdata = kFALSE);
93 virtual Bool_t WriteRawFiles(const char* detectors = "ALL");
94 virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date",
95 const char* rootFileName = "");
96 virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
97 const char* rootFileName = "raw.root");
98 virtual Bool_t ConvertRaw2SDigits(const char* rawDirectory, const char* esdFile = "");
101 void SetRunHLT(const char* options) {fRunHLT=options;}
102 virtual Bool_t RunHLT();
105 Int_t GetDetIndex(const char * detector);
106 void SetQACycles(AliQA::DETECTORINDEX_t det, const Int_t cycles) { fQASteer->SetCycleLength(det, cycles) ; }
108 Bool_t SetRunQA(TString detAndAction="ALL:ALL") ;
109 void SetQAWriteExpert(AliQA::DETECTORINDEX_t det) { fQASteer->SetWriteExpert(det) ; }
111 void SetWriteGRPEntry(Bool_t flag = kTRUE) { fWriteGRPEntry = flag; }
112 void WriteGRPEntry();
116 AliSimulation(const AliSimulation&); // Not implemented
117 AliSimulation& operator = (const AliSimulation&); // Not implemented
120 void InitRunNumber();
122 Bool_t SetRunNumberFromData();
123 AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
124 Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
125 Bool_t IsSelected(TString detName, TString& detectors) const;
127 static AliSimulation *fgInstance; // Static pointer to object
129 Bool_t fRunGeneration; // generate prim. particles or not
130 Bool_t fRunSimulation; // simulate detectors (hits) or not
131 Bool_t fLoadAlignFromCDB; // Load alignment data from CDB and apply it to geometry or not
132 TString fLoadAlObjsListOfDets; // Load alignment data from CDB for these detectors
133 TString fMakeSDigits; // create sdigits for these detectors
134 TString fMakeDigits; // create digits for these detectors
135 TString fMakeTrigger; // run trigger for these descriptors
136 TString fMakeDigitsFromHits; // create digits from hits for these detectors
137 TString fWriteRawData; // write raw data for these detectors
138 TString fRawDataFileName; // file name for the raw data file
139 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
140 Bool_t fWriteSelRawData; // write detectors raw data in a separate file accoring to the trigger cluster
141 Bool_t fStopOnError; // stop or continue on errors
143 Int_t fNEvents; // number of events
144 TString fConfigFileName; // name of the config file
145 TString fGAliceFileName; // name of the galice file
146 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
148 TObjArray* fBkgrdFileNames; // names of background files for merging
149 TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry
150 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
151 Bool_t fRegionOfInterest; // digitization in region of interest
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
161 Bool_t fEmbeddingFlag; // Flag for embedding
164 static const Int_t fgkNDetectors = 15 ; // number of detectors
165 static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors
166 TString fQADetectors ; // list of detectors to be QA'ed
167 TString fQATasks ; // list of QA tasks to be performed
168 AliQADataMakerSteer * fQASteer ; // steering object to run QA
169 Bool_t fRunQA ; // Runs the QA at the end of simulation
170 AliRecoParam::EventSpecie_t fEventSpecie ; // type of event (see AliRecoParam::EventSpecie_t)
173 TString fRunHLT; // HLT options, HLT is disabled if empty, default='default'
175 Bool_t fWriteGRPEntry; // Write or not GRP entry corresponding to the settings in Config.C
177 ClassDef(AliSimulation, 8) // class for running generation, simulation and digitization