From 90c24e4b5d8a6302591e124fdf9022cffbf1d077 Mon Sep 17 00:00:00 2001 From: Chiara Zampolli Date: Wed, 20 Nov 2024 16:28:14 +0100 Subject: [PATCH 1/2] Possibility to set the inputs from the qc-wf --- DATA/common/gen_topo_helper_functions.sh | 5 ++ .../configurations/asyncReco/setenv_extra.sh | 5 +- DATA/production/qc-async/itstpc.json | 14 ++-- .../qc-sync/glo-itstpc-mtch-qcmn-epn.json | 41 +++++++----- DATA/production/qc-workflow.sh | 67 ++++++++++++++++++- 5 files changed, 109 insertions(+), 23 deletions(-) diff --git a/DATA/common/gen_topo_helper_functions.sh b/DATA/common/gen_topo_helper_functions.sh index da4b087eb..0ce33047b 100755 --- a/DATA/common/gen_topo_helper_functions.sh +++ b/DATA/common/gen_topo_helper_functions.sh @@ -49,6 +49,11 @@ has_detector_matching() [[ $WORKFLOW_DETECTORS_MATCHING =~ (^|,)"ALL"(,|$) ]] || [[ $WORKFLOW_DETECTORS_MATCHING =~ (^|,)"$1"(,|$) ]] } +has_secvtx_source() +{ + [[ $SVERTEXING_SOURCES =~ (^|,)"ALL"(,|$) ]] || [[ $SVERTEXING_SOURCES =~ (^|,)"$1"(,|$) ]] +} + has_detector_qc() { has_detector $1 && [[ $WORKFLOW_DETECTORS_QC =~ (^|,)"$1"(,|$) ]] diff --git a/DATA/production/configurations/asyncReco/setenv_extra.sh b/DATA/production/configurations/asyncReco/setenv_extra.sh index 6a1ee1f63..025d16ca5 100644 --- a/DATA/production/configurations/asyncReco/setenv_extra.sh +++ b/DATA/production/configurations/asyncReco/setenv_extra.sh @@ -712,7 +712,10 @@ fi if [[ $ALIEN_JDL_QCOFF != "1" ]]; then export WORKFLOW_PARAMETERS="QC,${WORKFLOW_PARAMETERS}" fi -export QC_CONFIG_PARAM="--local-batch=QC.root --override-values \"qc.config.Activity.number=$RUNNUMBER;qc.config.Activity.passName=$PASS;qc.config.Activity.periodName=$PERIOD\"" + +export QC_CONFIG_OVERRIDE+=";qc.config.Activity.number=$RUNNUMBER;qc.config.Activity.passName=$PASS;qc.config.Activity.periodName=$PERIOD;" + +export QC_CONFIG_PARAM+=" --local-batch=QC.root " export GEN_TOPO_WORKDIR="./" #export QC_JSON_FROM_OUTSIDE="QC-20211214.json" diff --git a/DATA/production/qc-async/itstpc.json b/DATA/production/qc-async/itstpc.json index 59607bc4d..a4b02689a 100644 --- a/DATA/production/qc-async/itstpc.json +++ b/DATA/production/qc-async/itstpc.json @@ -39,7 +39,7 @@ "dataSource" : { "type" : "direct", "query_comment" : "checking every matched track", - "query" : "trackITSTPC:GLO/TPCITS/0;trackITSTPCABREFS:GLO/TPCITSAB_REFS/0;trackITSTPCABCLID:GLO/TPCITSAB_CLID/0;trackTPC:TPC/TRACKS;trackTPCClRefs:TPC/CLUSREFS;trackITS:ITS/TRACKS/0;trackITSROF:ITS/ITSTrackROF/0;trackITSClIdx:ITS/TRACKCLSID/0;alpparITS:ITS/ALPIDEPARAM/0?lifetime=condition&ccdb-path=ITS/Config/AlpideParam" + "query" : "trackITSTPC:GLO/TPCITS/0;trackITSTPCABREFS:GLO/TPCITSAB_REFS/0;trackITSTPCABCLID:GLO/TPCITSAB_CLID/0;trackTPC:TPC/TRACKS;trackTPCClRefs:TPC/CLUSREFS;trackITS:ITS/TRACKS/0;trackITSROF:ITS/ITSTrackROF/0;trackITSClIdx:ITS/TRACKCLSID/0;alpparITS:ITS/ALPIDEPARAM/0?lifetime=condition&ccdb-path=ITS/Config/AlpideParam;SVParam:GLO/SVPARAM/0?lifetime=condition&ccdb-path=GLO/Config/SVertexerParam;p2decay3body:GLO/PVTX_3BODYREFS/0;decay3body:GLO/DECAYS3BODY/0;decay3bodyIdx:GLO/DECAYS3BODY_IDX/0;p2cascs:GLO/PVTX_CASCREFS/0;cascs:GLO/CASCS/0;cascsIdx:GLO/CASCS_IDX/0;p2v0s:GLO/PVTX_V0REFS/0;v0s:GLO/V0S/0;v0sIdx:GLO/V0S_IDX/0;pvtx_tref:GLO/PVTX_TRMTCREFS/0;pvtx_trmtc:GLO/PVTX_TRMTC/0;pvtx:GLO/PVTX/0;SVParam:GLO/SVPARAM/0?lifetime=condition&ccdb-path=GLO/Config/SVertexerParam;clusTPCoccmap:TPC/TPCOCCUPANCYMAP/0;clusTPC:TPC/CLUSTERNATIVE;clusTPCshmap:TPC/CLSHAREDMAP/0;trigTPC:TPC/TRIGGERWORDS/0;trigITSTPCTRD:TRD/TRGREC_ITSTPC/0;trackITSTPCTRD:TRD/MATCH_ITSTPC/0;matchITSTPCTOF:TOF/MTC_ITSTPC/0;matchITSTPCTRDTOF:TOF/MTC_ITSTPCTRD/0;trigTPCTRD:TRD/TRGREC_TPC/0;trackTPCTRD:TRD/MATCH_TPC/0;matchTPCTOF:TOF/MTC_TPC/0;trackTPCTOF:TOF/TOFTRACKS_TPC/0;matchTPCTRDTOF/TOF/MTC_TPCTRD/0;tofcluster:TOF/CLUSTERS/0" }, "taskParameters" : { "GID" : "ITS-TPC,ITS", @@ -55,19 +55,23 @@ "minDCACutY": "10.f", "minPtCut": "0.f", "maxPtCut": "1e10f", - "etaCut": "1e10f" + "etaCut": "1e10f", + "cutK0Mass": "0.05f", + "maxEtaK0": "0.8f", + "doK0QC": "true", + "trackSourcesK0": "ITS,TPC,ITS-TPC,ITS-TPC-TOF,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF" }, "grpGeomRequest" : { "geomRequest": "None", - "askGRPECS": "false", - "askGRPLHCIF": "false", + "askGRPECS": "true", + "askGRPLHCIF": "true", "askGRPMagField": "true", "askMatLUT": "false", "askTime": "false", "askOnceAllButField": "true", "needPropagatorD": "false" }, - "saveObjectsToFile" : "ITSTPCmatched.root", + "saveObjectsToFile" : "ITSTPCmatched_allTracks_enabledK0.root", "" : "For debugging, path to the file where to save. If empty or missing it won't save." } } diff --git a/DATA/production/qc-sync/glo-itstpc-mtch-qcmn-epn.json b/DATA/production/qc-sync/glo-itstpc-mtch-qcmn-epn.json index 53a1dca39..a28ae70f3 100644 --- a/DATA/production/qc-sync/glo-itstpc-mtch-qcmn-epn.json +++ b/DATA/production/qc-sync/glo-itstpc-mtch-qcmn-epn.json @@ -32,18 +32,29 @@ "maxNumberCycles" : "-1", "dataSource" : { "type" : "dataSamplingPolicy", - "name" : "ITSTPCmSamp" + "name" : "ITSTPCmSampK0" }, "taskParameters" : { - "GID" : "ITS-TPC,ITS", - "verbose" : "false", - "minPtCut" : "0.1f", - "etaCut" : "1.4f", - "minNTPCClustersCut" : "60", - "minDCACut" : "100.f", - "minDCACutY" : "10.f" + "GID": "ITS-TPC,ITS", + "verbose": "false", + "minPtITSCut": "0.f", + "etaITSCut": "1e10f", + "minNITSClustersCut": "0", + "maxChi2PerClusterITS": "100000", + "minPtTPCCut": "0.1f", + "etaTPCCut": "0.9f", + "minNTPCClustersCut": "60", + "minDCACut": "100.f", + "minDCACutY": "10.f", + "minPtCut": "0.f", + "maxPtCut": "1e10f", + "etaCut": "1e10f", + "cutK0Mass": "0.05f", + "maxEtaK0": "0.8f", + "doK0QC": "true", + "trackSourcesK0": "" }, - "grpGeomRequest" : { + "grpGeomRequest" : { "geomRequest": "None", "askGRPECS": "false", "askGRPLHCIF": "false", @@ -54,23 +65,23 @@ "needPropagatorD": "false" }, "location" : "local", - "localMachines": [ + "localMachines": [ "epn", - "localhost" + "localhost" ], "remoteMachine": "alio2-cr1-qc07.cern.ch", - "remotePort": "47761", - "localControl": "odc" + "remotePort": "47761", + "localControl": "odc" } } }, "dataSamplingPolicies" : [ { - "id" : "ITSTPCmSamp", + "id" : "ITSTPCmSampK0", "active" : "true", "machines" : [], "query_comment" : "checking every 10% matched track", - "query" : "trackITSTPC:GLO/TPCITS/0;trackITSTPCABREFS:GLO/TPCITSAB_REFS/0;trackITSTPCABCLID:GLO/TPCITSAB_CLID/0;trackTPC:TPC/TRACKS;trackTPCClRefs:TPC/CLUSREFS;trackITS:ITS/TRACKS/0;trackITSROF:ITS/ITSTrackROF/0;trackITSClIdx:ITS/TRACKCLSID/0;alpparITS:ITS/ALPIDEPARAM/0?lifetime=condition&ccdb-path=ITS/Config/AlpideParam", + "query" : "", "samplingConditions" : [ { "condition" : "random", diff --git a/DATA/production/qc-workflow.sh b/DATA/production/qc-workflow.sh index aa893f612..66dec6a4b 100755 --- a/DATA/production/qc-workflow.sh +++ b/DATA/production/qc-workflow.sh @@ -50,8 +50,10 @@ add_QC_JSON() { OUTPUT_SUFFIX+="-$1" } +JSON_TEMP_FILES="()" + QC_CONFIG= -QC_CONFIG_OVERRIDE= +: ${QC_CONFIG_OVERRIDE:=} # set to empty string only if not already set externally : ${QC_DETECTOR_CONFIG_OVERRIDE:=} # set to empty string only if not already set externally if [[ -z ${QC_JSON_FROM_OUTSIDE:-} && ! -z ${GEN_TOPO_QC_JSON_FILE:-} && -f $GEN_TOPO_QC_JSON_FILE ]]; then QC_JSON_FROM_OUTSIDE=$GEN_TOPO_QC_JSON_FILE @@ -266,7 +268,61 @@ elif [[ -z ${QC_JSON_FROM_OUTSIDE:-} ]]; then DET_JSON_FILE="QC_JSON_GLO_$i" if has_matching_qc $i && [ ! -z "${!DET_JSON_FILE:-}" ]; then if [[ $i == "PRIMVTX" ]] && ! has_detector_reco ITS; then continue; fi - if [[ $i == "ITSTPC" ]] && ! has_detectors_reco ITS TPC; then continue; fi + if [[ $i == "ITSTPC" ]] ; then + if ! has_detectors_reco ITS TPC; then continue + else + # replace the input sources depending on the detector compostition and matching detectors + ITSTPCMatchQuery="trackITSTPC:GLO/TPCITS/0;trackITSTPCABREFS:GLO/TPCITSAB_REFS/0;trackITSTPCABCLID:GLO/TPCITSAB_CLID/0;trackTPC:TPC/TRACKS;trackTPCClRefs:TPC/CLUSREFS/0;trackITS:ITS/TRACKS/0;trackITSROF:ITS/ITSTrackROF/0;trackITSClIdx:ITS/TRACKCLSID/0;alpparITS:ITS/ALPIDEPARAM/0?lifetime=condition&ccdb-path=ITS/Config/AlpideParam;SVParam:GLO/SVPARAM/0?lifetime=condition&ccdb-path=GLO/Config/SVertexerParam" + if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then + HAS_K0_ENABLED=$(jq -r .qc.tasks.MTCITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") + else + HAS_K0_ENABLED=$(jq -r .qc.tasks.GLOMatchTrITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") + fi + TRACKSOURCESK0="ITS,TPC,ITS-TPC" + if [[ $HAS_K0_ENABLED == "true" ]]; then + ITSTPCMatchQuery+=";p2decay3body:GLO/PVTX_3BODYREFS/0;decay3body:GLO/DECAYS3BODY/0;decay3bodyIdx:GLO/DECAYS3BODY_IDX/0;p2cascs:GLO/PVTX_CASCREFS/0;cascs:GLO/CASCS/0;cascsIdx:GLO/CASCS_IDX/0;p2v0s:GLO/PVTX_V0REFS/0;v0s:GLO/V0S/0;v0sIdx:GLO/V0S_IDX/0;pvtx_tref:GLO/PVTX_TRMTCREFS/0;pvtx_trmtc:GLO/PVTX_TRMTC/0;pvtx:GLO/PVTX/0;clusTPCoccmap:TPC/TPCOCCUPANCYMAP/0;clusTPC:TPC/CLUSTERNATIVE;clusTPCshmap:TPC/CLSHAREDMAP/0;trigTPC:TPC/TRIGGERWORDS/0" + if has_secvtx_source ITS-TPC-TRD ; then + ITSTPCMatchQuery+=";trigITSTPCTRD:TRD/TRGREC_ITSTPC/0;trackITSTPCTRD:TRD/MATCH_ITSTPC/0" + TRACKSOURCESK0+=",ITS-TPC-TRD" + fi + if has_secvtx_source ITS-TPC-TOF ; then + ITSTPCMatchQuery+=";matchITSTPCTOF:TOF/MTC_ITSTPC/0" + TRACKSOURCESK0+=",ITS-TPC-TOF" + fi + if has_secvtx_source ITS-TPC-TRD-TOF ; then + ITSTPCMatchQuery+=";matchITSTPCTRDTOF:TOF/MTC_ITSTPCTRD/0" + TRACKSOURCESK0+=",ITS-TPC-TRD-TOF" + fi + if has_secvtx_source TPC-TRD ; then + ITSTPCMatchQuery+=";trigTPCTRD:TRD/TRGREC_TPC/0;trackTPCTRD:TRD/MATCH_TPC/0" + TRACKSOURCESK0+=",TPC-TRD" + fi + if has_secvtx_source TPC-TOF ; then + ITSTPCMatchQuery+=";matchTPCTOF:TOF/MTC_TPC/0;trackTPCTOF:TOF/TOFTRACKS_TPC/0" + TRACKSOURCESK0+=",TPC-TOF" + fi + if has_secvtx_source TPC-TRD-TOF ; then + ITSTPCMatchQuery+=";matchTPCTRDTOF/TOF/MTC_TPCTRD/0" + TRACKSOURCESK0+=",TPC-TRD-TOF" + fi + if has_secvtx_source TOF ; then + ITSTPCMatchQuery+=";tofcluster:TOF/CLUSTERS/0" + TRACKSOURCESK0+=",TOF" + fi + if has_secvtx_source TRD ; then + TRACKSOURCESK0+=",TRD" + fi + fi + TEMP_FILE=$(mktemp "${i}"_XXXXXXX) + if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then + cat "${!DET_JSON_FILE}" | jq "(.dataSamplingPolicies[] | select(.id == \"ITSTPCmSampK0\") | .query) = \"$ITSTPCMatchQuery\" | .qc.tasks.MTCITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" + else + cat "${!DET_JSON_FILE}" | jq ".qc.tasks.GLOMatchTrITSTPC.dataSource.query = \"$ITSTPCMatchQuery\" | .qc.tasks.GLOMatchTrITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" + fi + DET_JSON_FILE=TEMP_FILE + JSON_TEMP_FILES+=("$TEMP_FILE") + fi + fi add_QC_JSON GLO_$i ${!DET_JSON_FILE} fi done @@ -324,6 +380,11 @@ elif [[ -z ${QC_JSON_FROM_OUTSIDE:-} ]]; then fi MERGED_JSON_FILENAME=$(realpath $MERGED_JSON_FILENAME) + # Clean up: delete the temporary files after use + for tf in "${JSON_TEMP_FILES[@]}"; do + rm -f "$tf" + done + if [[ "${QC_REDIRECT_MERGER_TO_LOCALHOST:-}" == "1" ]]; then sed -i.bak -E 's/( *)"remoteMachine" *: *".*"(,?) *$/\1"remoteMachine": "127.0.0.1"\2/' $MERGED_JSON_FILENAME unlink $MERGED_JSON_FILENAME.bak @@ -362,7 +423,9 @@ if [[ ! -z "${QC_JSON_FROM_OUTSIDE:-}" ]]; then QC_CONFIG_PARAM="--local-batch=QC.root" fi fi + add_W o2-qc "--config json://$QC_JSON_FROM_OUTSIDE ${QC_CONFIG_PARAM} ${QC_CONFIG}" + fi if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:-} ]]; then From 072f901a6f1ab7a9a92c9c41c38ea41a8d954fe3 Mon Sep 17 00:00:00 2001 From: Chiara Zampolli Date: Thu, 5 Dec 2024 12:44:39 +0100 Subject: [PATCH 2/2] Forcing K0QC to be off if there is no SECVTX --- DATA/production/qc-workflow.sh | 92 +++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 41 deletions(-) diff --git a/DATA/production/qc-workflow.sh b/DATA/production/qc-workflow.sh index 66dec6a4b..19bbfee72 100755 --- a/DATA/production/qc-workflow.sh +++ b/DATA/production/qc-workflow.sh @@ -273,52 +273,62 @@ elif [[ -z ${QC_JSON_FROM_OUTSIDE:-} ]]; then else # replace the input sources depending on the detector compostition and matching detectors ITSTPCMatchQuery="trackITSTPC:GLO/TPCITS/0;trackITSTPCABREFS:GLO/TPCITSAB_REFS/0;trackITSTPCABCLID:GLO/TPCITSAB_CLID/0;trackTPC:TPC/TRACKS;trackTPCClRefs:TPC/CLUSREFS/0;trackITS:ITS/TRACKS/0;trackITSROF:ITS/ITSTrackROF/0;trackITSClIdx:ITS/TRACKCLSID/0;alpparITS:ITS/ALPIDEPARAM/0?lifetime=condition&ccdb-path=ITS/Config/AlpideParam;SVParam:GLO/SVPARAM/0?lifetime=condition&ccdb-path=GLO/Config/SVertexerParam" - if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then - HAS_K0_ENABLED=$(jq -r .qc.tasks.MTCITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") - else - HAS_K0_ENABLED=$(jq -r .qc.tasks.GLOMatchTrITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") - fi TRACKSOURCESK0="ITS,TPC,ITS-TPC" - if [[ $HAS_K0_ENABLED == "true" ]]; then - ITSTPCMatchQuery+=";p2decay3body:GLO/PVTX_3BODYREFS/0;decay3body:GLO/DECAYS3BODY/0;decay3bodyIdx:GLO/DECAYS3BODY_IDX/0;p2cascs:GLO/PVTX_CASCREFS/0;cascs:GLO/CASCS/0;cascsIdx:GLO/CASCS_IDX/0;p2v0s:GLO/PVTX_V0REFS/0;v0s:GLO/V0S/0;v0sIdx:GLO/V0S_IDX/0;pvtx_tref:GLO/PVTX_TRMTCREFS/0;pvtx_trmtc:GLO/PVTX_TRMTC/0;pvtx:GLO/PVTX/0;clusTPCoccmap:TPC/TPCOCCUPANCYMAP/0;clusTPC:TPC/CLUSTERNATIVE;clusTPCshmap:TPC/CLSHAREDMAP/0;trigTPC:TPC/TRIGGERWORDS/0" - if has_secvtx_source ITS-TPC-TRD ; then - ITSTPCMatchQuery+=";trigITSTPCTRD:TRD/TRGREC_ITSTPC/0;trackITSTPCTRD:TRD/MATCH_ITSTPC/0" - TRACKSOURCESK0+=",ITS-TPC-TRD" - fi - if has_secvtx_source ITS-TPC-TOF ; then - ITSTPCMatchQuery+=";matchITSTPCTOF:TOF/MTC_ITSTPC/0" - TRACKSOURCESK0+=",ITS-TPC-TOF" - fi - if has_secvtx_source ITS-TPC-TRD-TOF ; then - ITSTPCMatchQuery+=";matchITSTPCTRDTOF:TOF/MTC_ITSTPCTRD/0" - TRACKSOURCESK0+=",ITS-TPC-TRD-TOF" + if has_processing_step MATCH_SECVTX || has_detector_matching SECVTX ; then + if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then + HAS_K0_ENABLED=$(jq -r .qc.tasks.MTCITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") + else + HAS_K0_ENABLED=$(jq -r .qc.tasks.GLOMatchTrITSTPC.taskParameters.doK0QC "${!DET_JSON_FILE}") fi - if has_secvtx_source TPC-TRD ; then - ITSTPCMatchQuery+=";trigTPCTRD:TRD/TRGREC_TPC/0;trackTPCTRD:TRD/MATCH_TPC/0" - TRACKSOURCESK0+=",TPC-TRD" + if [[ $HAS_K0_ENABLED == "true" ]]; then + ITSTPCMatchQuery+=";p2decay3body:GLO/PVTX_3BODYREFS/0;decay3body:GLO/DECAYS3BODY/0;decay3bodyIdx:GLO/DECAYS3BODY_IDX/0;p2cascs:GLO/PVTX_CASCREFS/0;cascs:GLO/CASCS/0;cascsIdx:GLO/CASCS_IDX/0;p2v0s:GLO/PVTX_V0REFS/0;v0s:GLO/V0S/0;v0sIdx:GLO/V0S_IDX/0;pvtx_tref:GLO/PVTX_TRMTCREFS/0;pvtx_trmtc:GLO/PVTX_TRMTC/0;pvtx:GLO/PVTX/0;clusTPCoccmap:TPC/TPCOCCUPANCYMAP/0;clusTPC:TPC/CLUSTERNATIVE;clusTPCshmap:TPC/CLSHAREDMAP/0;trigTPC:TPC/TRIGGERWORDS/0" + if has_secvtx_source ITS-TPC-TRD ; then + ITSTPCMatchQuery+=";trigITSTPCTRD:TRD/TRGREC_ITSTPC/0;trackITSTPCTRD:TRD/MATCH_ITSTPC/0" + TRACKSOURCESK0+=",ITS-TPC-TRD" + fi + if has_secvtx_source ITS-TPC-TOF ; then + ITSTPCMatchQuery+=";matchITSTPCTOF:TOF/MTC_ITSTPC/0" + TRACKSOURCESK0+=",ITS-TPC-TOF" + fi + if has_secvtx_source ITS-TPC-TRD-TOF ; then + ITSTPCMatchQuery+=";matchITSTPCTRDTOF:TOF/MTC_ITSTPCTRD/0" + TRACKSOURCESK0+=",ITS-TPC-TRD-TOF" + fi + if has_secvtx_source TPC-TRD ; then + ITSTPCMatchQuery+=";trigTPCTRD:TRD/TRGREC_TPC/0;trackTPCTRD:TRD/MATCH_TPC/0" + TRACKSOURCESK0+=",TPC-TRD" + fi + if has_secvtx_source TPC-TOF ; then + ITSTPCMatchQuery+=";matchTPCTOF:TOF/MTC_TPC/0;trackTPCTOF:TOF/TOFTRACKS_TPC/0" + TRACKSOURCESK0+=",TPC-TOF" + fi + if has_secvtx_source TPC-TRD-TOF ; then + ITSTPCMatchQuery+=";matchTPCTRDTOF/TOF/MTC_TPCTRD/0" + TRACKSOURCESK0+=",TPC-TRD-TOF" + fi + if has_secvtx_source TOF ; then + ITSTPCMatchQuery+=";tofcluster:TOF/CLUSTERS/0" + TRACKSOURCESK0+=",TOF" + fi + if has_secvtx_source TRD ; then + TRACKSOURCESK0+=",TRD" + fi fi - if has_secvtx_source TPC-TOF ; then - ITSTPCMatchQuery+=";matchTPCTOF:TOF/MTC_TPC/0;trackTPCTOF:TOF/TOFTRACKS_TPC/0" - TRACKSOURCESK0+=",TPC-TOF" + TEMP_FILE=$(mktemp "${i}"_XXXXXXX) + if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then + cat "${!DET_JSON_FILE}" | jq "(.dataSamplingPolicies[] | select(.id == \"ITSTPCmSampK0\") | .query) = \"$ITSTPCMatchQuery\" | .qc.tasks.MTCITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" + else + cat "${!DET_JSON_FILE}" | jq ".qc.tasks.GLOMatchTrITSTPC.dataSource.query = \"$ITSTPCMatchQuery\" | .qc.tasks.GLOMatchTrITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" fi - if has_secvtx_source TPC-TRD-TOF ; then - ITSTPCMatchQuery+=";matchTPCTRDTOF/TOF/MTC_TPCTRD/0" - TRACKSOURCESK0+=",TPC-TRD-TOF" - fi - if has_secvtx_source TOF ; then - ITSTPCMatchQuery+=";tofcluster:TOF/CLUSTERS/0" - TRACKSOURCESK0+=",TOF" - fi - if has_secvtx_source TRD ; then - TRACKSOURCESK0+=",TRD" + else + # we need to force that the K0s part is disabled + TEMP_FILE=$(mktemp "${i}"_XXXXXXX) + if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then + cat "${!DET_JSON_FILE}" | jq "(.dataSamplingPolicies[] | select(.id == \"ITSTPCmSampK0\") | .query) = \"$ITSTPCMatchQuery\" | .qc.tasks.MTCITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\" | .qc.tasks.MTCITSTPC.taskParameters.doK0QC = \"false\"" > "$TEMP_FILE" + else + cat "${!DET_JSON_FILE}" | jq ".qc.tasks.GLOMatchTrITSTPC.dataSource.query = \"$ITSTPCMatchQuery\" | .qc.tasks.GLOMatchTrITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\" | .qc.tasks.GLOMatchTrITSTPC.taskParameters.doK0QC = \"false\"" > "$TEMP_FILE" fi - fi - TEMP_FILE=$(mktemp "${i}"_XXXXXXX) - if [[ $SYNCMODE == 1 ]] || [[ $EPNSYNCMODE == 1 ]] ; then - cat "${!DET_JSON_FILE}" | jq "(.dataSamplingPolicies[] | select(.id == \"ITSTPCmSampK0\") | .query) = \"$ITSTPCMatchQuery\" | .qc.tasks.MTCITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" - else - cat "${!DET_JSON_FILE}" | jq ".qc.tasks.GLOMatchTrITSTPC.dataSource.query = \"$ITSTPCMatchQuery\" | .qc.tasks.GLOMatchTrITSTPC.taskParameters.trackSourcesK0 = \"$TRACKSOURCESK0\"" > "$TEMP_FILE" - fi + fi DET_JSON_FILE=TEMP_FILE JSON_TEMP_FILES+=("$TEMP_FILE") fi