diff --git a/algo/kf/core/geo/KfModuleIndexMap.h b/algo/kf/core/geo/KfModuleIndexMap.h index 9410ecd395c84eea1e0f52074dd7437d7f874541..66b1cdb489ce20246856b1f366aefd8d7dfecf38 100644 --- a/algo/kf/core/geo/KfModuleIndexMap.h +++ b/algo/kf/core/geo/KfModuleIndexMap.h @@ -58,7 +58,7 @@ namespace cbm::algo::kf /// \tparam EDetID concrete index type of the det ID (can be either an enum, or an integral type) /// \param globId Internal layer index /// \return pair(detector ID, local ID) of the layer - template<class EDetID> + template<class EDetID = int> std::pair<EDetID, int> GlobalToLocal(int globId) const; /// \brief Converts external pair (detID, locID) to internal layer index diff --git a/macro/run/run_qa.C b/macro/run/run_qa.C index ad0442d387fe6c6282175189dd80171410cbb1d6..16880b48a3360654695bae2e344c5da0af6075df 100644 --- a/macro/run/run_qa.C +++ b/macro/run/run_qa.C @@ -293,6 +293,11 @@ void run_qa(TString dataTraColl, TString caParFile = recFile; caParFile.ReplaceAll(".root", ".ca.par"); + auto* pCaInputQaSetup = new cbm::ca::InputQaSetup(verbose, bUseMC); + pCaInputQaSetup->ReadParameters(caParFile.Data()); + pCaInputQaSetup->SetSetupName(setup.Data()); + qaManager->AddTask(pCaInputQaSetup); + auto* pCaOutputQa = new cbm::ca::OutputQa(verbose, bUseMC, recoMode); pCaOutputQa->SetStsTrackingMode(); pCaOutputQa->ReadParameters(caParFile.Data()); diff --git a/reco/L1/qa/CbmCaInputQaSetup.cxx b/reco/L1/qa/CbmCaInputQaSetup.cxx index 1d49ab0bc11c41104ef1164503a45a5074ec2891..41bb8fe5f67f19c84661e3d75f5f4fca03ae3921 100644 --- a/reco/L1/qa/CbmCaInputQaSetup.cxx +++ b/reco/L1/qa/CbmCaInputQaSetup.cxx @@ -11,6 +11,7 @@ #include "CaInitManager.h" #include "CbmCaTrackingSetupBuilder.h" +#include "CbmL1DetectorID.h" #include "CbmMCDataManager.h" #include "FairRootManager.h" #include "TAxis.h" @@ -407,6 +408,32 @@ try { } } + + auto CreateMaterialBudgetHistograms = [&](const auto& kfSetup, const TString& dir) { + for (int iLayer = 0; iLayer < kfSetup.GetNofLayers(); ++iLayer) { + const auto& matMap{kfSetup.GetMaterial(iLayer)}; + auto [detID, stationID] = kfSetup.GetIndexMap().GlobalToLocal(iLayer); + TString sN = Form("%s/mat_budget_%s_st%d", dir.Data(), kDetName[detID], stationID); + TString sT = + Form("Material budget map for %s station %d;x [cm];y [cm]; X/X_{0} [\%]", kDetName[detID], stationID); + auto nBins{matMap.GetNbins()}; + auto xMin{-matMap.GetXYmax()}; + auto xMax{+matMap.GetXYmax()}; + auto* pHist = MakeQaObject<TH2F>(sN, sT, nBins, xMin, xMax, nBins, xMin, xMax); + for (int iX = 0; iX < nBins; ++iX) { + for (int iY = 0; iY < nBins; ++iY) { + pHist->SetBinContent(iX + 1, iY + 1, 100. * matMap.GetThicknessX0(iX, iY)); + } + } + } + }; + + MakeQaDirectory("TrackingKFSetup"); + MakeQaDirectory("TrackingKFSetup/geometry"); + CreateMaterialBudgetHistograms(fpParameters->GetGeometrySetup(), "TrackingKFSetup/geometry"); + MakeQaDirectory("TrackingKFSetup/active"); + CreateMaterialBudgetHistograms(fpParameters->GetActiveSetup(), "TrackingKFSetup/active"); + LOG(error) << fName << ": initializing... \033[1;32mDone\033[0m"; return kSUCCESS; }