32 const double lep_counting_threshold,
33 const double lep_iso_cut,
34 const double lep_eta_cut,
35 const double d0_cut_b,
36 const double dz_cut_b,
37 const double d0_cut_e,
38 const double dz_cut_e) {
51 const float relisowithdb = absiso / el.
pt();
52 if (relisowithdb > lep_iso_cut)
56 bool pass_conversion =
false;
60 edm::LogError(
"LepHTMonitor") <<
"Electron conversion matching failed.\n";
66 float d0 = 999.,
dz = 999.;
68 d0 = -(el.
gsfTrack()->dxy(pv_position));
71 edm::LogError(
"LepHTMonitor") <<
"Could not read electron.gsfTrack().\n";
90 const double lep_counting_threshold,
91 const double lep_iso_cut,
92 const double lep_eta_cut,
99 if (mu.
pt() < lep_counting_threshold ||
std::abs(mu.
eta()) > lep_eta_cut)
106 const float relisowithdb = absiso / mu.
pt();
107 if (relisowithdb > lep_iso_cut)
111 bool pass_id =
false;
112 if (muonIDlevel == 1)
114 else if (muonIDlevel == 3)
125 if (d0 > d0_cut || dz > dz_cut)
133 : theElectronTag_(ps.getParameter<
edm::
InputTag>(
"electronCollection")),
135 theElectronVIDTag_(ps.getParameter<
edm::
InputTag>(
"electronVID")),
136 theElectronVIDMap_(consumes<
edm::
ValueMap<
bool> >(theElectronVIDTag_)),
137 theMuonTag_(ps.getParameter<
edm::
InputTag>(
"muonCollection")),
139 thePfMETTag_(ps.getParameter<
edm::
InputTag>(
"pfMetCollection")),
141 thePfJetTag_(ps.getParameter<
edm::
InputTag>(
"pfJetCollection")),
143 theJetTagTag_(ps.getParameter<
edm::
InputTag>(
"jetTagCollection")),
145 theVertexCollectionTag_(ps.getParameter<
edm::
InputTag>(
"vertexCollection")),
147 theConversionCollectionTag_(ps.getParameter<
edm::
InputTag>(
"conversionCollection")),
149 theBeamSpotTag_(ps.getParameter<
edm::
InputTag>(
"beamSpot")),
150 theBeamSpot_(consumes<
reco::
BeamSpot>(theBeamSpotTag_)),
153 ps.getParameter<
edm::
ParameterSet>(
"numGenericTriggerEventPSet"), consumesCollector(), *this)),
155 ps.getParameter<
edm::
ParameterSet>(
"den_lep_GenericTriggerEventPSet"), consumesCollector(), *this)),
157 ps.getParameter<
edm::
ParameterSet>(
"den_HT_GenericTriggerEventPSet"), consumesCollector(), *this)),
159 folderName_(ps.getParameter<
std::
string>(
"folderName")),
161 muonIDlevel_(ps.getUntrackedParameter<
int>(
"muonIDlevel")),
163 jetPtCut_(ps.getUntrackedParameter<double>(
"jetPtCut")),
164 jetEtaCut_(ps.getUntrackedParameter<double>(
"jetEtaCut")),
165 metCut_(ps.getUntrackedParameter<double>(
"metCut")),
166 htCut_(ps.getUntrackedParameter<double>(
"htCut")),
168 nmusCut_(ps.getUntrackedParameter<double>(
"nmus")),
169 nelsCut_(ps.getUntrackedParameter<double>(
"nels")),
170 lep_pt_plateau_(ps.getUntrackedParameter<double>(
"leptonPtPlateau")),
171 lep_counting_threshold_(ps.getUntrackedParameter<double>(
"leptonCountingThreshold")),
172 lep_iso_cut_(ps.getUntrackedParameter<double>(
"lepIsoCut")),
173 lep_eta_cut_(ps.getUntrackedParameter<double>(
"lepEtaCut")),
174 lep_d0_cut_b_(ps.getUntrackedParameter<double>(
"lep_d0_cut_b")),
175 lep_dz_cut_b_(ps.getUntrackedParameter<double>(
"lep_dz_cut_b")),
176 lep_d0_cut_e_(ps.getUntrackedParameter<double>(
"lep_d0_cut_e")),
177 lep_dz_cut_e_(ps.getUntrackedParameter<double>(
"lep_dz_cut_e")),
178 ptbins_(ps.getParameter<
std::vector<double> >(
"ptbins")),
179 htbins_(ps.getParameter<
std::vector<double> >(
"htbins")),
181 nbins_eta_(ps.getUntrackedParameter<
int>(
"nbins_eta")),
182 nbins_phi_(ps.getUntrackedParameter<
int>(
"nbins_phi")),
183 nbins_npv_(ps.getUntrackedParameter<
int>(
"nbins_npv")),
184 etabins_min_(ps.getUntrackedParameter<double>(
"etabins_min")),
185 etabins_max_(ps.getUntrackedParameter<double>(
"etabins_max")),
186 phibins_min_(ps.getUntrackedParameter<double>(
"phibins_min")),
187 phibins_max_(ps.getUntrackedParameter<double>(
"phibins_max")),
188 npvbins_min_(ps.getUntrackedParameter<double>(
"npvbins_min")),
189 npvbins_max_(ps.getUntrackedParameter<double>(
"npvbins_max")),
201 edm::LogInfo(
"LepHTMonitor") <<
"Constructor LepHTMonitor::LepHTMonitor\n";
207 edm::LogInfo(
"LepHTMonitor") <<
"LepHTMonitor::beginRun\n";
211 edm::LogInfo(
"LepHTMonitor") <<
"LepHTMonitor::bookHistograms\n";
225 if (is_mu && !is_ele) {
228 }
else if (is_ele && !is_mu) {
241 vector<float> f_ptbins;
243 f_ptbins.push_back(static_cast<float>(ptbin));
244 vector<float> f_htbins;
246 f_htbins.push_back(static_cast<float>(htbin));
250 ibooker.
book1D(
"pfHTTurnOn_num",
"Numerator;Offline H_{T} [GeV];", f_htbins.size() - 1, f_htbins.data());
252 ibooker.
book1D(
"pfHTTurnOn_den",
"Denominator;Offline H_{T} [GeV];", f_htbins.size() - 1, f_htbins.data());
255 (
"Numerator;Offline " + lepton +
" p_{T} [GeV];").c_str(),
259 (
"Denominator;Offline " + lepton +
" p_{T} [GeV];").c_str(),
272 "Numerator;Offline lepton #eta;Offline lepton #phi;",
280 "Denominator;Offline lepton #eta;Offline lepton #phi;",
295 edm::LogInfo(
"LepHTMonitor") <<
"LepHTMonitor::analyze\n";
298 bool hasFired =
false;
299 bool hasFiredAuxiliary =
false;
300 bool hasFiredLeptonAuxiliary =
false;
302 hasFiredLeptonAuxiliary =
true;
304 hasFiredAuxiliary =
true;
308 if (!(hasFiredAuxiliary || hasFiredLeptonAuxiliary))
315 if (!VertexCollection.
isValid()) {
318 npv = VertexCollection->size();
325 if (!ele_id_decisions.
isValid()) {
334 if (!ConversionCollection.
isValid()) {
353 if (!pfMETCollection.
isValid()) {
362 if (!pfJetCollection.
isValid()) {
371 if (!ElectronCollection.
isValid()) {
380 if (!MuonCollection.
isValid()) {
387 if (pfJetCollection.
isValid()) {
389 for (
auto const &pfjet : *pfJetCollection) {
400 if (pfMETCollection.
isValid() && !pfMETCollection->empty()) {
401 pfMET = pfMETCollection->front().et();
405 double lep_max_pt = -1.0;
408 double trailing_ele_eta = 0;
409 double trailing_ele_phi = 0;
410 double trailing_mu_eta = 0;
411 double trailing_mu_phi = 0;
412 double min_ele_pt = -1.0;
413 double min_mu_pt = -1.0;
416 if (VertexCollection.
isValid() && !VertexCollection->empty()) {
421 for (
auto const &
electron : *ElectronCollection) {
422 const auto el = ElectronCollection->ptrAt(index);
423 bool pass_id = (*ele_id_decisions)[el];
425 VertexCollection->front().position(),
441 if (
electron.pt() < min_ele_pt || min_ele_pt < 0) {
453 if (MuonCollection.
isValid()) {
454 for (
auto const &
muon : *MuonCollection) {
456 VertexCollection->front(),
463 if (
muon.pt() > lep_max_pt) {
464 lep_max_pt =
muon.pt();
465 lep_eta =
muon.eta();
466 lep_phi =
muon.phi();
468 if (
muon.pt() < min_mu_pt || min_mu_pt < 0) {
469 min_mu_pt =
muon.pt();
470 trailing_mu_eta =
muon.eta();
471 trailing_mu_phi =
muon.phi();
480 float lep_pt = lep_max_pt;
485 lep_eta = trailing_mu_eta;
486 lep_phi = trailing_mu_phi;
490 lep_eta = trailing_ele_eta;
491 lep_phi = trailing_ele_phi;
494 if (min_ele_pt < min_mu_pt) {
496 lep_eta = trailing_ele_eta;
497 lep_phi = trailing_ele_phi;
500 lep_eta = trailing_mu_eta;
501 lep_phi = trailing_mu_phi;
509 if (hasFiredLeptonAuxiliary || !e.
isRealData()) {
545 if (nleps_cut && lep_plateau) {
558 edm::LogInfo(
"LepHTMonitor") <<
"LepHTMonitor::endRun\n";
const PflowIsolationVariables & pfIsolationVariables() const
edm::EDGetTokenT< edm::ValueMap< bool > > theElectronVIDMap_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
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_
void setCurrentFolder(std::string const &fullpath)
nels
1: loose, 2: medium, 3: tight
MonitorElement * h_lepEtaTurnOn_den_
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
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_
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
std::unique_ptr< GenericTriggerEventFlag > den_lep_genTriggerEventFlag_
#define DEFINE_FWK_MODULE(type)
virtual TrackRef muonBestTrack() const
edm::EDGetTokenT< edm::View< reco::GsfElectron > > theElectronCollection_
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::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_
MonitorElement * h_NPVTurnOn_den_
const MuonPFIsolation & pfIsolationR04() const
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
MonitorElement * h_lepEtaPhiTurnOn_den_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::vector< double > htbins_
void dqmEndRun(const edm::Run &run, const edm::EventSetup &eSetup) override
SuperClusterRef superCluster() const override
reference to a SuperCluster
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &e) override
const Point & position() const
position
edm::EDGetTokenT< reco::VertexCollection > theVertexCollection_
std::unique_ptr< GenericTriggerEventFlag > den_HT_genTriggerEventFlag_
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
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)
edm::InputTag theVertexCollectionTag_
edm::EDGetTokenT< reco::MuonCollection > theMuonCollection_
edm::InputTag theBeamSpotTag_
MonitorElement * h_lepEtaTurnOn_num_
float sumChargedHadronPt
sum-pt of charged Hadron