diff --git a/macro/KF/kf_kfparticle.C b/macro/KF/kf_kfparticle.C index 8f575c9b80bd8f62ef017c3cee9a5d39481fd9bf..3c95f315f6319024b09e2bb74e03cf4a54dfb1dd 100644 --- a/macro/KF/kf_kfparticle.C +++ b/macro/KF/kf_kfparticle.C @@ -42,8 +42,8 @@ void kf_kfparticle(Int_t nEvents = 2, const TString setupName = "sis100_electron // ----- In- and output file names ------------------------------------ TString mcFile = dataset + ".tra.root"; TString parFile = dataset + ".par.root"; - TString rawFile = dataset + ".raw.root"; - TString recFile = dataset + ".reco.root"; + TString rawFile = dataset + ".event.raw.root"; + TString recFile = dataset + ".rec.root"; TString outFile = dataset + ".phys.root"; TString effFile = dataset + ".Efficiency_KFParticleFinder.txt"; TString histoFile = dataset + ".KFParticleFinder.root"; @@ -51,19 +51,10 @@ void kf_kfparticle(Int_t nEvents = 2, const TString setupName = "sis100_electron // ----- Load the geometry setup ------------------------------------- std::cout << std::endl; - TString setupFile = srcDir + "/geometry/setup/setup_" + setupName + ".C"; - TString setupFunct = "setup_"; - setupFunct = setupFunct + setupName + "()"; - std::cout << "-I- " << macroName << ": Loading macro " << setupFile << std::endl; - gROOT->LoadMacro(setupFile); - gROOT->ProcessLine(setupFunct); + // std::cout << "-I- " << myName << ": Loading setup " << setup << std::endl; CbmSetup* setup = CbmSetup::Instance(); + setup->LoadSetup(setupName); TString geoTag; - // You can modify the pre-defined setup by using - // CbmSetup::Instance()->RemoveModule(ESystemId) or - // CbmSetup::Instance()->SetModule(ESystemId, const char*, Bool_t) or - // CbmSetup::Instance()->SetActive(ESystemId, Bool_t) - // See the class documentation of CbmSetup. // ------------------------------------------------------------------------ // ----- Check if the simulation and reconstruction are complited --------- @@ -149,6 +140,23 @@ void kf_kfparticle(Int_t nEvents = 2, const TString setupName = "sis100_electron l1->SetStsMaterialBudgetFileName(stsMatBudgetFileName.Data()); } run->AddTask(l1); + + // ----- MuCh digi parameters initialization -------------------------------------- + if (setup->IsActive(ECbmModuleId::kMuch)) { + // Parameter file name + setup->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); + } + } + // -------------------------------------------------------------------------------- + // ------------------------------------------------------------------------ // ----- PID for KF Particle Finder --------------------------------------- diff --git a/macro/mcbm/mcbm_hadron_analysis.C b/macro/mcbm/mcbm_hadron_analysis.C index f9642e6110859f699bc3f93ce3602a25c28a38ff..3dfdce70122e82fa6e30eb7541222f7a3385975e 100644 --- a/macro/mcbm/mcbm_hadron_analysis.C +++ b/macro/mcbm/mcbm_hadron_analysis.C @@ -48,6 +48,22 @@ void mcbm_hadron_analysis(Int_t nEvents = 10, TString setupName = "mcbm_beam_202 CbmSetup* setup = CbmSetup::Instance(); // setup->RemoveModule(ECbmModuleId::kTrd); // ------------------------------------------------------------------------ + // ----- MuCh digi parameters initialization -------------------------------------- + + if (setup->IsActive(ECbmModuleId::kMuch)) { + // Parameter file name + TString geoTag; + setup->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); + } + } /* CbmMCDataManager* mcManager = new CbmMCDataManager("MCDataManager", 1);