Skip to content

Commit

Permalink
Slava's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rappoccio committed Jan 24, 2018
1 parent 253d636 commit 0e39d13
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions DataFormats/PatCandidates/interface/Jet.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,19 @@ namespace pat {

/// Access to mass of subjets
double groomedMass(unsigned int index = 0) const{
return nSubjetCollections() > 0 && !subjets(index).empty() ?
std::accumulate( subjets(index).begin(), subjets(index).end(),
reco::Candidate::LorentzVector(), [] (reco::Candidate::LorentzVector a, reco::CandidatePtr const & b){return a + b->p4();}).mass() :
auto const& sub = subjets(index);
return nSubjetCollections() > index && !sub.empty() ?
std::accumulate( sub.begin(), sub.end(),
reco::Candidate::LorentzVector(),
[] (reco::Candidate::LorentzVector const & a, reco::CandidatePtr const & b){return a + b->p4();}).mass() :
-1.0;
}
double groomedMass(std::string const & label) const{
return hasSubjets(label) && !subjets(label).empty() ?
std::accumulate( subjets(label).begin(), subjets(label).end(),
reco::Candidate::LorentzVector(), [] (reco::Candidate::LorentzVector a, reco::CandidatePtr const & b){return a + b->p4();}).mass() :
auto const& sub = subjets(label);
return hasSubjets(label) && !sub.empty() ?
std::accumulate( sub.begin(), sub.end(),
reco::Candidate::LorentzVector(),
[] (reco::Candidate::LorentzVector const & a, reco::CandidatePtr const & b){return a + b->p4();}).mass() :
-1.0;
}

Expand Down

0 comments on commit 0e39d13

Please sign in to comment.