Skip to content

Commit

Permalink
Protection in all_invariant_masses computation (#342)
Browse files Browse the repository at this point in the history
* Adding protection in all_invariant_masses computation

* Adding description of analyzer
atishelmanch authored Feb 15, 2024
1 parent 6c25a2f commit b408bdc
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h
Original file line number Diff line number Diff line change
@@ -252,7 +252,11 @@ namespace FCCAnalyses {
rv::RVec<TLorentzVector> compute_tlv_jets(const rv::RVec<fastjet::PseudoJet>& jets);
rv::RVec<TLorentzVector> sum_tlv_constituents(const rv::RVec<FCCAnalysesJetConstituents>& jets);
float InvariantMass(const TLorentzVector& tlv1, const TLorentzVector& tlv2);
rv::RVec<double> all_invariant_masses(rv::RVec<TLorentzVector> 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<double> all_invariant_masses(rv::RVec<TLorentzVector> AllJets);
rv::RVec<double> compute_residue_energy(const rv::RVec<TLorentzVector>& tlv_jet,
const rv::RVec<TLorentzVector>& sum_tlv_jcs);
rv::RVec<double> compute_residue_pt(const rv::RVec<TLorentzVector>& tlv_jet,
2 changes: 2 additions & 0 deletions analyzers/dataframe/src/JetConstituentsUtils.cc
Original file line number Diff line number Diff line change
@@ -1269,6 +1269,8 @@ namespace FCCAnalyses

rv::RVec<double> 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) {

0 comments on commit b408bdc

Please sign in to comment.