From f9064ea42bddc13d47fe4b8cdb0232ce38433329 Mon Sep 17 00:00:00 2001 From: Benedikt Volkel Date: Tue, 13 Feb 2024 11:07:26 +0100 Subject: [PATCH] [RelVal] Add specific QC objects to compare * put files with include patterns at RelVal/config/QC/async/_include_patterns_default.txt * add pattern files for ITS, TPC, TOF * allow comments starting with "#" --- .../QC/async/ITS_include_patterns_default.txt | 15 +++++++++++++++ .../QC/async/TOF_include_patterns_defautl.txt | 11 +++++++++++ .../QC/async/TPC_include_patterns_default.txt | 13 +++++++++++++ RelVal/utils/o2dpg_release_validation_utils.py | 8 +++++++- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 RelVal/config/QC/async/ITS_include_patterns_default.txt create mode 100644 RelVal/config/QC/async/TOF_include_patterns_defautl.txt create mode 100644 RelVal/config/QC/async/TPC_include_patterns_default.txt diff --git a/RelVal/config/QC/async/ITS_include_patterns_default.txt b/RelVal/config/QC/async/ITS_include_patterns_default.txt new file mode 100644 index 000000000..e63098e87 --- /dev/null +++ b/RelVal/config/QC/async/ITS_include_patterns_default.txt @@ -0,0 +1,15 @@ +# for data and MC +ITS_Tracks_PhiDistribution$ +ITS_Tracks_NClusters$ +ITS_Tracks_VertexZ$ +ITS_Tracks_VertexRvsZ$ +ITS_Tracks_VertexCoordinates$ +ITS_Clusters_Layer0_AverageClusterSizeSummary$ +ITS_Clusters_Layer3_AverageClusterSizeSummary$ +# only MC +ITS_TracksMc_efficiency_eta_ratioFromTEfficiency$ +ITS_TracksMc_efficiency_phi_ratioFromTEfficiency$ +ITS_TracksMc_efficiency_pt_ratioFromTEfficiency$ +ITS_TracksMc_faketrack_eta_ratioFromTEfficiency$ +ITS_TracksMc_faketrack_phi_ratioFromTEfficiency$ +ITS_TracksMc_faketrack_pt_ratioFromTEfficiency$ diff --git a/RelVal/config/QC/async/TOF_include_patterns_defautl.txt b/RelVal/config/QC/async/TOF_include_patterns_defautl.txt new file mode 100644 index 000000000..2a9204335 --- /dev/null +++ b/RelVal/config/QC/async/TOF_include_patterns_defautl.txt @@ -0,0 +1,11 @@ +# note that all "/" have to be replaced by "_" +TOF_Digits_DecodingErrors$ +TOF_Digits_Multiplicity_Integrated$ +TOF_MatchTrAll_mTOFChi2ITSTPC-ITSTPCTRD$ +TOF_MatchTrAll_mTOFChi2TPC$ +TOF_MatchTrAll_mTOFChi2TPCTRD$ +TOF_MatchTrAll_mEffPt_ITSTPC-ITSTPCTRD_ratioFromTEfficiency$ +TOF_PID_EvTimeTOF$ +TOF_PID_DeltaBCTOFFT0$ +TOF_PID_DeltatPi_Pt_ITSTPC_t0TOF$ +TOF_PID_DeltatPi_Pt_ITSTPCTRD_t0TOF$ diff --git a/RelVal/config/QC/async/TPC_include_patterns_default.txt b/RelVal/config/QC/async/TPC_include_patterns_default.txt new file mode 100644 index 000000000..4472729e5 --- /dev/null +++ b/RelVal/config/QC/async/TPC_include_patterns_default.txt @@ -0,0 +1,13 @@ +# note that all "/" have to be replaced by "_" +TPC_Tracks_hPhiAside$ +TPC_Tracks_hPhiCside$ +TPC_Tracks_hEta$ +TPC_Tracks_hNClustersAfterCuts$ +TPC_Tracks_hQOverPt$ +TPC_Tracks_hDCAr_A_Pos$ +TPC_Tracks_hDCAr_C_Pos$ +TPC_Tracks_hDCArVsEtaPos$ +TPC_Tracks_h2DNClustersPhiAside$ +TPC_Tracks_h2DNClustersPhiCside$ +TPC_PID_hdEdxTotMIP_TPC$ +TPC_PID_hdEdxTotVsP_TPC$ diff --git a/RelVal/utils/o2dpg_release_validation_utils.py b/RelVal/utils/o2dpg_release_validation_utils.py index 0482569aa..2607ab69e 100755 --- a/RelVal/utils/o2dpg_release_validation_utils.py +++ b/RelVal/utils/o2dpg_release_validation_utils.py @@ -282,9 +282,15 @@ def load_this_patterns(patterns): return patterns patterns_from_file = [] - with open(patterns[0][1:], "r") as f: + filename = patterns[0][1:] + if not exists(filename): + print(f"WARNING: Pattern file {filename} does not exist, not extracting any patterns!") + return + with open(filename, "r") as f: for line in f: line = line.strip() + # remove all comments; allows for inline comments or entire comment lines), then take the first token + line = line.split("#")[0].strip() if not line: continue patterns_from_file.append(line)