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.;
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)
199 auto const &iso =
mu.pfIsolationR04();
201 iso.sumChargedHadronPt +
std::max(0.0, iso.sumNeutralHadronEt + iso.sumPhotonEt - 0.5 * iso.sumPUPt);
202 const float relisowithdb = absiso /
mu.pt();
203 if (relisowithdb > lep_iso_cut)
207 bool pass_id =
false;
219 float d0 =
std::abs(
mu.muonBestTrack()->dxy(pv_position));
220 float dz =
std::abs(
mu.muonBestTrack()->dz(pv_position));
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)),
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")),
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))
450 if (!ele_id_decisions.
isValid()) {
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;
548 bool pass_id = (*ele_id_decisions)[el];
566 if (
electron.pt() < min_ele_pt || min_ele_pt < 0) {
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()) {
669 if (hasFiredAuxiliary || !
e.isRealData()) {
670 if (nleps_cut && lep_plateau) {
edm::EDGetTokenT< edm::ValueMap< bool > > theElectronVIDMap_
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_
edm::InputTag thePfMETTag_
#define DEFINE_FWK_MODULE(type)
edm::InputTag theJetTagTag_
nels
1: loose, 2: medium, 3: tight
MonitorElement * h_lepEtaTurnOn_den_
bool isNonnull() const
Checks for non-null.
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
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
const PflowIsolationVariables & pfIsolationVariables() const
std::unique_ptr< GenericTriggerEventFlag > den_lep_genTriggerEventFlag_
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_
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_