24 static const double WMASS = 80.4;
32 jetIDSelect_(nullptr),
33 jetlooseSelection_(nullptr),
34 jetSelection_(nullptr),
58 elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
80 std::make_unique<StringCutObjectSelector<reco::Vertex>>(
pvExtras.getParameter<
std::string>(
"select"));
89 muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
95 muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
124 "chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && " 125 "neutralHadronEnergyFraction()<0.99 && neutralEmEnergyFraction()<0.99 && " 126 "(chargedMultiplicity()+neutralMultiplicity())>1");
190 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{good pvs}", 50, 0., 50.);
192 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu TightId, TightIso)", 40, 0., 200.);
194 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{loose}(#mu)", 10, 0., 10.);
199 hists_[
"muonMultTight_"] = ibooker.
book1D(
"MuonMultTight",
"N_{TightIso,TightId}(#mu)", 10, 0., 10.);
201 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e TightId, TightIso)", 40, 0., 200.);
207 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
209 hists_[
"jetMultLoose_"] = ibooker.
book1D(
"JetMultLoose",
"N_{30, loose}(jet)", 10, 0., 10.);
218 hists_[
"metPflow_"] = ibooker.
book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
220 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
222 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
224 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
233 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId, TightIso)", 30, -3., 3.);
235 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
237 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId, TightIso)", 40, -4., 4.);
239 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e tightId)", 30, -3., 3.);
241 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId, TightIso)", 50, 0., 1.);
243 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e tightId)", 40, -4., 4.);
245 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
"N_{TightIso,TightId}(e)", 10, 0., 10.);
255 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
257 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
259 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
261 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
263 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{30,loose}(jet3)", 60, -3., 3.);
265 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{30,loose}(jet3)", 60, 0., 300.);
267 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{30,loose}(jet4)", 60, -3., 3.);
269 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{30,loose}(jet4)", 60, 0., 300.);
271 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
273 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
276 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
277 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
285 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
288 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
291 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu )", 50, 0., 5.);
294 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e tightId)", 50, 0., 5.);
297 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e tightId)", 50, 0., 5.);
300 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e tightId)", 50, 0., 5.);
303 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
305 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
315 hists_[
"eventLogger_"] = ibooker.
book2D(
"EventLogger",
"Logged Events", 9, 0., 9., 10, 0., 10.);
318 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
319 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
320 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
321 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
322 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{30,loose}(jet1)", 1);
323 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{30,loose}(jet2)", 1);
324 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{30,loose}(jet3)", 1);
325 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{30,loose}(jet4)", 1);
326 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
327 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
328 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
354 unsigned int pvMult = 0;
359 fill(
"pvMult_", pvMult);
372 event.getByLabel(
rhoTag, _rhoHandle);
384 unsigned int eMult = 0, eMultIso = 0;
385 std::vector<const reco::PFCandidate*> isoElecs;
387 if (elec->gsfElectronRef().isNull()) {
397 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
398 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
399 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
400 double absEta = std::fabs(gsf_el->superCluster()->eta());
406 else if (absEta < 1.479)
408 else if (absEta < 2.000)
410 else if (absEta < 2.200)
412 else if (absEta < 2.300)
414 else if (absEta < 2.400)
416 else if (absEta < 5.000)
419 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
420 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) / gsf_el->pt();
424 fill(
"elecRelIso_", el_pfRelIso);
425 fill(
"elecChHadIso_", el_ChHadIso);
426 fill(
"elecNeHadIso_", el_NeHadIso);
427 fill(
"elecPhIso_", el_PhIso);
431 if (!((el_pfRelIso < 0.0588 && absEta < 1.479) || (el_pfRelIso < 0.0571 && absEta > 1.479)))
436 fill(
"elecPt_", elec->pt());
437 fill(
"elecEta_", elec->eta());
438 fill(
"elecPhi_", elec->phi());
445 fill(
"elecMultTight_", eMultIso);
456 unsigned int mMult = 0, mTight = 0, mTightId = 0;
465 if (muonit->muonRef().isNull())
470 if (
muon->isGlobalMuon()) {
471 fill(
"muonDelZ_",
muon->innerTrack()->vz());
472 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
477 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
478 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
479 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
480 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
483 if (!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
484 muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 &&
485 muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
486 muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
487 fabs(
muon->muonBestTrack()->dxy(Pvertex.
position())) < 0.2 &&
488 fabs(
muon->muonBestTrack()->dz(Pvertex.
position())) < 0.5))
492 fill(
"muonRelIso_", pfRelIso);
493 fill(
"muonChHadIso_", chHadPt);
494 fill(
"muonNeHadIso_", neHadEt);
495 fill(
"muonPhIso_", phoEt);
499 if (!(pfRelIso < 0.15))
511 fill(
"muonMult_", mMult);
512 fill(
"muonMultTight_", mTight);
526 if (correctorHandle.
isValid()) {
530 <<
"-----------------------------------------------------------------" 531 "-------------------- \n" 532 <<
" No JetCorrector available from Event: " 534 <<
" - Jets will not be corrected. " 536 <<
"-----------------------------------------------------------------" 537 "-------------------- \n";
549 std::vector<reco::Jet> correctedJets;
550 std::vector<double> JetTagValues;
551 unsigned int mult = 0, multLoose = 0, multCSV = 0;
559 bool isLoose =
false;
561 if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
578 correctedJets.push_back(monitorJet);
582 fill(
"jetBCSV_", (*btagCSV)[jetRef]);
587 JetTagValues.push_back((*btagCSV)[jetRef]);
591 if (multLoose == 0) {
592 fill(
"jet1Pt_", monitorJet.
pt());
593 fill(
"jet1Eta_", monitorJet.
eta());
595 if (multLoose == 1) {
596 fill(
"jet2Pt_", monitorJet.
pt());
597 fill(
"jet2Eta_", monitorJet.
eta());
599 if (multLoose == 2) {
600 fill(
"jet3Pt_", monitorJet.
pt());
601 fill(
"jet3Eta_", monitorJet.
eta());
603 if (multLoose == 3) {
604 fill(
"jet4Pt_", monitorJet.
pt());
605 fill(
"jet4Eta_", monitorJet.
eta());
611 fill(
"jetMultLoose_", multLoose);
612 fill(
"jetMultBCSVM_", multCSV);
628 if (
met->begin() !=
met->end()) {
629 unsigned int idx = met_ -
mets_.begin();
631 fill(
"metPflow_",
met->begin()->et());
647 double topMass = eventKinematics.
massTopQuark(correctedJets);
648 if (
wMass >= 0 && topMass >= 0) {
650 fill(
"massTop_", topMass);
657 if (correctedJets.size() != JetTagValues.size())
661 fill(
"massBTop_", btopMass);
667 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
671 fill(
"eventLogger_", 1.5,
logged_ + 0.5,
event.eventAuxiliary().luminosityBlock());
673 if (!correctedJets.empty())
674 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
675 if (correctedJets.size() > 1)
676 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
677 if (correctedJets.size() > 2)
678 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
679 if (correctedJets.size() > 3)
680 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
690 : vertexSelect_(nullptr),
692 beamspotSelect_(nullptr),
694 ElectronStep(nullptr),
712 std::make_unique<StringCutObjectSelector<reco::BeamSpot>>(
beamspot.getParameter<
std::string>(
"select"));
716 sel_ =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
718 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
721 std::make_pair(
sel_.at(
i),
722 std::make_unique<TopSingleLepton::MonitorEnsemble>(
729 if (
type ==
"muons") {
732 if (
type ==
"elecs") {
738 if (
type ==
"jets") {
741 if (
type ==
"jets/pf") {
744 if (
type ==
"jets/calo") {
756 selIt->second.second->book(ibooker);
776 unsigned int nJetSteps = -1;
777 unsigned int nPFJetSteps = -1;
778 unsigned int nCaloJetSteps = -1;
783 if (
type ==
"empty") {
812 if (
type ==
"jets") {
814 if (
JetSteps[nJetSteps] !=
nullptr) {
822 if (
type ==
"jets/pf") {
832 if (
type ==
"jets/calo") {
std::map< std::string, MonitorElement * > hists_
histogram container
Log< level::Info, true > LogVerbatim
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
double massBTopQuark(const std::vector< reco::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
std::unique_ptr< SelectionStep< reco::PFCandidate > > ElectronStep
virtual void scaleEnergy(double fScale)
scale energy of the jet
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
double pt() const final
transverse momentum
virtual void setCurrentFolder(std::string const &fullpath)
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::vector< std::string > triggerPaths_
const Point & position() const
position
Base class for all types of Jets.
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
T const * product() const
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
constexpr bool isUninitialized() const noexcept
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
TopSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton::MonitorEnsemble > > > selection_
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Jets made from PFObjects.
std::vector< std::string > triggerPaths_
trigger paths
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
std::vector< std::string > selectionOrder_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
electronId
when omitted electron plots will be filled w/o cut on electronId
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
Level verbosity_
verbosity level for booking
static const double WMASS
double lowerEdge_
mass window upper and lower edge
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetSelection_
Helper class for the calculation of a top and a W boson mass estime.
std::string jetSelect_
extra selection on jets
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::InputTag beamspot_
beamspot
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
std::unique_ptr< SelectionStep< reco::PFCandidate > > MuonStep
std::unique_ptr< SelectionStep< reco::MET > > METStep
std::string label_
instance label
edm::EDGetTokenT< reco::JetCorrector > jetCorrector_
jetCorrector
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Templated helper class to allow a selection on a certain object collection.
std::string objectType(const std::string &label)
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetlooseSelection_
std::vector< edm::ParameterSet > sel_
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
static const unsigned int MAXJETS
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::vector< std::unique_ptr< SelectionStep< reco::CaloJet > > > CaloJetSteps
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonIso_
extra isolation criterion on muon
double eta() const final
momentum pseudorapidity