-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·68 lines (57 loc) · 2.82 KB
/
run.sh
File metadata and controls
executable file
·68 lines (57 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
#
# This is a simulation example showing the following things
#
# a) how to run a simple background event simulation with some parameter customization
# b) how to generate a pythia8 configuration file replacing values from a template configuration
# c) how to run a simulation producing signal events using several specific pythia8 settings and user hooks
# d) how to run digitization embedding/overlaying background and signal hits
#
# The main focus in this example is on PART c). PART b) just relaces some template values in the Pythia8 configuration file.
#
# An external event generator configuration `-g external` is loaded from the file defined via `--configKeyValues` setting
# `GeneratorExternal.fileName=GeneratorHF.macro` by running the code defined in the function `GeneratorExternal.funcName="GeneratorHF()"`.
# Special configuration parameters are loaded from the INI file `--configFile o2sim_configuration_sgn.ini`.
#
# GeneratorPythia8.config defines the Pythia8 configuration file name.
#
# We configured to bias towards c-cbar processes where we can select them baed on pt-hat bins.
#
# GeneratorPythia8.hooksFileName defines the file name where to load the custom Pythia8 hooks
# GeneratorPythia8.hooskFuncName defines the function call to be run to retrieve the custom Pythia8 hools.
#
# Hooks are used in this example to speedup the event generation. Event generation is paused at parton level.
# We check if there are the partons of our interest, if not we veto the event. This saves time because we
# do not have to process the full hadronisation step of uninteresting events.
# Look inside `pythia8_userhooks_ccbar.macro` for details on how this is implemented
#
# DecayerPythia8.config[0], [1] and [2] define several configuration files for the external decayer.
# The files are loaded in series. Look inside the corresponding `.cfg` for details.
#
# SimUserDecay.pdglist instructs Geant not to process the decays, but to hand them to the external decayer.
#
set -x
MODULES="PIPE ITS TPC"
BKGEVENTS=5
SIGEVENTS=20
NWORKERS=8
# PART a)
o2-sim -j ${NWORKERS} -n ${BKGEVENTS} -g pythia8hi -m ${MODULES} -o bkg \
--configFile o2sim_configuration_bkg.ini \
> logbkg 2>&1
# PART b)
RNDSEED=0 # [default = 0] time-based random seed
PTHATMIN=0. # [default = 0]
PTHATMAX=-1. # [default = -1]
sed -e "s/\${rndSeed}/$RNDSEED/" \
-e "s/\${pTHatMin}/$PTHATMIN/" \
-e "s/\${pTHatMax}/$PTHATMAX/" \
pythia8_ccbar.template > pythia8.cfg
# PART c)
o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g external -m ${MODULES} -o sgn \
--configKeyValues "GeneratorExternal.fileName=GeneratorHF.macro;GeneratorExternal.funcName=GeneratorHF()" \
--configFile o2sim_configuration_sgn.ini \
--embedIntoFile bkg_Kine.root \
> logsgn 2>&1
# PART d)
o2-sim-digitizer-workflow --sims bkg,sgn --tpc-lanes 4 -b --run