20 static const double WMASS = 80.4;
22 MonitorEnsemble::MonitorEnsemble(
const char*
label,
48 sources.
getParameter<std::vector<edm::InputTag> >(
"mets"))
144 .getParameter<edm::ParameterSet>(
"cvsVertex");
158 triggerExtras.
getParameter<std::vector<std::string> >(
"paths");
202 hists_[
"RunNumb_"] = ibooker.
book1D(
"RunNumber",
"Run Nr.", 1.
e4, 1.5e5, 3.e5);
204 hists_[
"InstLumi_"] = ibooker.
book1D(
"InstLumi",
"Inst. Lumi.", 100, 0., 1.e3);
206 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{pvs}", 100, 0., 100.);
208 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu)", 50, 0., 250.);
210 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{All}(#mu)", 10, 0., 10.);
213 "N_{Iso}(#mu)", 10, 0., 10.);
215 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e)", 50, 0., 250.);
217 hists_[
"elecMult_"] = ibooker.
book1D(
"ElecMult",
"N_{All}(e)", 10, 0., 10.);
219 hists_[
"elecMultIso_"] = ibooker.
book1D(
"ElecMultIso",
"N_{Iso}(e)", 10, 0., 10.);
221 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
224 "Eff(trigger)", nPaths, 0., nPaths);
227 "Mon(trigger)", nPaths, 0., nPaths);
229 hists_[
"metCalo_"] = ibooker.
book1D(
"METCalo",
"MET_{Calo}", 50, 0., 200.);
231 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
233 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
235 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
243 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu)", 30, -3., 3.);
246 "MuonRelIso",
"Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
248 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e)", 30, -3., 3.);
250 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e)", 50, 0., 1.);
260 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{L2L3}(jet1)", 60, -3., 3.);
262 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{L2L3}(jet1)", 60, 0., 300.);
264 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{L2L3}(jet2)", 60, -3., 3.);
266 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{L2L3}(jet2)", 60, 0., 300.);
268 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{L2L3}(jet3)", 60, -3., 3.);
270 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{L2L3}(jet3)", 60, 0., 300.);
272 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{L2L3}(jet4)", 60, -3., 3.);
274 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{L2L3}(jet4)", 60, 0., 300.);
276 hists_[
"metTC_"] = ibooker.
book1D(
"METTC",
"MET_{TC}", 50, 0., 200.);
278 hists_[
"metPflow_"] = ibooker.
book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
280 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
283 "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
286 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
287 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
294 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
295 "ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
298 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
299 "NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
303 "Photon_{IsoComponent}(#mu)", 50, 0., 5.);
306 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
307 "ChHad_{IsoComponent}(e)", 50, 0., 5.);
310 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
311 "NeHad_{IsoComponent}(e)", 50, 0., 5.);
314 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
315 "Photon_{IsoComponent}(e)", 50, 0., 5.);
318 hists_[
"jetMultCSVtx_"] = ibooker.
book1D(
"JetMultCSV",
"N_{30}(CSV)", 10, 0., 10.);
321 "Disc_{CSV}(JET)", 100, -1., 2.);
323 hists_[
"jet1PtRaw_"] = ibooker.
book1D(
"Jet1PtRaw",
"pt_{Raw}(jet1)", 60, 0., 300.);
325 hists_[
"jet2PtRaw_"] = ibooker.
book1D(
"Jet2PtRaw",
"pt_{Raw}(jet2)", 60, 0., 300.);
327 hists_[
"jet3PtRaw_"] = ibooker.
book1D(
"Jet3PtRaw",
"pt_{Raw}(jet3)", 60, 0., 300.);
329 hists_[
"jet4PtRaw_"] = ibooker.
book1D(
"Jet4PtRaw",
"pt_{Raw}(jet4)", 60, 0., 300.);
332 "Logged Events", 9, 0., 9., 10, 0., 10.);
335 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
336 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
337 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
338 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
339 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
340 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
341 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
342 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
343 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
344 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
345 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
368 unsigned int pvMult = 0;
370 pv != pvs->end(); ++
pv) {
373 fill(
"pvMult_", pvMult);
387 fill(
"InstLumi_", dummy);
408 unsigned int eMult = 0, eMultIso = 0;
409 std::vector<const reco::PFCandidate*> isoElecs;
411 elec != elecs->end(); ++elec) {
412 if (elec->gsfElectronRef().isNull()) {
421 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
422 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
423 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
426 max(0., el_NeHadIso + el_PhIso -
427 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
431 fill(
"elecPt_", elec->pt());
432 fill(
"elecEta_", elec->eta());
433 fill(
"elecRelIso_", el_pfRelIso);
434 fill(
"elecChHadIso_", el_ChHadIso);
435 fill(
"elecNeHadIso_", el_NeHadIso);
436 fill(
"elecPhIso_", el_PhIso);
442 isoElecs.push_back(&(*elec));
448 fill(
"elecMult_", eMult);
449 fill(
"elecMultIso_", eMultIso);
460 unsigned int mMult = 0, mMultIso = 0;
468 muonit != muons->end(); ++muonit) {
470 if (muonit->muonRef().isNull())
continue;
474 if (muon->isGlobalMuon()) {
475 fill(
"muonDelZ_", muon->innerTrack()->vz());
476 fill(
"muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
481 double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
482 double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
483 double phoEt = muon->pfIsolationR04().sumPhotonEt;
487 max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
492 fill(
"muonPt_", muon->pt());
493 fill(
"muonEta_", muon->eta());
495 fill(
"muonRelIso_", pfRelIso);
497 fill(
"muonChHadIso_", chHadPt);
498 fill(
"muonNeHadIso_", neHadEt);
499 fill(
"muonPhIso_", phoEt);
506 fill(
"muonMult_", mMult);
507 fill(
"muonMultIso_", mMultIso);
533 <<
"-----------------------------------------------------------------" 534 "-------------------- \n" 535 <<
" No JetCorrectionsRecord available from EventSetup: " 537 <<
" - Jets will not be corrected. " 539 <<
" - If you want to change this add the following lines to your " 543 <<
" ## load jet corrections " 546 "process.load(\"JetMETCorrections.Configuration." 547 "JetCorrectionServicesAllAlgos_cff\") \n" 548 <<
" process.prefer(\"ak5CaloL2L3\") " 552 <<
"-----------------------------------------------------------------" 553 "-------------------- \n";
558 std::vector<reco::Jet> correctedJets;
559 std::vector<double> JetTagValues;
560 unsigned int mult = 0, multCSV = 0;
573 jet != jets->end(); ++
jet) {
575 unsigned int idx =
jet - jets->begin();
577 dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
578 if (!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
581 if (dynamic_cast<const reco::CaloJet*>(&*
jet)) {
585 if (!jetSelect(sel)) {
588 }
else if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
592 if (!jetSelect(sel))
continue;
597 if (!jetSelect(sel))
continue;
603 correctedJets.push_back(monitorJet);
609 fill(
"jetBCVtx_", (*btagCSV)[jetRef]);
610 if ((*btagCSV)[jetRef] >
btagCSVWP_) ++multCSV;
614 JetTagValues.push_back((*btagCSV)[jetRef]);
618 fill(
"jet1Pt_", monitorJet.
pt());
620 fill(
"jet1Eta_", monitorJet.
eta());
623 fill(
"jet2Pt_", monitorJet.
pt());
625 fill(
"jet2Eta_", monitorJet.
eta());
628 fill(
"jet3Pt_", monitorJet.
pt());
630 fill(
"jet3Eta_", monitorJet.
eta());
633 fill(
"jet4Pt_", monitorJet.
pt());
635 fill(
"jet4Eta_", monitorJet.
eta());
638 fill(
"jetMult_", mult);
640 fill(
"jetMultCSVtx_", multCSV);
652 met_ =
mets_.begin();
653 met_ !=
mets_.end(); ++met_) {
656 if (met->begin() != met->end()) {
657 unsigned int idx = met_ -
mets_.begin();
658 if (idx == 0)
fill(
"metCalo_", met->begin()->et());
659 if (idx == 1)
fill(
"metTC_", met->begin()->et());
660 if (idx == 2)
fill(
"metPflow_", met->begin()->et());
674 Calculate eventKinematics(MAXJETS, WMASS);
675 double wMass = eventKinematics.massWBoson(correctedJets);
676 double topMass = eventKinematics.massTopQuark(correctedJets);
677 if (wMass >= 0 && topMass >= 0) {
678 fill(
"massW_", wMass);
679 fill(
"massTop_", topMass);
685 if (correctedJets.size() != JetTagValues.size())
return;
687 eventKinematics.massBTopQuark(correctedJets, JetTagValues,
btagCSVWP_);
688 if (btopMass >= 0)
fill(
"massBTop_", btopMass);
695 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
702 if (correctedJets.size() > 0)
703 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
704 if (correctedJets.size() > 1)
705 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
706 if (correctedJets.size() > 2)
707 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
708 if (correctedJets.size() > 3)
709 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
752 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
756 std::unique_ptr<TopSingleLepton::MonitorEnsemble>(
761 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
765 if (
type ==
"muons") {
769 if (
type ==
"elecs") {
777 if (
type ==
"jets") {
781 if (
type ==
"jets/pf") {
785 if (
type ==
"jets/calo") {
800 selIt->second.second->book(ibooker);
818 unsigned int nJetSteps = -1;
819 unsigned int nPFJetSteps = -1;
820 unsigned int nCaloJetSteps = -1;
821 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
825 if (
type ==
"empty") {
847 if (
PvStep->selectVertex(event)) {
854 if (
type ==
"jets") {
864 if (
type ==
"jets/pf") {
874 if (
type ==
"jets/calo") {
std::map< std::string, MonitorElement * > hists_
histogram container
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
EventAuxiliary const & eventAuxiliary() const override
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Jets made from CaloTowers.
std::unique_ptr< SelectionStep< reco::PFCandidate > > ElectronStep
virtual void scaleEnergy(double fScale)
scale energy of the jet
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
virtual double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::string > triggerPaths_
Base class for all types of Jets.
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
def setup(process, global_tag, zero_tesla=False)
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 accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Jets made from PFObjects.
std::vector< std::string > triggerPaths_
trigger paths
std::vector< std::string > selectionOrder_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
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
Helper class for the calculation of a top and a W boson mass estime.
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
MonitorElement * book1D(Args &&...args)
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
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
std::unique_ptr< SelectionStep< reco::PFCandidate > > MuonStep
std::unique_ptr< SelectionStep< reco::MET > > METStep
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::string label_
instance label
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
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
static EventSetupRecordKey makeKey()
std::vector< edm::ParameterSet > sel_
bool isUninitialized() const
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
std::string jetCorrector_
jetCorrector
static const unsigned int MAXJETS
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
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