24 static const double WMASS = 80.4;
26 MonitorEnsemble::MonitorEnsemble(
const char*
label,
59 sources.
getParameter<std::vector<edm::InputTag> >(
"mets"))
154 triggerExtras.
getParameter<std::vector<std::string> >(
"paths");
198 hists_[
"RunNumb_"] = ibooker.
book1D(
"RunNumber",
"Run Nr.", 1.
e4, 1.5e5, 3.e5);
200 hists_[
"InstLumi_"] = ibooker.
book1D(
"InstLumi",
"Inst. Lumi.", 100, 0., 1.e3);
202 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{pvs}", 100, 0., 100.);
204 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu)", 50, 0., 250.);
206 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{All}(#mu)", 10, 0., 10.);
209 "N_{Iso}(#mu)", 10, 0., 10.);
211 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e)", 50, 0., 250.);
213 hists_[
"elecMult_"] = ibooker.
book1D(
"ElecMult",
"N_{All}(e)", 10, 0., 10.);
215 hists_[
"elecMultIso_"] = ibooker.
book1D(
"ElecMultIso",
"N_{Iso}(e)", 10, 0., 10.);
217 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
220 "Eff(trigger)", nPaths, 0., nPaths);
223 "Mon(trigger)", nPaths, 0., nPaths);
225 hists_[
"slimmedMETs_"] = ibooker.
book1D(
"slimmedMETs",
"MET_{slimmed}", 50, 0., 200.);
227 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
229 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
231 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
239 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu)", 30, -3., 3.);
242 "MuonRelIso",
"Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
244 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e)", 30, -3., 3.);
246 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e)", 50, 0., 1.);
250 "N_{30}(TCHE)", 10, 0., 10.);
254 "Disc_{TCHE}(jet)", 100, 0., 10.);
256 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{L2L3}(jet1)", 60, -3., 3.);
258 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{L2L3}(jet1)", 60, 0., 300.);
260 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{L2L3}(jet2)", 60, -3., 3.);
262 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{L2L3}(jet2)", 60, 0., 300.);
264 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{L2L3}(jet3)", 60, -3., 3.);
266 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{L2L3}(jet3)", 60, 0., 300.);
268 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{L2L3}(jet4)", 60, -3., 3.);
270 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{L2L3}(jet4)", 60, 0., 300.);
272 hists_[
"slimmedMETsNoHF_"] = ibooker.
book1D(
"slimmedMETsNoHF",
"MET_{slimmedNoHF}", 50, 0., 200.);
274 hists_[
"slimmedMETsPuppi_"] = ibooker.
book1D(
"slimmedMETsPuppi",
"MET_{slimmedPuppi}", 50, 0., 200.);
276 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
279 "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
282 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
283 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
290 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
291 "ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
294 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
295 "NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
299 "Photon_{IsoComponent}(#mu)", 50, 0., 5.);
302 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
303 "ChHad_{IsoComponent}(e)", 50, 0., 5.);
306 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
307 "NeHad_{IsoComponent}(e)", 50, 0., 5.);
310 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
311 "Photon_{IsoComponent}(e)", 50, 0., 5.);
315 "N_{30}(TCHP)", 10, 0., 10.);
318 "Disc_{TCHP}(Jet)", 100, 0., 10.);
321 "N_{30}(SSVHE)", 10, 0., 10.);
324 "Disc_{SSVHE}(Jet)", 35, -1., 6.);
326 hists_[
"jetMultCSVtx_"] = ibooker.
book1D(
"JetMultCSV",
"N_{30}(CSV)", 10, 0., 10.);
329 "Disc_{CSV}(JET)", 100, -1., 2.);
331 hists_[
"jet1PtRaw_"] = ibooker.
book1D(
"Jet1PtRaw",
"pt_{Raw}(jet1)", 60, 0., 300.);
333 hists_[
"jet2PtRaw_"] = ibooker.
book1D(
"Jet2PtRaw",
"pt_{Raw}(jet2)", 60, 0., 300.);
335 hists_[
"jet3PtRaw_"] = ibooker.
book1D(
"Jet3PtRaw",
"pt_{Raw}(jet3)", 60, 0., 300.);
337 hists_[
"jet4PtRaw_"] = ibooker.
book1D(
"Jet4PtRaw",
"pt_{Raw}(jet4)", 60, 0., 300.);
340 "Logged Events", 9, 0., 9., 10, 0., 10.);
343 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
344 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
345 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
346 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
347 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
348 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
349 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
350 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
351 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
352 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
353 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
376 unsigned int pvMult = 0;
378 pv != pvs->end(); ++
pv) {
381 fill(
"pvMult_", pvMult);
395 fill(
"InstLumi_", dummy);
416 unsigned int eMult = 0, eMultIso = 0;
417 std::vector<const pat::Electron*> isoElecs;
421 elec != elecs->end(); ++elec) {
426 double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
427 double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
428 double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
431 max(0., el_NeHadIso + el_PhIso -
432 0.5 * elec->pfIsolationVariables().sumPUPt)) /
436 fill(
"elecPt_", elec->pt());
437 fill(
"elecEta_", elec->eta());
438 fill(
"elecRelIso_", el_pfRelIso);
439 fill(
"elecChHadIso_", el_ChHadIso);
440 fill(
"elecNeHadIso_", el_NeHadIso);
441 fill(
"elecPhIso_", el_PhIso);
446 isoElecs.push_back(&(*elec));
452 fill(
"elecMult_", eMult);
453 fill(
"elecMultIso_", eMultIso);
464 unsigned int mMult = 0, mMultIso = 0;
478 if (
muon->isGlobalMuon()) {
479 fill(
"muonDelZ_",
muon->innerTrack()->vz());
480 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
488 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
489 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
490 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
494 max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
502 fill(
"muonRelIso_", pfRelIso);
504 fill(
"muonChHadIso_", chHadPt);
505 fill(
"muonNeHadIso_", neHadEt);
506 fill(
"muonPhIso_", phoEt);
513 fill(
"muonMult_", mMult);
514 fill(
"muonMultIso_", mMultIso);
526 std::vector<pat::Jet> correctedJets;
527 std::vector<double> JetTagValues;
528 unsigned int mult = 0, multBEff = 0, multBPur = 0, multBVtx = 0, multCSV = 0;
536 jet != jets->end(); ++
jet) {
538 unsigned int idx =
jet - jets->begin();
548 correctedJets.push_back(monitorJet);
551 fill(
"jetBDiscEff_", monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
552 if (monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags") > 0.89) ++multBEff;
557 JetTagValues.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
561 fill(
"jet1Pt_", monitorJet.
pt());
563 fill(
"jet1Eta_", monitorJet.
eta());
566 fill(
"jet2Pt_", monitorJet.
pt());
568 fill(
"jet2Eta_", monitorJet.
eta());
571 fill(
"jet3Pt_", monitorJet.
pt());
573 fill(
"jet3Eta_", monitorJet.
eta());
576 fill(
"jet4Pt_", monitorJet.
pt());
578 fill(
"jet4Eta_", monitorJet.
eta());
581 fill(
"jetMult_", mult);
582 fill(
"jetMultBEff_", multBEff);
583 fill(
"jetMultBPur_", multBPur);
584 fill(
"jetMultBVtx_", multBVtx);
585 fill(
"jetMultCSVtx_", multCSV);
597 met_ =
mets_.begin();
598 met_ !=
mets_.end(); ++met_) {
601 if (met->begin() != met->end()) {
602 unsigned int idx = met_ -
mets_.begin();
603 if (idx == 0)
fill(
"slimmedMETs_", met->begin()->et());
604 if (idx == 1)
fill(
"slimmedMETsNoHF_", met->begin()->et());
605 if (idx == 2)
fill(
"slimmedMETsPuppi_", met->begin()->et());
620 double wMass = eventKinematics.massWBoson(correctedJets);
621 double topMass = eventKinematics.massTopQuark(correctedJets);
622 if (wMass >= 0 && topMass >= 0) {
623 fill(
"massW_", wMass);
624 fill(
"massTop_", topMass);
630 if (correctedJets.size() != JetTagValues.size())
return;
632 eventKinematics.massBTopQuark(correctedJets, JetTagValues, 0.89);
634 if (btopMass >= 0)
fill(
"massBTop_", btopMass);
672 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
676 std::unique_ptr<TopSingleLepton_miniAOD::MonitorEnsemble>(
681 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
685 if (
type ==
"muons") {
689 if (
type ==
"elecs") {
697 if (
type ==
"jets") {
713 selIt->second.second->book(ibooker);
731 unsigned int nJetSteps = -1;
733 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
737 if (
type ==
"empty") {
759 if (
PvStep->selectVertex(event)) {
766 if (
type ==
"jets") {
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
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
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
EventAuxiliary const & eventAuxiliary() const override
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::string objectType(const std::string &label)
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
input sources for monitoring
virtual double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
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_
static const unsigned int MAXJETS
def setup(process, global_tag, zero_tesla=False)
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
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
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
MonitorElement * book1D(Args &&...args)
std::map< std::string, MonitorElement * > hists_
histogram container
std::vector< std::string > triggerPaths_
trigger paths
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::string jetCorrector_
jetCorrector
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
static const double WMASS
double lowerEdge_
mass window upper and lower edge
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
Analysis-level calorimeter jet class.
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
std::vector< std::string > triggerPaths_
bool isUninitialized() const
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecSelect_
extra selection on electrons
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