@@ -12,11 +12,11 @@ elif [[ -z $QC_JSON_FROM_OUTSIDE ]]; then
1212 [[ -z " $QC_JSON_TPC " ]] && QC_JSON_TPC=consul://o2/components/qc/ANY/any/tpc-full-qcmn
1313 [[ -z " $QC_JSON_ITS " ]] && QC_JSON_ITS=consul://o2/components/qc/ANY/any/its-qcmn-epn-full
1414 [[ -z " $QC_JSON_MFT " ]] && QC_JSON_MFT=consul://o2/components/qc/ANY/any/mft-full-qcmn
15- if has_detector MFT && has_processing_step MFT_RECO; then
16- [[ -z " $QC_JSON_MFT " ]] && QC_JSON_MFT=consul://o2/components/qc/ANY/any/mft-track-full-qcmn
17- else
18- [[ -z " $QC_JSON_MFT " ]] && QC_JSON_MFT=consul://o2/components/qc/ANY/any/mft-full-qcmn
19- fi
15+ if has_detector MFT && has_processing_step MFT_RECO; then
16+ [[ -z " $QC_JSON_MFT " ]] && QC_JSON_MFT=consul://o2/components/qc/ANY/any/mft-track-full-qcmn
17+ else
18+ [[ -z " $QC_JSON_MFT " ]] && QC_JSON_MFT=consul://o2/components/qc/ANY/any/mft-full-qcmn
19+ fi
2020
2121 if [[ -z " $QC_JSON_TOF " ]]; then
2222 if has_detector_flp_processing TOF; then
3030 [[ -z " $QC_JSON_FV0 " ]] && QC_JSON_FV0=consul://o2/components/qc/ANY/any/fv0-digits-qc-epn
3131 [[ -z " $QC_JSON_EMC " ]] && QC_JSON_EMC=consul://o2/components/qc/ANY/any/emc-qcmn-epnall
3232 if [[ -z " $QC_JSON_MCH " ]]; then
33- if has_detector MCH && has_processing_step MCH_RECO; then
34- QC_JSON_MCH=consul://o2/components/qc/ANY/any/mch-qcmn-epn-full
35- else
36- QC_JSON_MCH=consul://o2/components/qc/ANY/any/mch-qcmn-epn-digits
37- fi
33+ if has_detector MCH && has_processing_step MCH_RECO; then
34+ QC_JSON_MCH=consul://o2/components/qc/ANY/any/mch-qcmn-epn-full
35+ else
36+ QC_JSON_MCH=consul://o2/components/qc/ANY/any/mch-qcmn-epn-digits
37+ fi
38+ fi
39+ if [[ -z " $QC_JSON_MID " ]]; then
40+ if has_detector MID && has_processing_step MID_RECO; then
41+ QC_JSON_MID=consul://o2/components/qc/ANY/any/mid-flp_raw-epn_full-qcmn
42+ else
43+ QC_JSON_MID=consul://o2/components/qc/ANY/any/mid-flp_raw-epn_digits-qcmn
44+ fi
3845 fi
39- [[ -z " $QC_JSON_MID " ]] && QC_JSON_MID=consul://o2/components/qc/ANY/any/mid-full-qcmn
4046 [[ -z " $QC_JSON_CPV " ]] && QC_JSON_CPV=consul://o2/components/qc/ANY/any/cpv-physics-qcmn-epn
4147 [[ -z " $QC_JSON_TRD " ]] && QC_JSON_TRD=consul://o2/components/qc/ANY/any/trd-full-qcmn-norawdatastats-epn
4248 [[ -z " $QC_JSON_PHS " ]] && QC_JSON_PHS=consul://o2/components/qc/ANY/any/phos-raw-clusters-epn
4349 [[ -z " $QC_JSON_PRIMVTX " ]] && QC_JSON_PRIMVTX=consul://o2/components/qc/ANY/any/vertexing-qc
4450 [[ -z " $QC_JSON_GLOBAL " ]] && QC_JSON_GLOBAL=$O2DPG_ROOT /DATA/production/qc-sync/qc-global.json
4551 if [[ -z " $QC_JSON_TOF_MATCH " ]]; then
46- if has_tof_matching_source ITS-TPC && has_tof_matching_source ITS-TPC-TRD ; then
47- QC_JSON_TOF_MATCH=consul://o2/components/qc/ANY/any/tof-qcmn-match-itstpctrdtof
48- elif has_tof_matching_source ITS-TPC ; then
49- QC_JSON_TOF_MATCH=consul://o2/components/qc/ANY/any/tof-qcmn-match-itstpctof
50- fi
52+ if has_tof_matching_source ITS-TPC && has_tof_matching_source ITS-TPC-TRD; then
53+ QC_JSON_TOF_MATCH=consul://o2/components/qc/ANY/any/tof-qcmn-match-itstpctrdtof
54+ elif has_tof_matching_source ITS-TPC; then
55+ QC_JSON_TOF_MATCH=consul://o2/components/qc/ANY/any/tof-qcmn-match-itstpctof
56+ fi
5157 fi
5258 elif [[ $SYNCMODE == 1 ]]; then
5359 [[ -z " $QC_JSON_TPC " ]] && QC_JSON_TPC=$O2DPG_ROOT /DATA/production/qc-sync/tpc.json
6672 [[ -z " $QC_JSON_PRIMVTX " ]] && QC_JSON_PRIMVTX=$O2DPG_ROOT /DATA/production/qc-sync/pvtx.json
6773 [[ -z " $QC_JSON_GLOBAL " ]] && QC_JSON_GLOBAL=$O2DPG_ROOT /DATA/production/qc-sync/qc-global.json
6874 if [[ -z " $QC_JSON_TOF_MATCH " ]]; then
69- if has_tof_matching_source ITS-TPC && has_tof_matching_source ITS-TPC-TRD ; then
70- QC_JSON_TOF_MATCH=$O2DPG_ROOT /DATA/production/qc-sync/itstpctrdtof.json
71- elif has_tof_matching_source ITS-TPC ; then
72- QC_JSON_TOF_MATCH=$O2DPG_ROOT /DATA/production/qc-sync/itstpctof.json
73- fi
75+ if has_tof_matching_source ITS-TPC && has_tof_matching_source ITS-TPC-TRD; then
76+ QC_JSON_TOF_MATCH=$O2DPG_ROOT /DATA/production/qc-sync/itstpctrdtof.json
77+ elif has_tof_matching_source ITS-TPC; then
78+ QC_JSON_TOF_MATCH=$O2DPG_ROOT /DATA/production/qc-sync/itstpctof.json
79+ fi
7480 fi
7581 else
7682 [[ -z " $QC_JSON_TPC " ]] && QC_JSON_TPC=$O2DPG_ROOT /DATA/production/qc-async/tpc.json
98104
99105 FETCHTMPDIR=$( mktemp -d -t GEN_TOPO_DOWNLOAD_JSON-XXXXXX)
100106
101- add_QC_JSON ()
102- {
107+ add_QC_JSON () {
103108 if [[ ${2} =~ ^consul://.* ]]; then
104109 TMP_FILENAME=$FETCHTMPDIR /$1 .$RANDOM .$RANDOM .json
105110 curl -s -o $TMP_FILENAME " http://alio2-cr1-hv-aliecs.cern.ch:8500/v1/kv/${2/ consul: \/\/ / } ?raw"
117122 JSON_FILES=
118123 OUTPUT_SUFFIX=
119124 QC_CONFIG=
120- for i in ` echo $LIST_OF_DETECTORS | sed " s/,/ /g" ` ; do
125+ for i in $( echo $LIST_OF_DETECTORS | sed " s/,/ /g" ) ; do
121126 DET_JSON_FILE=" QC_JSON_$i "
122127 if has_detector_qc $i && [ ! -z " ${! DET_JSON_FILE} " ]; then
123128 add_QC_JSON $i ${! DET_JSON_FILE}
129134 add_QC_JSON matchTOF ${QC_JSON_TOF_MATCH}
130135 fi
131136
132- for i in ` echo $LIST_OF_GLORECO | sed " s/,/ /g" ` ; do
137+ for i in $( echo $LIST_OF_GLORECO | sed " s/,/ /g" ) ; do
133138 GLO_JSON_FILE=" QC_JSON_$i "
134139 if has_detector_matching $i && has_matching_qc $i && [ ! -z " ${! GLO_JSON_FILE} " ]; then
135- add_QC_JSON $i ${! GLO_JSON_FILE}
140+ add_QC_JSON $i ${! GLO_JSON_FILE}
136141 fi
137142 done
138143
139144 # PID QC
140- for i in ` echo $LIST_OF_PID | sed " s/,/ /g" ` ; do
141- PIDDETFORFILE=` echo $i | sed " s/-//g" `
145+ for i in $( echo $LIST_OF_PID | sed " s/,/ /g" ) ; do
146+ PIDDETFORFILE=$( echo $i | sed " s/-//g" )
142147 PID_JSON_FILE=" QC_JSON_PID_$PIDDETFORFILE "
143148 if has_pid_qc $i && [ ! -z " ${! PID_JSON_FILE} " ]; then
144- add_QC_JSON pid$i ${! PID_JSON_FILE}
149+ add_QC_JSON pid$i ${! PID_JSON_FILE}
145150 fi
146151 done
147152
156161 if [[ " 0$GEN_TOPO_ONTHEFLY " == " 01" ]]; then
157162 find $GEN_TOPO_WORKDIR /json_cache/ -maxdepth 1 -type f -mtime +30 | xargs rm -f
158163 fi
159- MERGED_JSON_FILENAME=$GEN_TOPO_WORKDIR /json_cache/` date +%Y%m%d-%H%M%S` -$$ -$RANDOM -$OUTPUT_SUFFIX .json
164+ MERGED_JSON_FILENAME=$GEN_TOPO_WORKDIR /json_cache/$( date +%Y%m%d-%H%M%S) -$$ -$RANDOM -$OUTPUT_SUFFIX .json
160165 else
161166 MERGED_JSON_FILENAME=$GEN_TOPO_QC_JSON_FILE
162167 fi
163- jq -n ' reduce inputs as $s (input; .qc.tasks += ($s.qc.tasks) | .qc.checks += ($s.qc.checks) | .qc.externalTasks += ($s.qc.externalTasks) | .qc.postprocessing += ($s.qc.postprocessing)| .dataSamplingPolicies += ($s.dataSamplingPolicies))' $QC_JSON_GLOBAL $JSON_FILES > $MERGED_JSON_FILENAME
168+ jq -n ' reduce inputs as $s (input; .qc.tasks += ($s.qc.tasks) | .qc.checks += ($s.qc.checks) | .qc.externalTasks += ($s.qc.externalTasks) | .qc.postprocessing += ($s.qc.postprocessing)| .dataSamplingPolicies += ($s.dataSamplingPolicies))' $QC_JSON_GLOBAL $JSON_FILES > $MERGED_JSON_FILENAME
164169 if [[ $? != 0 ]]; then
165170 echo Merging QC workflow with JSON files $JSON_FILES failed 1>&2
166171 exit 1
167172 fi
168- MERGED_JSON_FILENAME=` realpath $MERGED_JSON_FILENAME `
173+ MERGED_JSON_FILENAME=$( realpath $MERGED_JSON_FILENAME )
169174
170175 if [[ " 0$QC_REDIRECT_MERGER_TO_LOCALHOST " == " 01" ]]; then
171176 sed -i.bak -E ' s/( *)"remoteMachine" *: *".*"(,?) *$/\1"remoteMachine": "127.0.0.1"\2/' $MERGED_JSON_FILENAME
0 commit comments