Skip to content
Snippets Groups Projects
Commit c9b14111 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

[mcbm 2024] Enable alignment matrices application in chained ana script

parent 22becf29
Branches
Tags
1 merge request!1874CI for mCBM 2024 Ni with temporary example run
...@@ -90,7 +90,7 @@ RECO_PSD=0 ...@@ -90,7 +90,7 @@ RECO_PSD=0
# Algorithm flags # Algorithm flags
RECO_TOFtr=0 RECO_TOFtr=0
RECO_ALI=0 RECO_ALI=1
RECO_EvB=1 RECO_EvB=1
RECO_CA=1 RECO_CA=1
RECO_PV=1 RECO_PV=1
...@@ -293,7 +293,7 @@ if [[ ${DO_QA_MODULE} -eq 1 ]]; then ...@@ -293,7 +293,7 @@ if [[ ${DO_QA_MODULE} -eq 1 ]]; then
QA_GEO="${DATA_TOP_DIR}/${SETUP_NAME}.geo.root" QA_GEO="${DATA_TOP_DIR}/${SETUP_NAME}.geo.root"
QA_REC="${DATA_TOP_DIR}/${FILE_LABEL}.rec.root" QA_REC="${DATA_TOP_DIR}/${FILE_LABEL}.rec.root"
ln -s -f ${QA_GEO} "${SETUP_NAME}.geo.root" ln -s -f ${QA_GEO} "${SETUP_NAME}.geo.root"
PARS="-1,\"${QA_REC}\",\"${SETUP_NAME}\",kFALSE" PARS="-1,\"${QA_REC}\",\"${SETUP_NAME}\",kFALSE,${RECO_ALI}"
root -b -l -q ${MACRO_QA_MODULE}"(${PARS})" &> ${RECO_QA_LOG} root -b -l -q ${MACRO_QA_MODULE}"(${PARS})" &> ${RECO_QA_LOG}
cat ${RECO_QA_LOG} cat ${RECO_QA_LOG}
...@@ -318,7 +318,7 @@ if [[ ${DO_QA} -eq 1 ]]; then ...@@ -318,7 +318,7 @@ if [[ ${DO_QA} -eq 1 ]]; then
QA_OUT="${DATA_TOP_DIR}/${FILE_LABEL}.qa.root" QA_OUT="${DATA_TOP_DIR}/${FILE_LABEL}.qa.root"
PARS="0,\"\",\"${QA_RAW}\",\"${QA_REC}\",\"${QA_PAR}\",\"${QA_GEO}\",\"${QA_OUT}\",\"${SETUP_NAME}\"" PARS="0,\"\",\"${QA_RAW}\",\"${QA_REC}\",\"${QA_PAR}\",\"${QA_GEO}\",\"${QA_OUT}\",\"${SETUP_NAME}\""
PARS="${PARS},${USE_MC},\"${CONFIG}\",\"${BENCHMARK}\"" PARS="${PARS},${USE_MC},\"${CONFIG}\",\"${BENCHMARK}\",${RECO_ALI}"
root -b -l -q ${MACRO_QA}"(${PARS})" &> ${QA_LOG} root -b -l -q ${MACRO_QA}"(${PARS})" &> ${QA_LOG}
cat ${QA_LOG} cat ${QA_LOG}
......
...@@ -76,6 +76,7 @@ void mcbm_qa(Int_t nEvents = 0, ...@@ -76,6 +76,7 @@ void mcbm_qa(Int_t nEvents = 0,
/// \param bUseMC Flag for MC (simulation) usage /// \param bUseMC Flag for MC (simulation) usage
/// \param config QA YAML configuraiton file /// \param config QA YAML configuraiton file
/// \param benchmarkInput Path to a benchmark QA output, obtained for a given setup and given number of events /// \param benchmarkInput Path to a benchmark QA output, obtained for a given setup and given number of events
/// \param bUseAlignment Flag for enabling alignment matrices usage
void mcbm_qa(Int_t nEvents = 0, void mcbm_qa(Int_t nEvents = 0,
TString traColFile = "data/mcbm_beam_2022_05_nickel.tra.root", TString traColFile = "data/mcbm_beam_2022_05_nickel.tra.root",
TString rawFile = "data/mcbm_beam_2022_05_nickel.event.raw.root", TString rawFile = "data/mcbm_beam_2022_05_nickel.event.raw.root",
...@@ -86,7 +87,8 @@ void mcbm_qa(Int_t nEvents = 0, ...@@ -86,7 +87,8 @@ void mcbm_qa(Int_t nEvents = 0,
TString setupName = "mcbm_beam_2022_05_nickel", TString setupName = "mcbm_beam_2022_05_nickel",
Bool_t bUseMC = kTRUE, Bool_t bUseMC = kTRUE,
TString config = "", TString config = "",
TString benchmarkInput = "") TString benchmarkInput = "",
Bool_t bUseAlignment = kFALSE)
/* clang-format on */ /* clang-format on */
{ {
...@@ -228,6 +230,25 @@ void mcbm_qa(Int_t nEvents = 0, ...@@ -228,6 +230,25 @@ void mcbm_qa(Int_t nEvents = 0,
FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Alignment matrices -------------------------------------------
if (bUseAlignment) {
std::map<std::string, TGeoHMatrix>* matrices{nullptr};
TString alignmentMatrixFileName = srcDir + "/parameters/mcbm/AlignmentMatrices_" + setupName + ".root";
LOG(info) << "Trying to load alignment matrices from file " << alignmentMatrixFileName;
TFile* misalignmentMatrixRootfile = TFile::Open(alignmentMatrixFileName, "READ");
if (misalignmentMatrixRootfile && misalignmentMatrixRootfile->IsOpen()) {
gDirectory->GetObject("MisalignMatrices", matrices);
misalignmentMatrixRootfile->Close();
LOG(info) << "Read alignment matrices ";
}
else {
LOG(info) << "Could not find usable alignment file. Skip alignment matrices.";
}
if (matrices) run->AddAlignmentMatrices(*matrices);
}
// ------------------------------------------------------------------------
// ----- QA manager --------------------------------------------------- // ----- QA manager ---------------------------------------------------
auto* qaManager = new CbmQaManager(verbose); auto* qaManager = new CbmQaManager(verbose);
qaManager->SetConfigName(qaConfig); qaManager->SetConfigName(qaConfig);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#endif #endif
void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.root", void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.root",
TString setupName = "mcbm_beam_2022_05_23_nickel", Bool_t bUseMC = kFALSE) TString setupName = "mcbm_beam_2022_05_23_nickel", Bool_t bUseMC = kFALSE, Bool_t bUseAlignment = kTRUE)
{ {
// ======================================================================== // ========================================================================
...@@ -86,13 +86,22 @@ void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.roo ...@@ -86,13 +86,22 @@ void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.roo
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
std::map<std::string, TGeoHMatrix>* matrices{nullptr}; std::map<std::string, TGeoHMatrix>* matrices{nullptr};
TFile* misalignmentMatrixRootfile = TFile::Open(Form("AlignmentMatrices_%s.root", setupName.Data()), "READ"); if (bUseAlignment) {
TString alignmentMatrixFileName = srcDir + "/parameters/mcbm/AlignmentMatrices_" + setupName + ".root";
LOG(info) << "Trying to load alignment matrices from file " << alignmentMatrixFileName;
TFile* misalignmentMatrixRootfile = TFile::Open(alignmentMatrixFileName, "READ");
if (misalignmentMatrixRootfile && misalignmentMatrixRootfile->IsOpen()) { if (misalignmentMatrixRootfile && misalignmentMatrixRootfile->IsOpen()) {
gDirectory->GetObject("MisalignMatrices", matrices); gDirectory->GetObject("MisalignMatrices", matrices);
misalignmentMatrixRootfile->Close(); misalignmentMatrixRootfile->Close();
LOG(info) << "Read alignment matrices ";
}
else {
LOG(warning) << "Could not find usable alignment file. Skip alignment matrices.";
}
}
else {
LOG(warning) << "Usage of alignment matrices disabled.";
} }
else
LOG(warning) << "Could not find usable alignment file. Skip.";
// ----- FairRunAna --------------------------------------------------- // ----- FairRunAna ---------------------------------------------------
FairFileSource* inputSource = new FairFileSource(recFile); FairFileSource* inputSource = new FairFileSource(recFile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment