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.);
216 hists_[
"MTWm_"] = ibooker.
book1D(
"MTWm",
"M_{T}^{W}(#mu)", 60, 0., 300.);
218 hists_[
"mMTT_"] = ibooker.
book1D(
"mMTT",
"M_{T}^{t}(#mu)", 50, 0., 500.);
221 hists_[
"MTWe_"] = ibooker.
book1D(
"MTWe",
"M_{T}^{W}(e)", 60, 0., 300.);
223 hists_[
"eMTT_"] = ibooker.
book1D(
"eMTT",
"M_{T}^{t}(e)", 50, 0., 500.);
233 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId,TightIso)", 30, -3., 3.);
235 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId,TightIso)", 40, -4., 4.);
236 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
239 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e TightId, TightIso)", 30, -3., 3.);
240 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e TightId, TightIso)", 40, -4., 4.);
242 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId)", 50, 0., 1.);
244 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.);
272 hists_[
"slimmedMETsPuppi_"] = ibooker.
book1D(
"slimmedMETsPuppi",
"MET_{slimmedPuppi}", 40, 0., 200.);
274 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
276 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
279 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
280 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
288 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
291 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
294 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu TightId)", 50, 0., 5.);
297 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e TightId)", 50, 0., 5.);
300 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e TightId)", 50, 0., 5.);
303 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e TightId)", 50, 0., 5.);
318 hists_[
"jetMultBDeepJetM_"] = ibooker.
book1D(
"JetMultBDeepJetM",
"N_{30}(DeepJetM)", 10, 0., 10.);
320 hists_[
"jetBDeepJet_"] = ibooker.
book1D(
"JetDiscDeepJet",
"BJet Disc_{DeepJet}(JET)", 100, -1., 2.);
330 hists_[
"eventLogger_"] = ibooker.
book2D(
"EventLogger",
"Logged Events", 9, 0., 9., 10, 0., 10.);
333 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
334 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
335 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
336 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
337 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
338 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
339 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
340 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
341 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
342 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
343 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
369 unsigned int pvMult = 0;
373 (!(
pv->isFake()) && (
pv->ndof() > 4.0) && (
abs(
pv->z()) < 24.0) && (
abs(
pv->position().Rho()) < 2.0));
381 fill(
"pvMult_", pvMult);
413 event.getByLabel(
rhoTag, _rhoHandle);
424 unsigned int eMultIso = 0, eMult = 0;
425 std::vector<const pat::Electron*> isoElecs;
432 double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
433 double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
434 double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
436 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
437 double absEta =
abs(elec->superCluster()->eta());
441 else if (absEta < 1.479)
443 else if (absEta < 2.000)
445 else if (absEta < 2.200)
447 else if (absEta < 2.300)
449 else if (absEta < 2.400)
451 else if (absEta < 5.000)
454 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) / elec->pt();
459 fill(
"elecRelIso_", el_pfRelIso);
460 fill(
"elecChHadIso_", el_ChHadIso);
461 fill(
"elecNeHadIso_", el_NeHadIso);
462 fill(
"elecPhIso_", el_PhIso);
468 if (!((el_pfRelIso < 0.0588 && absEta < 1.479) || (el_pfRelIso < 0.0571 && absEta > 1.479)))
476 fill(
"elecPt_", elec->pt());
477 fill(
"elecEta_", elec->eta());
478 fill(
"elecPhi_", elec->phi());
484 fill(
"elecMultTight_", eMultIso);
495 unsigned int mMult = 0, mTight = 0;
508 if (
muon->isGlobalMuon()) {
509 fill(
"muonDelZ_",
muon->innerTrack()->vz());
510 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
517 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
518 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
519 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
521 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
524 if (!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
525 muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 &&
526 fabs(
muon->muonBestTrack()->dxy(pver.
position())) < 0.2 &&
527 fabs(
muon->muonBestTrack()->dz(pver.
position())) < 0.5 &&
528 muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
529 muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5))
534 fill(
"muonRelIso_", pfRelIso);
535 fill(
"muonChHadIso_", chHadPt);
536 fill(
"muonNeHadIso_", neHadEt);
537 fill(
"muonPhIso_", phoEt);
538 fill(
"muonRelIso_", pfRelIso);
541 if (!(pfRelIso < 0.15))
557 fill(
"muonMult_", mMult);
558 fill(
"muonMultTight_", mTight);
569 std::vector<pat::Jet> correctedJets;
570 std::vector<double> JetTagValues;
572 vector<double> bJetDiscVal;
574 unsigned int mult = 0, loosemult = 0, multBDeepJetM = 0;
603 correctedJets.push_back(monitorJet);
612 if (multBDeepJetM == 0) {
613 TaggedJetCand = monitorJet;
615 }
else if (multBDeepJetM == 1) {
617 if (bJetDiscVal[1] > bJetDiscVal[0])
618 TaggedJetCand = monitorJet;
629 if (loosemult == 1) {
632 fill(
"jet1Pt_", monitorJet.
pt());
634 fill(
"jet1Eta_", monitorJet.
eta());
636 if (loosemult == 2) {
637 fill(
"jet2Pt_", monitorJet.
pt());
639 fill(
"jet2Eta_", monitorJet.
eta());
644 fill(
"jetLooseMult_", loosemult);
645 fill(
"jetMultBDeepJetM_", multBDeepJetM);
664 if (
met->begin() !=
met->end()) {
665 unsigned int idx = met_ -
mets_.begin();
667 fill(
"slimmedMETs_",
met->begin()->et());
669 fill(
"slimmedMETsPuppi_",
met->begin()->et());
685 double topMass = eventKinematics.
massTopQuark(correctedJets);
686 if (
wMass >= 0 && topMass >= 0) {
688 fill(
"massTop_", topMass);
704 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
708 fill(
"eventLogger_", 1.5,
logged_ + 0.5,
event.eventAuxiliary().luminosityBlock());
710 if (!correctedJets.empty())
711 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
712 if (correctedJets.size() > 1)
713 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
714 if (correctedJets.size() > 2)
715 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
716 if (correctedJets.size() > 3)
717 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
725 if (multBDeepJetM != 0 && mTight == 1) {
726 double mtW = eventKinematics.
tmassWBoson(&
mu, mET, TaggedJetCand);
732 if (multBDeepJetM != 0 && eMultIso == 1) {
733 double mtW = eventKinematics.
tmassWBoson(&
e, mET, TaggedJetCand);
735 double MTT = eventKinematics.
tmassTopQuark(&
e, mET, TaggedJetCand);
742 : vertexSelect_(nullptr),
744 beamspotSelect_(nullptr),
746 ElectronStep(nullptr),
763 std::make_unique<StringCutObjectSelector<reco::BeamSpot>>(
beamspot.getParameter<
std::string>(
"select"));
767 sel_ =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
769 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
772 std::make_pair(
sel_.at(
i),
773 std::make_unique<SingleTopTChannelLepton_miniAOD::MonitorEnsemble>(
781 if (
type ==
"muons") {
784 if (
type ==
"elecs") {
790 if (
type ==
"jets") {
804 selIt->second.second->book(ibooker);
823 unsigned int nJetSteps = -1;
829 if (
type ==
"empty") {
853 if (
type ==
"jets") {
855 if (
JetSteps[nJetSteps] !=
nullptr) {
Analysis-level MET class.
std::vector< std::string > selectionOrder_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
T getParameter(std::string const &) const
std::map< std::string, MonitorElement * > hists_
histogram container
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::vector< std::string > triggerPaths_
double pt() const final
transverse momentum
int chargedMultiplicity() const
chargedMultiplicity
double tmassWBoson(pat::Muon *lep, const pat::MET &met, const pat::Jet &b)
calculate W boson transverse mass estimate
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
virtual void setCurrentFolder(std::string const &fullpath)
const Point & position() const
position
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< edm::View< pat::Electron > > elecs_
Level verbosity_
verbosity level for booking
constexpr bool isUninitialized() const noexcept
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
int neutralMultiplicity() const
neutralMultiplicity
double massWBoson(const std::vector< pat::Jet > &jets)
calculate W boson mass estimate
static const double WMASS
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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::unique_ptr< StringCutObjectSelector< pat::Electron > > elecIso_
extra isolation criterion on electron
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
electronId
when omitted electron plots will be filled w/o cut on electronId
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
input sources for monitoring
double lowerEdge_
mass window upper and lower edge
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int logged_
number of logged interesting events
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
std::string objectType(const std::string &label)
Abs< T >::type abs(const T &t)
std::vector< edm::ParameterSet > sel_
key
prepare the HTCondor submission files and eventually submit them
edm::InputTag beamspot_
beamspot
edm::EDGetTokenT< reco::BeamSpot > beamspot__
double massTopQuark(const std::vector< pat::Jet > &jets)
calculate t-quark mass estimate
double tmassTopQuark(pat::Muon *lep, const pat::MET &met, const pat::Jet &b)
calculate top quark transverse mass estimate
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecSelect_
extra selection on electrons
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< std::string > triggerPaths_
trigger paths
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Analysis-level electron class.
Analysis-level calorimeter jet class.
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Templated helper class to allow a selection on a certain object collection.
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::unique_ptr< StringCutObjectSelector< pat::Jet > > jetSelect
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
std::string label_
instance label
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< edm::EDGetTokenT< edm::View< pat::MET > > > mets_
considers a vector of METs
SingleTopTChannelLeptonDQM_miniAOD(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
Analysis-level muon class.
static const unsigned int MAXJETS
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
double eta() const final
momentum pseudorapidity