Skip to content

Commit 7caff12

Browse files
authored
Add support for input-specific task configuration (#456)
1 parent 79180c3 commit 7caff12

File tree

8 files changed

+28
-13
lines changed

8 files changed

+28
-13
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ These are the available input parameters and their default values:
119119
* `INPUT_IS_O2=0` Input files are in O<sup>2</sup> format.
120120
* `INPUT_IS_MC=0` Input files are MC data.
121121
* `INPUT_PARENT_MASK=""` Path replacement mask for the input directory of parent files in case of linked derived O<sup>2</sup> input. Set to `";"` if no replacement needed.
122+
* `INPUT_TASK_CONFIG=""` Input-specific task configuration (e.g. enabling converters), overriding the task configuration. String of space-separated commands.
122123
* `JSON="dpl-config.json"` O<sup>2</sup> device configuration
123124

124125
This allows you to define several input datasets and switch between them easily by setting the corresponding value of `INPUT_CASE`.

codeHF/config_input.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NJOBSPARALLEL_O2=$(python3 -c "print(min(10, round($(nproc) / 2)))")
2525
# INPUT_IS_O2=0 # Input files are in O2 format.
2626
# INPUT_IS_MC=0 # Input files are MC data.
2727
# INPUT_PARENT_MASK="" # Path replacement mask for the input directory of parent files in case of linked derived O2 input. Set to ";" if no replacement needed.
28+
# INPUT_TASK_CONFIG="" # Input-specific task configuration (e.g. enabling converters), overriding the task configuration in CONFIG_TASKS. String of space-separated commands.
2829
# JSON="dpl-config.json" # O2 device configuration
2930

3031
# O2 device configuration
@@ -44,6 +45,7 @@ case $INPUT_CASE in
4445
INPUT_LABEL="Run 2, p-p 5.02 TeV LHC17p, MC LHC18a4a2_cent"
4546
INPUT_DIR="$INPUT_BASE/Run2/pp_5.02TeV/sim/LHC18a4a2_cent/282099"
4647
INPUT_IS_MC=1
48+
INPUT_TASK_CONFIG="DOO2_CONV_ZDC=1 DOO2_CONV_BC=1 DOO2_CONV_TRKEX=1"
4749
;;
4850
3)
4951
INPUT_LABEL="Run 2, p-p 5.02 TeV LHC17p, MC LHC18a4a2_cent"

codeHF/config_tasks.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ DOO2_PID_TPC=0 # pid-tpc-full
116116
DOO2_PID_TOF=0 # pid-tof-full/alice3-pid-tof
117117
DOO2_PID_TOF_QA=0 # pid-tof-qa-mc
118118
DOO2_PID_BAYES=0 # pid-bayes
119-
# Converters
119+
# Converters (Consider setting these per input case via INPUT_TASK_CONFIG.)
120120
DOO2_CONV_MC=0 # mc-converter
121121
DOO2_CONV_FDD=0 # fdd-converter
122122
DOO2_CONV_COLL=0 # collision-converter
123-
DOO2_CONV_ZDC=1 # zdc-converter
124-
DOO2_CONV_BC=1 # bc-converter
125-
DOO2_CONV_TRKEX=1 # tracks-extra-converter
123+
DOO2_CONV_ZDC=0 # zdc-converter
124+
DOO2_CONV_BC=0 # bc-converter
125+
DOO2_CONV_TRKEX=0 # tracks-extra-converter
126126
DOO2_CONV_V0=0 # v0converter
127127

128128
# Selection cuts

codeJE/config_input.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NJOBSPARALLEL_O2=$(python3 -c "print(min(10, round($(nproc) / 2)))")
2525
# INPUT_IS_O2=0 # Input files are in O2 format.
2626
# INPUT_IS_MC=0 # Input files are MC data.
2727
# INPUT_PARENT_MASK="" # Path replacement mask for the input directory of parent files in case of linked derived O2 input. Set to ";" if no replacement needed.
28+
# INPUT_TASK_CONFIG="" # Input-specific task configuration (e.g. enabling converters), overriding the task configuration in CONFIG_TASKS. String of space-separated commands.
2829
# JSON="dpl-config.json" # O2 device configuration
2930

3031
INPUT_BASE="/data2/data" # alicecerno2
@@ -38,6 +39,7 @@ case $INPUT_CASE in
3839
INPUT_LABEL="Run 2, p-p 5.02 TeV LHC17p, MC LHC18a4a2_cent"
3940
INPUT_DIR="$INPUT_BASE/Run2/pp_5.02TeV/sim/LHC18a4a2_cent/282099"
4041
INPUT_IS_MC=1
42+
INPUT_TASK_CONFIG="DOO2_CONV_ZDC=1 DOO2_CONV_BC=1 DOO2_CONV_TRKEX=1"
4143
;;
4244
3)
4345
INPUT_LABEL="Run 2, p-p 5.02 TeV LHC17p, MC LHC18a4a2_cent"

codeJE/config_tasks.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ DOO2_JET_FINDER=0 # je-jet-finder-data-charged
4141
# QA
4242
DOO2_QA_EVTRK=0 # qa-event-track
4343
DOO2_JET_VALID=1 # je-jet-validation-qa
44-
# Converters
44+
# Converters (Consider setting these per input case via INPUT_TASK_CONFIG.)
4545
DOO2_CONV_MC=0 # mc-converter
4646
DOO2_CONV_FDD=0 # fdd-converter
4747
DOO2_CONV_COLL=0 # collision-converter
48-
DOO2_CONV_ZDC=1 # zdc-converter
49-
DOO2_CONV_BC=1 # bc-converter
50-
DOO2_CONV_TRKEX=1 # tracks-extra-converter
48+
DOO2_CONV_ZDC=0 # zdc-converter
49+
DOO2_CONV_BC=0 # bc-converter
50+
DOO2_CONV_TRKEX=0 # tracks-extra-converter
5151
DOO2_CONV_V0=0 # v0converter
5252

5353
SAVETREES=0 # Save O2 tables to trees.

config/config_input_dummy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NJOBSPARALLEL_O2=$(python3 -c "print(min(10, round($(nproc) / 2)))")
2525
# INPUT_IS_O2=0 # Input files are in O2 format.
2626
# INPUT_IS_MC=0 # Input files are MC data.
2727
# INPUT_PARENT_MASK="" # Path replacement mask for the input directory of parent files in case of linked derived O2 input. Set to ";" if no replacement needed.
28+
# INPUT_TASK_CONFIG="" # Input-specific task configuration (e.g. enabling converters), overriding the task configuration in CONFIG_TASKS. String of space-separated commands.
2829
# JSON="dpl-config.json" # O2 device configuration
2930

3031
# O2 device configuration

config/config_tasks_dummy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ MAKE_GRAPH=0 # Make topology graph.
3636
# Trigger selection
3737
DOO2_EVTSEL=1 # event-selection
3838
DOO2_TRACKSEL=1 # trackselection
39-
# Converters
39+
# Converters (Consider setting these per input case via INPUT_TASK_CONFIG.)
4040
DOO2_CONV_MC=0 # mc-converter
4141
DOO2_CONV_FDD=0 # fdd-converter
4242
DOO2_CONV_COLL=0 # collision-converter
43-
DOO2_CONV_ZDC=1 # zdc-converter
44-
DOO2_CONV_BC=1 # bc-converter
45-
DOO2_CONV_TRKEX=1 # tracks-extra-converter
43+
DOO2_CONV_ZDC=0 # zdc-converter
44+
DOO2_CONV_BC=0 # bc-converter
45+
DOO2_CONV_TRKEX=0 # tracks-extra-converter
4646
DOO2_CONV_V0=0 # v0converter
4747

4848
SAVETREES=0 # Save O2 tables to trees.

exec/runtest.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ INPUT_RUN=2 # LHC Run (2, 3, 5)
3131
INPUT_IS_O2=0 # Input files are in O2 format.
3232
INPUT_IS_MC=0 # Input files are MC data.
3333
INPUT_PARENT_MASK="" # Path replacement mask for the input directory of parent files in case of linked derived O2 input. Set to ";" if no replacement needed.
34+
INPUT_TASK_CONFIG="" # Input-specific task configuration (e.g. enabling converters), overriding the task configuration in CONFIG_TASKS. String of space-separated commands.
3435
JSON="dpl-config.json" # O2 device configuration
3536

3637
# Processing
@@ -99,7 +100,7 @@ done
99100
# Load input specification.
100101
source "$CONFIG_INPUT" || ErrExit "Failed to load input specification."
101102

102-
# Load tasks configuration.
103+
# Load task configuration.
103104
source "$CONFIG_TASKS" || ErrExit "Failed to load tasks configuration."
104105
DIR_TASKS="$(dirname "$(realpath "$CONFIG_TASKS")")"
105106

@@ -114,6 +115,14 @@ DIR_TASKS="$(dirname "$(realpath "$CONFIG_TASKS")")"
114115
# Print out input description.
115116
MsgStep "Processing case $INPUT_CASE: $INPUT_LABEL"
116117

118+
# Adjust task configuration with input-specific configuration.
119+
if [ "$INPUT_TASK_CONFIG" ]; then
120+
for cmd in $INPUT_TASK_CONFIG; do
121+
MsgWarn "Evaluating $cmd"
122+
eval "$cmd"
123+
done
124+
fi
125+
117126
# Clean before running.
118127
if [ $DOCLEAN -eq 1 ]; then
119128
MsgStep "Cleaning..."

0 commit comments

Comments
 (0)