Skip to content
Snippets Groups Projects
Commit 4e09a51e authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Added real event generation step

parent 5e20aaaa
No related branches found
No related tags found
1 merge request!2DVMP work
......@@ -23,3 +23,6 @@ export DETECTOR_PREFIX=`realpath ${DETECTOR_PREFIX}`
## setup detector paths
export LD_LIBRARY_PATH=${DETECTOR_PREFIX}/lib:$LD_LIBRARY_PATH
export DETECTOR_SOURCE_PATH=${DETECTOR_PREFIX}/src
## setup root results artifact path
export RESULTS_PATH=`realpath results`
dvmp:jpsi_central:generate:
image: eicweb.phy.anl.gov:4567/monte_carlo/lager/lager:unstable
stage: generate
needs: []
timeout: 1 hours
......@@ -6,6 +7,7 @@ dvmp:jpsi_central:generate:
key:
files:
- dvmp/generator/jpsi_central.json
- dvmp/scripts/jpsi_central-generate.sh
prefix: "$CI_COMMIT_REF_SLUG"
paths:
- results/dvmp
......@@ -13,9 +15,7 @@ dvmp:jpsi_central:generate:
paths:
- results
script:
- echo "stub for generator"
- mkdir -p results/dvmp
- touch results/dvmp/event-stub
- ./dvmp/scripts/jpsi_central-generate.sh
dvmp:jpsi_central:process:
stage: process
......@@ -39,7 +39,7 @@ dvmp:jpsi_central:dummy_test:
dependencies:
- dvmp:jpsi_central:process
script:
- dvmp/dummy_test.sh
- dvmp/scripts/dummy_test.sh
dvmp:jpsi_central:dummy_test2:
stage: analyze
......@@ -47,7 +47,7 @@ dvmp:jpsi_central:dummy_test2:
dependencies:
- dvmp:jpsi_central:process
script:
- dvmp/dummy_test2.sh
- dvmp/scripts/dummy_test2.sh
dvmp:jpsi_central:dummy_fail_test:
stage: analyze
......@@ -56,7 +56,7 @@ dvmp:jpsi_central:dummy_fail_test:
- dvmp:jpsi_central:process
allow_failure: true
script:
- dvmp/dummy_fail_test.sh
- dvmp/scripts/dummy_fail_test.sh
dvmp:results:
stage: collect
......
#!/bin/bash
## Generates different configurations from the master configuration
## for both electron and muon decay channels
echo "Generating generator configuration files for J/psi -> e+e- and mu+mu-"
CONFIG=
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-c|--config)
CONFIG="$2"
shift # past argument
shift # past value
;;
*) # unknown option
echo "unknown option"
exit 1
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ -z ${CONFIG} ]] ; then
echo " ERROR: need argument -c/--config <config file> "
exit 1
fi
if [[ ! -f ${CONFIG} ]] ; then
echo " ERROR: cannot find config input file ${CONFIG}"
exit 1
fi
CONFIG_BASE=`basename ${CONFIG} .json.in`
echo "Generating ${CONFIG_BASE}_el.json"
sed "s/@TAG@/electron/" ${CONFIG} | \
sed "s/@DECAY_LEPTON@/11/" | sed "s/@BRANCHING@/0.05971/" > ${CONFIG_BASE}_el.json
echo "Generating ${CONFIG_BASE}_mu.json"
sed "s/@TAG@/muon/" ${CONFIG} | \
sed "s/@DECAY_LEPTON@/13/" | sed "s/@BRANCHING@/0.05961/" > ${CONFIG_BASE}_mu.json
echo "Configuration generation finished."
{
"mc" : {
"type" : "eic",
"tag" : "@TAG@",
"events" : "10000",
"generator" : {
"type" : "ep-2gluon",
"vertex" : {"type" : "origin"},
"beam": {
"lepton" : {
"type" : "constant",
"particle_type" : "e-",
"dir" : [ "0", "0", "-1" ],
"energy" : "10.0"
},
"ion" : {
"type" : "constant",
"particle_type" : "proton",
"dir" : [ "0", "0", "1" ],
"energy" : "100"
}
},
"target": {"type": "primary"},
"photon" : {
"type" : "vphoton",
"y_range" : [ "0.01", "1" ],
"Q2_range": [ "1.0", "1000"]
},
"process_0" : {
"type" : "brodsky_2vmX",
"vm_type" : "J/psi",
"recoil_type" : "proton",
"photo_b" : "4.50",
"photo_c2g" : "6.0e4",
"photo_c3g" : "0.0",
"R_vm_c" : "2.164",
"R_vm_n" : "2.131",
"dipole_n" : "2.575",
"note": "b from the H1 paper, c2g adjusted to fit HERA points"
}
},
"detector" : {
"type" : "composite",
"components" : {
"barrel" : {
"id" : "1",
"name" : "barrel",
"type" : "cone",
"acceptance" : {
"acceptance" : "1.0",
"p" : [ "1", "1000" ],
"theta" : [ "45", "135" ],
"pid" : [ "e+", "e-", "mu+", "mu-" ]
},
"smearing" : {"p" : "0.0", "theta" : "0.0", "phi" : "0.0"}
},
"endcap_fw" : {
"id" : "2",
"name" : "endcap_fw",
"type" : "cone",
"acceptance" : {
"acceptance" : "1.0",
"p" : [ "1", "1000" ],
"theta" : [ "10", "45" ],
"pid" : [ "e+", "e-", "mu+", "mu-" ]
},
"smearing" : {"p" : "0.0", "theta" : "0.0", "phi" : "0.0"}
},
"endcap_bw" : {
"id" : "3",
"name" : "endcap_bw",
"type" : "cone",
"acceptance" : {
"acceptance" : "1.0",
"p" : [ "1", "1000" ],
"theta" : [ "135", "170" ],
"pid" : [ "e+", "e-", "mu+", "mu-" ]
},
"smearing" : {"p" : "0.0", "theta" : "0.0", "phi" : "0.0"}
}
}
},
"reconstruction" : {"require_leading" : "true"},
"decay" : {
"vm_decay_lepton_type" : "@DECAY_LEPTON@",
"vm_branching_ratio" : "@BRANCHING@",
"do_radiative_decay_vm" : "true"
}
}
}
File moved
File moved
File moved
#!/bin/bash
## Init the environment
source config/env.sh
## Generator configuration
export NEVENTS=100
export RNG_SEED=1
export DVMP_RESULTS_PATH=$RESULTS_PATH/dvmp
export FNAME_EL="${DVMP_RESULTS_PATH}/jpsi_central_el-gen"
export FNAME_MU="${DVMP_RESULTS_PATH}/jpsi_central_mu-gen"
## Check if we already have our MC files in the cache
if [ -f "${FNAME_EL}.hepmc" ] && [ -f "${FNAME_MU}.hepmc"]; then
echo "Found cached generator output, no need to rerun"
else
echo "Need to generate our event sample"
pushd dvmp
## First generate our actual configuration files. We run for both electron
## and muon configurations
./generator/config_jpsi_decay.sh -c generator/jpsi_central.json.in
## This generates our jpsi_central_el.json and jpsi_central_mu.json files
## Now we can run the generator in parallel for both configurations
echo "Running the generator"
lager -r ${RNG_SEED} -c jpsi_central_el.json -e ${NEVENTS} -o . &
lager -r ${RNG_SEED} -c jpsi_central_mu.json -e ${NEVENTS} -o . &
wait
## Finally, we move our output into the artifacts directory
echo "Moving generator output into ${DVMP_RESULTS_PATH}"
mkdir -p ${DVMP_RESULTS_PATH}
mv *electron*.json ${FNAME_EL}.json
mv *electron*.root ${FNAME_EL}.root
mv *electron*.hepmc ${FNAME_EL}.hepmc
mv *electron*.log ${FNAME_EL}.log
mv *muon*.json ${FNAME_MU}.json
mv *muon*.root ${FNAME_MU}.root
mv *muon*.hepmc ${FNAME_MU}.hepmc
mv *muon*.log ${FNAME_MU}.log
fi
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