Skip to content

Commit 44b9b68

Browse files
adding calib-workflow
1 parent 87a5cb5 commit 44b9b68

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

DATA/common/setenv.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,22 @@ add_comma_separated()
225225
fi
226226
done
227227
}
228+
229+
add_semicolon_separated()
230+
{
231+
if (( $# < 2 )); then
232+
echo "$# parameters received"
233+
echo "Function name: ${FUNCNAME} expects at least 2 parameters:"
234+
echo "it concatenates the string in 1st parameter by the following"
235+
echo "ones, forming semi-colon-separated string. $# parameters received"
236+
exit 1
237+
fi
238+
239+
for ((i = 2; i <= $#; i++ )); do
240+
if [[ -z ${!1} ]]; then
241+
eval $1+="${!i}"
242+
else
243+
eval $1+="\;${!i}"
244+
fi
245+
done
246+
}

DATA/common/setenv_calib.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# ---------------------------------------------------------------------------------------------------------------------
4+
5+
# Check that the requirements to enable the calibrations are met, and
6+
# enabled them by default if they are not yet enabled or
7+
# if they are not explicitly disabled.
8+
# Then, configure data spec according to enabled calibrations
9+
10+
source $O2DPG_ROOT/DATA/common/setenv.sh
11+
12+
if [[ $BEAMTYPE != "cosmic" ]] && [[ $FORCECALIBRATIONS != 1 ]] ; then
13+
14+
# calibrations for primary vertex
15+
if has_detector_calib ITS && has_detectors_reco ITS && has_detector_matching PRIMVTX && [[ ! -z "$VERTEXING_SOURCES" ]]; then
16+
if [[ -z $CALIB_PRIMVTX_MEANVTX ]]; then CALIB_PRIMVTX_MEANVTX=1; fi
17+
else
18+
CALIB_PRIMVTX_MEANVTX=0
19+
fi
20+
21+
# calibrations for TOF
22+
if has_detector_calib TOF && has_detector_reco TOF; then
23+
if has_detector_matching ITSTPCTOF || has_detector_matching ITSTPCTRDTOF; then
24+
if [[ -z $CALIB_TOF_LHCPHASE ]]; then CALIB_TOF_LHCPHASE=1; fi
25+
if [[ -z $CALIB_TOF_CHANNELOFFSETS ]]; then CALIB_TOF_CHANNELOFFSETS=1; fi
26+
else
27+
CALIB_TOF_LHCPHASE=0
28+
CALIB_TOF_CHANNELOFFSETS=0
29+
fi
30+
if [[ -z $CALIB_TOF_DIAGNOSTICS ]]; then CALIB_TOF_DIAGNOSTICS=1; fi
31+
else
32+
CALIB_TOF_DIAGNOSTICS=0
33+
fi
34+
35+
# calibrations for TPC
36+
if has_detector_calib TPC && has_detectors ITS TPC TOF TRD; then
37+
if has_detectors TPC ITS TRD TOF && has_detector_matching ITSTPCTRDTOF; then
38+
if [[ -z $CALIB_TPC_SCDCALIB ]]; then CALIB_TPC_SCDCALIB=1; fi
39+
else
40+
CALIB_TPC_SCDCALIB=0
41+
fi
42+
fi
43+
fi
44+
45+
if [[ $CALIB_PRIMVTX_MEANVTX == 1 ]] ; then add_semicolon_separated CALIBDATASPEC "pvtx:GLO/PVTX/0"; fi
46+
if [[ $CALIB_TOF_LHCPHASE == 1 ]] || [[ $CALIB_TOF_CHANNELOFFSETS == 1 ]]; then add_semicolon_separated CALIBDATASPEC "calibTOF:TOF/CALIBDATA/0"; fi
47+
if [[ $CALIB_TOF_DIAGNOSTICS == 1 ]]; then add_semicolon_separated CALIBDATASPEC "diagWords:TOF/DIAFREQ/0"; fi
48+
49+
echo CALIBDATASPEC = $CALIBDATASPEC 1>&2
50+

0 commit comments

Comments
 (0)