59 throw std::runtime_error{
"TRD not enabled in current geometry!"};
63 throw std::runtime_error{
"Failed to get TRD geo tag from CbmSetup!"};
66 TString paramFilesTrd(Form(
"%s/parameters/trd/trd_%s",
fSrcDir.Data(), geoTagTrd.Data()));
67 std::vector<TString> paramFilesVecTrd = {
"asic",
"digi",
"gas",
"gain"};
68 for (
auto parIt : paramFilesVecTrd) {
69 fParList->Add(
new TObjString(Form(
"%s.%s.par", paramFilesTrd.Data(), parIt.Data())));
72 for (
auto parFileVecIt : *
fParList) {
73 std::cout << Form(
"TrdParams - %s - added to parameter file list", parFileVecIt->GetName()) << std::endl;
78 fRun->AddTask(trdHitfinderPar);
82 FairParAsciiFileIo asciiInput;
83 std::string digiparfile = Form(
"%s/parameters/trd/trd_%s.digi.par",
fSrcDir.Data(), geoTagTrd.Data());
84 std::string asicparfile = Form(
"%s/parameters/trd/trd_%s.asic.par",
fSrcDir.Data(), geoTagTrd.Data());
88 if (asciiInput.open(digiparfile.data())) {
89 digiparset->init(&asciiInput);
95 if (asciiInput.open(asicparfile.data())) {
96 asicparset->init(&asciiInput);
103 fRun->AddTask(trdUnpackPar);
117 TObjString* tofBdfFile =
new TObjString(
fSrcDir +
"/parameters/tof/tof_" + geoTag +
".digibdf.par");
119 std::cout <<
"-I- TOF: Using parameter file " << tofBdfFile->GetString() << std::endl;
125 Double_t dDeadtime = 50.;
127 TString TofFileFolder =
fSrcDir +
"/parameters/mcbm/";
128 bool doCalibration =
false;
129 TString cCalId =
"490.100.5.0";
130 Int_t iCalSet = 30040500;
134 case Setup::mCBM2022:
135 doCalibration =
true;
136 cCalId =
"2391.5.000";
139 case Setup::mCBM2024_03:
140 doCalibration =
true;
144 case Setup::mCBM2024_05:
145 doCalibration =
true;
146 cFname = Form(
"%s/3026_1_TofCal.hst.root", TofFileFolder.Data());
148 default:
throw std::runtime_error(
"TOF: Unknown setup type");
151 if (cFname.IsNull() && doCalibration) {
153 Form(
"%s/%s_set%09d_%02d_%01dtofClust.hst.root", TofFileFolder.Data(), cCalId.Data(), iCalSet, calMode, calSel);
157 tofCluster->SetCalParFileName(cFname);
158 tofCluster->SetCalMode(calMode);
159 tofCluster->SetTotMax(20.);
160 tofCluster->SetTotMin(0.);
161 tofCluster->SetTotMean(5.);
162 tofCluster->SetMaxTimeDist(1.0);
163 tofCluster->SetChannelDeadtime(dDeadtime);
164 tofCluster->PosYMaxScal(0.75);
165 fRun->AddTask(tofCluster);
183 LOG(info) <<
"STS geo tag: " << geoTag;
187 sensor6cm.
SetPar(0, 6.2092);
189 sensor6cm.
SetPar(2, 0.03);
190 sensor6cm.
SetPar(3, 5.9692);
191 sensor6cm.
SetPar(4, 1024.);
192 sensor6cm.
SetPar(5, 1024.);
193 sensor6cm.
SetPar(6, 0.0058);
194 sensor6cm.
SetPar(7, 0.0058);
199 sensor12cm.
SetPar(1, 12.4);
200 sensor12cm.
SetPar(3, 12.1692);
208 auto sensorParSet =
new CbmStsParSetSensor(
"CbmStsParSetSensor",
"STS sensor parameters"
238 sensorParSet->SetParSensor(stsAddress01, sensor6cm);
239 sensorParSet->SetParSensor(stsAddress02, sensor6cm);
240 sensorParSet->SetParSensor(stsAddress03, sensor6cm);
241 sensorParSet->SetParSensor(stsAddress04, sensor6cm);
242 sensorParSet->SetParSensor(stsAddress05, sensor6cm);
243 sensorParSet->SetParSensor(stsAddress06, sensor12cm);
244 sensorParSet->SetParSensor(stsAddress07, sensor6cm);
245 sensorParSet->SetParSensor(stsAddress08, sensor12cm);
246 sensorParSet->SetParSensor(stsAddress09, sensor6cm);
247 sensorParSet->SetParSensor(stsAddress10, sensor6cm);
248 sensorParSet->SetParSensor(stsAddress11, sensor6cm);
251 uint32_t addr01 = 0x10008012;
252 uint32_t addr02 = 0x10018012;
253 uint32_t addr03 = 0x10008412;
254 uint32_t addr04 = 0x10018412;
255 uint32_t addr05 = 0x10008422;
256 uint32_t addr06 = 0x10018422;
257 uint32_t addr07 = 0x10008822;
258 uint32_t addr08 = 0x10018822;
259 uint32_t addr09 = 0x10028822;
260 uint32_t addr10 = 0x10008022;
261 uint32_t addr11 = 0x10018022;
262 uint32_t addr00 = 0x10000002;
277 sensorParSet->SetParSensor(addr01, sensor6cm);
278 sensorParSet->SetParSensor(addr02, sensor6cm);
279 sensorParSet->SetParSensor(addr03, sensor6cm);
280 sensorParSet->SetParSensor(addr04, sensor6cm);
281 sensorParSet->SetParSensor(addr05, sensor6cm);
282 sensorParSet->SetParSensor(addr06, sensor12cm);
283 sensorParSet->SetParSensor(addr07, sensor6cm);
284 sensorParSet->SetParSensor(addr08, sensor6cm);
285 sensorParSet->SetParSensor(addr09, sensor6cm);
286 sensorParSet->SetParSensor(addr10, sensor6cm);
287 sensorParSet->SetParSensor(addr11, sensor12cm);
288 sensorParSet->SetParSensor(addr00, sensor6cm);
291 throw std::runtime_error(
"STS: Unknown setup type");
294 recoSts->UseSensorParSet(sensorParSet);
298 auto parAsic =
new CbmStsParAsic(128, 31, 75000., 3000., 5., 800., 1000., 3.9789e-3);
302 parMod->SetAllAsics(*parAsic);
303 recoSts->UseModulePar(parMod);
308 recoSts->UseSensorCond(sensorCond);
310 fRun->AddTask(recoSts);
317 static bool callOnce =
true;
319 throw std::runtime_error(
"CbmOnlineParWrite::Run() can only be called once at the moment!");
326 fSrcDir = gSystem->Getenv(
"VMCWORKDIR");
332 TString geoSetupTag =
"";
336 case Setup::mCBM2022: runId = 2391;
break;
337 case Setup::mCBM2024_03: runId = 2724;
break;
338 case Setup::mCBM2024_05: runId = 2918;
break;
339 default:
throw std::runtime_error(
"Unknown setup type");
343 catch (
const std::invalid_argument& e) {
344 std::cout <<
"Error in mapping from runID to setup name: " << e.what() << std::endl;
348 LOG(info) <<
"Using geometry setup: " << geoSetupTag;
350 TString geoFile =
fSrcDir +
"/macro/run/data/" + geoSetupTag +
".geo.root";
358 fRun =
new FairRunAna();
370 TString alignmentMatrixFileName =
fSrcDir +
"/parameters/mcbm/AlignmentMatrices_" + geoSetupTag +
".root";
371 if (alignmentMatrixFileName.Length() == 0) {
372 throw std::runtime_error{
"Alignment matrix file name is empty"};
375 LOG(info) <<
"Applying alignment for file '" << alignmentMatrixFileName <<
"'";
380 std::map<std::string, TGeoHMatrix>* matrices{
nullptr};
383 LOG(info) <<
"Filename: " << alignmentMatrixFileName;
384 TFile* misalignmentMatrixRootfile =
new TFile(alignmentMatrixFileName,
"READ");
385 if (misalignmentMatrixRootfile->IsOpen()) {
386 gDirectory->GetObject(
"MisalignMatrices", matrices);
387 misalignmentMatrixRootfile->Close();
390 throw std::runtime_error{
"Could not open alignment matrix file: " + alignmentMatrixFileName};
394 fRun->AddAlignmentMatrices(*matrices);
397 throw std::runtime_error{
"Could not read alignment matrices from file: " + alignmentMatrixFileName};
406 FairRuntimeDb* rtdb =
fRun->GetRuntimeDb();
407 FairParAsciiFileIo* parIo2 =
new FairParAsciiFileIo();
408 parIo2->setAutoWritable(
false);
410 rtdb->setSecondInput(parIo2);
414 fRun->SetGeomFile(geoFile);
421 gGeoManager->GetListOfVolumes()->Delete();
422 gGeoManager->GetListOfShapes()->Delete();
426 gSystem->Exec(
"rm all_*.par");
int32_t GetAddress(uint32_t unit=0, uint32_t ladder=0, uint32_t halfladder=0, uint32_t module=0, uint32_t sensor=0, uint32_t side=0, uint32_t version=kCurrentVersion)
Construct address.