Skip to content
Snippets Groups Projects
Commit 7123e90b authored by Administrator's avatar Administrator
Browse files

Allow fixed random seed for all transport macros

There were still some transport macros which did not allow to fix the random
seed. This is fixed now such that all transport macros from the CI suite now
run with a fixed random seed of 1. This allows to compare results of different
software versions for identity.
parent 982c4b76
No related branches found
No related tags found
1 merge request!1120Allow fixed random seed for all transport macros
Pipeline #21677 passed
......@@ -13,6 +13,7 @@ File(COPY ${CBMROOT_SOURCE_DIR}/parameters/much/TOF8gev_fitParam_sigma2.sis100_m
# Define the number of events to run
Set(NumEvents 1000)
Set(randomSeed 1)
# Define the different setups to be tested
List(APPEND cbm_setup sis100_muon_lmvm)
......@@ -36,7 +37,7 @@ ForEach(setup IN LISTS cbm_setup)
# --- Transport run, using run_transport.C
Set(testname dimuon_transport_${setup})
Set(fixture_dimuon_digi fixture_dimuon_digi_${testname})
Add_Test(${testname} ${MACRO_DIR}/dimuon_transport.sh ${NumEvents} \"${setup}\" \"data/${setup}_test\" \"\" kTRUE)
Add_Test(${testname} ${MACRO_DIR}/dimuon_transport.sh ${NumEvents} \"${setup}\" \"data/${setup}_test\" \"\" kTRUE ${randomSeed})
Set_Tests_Properties(${testname} PROPERTIES
TIMEOUT "600"
PASS_REGULAR_EXPRESSION "Test Passed;All ok"
......
......@@ -40,7 +40,7 @@
//---------------------------------------------------
void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon_lmvm", const char* output = "test",
const char* inputFile = "", Bool_t overwrite = kFALSE)
const char* inputFile = "", Bool_t overwrite = kFALSE, int randomSeed = 0)
{
// --- Logger settings ----------------------------------------------------
......@@ -86,6 +86,7 @@ void dimuon_transport(Int_t nEvents = 1000, const char* setupName = "sis100_muon
run.SetTarget("Gold", 0.025, 2.5);
run.SetBeamPosition(0., 0., 0.1, 0.1);
run.SetEngine(kGeant3);
run.SetRandomSeed(randomSeed);
// ------------------------------------------------------------------------
run.Run(nEvents);
......
......@@ -22,6 +22,7 @@ File(COPY ${CBMROOT_SOURCE_DIR}/macro/include/.rootrc DESTINATION ${CBMROOT_BINA
# Define the number of events to run
Set(NumEvents 10)
Set(BeamAngle 25)
Set(randomSeed 1)
# Define the different setups to be tested
# Default should always be tested in all case
......@@ -53,7 +54,7 @@ ForEach(setup IN LISTS cbm_setup)
Set(testname mcbm_transport_${setup})
Set(fixture_mcbm_transport fixture_${testname})
Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/mcbm/mcbm_transport.sh ${NumEvents} \"${setup}\" \"data/${setup}_test\" \"\" kTRUE)
Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/mcbm/mcbm_transport.sh ${NumEvents} \"${setup}\" \"data/${setup}_test\" \"\" kTRUE ${randomSeed})
Set_Tests_Properties(${testname} PROPERTIES
TIMEOUT "600"
PASS_REGULAR_EXPRESSION "Test Passed;All ok"
......
......@@ -43,7 +43,8 @@ void mcbm_transport(Int_t nEvents = 10,
// const char* setupName = "mcbm_beam_2019_11",
// const char* setupName = "mcbm_beam_2019_03",
// const char* setupName = "sis18_mcbm_25deg_long",
const char* output = "data/test", const char* inputFile = "", Bool_t overwrite = kTRUE)
const char* output = "data/test", const char* inputFile = "",
Bool_t overwrite = kTRUE, int randomSeed = 0)
{
// --- Define the beam angle ----------------------------------------------
Double_t beamRotY = 25.;
......@@ -208,6 +209,7 @@ void mcbm_transport(Int_t nEvents = 10,
run.SetBeamAngle(beamRotY * TMath::DegToRad(), 0.);
if (nEvents <= 10) // store only for small number of events
run.StoreTrajectories();
run.SetRandomSeed(randomSeed);
run.Run(nEvents);
// ------------------------------------------------------------------------
......
......@@ -10,6 +10,7 @@ GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_reco_event.C ${MACR
File(COPY ${CBMROOT_SOURCE_DIR}/macro/include/.rootrc DESTINATION ${CBMROOT_BINARY_DIR}/macro/much)
Set(NumEvents 3)
Set(randomSeed 1)
# ===== Cleanup the data directory =======================================
add_test(much_cleanup ${CMAKE_COMMAND}
......@@ -19,10 +20,9 @@ set_tests_properties(much_cleanup PROPERTIES
FIXTURES_SETUP much_cleanup
)
# --- Transport of UrQMD events
Set(testname much_transport)
add_test(${testname} ${MACRO_DIR}/run_transport.sh ${NumEvents} \"sis100_muon_lmvm\" \"data/muons\")
add_test(${testname} ${MACRO_DIR}/run_transport.sh ${NumEvents} \"sis100_muon_lmvm\" \"data/muons\" \"\" \"\" kFALSE ${randomSeed})
SET_TESTS_PROPERTIES(${testname} PROPERTIES
TIMEOUT "1200"
PASS_REGULAR_EXPRESSION "TestPassed;All ok"
......
......@@ -40,7 +40,8 @@
//---------------------------------------------------
void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm", const char* output = "muons",
const char* inputFile = "", const char* plutoFile = "", Bool_t overwrite = kFALSE)
const char* inputFile = "", const char* plutoFile = "", Bool_t overwrite = kFALSE,
int randomSeed = 0)
{
// --- Logger settings ----------------------------------------------------
......@@ -119,6 +120,7 @@ void run_transport(Int_t nEvents = 3, const char* setupName = "sis100_muon_lmvm"
run.SetTarget("Gold", 0.025, 2.5);
run.SetBeamPosition(0., 0., 0.1, 0.1);
run.SetEngine(kGeant3);
run.SetRandomSeed(randomSeed);
// run.GetStackFilter()->SetMinNofPoints(kSts,0);
// run.GetStackFilter()->SetMinNofPoints(kMuch,0);
// run.GetStackFilter()->SetMinNofPoints(kTrd,0);
......
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