Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to set the input specs for GLO QC dynamically, for K0s #1834

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DATA/common/gen_topo_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"(,|$) ]]
Expand Down
5 changes: 4 additions & 1 deletion DATA/production/configurations/asyncReco/setenv_extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 9 additions & 5 deletions DATA/production/qc-async/itstpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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."
}
}
Expand Down
41 changes: 26 additions & 15 deletions DATA/production/qc-sync/glo-itstpc-mtch-qcmn-epn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
77 changes: 75 additions & 2 deletions DATA/production/qc-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -266,7 +268,71 @@ 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"
TRACKSOURCESK0="ITS,TPC,ITS-TPC"
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_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
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
DET_JSON_FILE=TEMP_FILE
JSON_TEMP_FILES+=("$TEMP_FILE")
fi
fi
add_QC_JSON GLO_$i ${!DET_JSON_FILE}
fi
done
Expand Down Expand Up @@ -324,6 +390,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
Expand Down Expand Up @@ -362,7 +433,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
Expand Down
Loading