From 033d8386fc8451ef230d3dea7e4e382303f985e0 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Wed, 31 Jan 2024 02:41:35 -0500 Subject: [PATCH 1/2] Adding protection in all_invariant_masses computation --- analyzers/dataframe/src/JetConstituentsUtils.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/analyzers/dataframe/src/JetConstituentsUtils.cc b/analyzers/dataframe/src/JetConstituentsUtils.cc index 0fead9fa72..f339920219 100644 --- a/analyzers/dataframe/src/JetConstituentsUtils.cc +++ b/analyzers/dataframe/src/JetConstituentsUtils.cc @@ -1269,6 +1269,8 @@ namespace FCCAnalyses rv::RVec InvariantMasses; + if(AllJets.size() < 2) return InvariantMasses; + // For each jet, take its invariant mass with the remaining jets. Stop at last jet. for(int i = 0; i < AllJets.size()-1; ++i) { From bc5d4363e3fe0095c8b31e1b25c08f462bf97813 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Thu, 8 Feb 2024 17:19:13 -0500 Subject: [PATCH 2/2] Adding description of analyzer --- analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h b/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h index 8db72cb9f4..7d2f40a878 100644 --- a/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h +++ b/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h @@ -252,7 +252,11 @@ namespace FCCAnalyses { rv::RVec compute_tlv_jets(const rv::RVec& jets); rv::RVec sum_tlv_constituents(const rv::RVec& jets); float InvariantMass(const TLorentzVector& tlv1, const TLorentzVector& tlv2); - rv::RVec all_invariant_masses(rv::RVec AllJets); // invariant masses of all jet pairs given a vector of jets + + /** + * @brief all_invariant_masses takes an RVec of TLorentzVectors of jets and computes the invariant masses of all jet pairs, and returns an RVec with all invariant masses. + */ + rv::RVec all_invariant_masses(rv::RVec AllJets); rv::RVec compute_residue_energy(const rv::RVec& tlv_jet, const rv::RVec& sum_tlv_jcs); rv::RVec compute_residue_pt(const rv::RVec& tlv_jet,