-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of cocktail generation
Works for sequence generation * Updated Hybrid example
- Loading branch information
1 parent
a14603d
commit d52ac29
Showing
7 changed files
with
236 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- doxy | ||
\page refrunSimExamplesHybrid Example Hybrid_cocktail | ||
/doxy --> | ||
|
||
The usage of the Hybrid generator using cocktails is presented in this example. | ||
The syntax of the JSON file shows how the cocktails can be grouped. Each generator will be pulled exactly once in order for each cocktail event generation. | ||
The basic Hybrid Generator mechanisms are shown in the Hybrid and Hybrid_parallel example folders. | ||
The cocktail configuration can not be setup with the template script for now. | ||
|
||
# Files description | ||
|
||
- **runo2sim.sh** → allows to use the hybrid generator example | ||
- **hybridcocktail.json** → example JSON file for the hybrid generator configuration using cocktails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"generators": [ | ||
{ | ||
"name": "pythia8", | ||
"config": { | ||
"config": "$O2_ROOT/share/Generators/egconfig/pythia8_inel.cfg", | ||
"hooksFileName": "", | ||
"hooksFuncName": "", | ||
"includePartonEvent": false, | ||
"particleFilter": "", | ||
"verbose": 0 | ||
} | ||
}, | ||
{ | ||
"name": "external", | ||
"config": { | ||
"fileName": "${O2DPG_ROOT}/MC/config/PWGDQ/external/generator/GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV.C", | ||
"funcName": "GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV()", | ||
"iniFile": "" | ||
} | ||
}, | ||
{ | ||
"name": "pythia8pp" | ||
}, | ||
{ | ||
"name": "extkinO2", | ||
"config": { | ||
"skipNonTrackable": true, | ||
"continueMode": false, | ||
"roundRobin": false, | ||
"randomize": false, | ||
"rngseed": 0, | ||
"randomphi": false, | ||
"fileName": "${PWD}/evtpool.root" | ||
} | ||
}, | ||
{ | ||
"name": "pythia8hf", | ||
"config": "" | ||
} | ||
], | ||
"cocktail": [ | ||
{ | ||
"group": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"group": [ | ||
2, | ||
3 | ||
] | ||
} | ||
], | ||
"fractions": [ | ||
1, | ||
1, | ||
1 | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Hybrid generator simulation example using cocktails: | ||
# the simulation is configured using a JSON file (hybridcocktail.json in this folder) | ||
set -x | ||
if [ ! "${O2DPG_ROOT}" ]; then | ||
echo "This needs O2DPG loaded; alienv enter ..." | ||
exit 1 | ||
fi | ||
|
||
[ ! "${O2_ROOT}" ] && echo "Error: This needs O2 loaded" && exit 2 | ||
|
||
NEV=-1 | ||
more="" | ||
JOBS=2 | ||
|
||
usage() | ||
{ | ||
cat <<EOF | ||
Usage: $0 [OPTIONS] | ||
Options: | ||
-m,--more CONFIG More configurations ($more) | ||
-n,--nevents EVENTS Number of events ($NEV) | ||
-j,--jobs JOBS Number of jobs ($JOBS) | ||
-h,--help Print these instructions | ||
-- Rest of command line sent to o2-sim | ||
COMMAND must be quoted if it contains spaces or other special | ||
characters | ||
Below follows the help output of o2-sim | ||
EOF | ||
} | ||
|
||
if [ "$#" -lt 2 ]; then | ||
echo "Running with default values" | ||
fi | ||
|
||
while test $# -gt 0 ; do | ||
case $1 in | ||
-m|--more) more="$2" ; shift ;; | ||
-n|--nevents) NEV=$2 ; shift ;; | ||
-j|--jobs) JOBS=$2 ; shift ;; | ||
-h|--help) usage; o2-sim --help full ; exit 0 ;; | ||
--) shift ; break ;; | ||
*) echo "Unknown option '$1', did you forget '--'?" >/dev/stderr | ||
exit 3 | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
# Set number of events in optns file | ||
if [ ! $NEV -eq -1 ]; then | ||
echo "Setting number of events to $NEV" | ||
else | ||
echo "Number of events not set, defaulting to 10..." | ||
NEV=10 | ||
fi | ||
|
||
# Generation of event pool with pythia8 (10000 events) in a evtpool.root file | ||
${O2DPG_ROOT}/MC/run/examples/event_pool.sh --make | ||
|
||
# Starting simulation with Hybrid generator | ||
${O2_ROOT}/bin/o2-sim --noGeant -j $JOBS --field ccdb --vertexMode kCCDB --run 300000 --configKeyValues "MFTBase.buildAlignment=true;GeneratorHybrid.configFile=$PWD/hybridcocktail.json;GeneratorHybrid.randomize=false;${more}" -g hybrid -o genevents --timestamp 1546300800000 --seed 836302859 -n $NEV |