7 #include "TLorentzVector.h"
16 : verbose_(ps.getUntrackedParameter<bool>(
"verbose",
false)),
17 muonTag_(ps.getUntrackedParameter<edm::
InputTag>(
"muonInputTag", edm::
InputTag(
"muons"))),
18 bsTag_(ps.getUntrackedParameter<edm::
InputTag>(
"offlineBeamSpot", edm::
InputTag(
"offlineBeamSpot"))),
21 maxEta_(ps.getUntrackedParameter<double>(
"maxEta", 2.1)),
22 minPt_(ps.getUntrackedParameter<double>(
"minPt", 5)),
23 maxNormChi2_(ps.getUntrackedParameter<double>(
"maxNormChi2", 10)),
24 maxD0_(ps.getUntrackedParameter<double>(
"maxD0", 0.02)),
25 maxDz_(ps.getUntrackedParameter<double>(
"maxDz", 20.)),
26 minPixelHits_(ps.getUntrackedParameter<uint32_t>(
"minPixelHits", 1)),
27 minStripHits_(ps.getUntrackedParameter<uint32_t>(
"minStripHits", 8)),
28 minChambers_(ps.getUntrackedParameter<uint32_t>(
"minChambers", 2)),
29 minMatches_(ps.getUntrackedParameter<uint32_t>(
"minMatches", 2)),
30 minMatchedStations_(ps.getUntrackedParameter<double>(
"minMatchedStations", 2)),
31 maxIso_(ps.getUntrackedParameter<double>(
"maxIso", 0.3)),
32 minPtHighest_(ps.getUntrackedParameter<double>(
"minPtHighest", 24)),
33 minInvMass_(ps.getUntrackedParameter<double>(
"minInvMass", 60)),
34 maxInvMass_(ps.getUntrackedParameter<double>(
"maxInvMass", 120)) {}
44 std::vector<TLorentzVector> list;
46 for (
auto const&
mu : *muonColl) {
47 if (!
mu.isGlobalMuon())
57 double chi2 = gtk->chi2();
58 double ndof = gtk->ndof();
59 double chbyndof = (ndof > 0) ? chi2 / ndof : 0;
65 double abstrkd0 =
std::abs(tk->dxy(beamSpot->position()));
68 double abstrkdz =
std::abs(tk->dz(beamSpot->position()));
72 edm::LogError(
"ZtoMMEventSelector") <<
"Error >> Failed to get BeamSpot for label: " <<
bsTag_;
99 lv.SetPtEtaPhiE(
mu.pt(),
mu.eta(),
mu.phi(),
mu.energy());
103 edm::LogError(
"ZtoMMEventSelector") <<
"Error >> Failed to get MuonCollection for label: " <<
muonTag_;
111 TLorentzVector
zv = list[0] + list[1];
112 double mass = zv.M();
const edm::InputTag muonTag_
const double maxNormChi2_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
int numberOfValidStripHits() const
Log< level::Error, false > LogError
float sumPhotonEt
sum pt of PF photons
const int minMatchedStations_
const double minPtHighest_
std::vector< Muon > MuonCollection
collection of Muon objects
float sumNeutralHadronEt
sum pt of neutral hadrons
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
Abs< T >::type abs(const T &t)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
ZtoMMEventSelector(const edm::ParameterSet &)
const edm::InputTag bsTag_
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
bool filter(edm::Event &, edm::EventSetup const &) override
int numberOfValidPixelHits() const