diff --git a/core/base/CbmDigiManager.cxx b/core/base/CbmDigiManager.cxx index c6161434a4133d2a7ea861b7ca7577edcb37a963..c68d4bc5cd5cadf7016a64044685cd43bb00336d 100644 --- a/core/base/CbmDigiManager.cxx +++ b/core/base/CbmDigiManager.cxx @@ -134,11 +134,7 @@ void CbmDigiManager::SetBranch() // Get system ID and class name from digi class. ECbmModuleId systemId = Digi::GetSystem(); string className = Digi::GetClassName(); - std::cout << "systemId= " << systemId << " className= " << className << std::endl; - // TODO: Remove ugly fix for CbmMuchBeamTimeDigi once class has disappeared. - // VS: CbmMuchBeamTimeDigi may be removed now. 26/06/23 - //if (systemId == ECbmModuleId::kMuch && fUseMuchBeamTimeDigi) className = "CbmMuchBeamTimeDigi"; - if (systemId == ECbmModuleId::kMuch) className = "CbmMuchDigi"; + LOG(info) << "systemId= " << systemId << " className= " << className; // --- Catch branch being already set if (fBranches.find(systemId) != fBranches.end()) { diff --git a/macro/beamtime/mcbm2022/mcbm_reco.C b/macro/beamtime/mcbm2022/mcbm_reco.C index 53a3578972a07d2224bb4f95f02bb8d87e2c12a8..2f30cb9afc114216ce72cfaffb93b1055039aa41 100644 --- a/macro/beamtime/mcbm2022/mcbm_reco.C +++ b/macro/beamtime/mcbm2022/mcbm_reco.C @@ -375,6 +375,34 @@ Bool_t mcbm_reco(UInt_t uRunId = 2391, // ------------------------------------------------------------------------ } + // ========================================================================= + // === local MUCH Reconstruction === + // ========================================================================= + if (bMUCH) { + TString muchGeoTag; + if (geoSetup->GetGeoTag(ECbmModuleId::kMuch, muchGeoTag)) { + // --- Parameter file name + TString geoTag; + geoSetup->GetGeoTag(ECbmModuleId::kMuch, geoTag); + Int_t muchFlag = 0; + if (geoTag.Contains("mcbm")) muchFlag = 1; + TString sectorFile = gSystem->Getenv("VMCWORKDIR"); + sectorFile += "/parameters/much/much_" + geoTag(0, 4) + "_mcbm_digi_sector.root"; + //sectorFile += "/parameters/much/much_v22j_mcbm_digi_sector.root"; + std::cout << "Using parameter file " << sectorFile << std::endl; + + // --- Initialization of the digi scheme + auto muchGeoScheme = CbmMuchGeoScheme::Instance(); + if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(sectorFile.Data(), muchFlag); } + // --- Hit finder for GEMs + FairTask* muchReco = new CbmMuchFindHitsGem(sectorFile.Data(), muchFlag); + run->AddTask(muchReco); + std::cout << "-I- " << myName << ": Added task " << muchReco->GetName() << " with parameter file " << sectorFile + << std::endl; + } + } + // ------------------------------------------------------------------------ + // ========================================================================= // === local TRD Reconstruction === diff --git a/reco/detectors/much/CbmMuchFindHitsGem.cxx b/reco/detectors/much/CbmMuchFindHitsGem.cxx index 47e4fa8a04d9983e831f841f9c43819511b64b7c..9fdf3861eac578f01d11efdeedd7300eb3ca57e3 100644 --- a/reco/detectors/much/CbmMuchFindHitsGem.cxx +++ b/reco/detectors/much/CbmMuchFindHitsGem.cxx @@ -123,7 +123,9 @@ InitStatus CbmMuchFindHitsGem::Init() TDirectory* oldDir = gDirectory; TFile* file = new TFile(fDigiFile); - TObjArray* stations = (TObjArray*) file->Get("stations"); + LOG_IF(fatal, !file) << "Could not open file " << fDigiFile; + TObjArray* stations = file->Get<TObjArray>("stations"); + LOG_IF(fatal, !stations) << "TObjArray stations not found in file " << fDigiFile; file->Close(); file->Delete(); /// Restore old global file and folder pointer to avoid messing with FairRoot