Skip to content

Commit

Permalink
Merge pull request #56 from mverzett/right_masses
Browse files Browse the repository at this point in the history
force the right electron mass
  • Loading branch information
sarafiorendi authored Sep 12, 2019
2 parents 564ac11 + 795f20a commit 5ff85b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 20 additions & 1 deletion BParkingNano/plugins/ElectronMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ void ElectronMerger::produce(edm::StreamID, edm::Event &evt, edm::EventSetup con
// apply conversion veto unless we want conversions
if (!ele.passConversionVeto()) continue;

// Fix the mass to the proper one
reco::Candidate::PolarLorentzVector p4(
ele.pt(),
ele.eta(),
ele.phi(),
ELECTRON_MASS
);
ele.setP4(p4);

// skip electrons inside tag's jet or from different PV
bool skipEle=true;
for(const auto & trg : *trgMuon) {
Expand Down Expand Up @@ -156,8 +165,18 @@ void ElectronMerger::produce(edm::StreamID, edm::Event &evt, edm::EventSetup con
reco::Candidate::PolarLorentzVector p4( ele.gsfTrack()->ptMode(),
ele.gsfTrack()->etaMode(),
ele.gsfTrack()->phiMode(),
ele.mass() );
ELECTRON_MASS );
ele.setP4(p4);
}
else {
// Fix the mass to the proper one
reco::Candidate::PolarLorentzVector p4(
ele.pt(),
ele.eta(),
ele.phi(),
ELECTRON_MASS
);
ele.setP4(p4);
}

//same cuts as in PF
Expand Down
1 change: 1 addition & 0 deletions BParkingNano/plugins/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ constexpr float LEP_SIGMA = 0.0000001;
constexpr float K_SIGMA = 0.000016;
constexpr float PI_SIGMA = 0.000016;
constexpr float MUON_MASS = 0.10565837;
constexpr float ELECTRON_MASS = 0.000511;

inline std::pair<float, float> min_max_dr(const std::vector< edm::Ptr<reco::Candidate> > & cands) {
float min_dr = std::numeric_limits<float>::max();
Expand Down

0 comments on commit 5ff85b1

Please sign in to comment.