128 const double lep_counting_threshold,
129 const double lep_iso_cut,
130 const double lep_eta_cut,
131 const double d0_cut_b,
132 const double dz_cut_b,
133 const double d0_cut_e,
134 const double dz_cut_e) {
147 const float relisowithdb = absiso / el.
pt();
148 if (relisowithdb > lep_iso_cut)
152 bool pass_conversion =
false;
156 edm::LogError(
"LepHTMonitor") <<
"Electron conversion matching failed.\n";
158 if (!pass_conversion)
162 float d0 = 999.,
dz = 999.;
164 d0 = -(el.
gsfTrack()->dxy(pv_position));
167 edm::LogError(
"LepHTMonitor") <<
"Could not read electron.gsfTrack().\n";
186 const double lep_counting_threshold,
187 const double lep_iso_cut,
188 const double lep_eta_cut,
195 if (mu.
pt() < lep_counting_threshold ||
std::abs(mu.
eta()) > lep_eta_cut)
202 const float relisowithdb = absiso / mu.
pt();
203 if (relisowithdb > lep_iso_cut)
207 bool pass_id =
false;
208 if (muonIDlevel == 1)
210 else if (muonIDlevel == 3)
221 if (d0 > d0_cut || dz > dz_cut)
249 ps.getParameter<edm::
ParameterSet>(
"numGenericTriggerEventPSet"), consumesCollector(), *this)),
251 ps.getParameter<edm::
ParameterSet>(
"den_lep_GenericTriggerEventPSet"), consumesCollector(), *this)),
253 ps.getParameter<edm::
ParameterSet>(
"den_HT_GenericTriggerEventPSet"), consumesCollector(), *this)),
259 muonIDlevel_(ps.getUntrackedParameter<int>(
"muonIDlevel")),
260 jetPtCut_(ps.getUntrackedParameter<double>(
"jetPtCut")),
261 jetEtaCut_(ps.getUntrackedParameter<double>(
"jetEtaCut")),
262 metCut_(ps.getUntrackedParameter<double>(
"metCut")),
263 htCut_(ps.getUntrackedParameter<double>(
"htCut")),
265 nmusCut_(ps.getUntrackedParameter<double>(
"nmus")),
266 nelsCut_(ps.getUntrackedParameter<double>(
"nels")),
269 lep_iso_cut_(ps.getUntrackedParameter<double>(
"lepIsoCut")),
270 lep_eta_cut_(ps.getUntrackedParameter<double>(
"lepEtaCut")),
271 lep_d0_cut_b_(ps.getUntrackedParameter<double>(
"lep_d0_cut_b")),
272 lep_dz_cut_b_(ps.getUntrackedParameter<double>(
"lep_dz_cut_b")),
273 lep_d0_cut_e_(ps.getUntrackedParameter<double>(
"lep_d0_cut_e")),
274 lep_dz_cut_e_(ps.getUntrackedParameter<double>(
"lep_dz_cut_e")),
278 nbins_eta_(ps.getUntrackedParameter<int>(
"nbins_eta")),
279 nbins_phi_(ps.getUntrackedParameter<int>(
"nbins_phi")),
280 nbins_npv_(ps.getUntrackedParameter<int>(
"nbins_npv")),
281 etabins_min_(ps.getUntrackedParameter<double>(
"etabins_min")),
282 etabins_max_(ps.getUntrackedParameter<double>(
"etabins_max")),
283 phibins_min_(ps.getUntrackedParameter<double>(
"phibins_min")),
284 phibins_max_(ps.getUntrackedParameter<double>(
"phibins_max")),
285 npvbins_min_(ps.getUntrackedParameter<double>(
"npvbins_min")),
286 npvbins_max_(ps.getUntrackedParameter<double>(
"npvbins_max")),
298 edm::LogInfo(
"LepHTMonitor") <<
"Constructor LepHTMonitor::LepHTMonitor\n";
353 if (is_mu && !is_ele) {
356 }
else if (is_ele && !is_mu) {
362 vector<float> f_ptbins;
364 f_ptbins.push_back(static_cast<float>(ptbin));
365 vector<float> f_htbins;
367 f_htbins.push_back(static_cast<float>(htbin));
371 ibooker.
book1D(
"pfHTTurnOn_num",
"Numerator;Offline H_{T} [GeV];", f_htbins.size() - 1, f_htbins.data());
373 ibooker.
book1D(
"pfHTTurnOn_den",
"Denominator;Offline H_{T} [GeV];", f_htbins.size() - 1, f_htbins.data());
376 (
"Numerator;Offline " + lepton +
" p_{T} [GeV];").c_str(),
380 (
"Denominator;Offline " + lepton +
" p_{T} [GeV];").c_str(),
393 "Numerator;Offline lepton #eta;Offline lepton #phi;",
401 "Denominator;Offline lepton #eta;Offline lepton #phi;",
423 bool hasFired =
false;
424 bool hasFiredAuxiliary =
false;
425 bool hasFiredLeptonAuxiliary =
false;
427 hasFiredLeptonAuxiliary =
true;
429 hasFiredAuxiliary =
true;
433 if (!(hasFiredAuxiliary || hasFiredLeptonAuxiliary))
440 if (!VertexCollection.
isValid()) {
443 npv = VertexCollection->size();
450 if (!ele_id_decisions.
isValid()) {
459 if (!ConversionCollection.
isValid()) {
478 if (!pfMETCollection.
isValid()) {
487 if (!pfJetCollection.
isValid()) {
496 if (!ElectronCollection.
isValid()) {
505 if (!MuonCollection.
isValid()) {
512 if (pfJetCollection.
isValid()) {
514 for (
auto const &pfjet : *pfJetCollection) {
525 if (pfMETCollection.
isValid() && !pfMETCollection->empty()) {
526 pfMET = pfMETCollection->front().et();
530 double lep_max_pt = -1.0;
533 double trailing_ele_eta = 0;
534 double trailing_ele_phi = 0;
535 double trailing_mu_eta = 0;
536 double trailing_mu_phi = 0;
537 double min_ele_pt = -1.0;
538 double min_mu_pt = -1.0;
541 if (VertexCollection.
isValid() && !VertexCollection->empty()) {
546 for (
auto const &
electron : *ElectronCollection) {
547 const auto el = ElectronCollection->ptrAt(index);
548 bool pass_id = (*ele_id_decisions)[el];
550 VertexCollection->front().position(),
551 BeamSpot->position(),
566 if (
electron.pt() < min_ele_pt || min_ele_pt < 0) {
578 if (MuonCollection.
isValid()) {
579 for (
auto const &
muon : *MuonCollection) {
581 VertexCollection->front(),
588 if (
muon.pt() > lep_max_pt) {
589 lep_max_pt =
muon.pt();
590 lep_eta =
muon.eta();
591 lep_phi =
muon.phi();
593 if (
muon.pt() < min_mu_pt || min_mu_pt < 0) {
594 min_mu_pt =
muon.pt();
595 trailing_mu_eta =
muon.eta();
596 trailing_mu_phi =
muon.phi();
605 float lep_pt = lep_max_pt;
610 lep_eta = trailing_mu_eta;
611 lep_phi = trailing_mu_phi;
615 lep_eta = trailing_ele_eta;
616 lep_phi = trailing_ele_phi;
619 if (min_ele_pt < min_mu_pt) {
621 lep_eta = trailing_ele_eta;
622 lep_phi = trailing_ele_phi;
625 lep_eta = trailing_mu_eta;
626 lep_phi = trailing_mu_phi;
634 if (hasFiredLeptonAuxiliary || !e.
isRealData()) {
670 if (nleps_cut && lep_plateau) {
const PflowIsolationVariables & pfIsolationVariables() const
edm::EDGetTokenT< edm::ValueMap< bool > > theElectronVIDMap_
bool isNonnull() const
Checks for non-null.
double pt() const final
transverse momentum
dqm::reco::MonitorElement MonitorElement
virtual void setCurrentFolder(std::string const &fullpath)
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
MonitorElement * h_pfHTTurnOn_num_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag thePfMETTag_
#define DEFINE_FWK_MODULE(type)
edm::InputTag theJetTagTag_
MonitorElement * h_lepEtaTurnOn_den_
math::XYZPoint Point
point in the space
MonitorElement * h_pfHTTurnOn_den_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * h_lepPhiTurnOn_num_
JetFloatAssociation::Container JetTagCollection
Log< level::Error, false > LogError
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
std::vector< Vertex > VertexCollection
const Point & position() const
position
MonitorElement * h_NPVTurnOn_num_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
std::vector< Muon > MuonCollection
collection of Muon objects
bool isLooseMuon(const reco::Muon &)
std::vector< double > ptbins_
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
std::unique_ptr< GenericTriggerEventFlag > den_lep_genTriggerEventFlag_
virtual TrackRef muonBestTrack() const
edm::EDGetTokenT< edm::View< reco::GsfElectron > > theElectronCollection_
dqm::reco::DQMStore DQMStore
edm::InputTag thePfJetTag_
edm::InputTag theElectronTag_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpot_
MonitorElement * h_lepPtTurnOn_den_
MonitorElement * h_lepPtTurnOn_num_
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
edm::EDGetTokenT< reco::ConversionCollection > theConversionCollection_
edm::EDGetTokenT< reco::JetTagCollection > theJetTagCollection_
edm::InputTag theMuonTag_
void analyze(const edm::Event &e, const edm::EventSetup &eSetup) override
std::vector< Electron > ElectronCollection
collectin of Electron objects
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
double lep_counting_threshold_
Log< level::Info, false > LogInfo
static constexpr float d0
MonitorElement * h_NPVTurnOn_den_
const MuonPFIsolation & pfIsolationR04() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
const std::string folderName_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
MonitorElement * h_lepEtaPhiTurnOn_den_
std::vector< double > htbins_
edm::EDGetTokenT< reco::VertexCollection > theVertexCollection_
std::unique_ptr< GenericTriggerEventFlag > den_HT_genTriggerEventFlag_
Log< level::Warning, false > LogWarning
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::InputTag theConversionCollectionTag_
edm::InputTag theElectronVIDTag_
MonitorElement * h_lepEtaPhiTurnOn_num_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
MonitorElement * h_lepPhiTurnOn_den_
LepHTMonitor(const edm::ParameterSet &ps)
SuperClusterRef superCluster() const override
reference to a SuperCluster
edm::InputTag theVertexCollectionTag_
edm::EDGetTokenT< reco::MuonCollection > theMuonCollection_
const bool requireValidHLTPaths_
edm::InputTag theBeamSpotTag_
MonitorElement * h_lepEtaTurnOn_num_
float sumChargedHadronPt
sum-pt of charged Hadron
double eta() const final
momentum pseudorapidity