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, 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) {