diff --git a/core/detectors/much/CbmMuchTrackingInterface.cxx b/core/detectors/much/CbmMuchTrackingInterface.cxx index 72fd41dda3694d4f0d73b728efe184eb65908b10..d86cb2e3c48afdcfb61573d8144b25e7349800e3 100644 --- a/core/detectors/much/CbmMuchTrackingInterface.cxx +++ b/core/detectors/much/CbmMuchTrackingInterface.cxx @@ -58,12 +58,13 @@ InitStatus CbmMuchTrackingInterface::Init() // Check initialization of the MuCh digi parameters file if (!fGeoScheme->IsInitialized()) { LOG(fatal) << "CbmMuchTrackingInterface::Init: MuCh digi parameters were not intialized\n" - << "\033[4;1;32mNOTE\033[0m: For the MuCh digi parameters initialization one can place the following " - << "code to the reconstruction macro:\n" + << "\033[4;1;32mNOTE\033[0m: For the MuCh digi parameters initialization please place the following " + << "code your macro:\n" + << "\n\t// ----- MuCh digi parameters initialization --------------------------------------" << "\n\tif (CbmSetup::Instance()->IsActive(ECbmModuleId::kMuch)) {" << "\n\t // Parameter file name" << "\n\t TString geoTag;" - << "\n\t geo->GetGeoTag(ECbmModuleId::kMuch, geoTag);" + << "\n\t CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kMuch, geoTag);" << "\n\t Int_t muchFlag = (geoTag.Contains(\"mcbm\") ? 1 : 0);" << "\n\t TString parFile = gSystem->Getenv(\"VMCWORKDIR\");" << "\n\t parFile += \"/parameters/much/much_\" + geoTag(0, 4) + \"_digi_sector.root\";" @@ -71,7 +72,8 @@ InitStatus CbmMuchTrackingInterface::Init() << "\n\t // Initialization of the geometry scheme" << "\n\t auto muchGeoScheme = CbmMuchGeoScheme::Instance();" << "\n\t if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(parFile, muchFlag); }" - << "\n\t}"; + << "\n\t}" + << "\n\t// --------------------------------------------------------------------------------"; } return kSUCCESS; diff --git a/macro/much/run_ana.C b/macro/much/run_ana.C index acf23e8193e9bc19f5fc76e83a81c0d3223bbae2..c08e7310a44cbd33561c2b36b06abe876bd21ac3 100644 --- a/macro/much/run_ana.C +++ b/macro/much/run_ana.C @@ -49,6 +49,19 @@ void run_ana(Int_t nEvents = 1000, TString dataSet = "muons", TString setup = "s // ------------------------------------------------------------------------ + if (CbmSetup::Instance()->IsActive(ECbmModuleId::kMuch)) { + // Parameter file name + TString geoTag; + CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kMuch, geoTag); + Int_t muchFlag = (geoTag.Contains("mcbm") ? 1 : 0); + TString parFile = gSystem->Getenv("VMCWORKDIR"); + parFile += "/parameters/much/much_" + geoTag(0, 4) + "_digi_sector.root"; + + // Initialization of the geometry scheme + auto muchGeoScheme = CbmMuchGeoScheme::Instance(); + if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(parFile, muchFlag); } + } + run->AddTask(new CbmTrackingDetectorInterfaceInit()); CbmKF* kf = new CbmKF(); run->AddTask(kf);