Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Alain Loizeau
cbmroot
Commits
ec88aff0
Commit
ec88aff0
authored
Oct 29, 2021
by
Sergey Gorbunov
Browse files
add random seed as a parameter to transport macros, fix it for the CI tests
parent
1e7554f2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
10 deletions
+16
-10
macro/run/CMakeLists.txt
macro/run/CMakeLists.txt
+7
-5
macro/run/run_tra_beam.C
macro/run/run_tra_beam.C
+3
-1
macro/run/run_tra_file.C
macro/run/run_tra_file.C
+2
-2
macro/run/run_transport.C
macro/run/run_transport.C
+2
-1
macro/run/run_transport_json_config.C
macro/run/run_transport_json_config.C
+2
-1
No files found.
macro/run/CMakeLists.txt
View file @
ec88aff0
...
...
@@ -21,10 +21,12 @@ if($ENV{ctest_model} MATCHES Weekly)
Set
(
nEvents 100
)
Set
(
uploadHistJPG 1
)
Set
(
pullDevAllowed .2
)
Set
(
randomSeed 1
)
else
()
Set
(
nEvents 3
)
Set
(
uploadHistJPG 0
)
Set
(
pullDevAllowed .5
)
Set
(
randomSeed 1
)
endIf
()
math
(
EXPR timeOutTime
"
${
nEvents
}
* 200"
)
...
...
@@ -73,7 +75,7 @@ foreach(setup IN LISTS cbm_setup)
# --- Test run_transport_json_config
# --- Transport run using run_transport_json_config.C
set
(
testname run_transport_json_config
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_transport_json_config.sh
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_transport_json_config.sh
\"\" 2
${
randomSeed
}
)
set_tests_properties
(
${
testname
}
PROPERTIES
TIMEOUT
${
timeOutTime
}
PASS_REGULAR_EXPRESSION
"Macro finished successfully"
...
...
@@ -99,7 +101,7 @@ foreach(setup IN LISTS cbm_setup)
set
(
testname run_
${
sname
}
_tra_coll
)
set
(
input
${
CBMROOT_SOURCE_DIR
}
/input/urqmd.auau.10gev.centr.root
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_tra_file.sh
\"
${
input
}
\"
${
nEvents
}
\"data/
${
sname
}
_coll\" \"
${
setup
}
\"
)
\"
${
input
}
\"
${
nEvents
}
\"data/
${
sname
}
_coll\" \"
${
setup
}
\"
kGeant3
${
randomSeed
}
)
set_tests_properties
(
${
testname
}
PROPERTIES
TIMEOUT
${
timeOutTime
}
PASS_REGULAR_EXPRESSION
"Macro finished successfully"
...
...
@@ -113,7 +115,7 @@ foreach(setup IN LISTS cbm_setup)
set
(
testname run_
${
sname
}
_tra_sign
)
set
(
input
${
CBMROOT_SOURCE_DIR
}
/input/pluto.auau.8gev.omega.mpmm.0001.root
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_tra_file.sh
\"
${
input
}
\"
${
nEvents
}
\"data/
${
sname
}
_sign\" \"
${
setup
}
\"
)
\"
${
input
}
\"
${
nEvents
}
\"data/
${
sname
}
_sign\" \"
${
setup
}
\"
kGeant3
${
randomSeed
}
)
set_tests_properties
(
${
testname
}
PROPERTIES
TIMEOUT
${
timeOutTime
}
PASS_REGULAR_EXPRESSION
"Macro finished successfully"
...
...
@@ -126,7 +128,7 @@ foreach(setup IN LISTS cbm_setup)
# --- Transport run with beam events, using run_tra_beam.C
set
(
testname run_
${
sname
}
_tra_beam
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_tra_beam.sh
${
nBeam
}
\"Au\" 10 -1 \"data/
${
sname
}
_beam\" \"
${
setup
}
\"
)
${
nBeam
}
\"Au\" 10 -1 \"data/
${
sname
}
_beam\" \"
${
setup
}
\"
kGeant3
${
randomSeed
}
)
set_tests_properties
(
${
testname
}
PROPERTIES
TIMEOUT
${
timeOutTime
}
PASS_REGULAR_EXPRESSION
"Macro finished successfully"
...
...
@@ -257,7 +259,7 @@ foreach(setup IN LISTS cbm_setup)
# --- Test run_transport_json_config
# --- Transport run using run_transport_json_config.C
set
(
testname run_transport_json_config
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_transport_json_config.sh
)
add_test
(
${
testname
}
${
MACRO_DIR
}
/run_transport_json_config.sh
\"\" 2
${
randomSeed
}
)
set_tests_properties
(
${
testname
}
PROPERTIES
TIMEOUT
${
timeOutTime
}
PASS_REGULAR_EXPRESSION
"Macro finished successfully"
...
...
macro/run/run_tra_beam.C
View file @
ec88aff0
...
...
@@ -58,7 +58,8 @@
** http://computing.gitpages.cbm.gsi.de/cbmroot/classCbmTransport.html
**/
void
run_tra_beam
(
Int_t
nEvents
=
1
,
const
char
*
species
=
"Au"
,
Double_t
beamP
=
12
.,
Double_t
beamStartZ
=
-
1
.,
const
char
*
output
=
"beam"
,
const
char
*
setup
=
"sis100_electron"
,
ECbmEngine
engine
=
kGeant3
)
const
char
*
output
=
"beam"
,
const
char
*
setup
=
"sis100_electron"
,
ECbmEngine
engine
=
kGeant3
,
int
randomSeed
=
0
)
{
// --- Logger settings ----------------------------------------------------
...
...
@@ -154,6 +155,7 @@ void run_tra_beam(Int_t nEvents = 1, const char* species = "Au", Double_t beamP
run
.
SetBeamPosition
(
beamMeanX
,
beamMeanY
,
beamSigmaX
,
beamSigmaY
,
beamFocusZ
);
run
.
SetBeamAngle
(
beamMeanTx
,
beamMeanTy
,
beamSigmaTx
,
beamSigmaTy
);
run
.
AddInput
(
new
CbmBeamGenerator
(
beamZ
,
beamA
,
beamQ
,
beamP
,
beamStartZ
));
run
.
SetRandomSeed
(
randomSeed
);
run
.
Run
(
nEvents
);
// ------------------------------------------------------------------------
...
...
macro/run/run_tra_file.C
View file @
ec88aff0
...
...
@@ -67,7 +67,7 @@
** http://computing.gitpages.cbm.gsi.de/cbmroot/classCbmTransport.html
**/
void
run_tra_file
(
const
char
*
input
=
""
,
Int_t
nEvents
=
1
,
const
char
*
output
=
""
,
const
char
*
setup
=
"sis100_electron"
,
ECbmEngine
engine
=
kGeant3
)
const
char
*
setup
=
"sis100_electron"
,
ECbmEngine
engine
=
kGeant3
,
int
randomSeed
=
0
)
{
// --- Logger settings ----------------------------------------------------
...
...
@@ -75,7 +75,6 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
FairLogger
::
GetLogger
()
->
SetLogVerbosityLevel
(
"LOW"
);
// ------------------------------------------------------------------------
// ----- Environment --------------------------------------------------
TString
myName
=
"run_tra_file"
;
// this macro's name for screen output
TString
srcDir
=
gSystem
->
Getenv
(
"VMCWORKDIR"
);
// top source directory
...
...
@@ -153,6 +152,7 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
run
.
SetTarget
(
targetMedium
,
targetThickness
,
targetDiameter
);
run
.
SetBeamPosition
(
beamPosX
,
beamPosY
,
beamSigmaX
,
beamSigmaY
);
if
(
rotateEvents
)
run
.
SetRandomEventPlane
();
run
.
SetRandomSeed
(
randomSeed
);
run
.
Run
(
nEvents
);
// ------------------------------------------------------------------------
...
...
macro/run/run_transport.C
View file @
ec88aff0
...
...
@@ -44,7 +44,7 @@
** CbmTransport.
**/
void
run_transport
(
Int_t
nEvents
=
2
,
const
char
*
setupName
=
"sis100_electron"
,
const
char
*
output
=
"test"
,
const
char
*
inputFile
=
""
)
const
char
*
inputFile
=
""
,
Int_t
randomSeed
=
0
)
{
// --- Logger settings ----------------------------------------------------
...
...
@@ -91,6 +91,7 @@ void run_transport(Int_t nEvents = 2, const char* setupName = "sis100_electron",
run
.
SetBeamPosition
(
0
.,
0
.,
0
.
1
,
0
.
1
);
run
.
SetRandomEventPlane
();
// run.StoreTrajectories();
run
.
SetRandomSeed
(
randomSeed
);
run
.
Run
(
nEvents
);
// ------------------------------------------------------------------------
...
...
macro/run/run_transport_json_config.C
View file @
ec88aff0
...
...
@@ -29,7 +29,7 @@
** the main config is applied.
**/
void
run_transport_json_config
(
std
::
string
config
=
""
,
int
nEvents
=
2
)
void
run_transport_json_config
(
std
::
string
config
=
""
,
int
nEvents
=
2
,
int
randomSeed
=
0
)
{
if
(
config
==
""
)
config
=
Form
(
"%s/macro/run/config.json"
,
gSystem
->
Getenv
(
"VMCWORKDIR"
));
...
...
@@ -39,6 +39,7 @@ void run_transport_json_config(std::string config = "", int nEvents = 2)
// ------------------------------------------------------------------------
CbmTransport
run
;
run
.
SetRandomSeed
(
randomSeed
);
if
(
CbmTransportConfig
::
Load
(
run
,
config
))
run
.
Run
(
nEvents
);
else
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment