27 static const double WMASS = 80.4;
36 jetIDSelect_(nullptr),
62 std::make_unique<StringCutObjectSelector<pat::Electron>>(
elecExtras.getParameter<
std::string>(
"select"));
68 std::make_unique<StringCutObjectSelector<pat::Electron>>(
elecExtras.getParameter<
std::string>(
"isolation"));
89 std::make_unique<StringCutObjectSelector<reco::Vertex>>(
pvExtras.getParameter<
std::string>(
"select"));
105 std::make_unique<StringCutObjectSelector<pat::Muon>>(
muonExtras.getParameter<
std::string>(
"isolation"));
179 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{good pvs}", 50, 0., 50.);
181 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu TightId, TightIso)", 40, 0., 200.);
183 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{loose}(#mu)", 10, 0., 10.);
188 hists_[
"muonMultTight_"] = ibooker.
book1D(
"MuonMultTight",
"N_{TightIso,TightId}(#mu)", 10, 0., 10.);
191 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e TightId, TightIso)", 40, 0., 200.);
197 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
198 hists_[
"jetLooseMult_"] = ibooker.
book1D(
"JetLooseMult",
"N_{30,loose}(jet)", 10, 0., 10.);
207 hists_[
"slimmedMETs_"] = ibooker.
book1D(
"slimmedMETs",
"MET_{slimmed}", 40, 0., 200.);
209 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
211 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
213 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
222 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId,TightIso)", 30, -3., 3.);
224 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId,TightIso)", 40, -4., 4.);
225 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
228 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e TightId, TightIso)", 30, -3., 3.);
229 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e TightId, TightIso)", 40, -4., 4.);
231 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId)", 50, 0., 1.);
233 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
"N_{TightIso,TightId}(e)", 10, 0., 10.);
244 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
246 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
248 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
250 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
252 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{30,loose}(jet3)", 60, -3., 3.);
254 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{30,loose}(jet3)", 60, 0., 300.);
256 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{30,loose}(jet4)", 60, -3., 3.);
258 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{30,loose}(jet4)", 60, 0., 300.);
260 hists_[
"slimmedMETsNoHF_"] = ibooker.
book1D(
"slimmedMETsNoHF",
"MET_{slimmedNoHF}", 40, 0., 200.);
262 hists_[
"slimmedMETsPuppi_"] = ibooker.
book1D(
"slimmedMETsPuppi",
"MET_{slimmedPuppi}", 40, 0., 200.);
264 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
266 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
269 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
270 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
278 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
281 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
284 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu TightId)", 50, 0., 5.);
287 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e TightId)", 50, 0., 5.);
290 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e TightId)", 50, 0., 5.);
293 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e TightId)", 50, 0., 5.);
308 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
310 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
320 hists_[
"eventLogger_"] = ibooker.
book2D(
"EventLogger",
"Logged Events", 9, 0., 9., 10, 0., 10.);
323 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
324 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
325 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
326 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
327 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
328 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
329 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
330 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
331 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
332 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
333 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
359 unsigned int pvMult = 0;
363 (!(
pv->isFake()) && (
pv->ndof() > 4.0) && (
abs(
pv->z()) < 24.0) && (
abs(
pv->position().Rho()) < 2.0));
371 fill(
"pvMult_", pvMult);
403 event.getByLabel(
rhoTag, _rhoHandle);
414 unsigned int eMultIso = 0, eMult = 0;
415 std::vector<const pat::Electron*> isoElecs;
420 double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
421 double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
422 double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
424 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
425 double absEta =
abs(elec->superCluster()->eta());
429 else if (absEta < 1.479)
431 else if (absEta < 2.000)
433 else if (absEta < 2.200)
435 else if (absEta < 2.300)
437 else if (absEta < 2.400)
439 else if (absEta < 5.000)
442 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) / elec->pt();
447 fill(
"elecRelIso_", el_pfRelIso);
448 fill(
"elecChHadIso_", el_ChHadIso);
449 fill(
"elecNeHadIso_", el_NeHadIso);
450 fill(
"elecPhIso_", el_PhIso);
456 if (!((el_pfRelIso < 0.0588 && absEta < 1.479) || (el_pfRelIso < 0.0571 && absEta > 1.479)))
462 fill(
"elecPt_", elec->pt());
463 fill(
"elecEta_", elec->eta());
464 fill(
"elecPhi_", elec->phi());
470 fill(
"elecMultTight_", eMultIso);
481 unsigned int mMult = 0, mTight = 0, mTightId = 0;
491 if (
muon->isGlobalMuon()) {
492 fill(
"muonDelZ_",
muon->innerTrack()->vz());
493 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
500 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
501 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
502 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
504 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
507 if (!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
508 muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 &&
509 fabs(
muon->muonBestTrack()->dxy(pver.
position())) < 0.2 &&
510 fabs(
muon->muonBestTrack()->dz(pver.
position())) < 0.5 &&
511 muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
512 muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5))
517 fill(
"muonRelIso_", pfRelIso);
518 fill(
"muonChHadIso_", chHadPt);
519 fill(
"muonNeHadIso_", neHadEt);
520 fill(
"muonPhIso_", phoEt);
524 if (!(pfRelIso < 0.15))
539 fill(
"muonMult_", mMult);
540 fill(
"muonMultTight_", mTight);
551 std::vector<pat::Jet> correctedJets;
552 std::vector<double> JetTagValues;
553 unsigned int mult = 0, loosemult = 0, multBCSVM = 0;
579 correctedJets.push_back(monitorJet);
584 "pfCombinedInclusiveSecondaryVertexV2BJetTags"));
585 if (monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags") > 0.89)
590 JetTagValues.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
593 if (loosemult == 1) {
596 fill(
"jet1Pt_", monitorJet.
pt());
598 fill(
"jet1Eta_", monitorJet.
eta());
600 if (loosemult == 2) {
601 fill(
"jet2Pt_", monitorJet.
pt());
603 fill(
"jet2Eta_", monitorJet.
eta());
605 if (loosemult == 3) {
606 fill(
"jet3Pt_", monitorJet.
pt());
608 fill(
"jet3Eta_", monitorJet.
eta());
610 if (loosemult == 4) {
611 fill(
"jet4Pt_", monitorJet.
pt());
613 fill(
"jet4Eta_", monitorJet.
eta());
618 fill(
"jetLooseMult_", loosemult);
619 fill(
"jetMultBCSVM_", multBCSVM);
635 if (
met->begin() !=
met->end()) {
636 unsigned int idx = met_ -
mets_.begin();
638 fill(
"slimmedMETs_",
met->begin()->et());
640 fill(
"slimmedMETsNoHF_",
met->begin()->et());
642 fill(
"slimmedMETsPuppi_",
met->begin()->et());
658 double topMass = eventKinematics.
massTopQuark(correctedJets);
659 if (
wMass >= 0 && topMass >= 0) {
661 fill(
"massTop_", topMass);
667 if (correctedJets.size() != JetTagValues.size())
669 double btopMass = eventKinematics.
massBTopQuark(correctedJets, JetTagValues, 0.89);
672 fill(
"massBTop_", btopMass);
678 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
682 fill(
"eventLogger_", 1.5,
logged_ + 0.5,
event.eventAuxiliary().luminosityBlock());
685 if (!correctedJets.empty())
686 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
687 if (correctedJets.size() > 1)
688 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
689 if (correctedJets.size() > 2)
690 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
691 if (correctedJets.size() > 3)
692 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
702 : vertexSelect_(nullptr),
704 beamspotSelect_(nullptr),
706 ElectronStep(nullptr),
723 std::make_unique<StringCutObjectSelector<reco::BeamSpot>>(
beamspot.getParameter<
std::string>(
"select"));
727 sel_ =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
729 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
732 std::make_pair(
sel_.at(
i),
733 std::make_unique<TopSingleLepton_miniAOD::MonitorEnsemble>(
740 if (
type ==
"muons") {
743 if (
type ==
"elecs") {
749 if (
type ==
"jets") {
761 selIt->second.second->book(ibooker);
780 unsigned int nJetSteps = -1;
786 if (
type ==
"empty") {
810 if (
type ==
"jets") {
812 if (
JetSteps[nJetSteps] !=
nullptr) {
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::vector< edm::EDGetTokenT< edm::View< pat::MET > > > mets_
considers a vector of METs
T getParameter(std::string const &) const
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
double pt() const final
transverse momentum
std::string objectType(const std::string &label)
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecIso_
extra isolation criterion on electron
int chargedMultiplicity() const
chargedMultiplicity
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
input sources for monitoring
virtual void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
const Point & position() const
position
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
constexpr bool isUninitialized() const noexcept
edm::EDGetTokenT< edm::View< pat::Electron > > elecs_
static const unsigned int MAXJETS
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
int neutralMultiplicity() const
neutralMultiplicity
double massWBoson(const std::vector< pat::Jet > &jets)
calculate W boson mass estimate
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
std::vector< edm::ParameterSet > sel_
std::vector< std::string > selectionOrder_
TopSingleLeptonDQM_miniAOD(const edm::ParameterSet &cfg)
default constructor
electronId
when omitted electron plots will be filled w/o cut on electronId
edm::InputTag beamspot_
beamspot
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::string selectionStep(const std::string &label)
std::unique_ptr< StringCutObjectSelector< pat::Jet > > jetSelect
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
Abs< T >::type abs(const T &t)
std::map< std::string, MonitorElement * > hists_
histogram container
key
prepare the HTCondor submission files and eventually submit them
std::vector< std::string > triggerPaths_
trigger paths
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
double massTopQuark(const std::vector< pat::Jet > &jets)
calculate t-quark mass estimate
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
double massBTopQuark(const std::vector< pat::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
static const double WMASS
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
double lowerEdge_
mass window upper and lower edge
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
Analysis-level calorimeter jet class.
int logged_
number of logged interesting events
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
Templated helper class to allow a selection on a certain object collection.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::string label_
instance label
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
std::vector< std::string > triggerPaths_
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecSelect_
extra selection on electrons
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Level verbosity_
verbosity level for booking
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
double eta() const final
momentum pseudorapidity