Skip to content

Commit

Permalink
fix bit, restrict to hadrons
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadalfonso authored and gpetruc committed Oct 27, 2015
1 parent 3fb84b3 commit fb8d1df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DataFormats/PatCandidates/interface/PackedCandidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ namespace pat {

// for teh neutral fraction
void setHcalFraction(float p); /// Set the fraction of Ecal and Hcal needed for HF and neutral hadrons
float hcalFraction() const { return hcalFraction_; } /// Fraction of Ecal and Hcal for HF and neutral hadrons
float hcalFraction() const { return (hcalFraction_/100.); } /// Fraction of Ecal and Hcal for HF and neutral hadrons


protected:
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/PatCandidates/src/PackedCandidate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,5 +315,5 @@ float pat::PackedCandidate::puppiWeight() const { return unpack8logClosed(packed
float pat::PackedCandidate::puppiWeightNoLep() const { return unpack8logClosed(packedPuppiweightNoLepDiff_+packedPuppiweight_,-2,0,64)/2. + 0.5;}

void pat::PackedCandidate::setHcalFraction(float p) {
hcalFraction_ = p;
hcalFraction_ = 100*p;
}
4 changes: 2 additions & 2 deletions PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ void pat::PATPackedCandidateProducer::produce(edm::StreamID, edm::Event& iEvent,

// neutrals

if(abs(cand.pdgId()) == 1 || abs(cand.pdgId()) == 2 || abs(cand.pdgId()) == 130) {
outPtrP->back().setHcalFraction(100*(cand.hcalEnergy()/(cand.ecalEnergy()+cand.hcalEnergy())));
if(abs(cand.pdgId()) == 1 || abs(cand.pdgId()) == 130) {
outPtrP->back().setHcalFraction(cand.hcalEnergy()/(cand.ecalEnergy()+cand.hcalEnergy()));
} else {
outPtrP->back().setHcalFraction(0);
}
Expand Down

0 comments on commit fb8d1df

Please sign in to comment.