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

[mCBM] Add macro to create the setup geo root files based on RunId

- For now making call to mcbm_transport.C from a different folder (hardcoded path) + running 1 event
- Call should be replaced on the long term with an INIT only method (no need to run a simulation to get a geometry)
parent 2018bab5
No related branches found
No related tags found
1 merge request!962Add possibility to create mCBM setup geo root file from only the runID + some cleanup
...@@ -2,3 +2,4 @@ all_*.par ...@@ -2,3 +2,4 @@ all_*.par
data/*.root data/*.root
data/qa/*.root data/qa/*.root
CbmRecoUnpack.perf.root CbmRecoUnpack.perf.root
gphysi.dat
...@@ -302,11 +302,11 @@ If(DEFINED ENV{RAW_DATA_PATH} ) ...@@ -302,11 +302,11 @@ If(DEFINED ENV{RAW_DATA_PATH} )
Message( STATUS "Raw data path provided => Performing mCBM 2021 tests using tsa files in ${RAW_DATA_PATH}" ) Message( STATUS "Raw data path provided => Performing mCBM 2021 tests using tsa files in ${RAW_DATA_PATH}" )
## Generate scripts ## Generate scripts
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/create_mcbm_geo_setup.C ) # Geofile creation
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_unpack_tsa.C ) # Unpackers GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_unpack_tsa.C ) # Unpackers
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2021/check_timing_any.C ) # Check Timing mCBM 2021 GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2021/check_timing_any.C ) # Check Timing mCBM 2021
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2022/mcbm_event.C ) # Event building mCBM 2022 GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2022/mcbm_event.C ) # Event building mCBM 2022
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C ) # Reco + Event building + L1 mCBM 2022 GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C ) # Reco + Event building + L1 mCBM 2022
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/mcbm/mcbm_transport.C)
## Run only if raw data files present: 2021 ## Run only if raw data files present: 2021
# =====> Set the timeouts depending on test model (profiling = slow) # =====> Set the timeouts depending on test model (profiling = slow)
...@@ -368,17 +368,6 @@ If(DEFINED ENV{RAW_DATA_PATH} ) ...@@ -368,17 +368,6 @@ If(DEFINED ENV{RAW_DATA_PATH} )
endif() endif()
### Transport run to create geo file
Set(setup mcbm_beam_2022_05_23_nickel)
Set(testname mcbm_geo_${setup})
Set(fixture_geo_run fixture_done_${testname})
Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/mcbm/mcbm_transport.sh 1 \"${setup}\" \"${CBMROOT_BINARY_DIR}/macro/run/data/${setup}\" \"\" kTRUE)
Set_Tests_Properties(${testname} PROPERTIES
TIMEOUT "600"
PASS_REGULAR_EXPRESSION "Test Passed;All ok"
FIXTURES_REQUIRED run_cleanup
FIXTURES_SETUP ${fixture_geo_run}
)
# ==================================================================== # ====================================================================
ForEach(RUN 2391 2488 ) ForEach(RUN 2391 2488 )
...@@ -386,6 +375,17 @@ If(DEFINED ENV{RAW_DATA_PATH} ) ...@@ -386,6 +375,17 @@ If(DEFINED ENV{RAW_DATA_PATH} )
If(EXISTS ${RAW_DATA_PATH}/${RUN}_first20Ts.tsa) If(EXISTS ${RAW_DATA_PATH}/${RUN}_first20Ts.tsa)
Message( STATUS "Raw data file found, tests will be performed for mCBM run ${RUN}" ) Message( STATUS "Raw data file found, tests will be performed for mCBM run ${RUN}" )
### Transport run to create geo file
Set(testname mcbm_geo_${RUN})
Set(fixture_geo_${RUN} fixture_done_${testname})
Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/run/create_mcbm_geo_setup.sh ${RUN})
Set_Tests_Properties(${testname} PROPERTIES
TIMEOUT "200"
PASS_REGULAR_EXPRESSION "Test Passed;All ok"
FIXTURES_REQUIRED run_cleanup
FIXTURES_SETUP ${fixture_geo_${RUN}}
)
## Define tests + dependencies ## Define tests + dependencies
### Raw data analysis tests: unpacking ### Raw data analysis tests: unpacking
Set(testname mcbm_unpack_${RUN}) Set(testname mcbm_unpack_${RUN})
...@@ -415,15 +415,15 @@ If(DEFINED ENV{RAW_DATA_PATH} ) ...@@ -415,15 +415,15 @@ If(DEFINED ENV{RAW_DATA_PATH} )
Set(testname mcbm_reco_2022_${RUN}) Set(testname mcbm_reco_2022_${RUN})
Set(fixture_reco_${RUN} fixture_done_${testname}) Set(fixture_reco_${RUN} fixture_done_${testname})
Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2022/mcbm_event_reco_L1.sh ${RUN} ${RECO_EVNTS_NB} Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2022/mcbm_event_reco_L1.sh ${RUN} ${RECO_EVNTS_NB}
\"${CBMROOT_BINARY_DIR}/macro/run/data/\" \"${CBMROOT_BINARY_DIR}/macro/run/data/\" \"${CBMROOT_BINARY_DIR}/macro/run/data/\" \"${CBMROOT_BINARY_DIR}/macro/run/data/\"
-1 kFALSE kTRUE kTRUE kTRUE kTRUE kFALSE kTRUE kTRUE kFALSE kTRUE kTRUE kFALSE kFALSE -1 kFALSE kTRUE kTRUE kTRUE kTRUE kFALSE kTRUE kTRUE kFALSE kTRUE kTRUE kFALSE kFALSE
\"${CBMROOT_BINARY_DIR}/macro/run/data/${RUN}_first20Ts.digi.root\" \"${CBMROOT_BINARY_DIR}/macro/run/data/${RUN}_first20Ts.digi.root\"
) )
Set_Tests_Properties(${testname} PROPERTIES Set_Tests_Properties(${testname} PROPERTIES
TIMEOUT ${RAW_DATA_RECO_TO} TIMEOUT ${RAW_DATA_RECO_TO}
FAIL_REGULAR_EXPRESSION "segmentation violation" FAIL_REGULAR_EXPRESSION "segmentation violation"
PASS_REGULAR_EXPRESSION "Macro finished successfully" PASS_REGULAR_EXPRESSION "Macro finished successfully"
FIXTURES_REQUIRED "${fixture_geo_run};${fixture_event_${RUN}}" FIXTURES_REQUIRED "${fixture_geo_${RUN}};${fixture_event_${RUN}}"
FIXTURES_SETUP ${fixture_reco_${RUN}} FIXTURES_SETUP ${fixture_reco_${RUN}}
RESOURCE_LOCK mcbmRecoAllCoresBug RESOURCE_LOCK mcbmRecoAllCoresBug
) )
......
/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
void create_mcbm_geo_setup(uint64_t ulRunId)
{
/// Do automatic mapping
std::string sSetupName = "";
cbm::mcbm::ToForceLibLoad dummy; /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
try {
sSetupName = cbm::mcbm::GetSetupFromRunId(ulRunId);
}
catch (const std::invalid_argument& e) {
std::cout << "Error in mapping from runID to setup name: " << e.what() << std::endl;
return;
}
std::string sPath = "data/" + sSetupName;
if (gSystem->AccessPathName(Form("%s.geo.root", sPath.data()))) {
std::string sSrcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
std::string sTransportMacro = sSrcDir + "/macro/mcbm/mcbm_transport.C";
gROOT->LoadMacro(sTransportMacro.data());
std::string sTransportCall = "mcbm_transport( 1, \"" + sSetupName + "\", \"" + sPath + "\")";
gInterpreter->ProcessLine(sTransportCall.data());
}
else {
std::cout << "Geofile already existing for this run at: " << Form("%s.geo.root", sPath.data()) << std::endl;
std::cout << " Test passed" << std::endl;
std::cout << " All ok " << std::endl;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment