Skip to content

Commit 6b44b5d

Browse files
committed
anchorMC: Improve checking of essential variables
* we need to check for variable presence before any assignment * prevent publication of MCProd when LPM production tag was empty
1 parent fd274b3 commit 6b44b5d

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

MC/prodinfo/mcprodinfo_ccdb_upload.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def upload_mcprodinfo_meta(base_url, user, run_number, lpm_prod_tag, keys, cert_
148148
def publish_MCProdInfo(mc_prod_info, ccdb_url = "https://alice-ccdb.cern.ch", username = "aliprod", force_overwrite=False, include_meta_into_aod=False):
149149
print("Publishing MCProdInfo")
150150

151+
if mc_prod_info.LPMProductionTag == None or len(mc_prod_info.LPMProductionTag) == 0:
152+
print ("No LPM production tag found; Not publishing")
153+
return
154+
151155
# see if this already has meta-data uploaded, otherwise do nothing
152156
mc_prod_info_q = query_mcprodinfo(ccdb_url, username, mc_prod_info.RunNumber, mc_prod_info.LPMProductionTag)
153157
if mc_prod_info_q == None or force_overwrite == True:

MC/run/ANCHOR/anchorMC.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,7 @@ export ALIEN_JDL_LPMANCHORYEAR=${ALIEN_JDL_LPMANCHORYEAR:-${ANCHORYEAR}}
119119
# decide whether to run TPC time series; on by default, switched off by setting to 0
120120
export ALIEN_JDL_ADDTIMESERIESINMC=${ALIEN_JDL_ADDTIMESERIESINMC:-1}
121121

122-
# cache the production tag, will be set to a special anchor tag; reset later in fact
123-
ALIEN_JDL_LPMPRODUCTIONTAG_KEEP=$ALIEN_JDL_LPMPRODUCTIONTAG
124-
echo_info "Substituting ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG with ALIEN_JDL_LPMANCHORPRODUCTION=$ALIEN_JDL_LPMANCHORPRODUCTION for simulating reco pass..."
125-
ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMANCHORPRODUCTION
126-
127-
if [[ $ALIEN_JDL_ANCHOR_SIM_OPTIONS == *"--tpc-distortion-type 2"* ]]; then
128-
export O2DPG_ENABLE_TPC_DISTORTIONS=ON
129-
# set the SCALING SOURCE to CTP for MC unless explicitely given from outside
130-
export ALIEN_JDL_TPCSCALINGSOURCE=${ALIEN_JDL_TPCSCALINGSOURCE:-"CTP"}
131-
fi
132-
133-
# check variables that need to be set
122+
# check for presence of essential variables that need to be set
134123
[ -z "${ALIEN_JDL_LPMANCHORPASSNAME}" ] && { echo_error "Set ALIEN_JDL_LPMANCHORPASSNAME or ANCHORPASSNAME" ; exit 1 ; }
135124
[ -z "${ALIEN_JDL_LPMRUNNUMBER}" ] && { echo_error "Set ALIEN_JDL_LPMRUNNUMBER or RUNNUMBER" ; exit 1 ; }
136125
[ -z "${ALIEN_JDL_LPMPRODUCTIONTYPE}" ] && { echo_error "Set ALIEN_JDL_LPMPRODUCTIONTYPE or PRODUCTIONTYPE" ; exit 1 ; }
@@ -144,6 +133,19 @@ fi
144133
[ -z "${SPLITID}" ] && { echo_error "Set SPLITID" ; exit 1 ; }
145134
[ -z "${PRODSPLIT}" ] && { echo_error "Set PRODSPLIT" ; exit 1 ; }
146135

136+
137+
# cache the production tag, will be set to a special anchor tag; reset later in fact
138+
ALIEN_JDL_LPMPRODUCTIONTAG_KEEP=$ALIEN_JDL_LPMPRODUCTIONTAG
139+
echo_info "Substituting ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG with ALIEN_JDL_LPMANCHORPRODUCTION=$ALIEN_JDL_LPMANCHORPRODUCTION for simulating reco pass..."
140+
ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMANCHORPRODUCTION
141+
142+
if [[ $ALIEN_JDL_ANCHOR_SIM_OPTIONS == *"--tpc-distortion-type 2"* ]]; then
143+
export O2DPG_ENABLE_TPC_DISTORTIONS=ON
144+
# set the SCALING SOURCE to CTP for MC unless explicitely given from outside
145+
export ALIEN_JDL_TPCSCALINGSOURCE=${ALIEN_JDL_TPCSCALINGSOURCE:-"CTP"}
146+
fi
147+
148+
147149
# The number of signal events can be given, but should be useful only in
148150
# certain expert modes. In the default case, the final event number is determined by the timeframe length.
149151
if [ -z "${NSIGEVENTS}" ]; then

0 commit comments

Comments
 (0)