134 ibooker.setCurrentFolder(current);
142 hists_[
"RunNumb_"] = ibooker.book1D(
"RunNumber",
"Run Nr.", 1.
e4, 1.5e5, 3.e5);
144 hists_[
"invMass_"] = ibooker.book1D(
"InvMass",
"M(lep1, lep2)", 80, 0., 320.);
146 hists_[
"invMassLog_"] = ibooker.book1D(
"InvMassLog",
"log_{10}(M(lep1, lep2))", 80, .1, 2.5);
149 hists_[
"invMassWC_"] = ibooker.book1D(
"InvMassWC",
"M_{WC}(L1, L2)", 80, 0., 320.);
152 hists_[
"invMassWCLog_"] = ibooker.book1D(
"InvMassLogWC",
"log_{10}(M_{WC})", 80, .1, 2.5);
154 hists_[
"decayChannel_"] = ibooker.book1D(
"DecayChannel",
"Decay Channel", 3, 0, 3);
156 hists_[
"elecMuEff_"] = ibooker.book1D(
"ElecMuEff",
"Eff(e/#mu paths)", nElecMu, 0., nElecMu);
158 hists_[
"elecMuMon_"] = ibooker.book1D(
"ElecMuMon",
"Mon(e/#mu paths)", nElecMu, 0., nElecMu);
160 hists_[
"diMuonEff_"] = ibooker.book1D(
"DiMuonEff",
"Eff(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
162 hists_[
"diMuonMon_"] = ibooker.book1D(
"DiMuonMon",
"Mon(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
164 hists_[
"lep1Pt_"] = ibooker.book1D(
"Lep1Pt",
"pt(lep1)", 50, 0., 200.);
166 hists_[
"lep2Pt_"] = ibooker.book1D(
"Lep2Pt",
"pt(lep2)", 50, 0., 200.);
168 hists_[
"jetMult_"] = ibooker.book1D(
"JetMult",
"N_{30}(jet)", 21, -0.5, 20.5);
170 hists_[
"metCalo_"] = ibooker.book1D(
"METCalo",
"MET_{Calo}", 50, 0., 200.);
176 hists_[
"decayChannel_"]->setBinLabel(1,
"#mu e", 1);
177 hists_[
"decayChannel_"]->setBinLabel(2,
"#mu #mu", 1);
178 hists_[
"decayChannel_"]->setBinLabel(3,
"e e", 1);
185 hists_[
"sumEtaL1L2_"] = ibooker.book1D(
"SumEtaL1L2",
"<#eta>(lep1, lep2)", 100, -5., 5.);
187 hists_[
"dEtaL1L2_"] = ibooker.book1D(
"DEtaL1L2",
"#Delta#eta(lep1,lep2)", 80, -4., 4.);
189 hists_[
"dPhiL1L2_"] = ibooker.book1D(
"DPhiL1L2",
"#Delta#phi(lep1,lep2)", 64, -3.2, 3.2);
191 hists_[
"elecPt_"] = ibooker.book1D(
"ElecPt",
"pt(e)", 50, 0., 200.);
194 hists_[
"elecRelIso_"] = ibooker.book1D(
"ElecRelIso",
"Iso_{Rel}(e)", 50, 0., 1.);
196 hists_[
"muonPt_"] = ibooker.book1D(
"MuonPt",
"pt(#mu)", 50, 0., 200.);
198 hists_[
"muonRelIso_"] = ibooker.book1D(
"MuonRelIso",
"Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
200 hists_[
"jet1Pt_"] = ibooker.book1D(
"Jet1Pt",
"pt_{L2L3}(jet1)", 60, 0., 300.);
202 hists_[
"jet2Pt_"] = ibooker.book1D(
"Jet2Pt",
"pt_{L2L3}(jet2)", 60, 0., 300.);
204 hists_[
"metPflow_"] = ibooker.book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
206 hists_[
"metTC_"] = ibooker.book1D(
"METTC",
"MET_{TC}", 50, 0., 200.);
208 hists_[
"muonDelZ_"] = ibooker.book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
210 hists_[
"muonDelXY_"] = ibooker.book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -1., 1., 50, -1., 1.);
212 hists_[
"lepMultIso_"] = ibooker.book2D(
"LepMultIso",
"N_{Iso}(e) vs N_{Iso}(#mu)", 5, 0., 5., 5, 0., 5.);
215 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
216 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
218 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(#mu)", 1);
219 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(elec)", 2);
226 hists_[
"elecMultIso_"] = ibooker.book1D(
"ElecMultIso",
"N_{Iso}(e)", 11, -0.5, 10.5);
228 hists_[
"muonMultIso_"] = ibooker.book1D(
"MuonMultIso",
"N_{Iso}(#mu)", 11, -0.5, 10.5);
231 hists_[
"muonChHadIso_"] = ibooker.book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
234 hists_[
"muonNeHadIso_"] = ibooker.book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
237 hists_[
"muonPhIso_"] = ibooker.book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu)", 50, 0., 5.);
240 hists_[
"elecChHadIso_"] = ibooker.book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e)", 50, 0., 5.);
243 hists_[
"elecNeHadIso_"] = ibooker.book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e)", 50, 0., 5.);
246 hists_[
"elecPhIso_"] = ibooker.book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e)", 50, 0., 5.);
248 hists_[
"jet1Eta_"] = ibooker.book1D(
"Jet1Eta",
"#eta(jet1)", 30, -5., 5.);
250 hists_[
"jet2Eta_"] = ibooker.book1D(
"Jet2Eta",
"#eta(jet2)", 30, -5., 5.);
252 hists_[
"jet1PtRaw_"] = ibooker.book1D(
"Jet1PtRaw",
"pt_{Raw}(jet1)", 60, 0., 300.);
254 hists_[
"jet2PtRaw_"] = ibooker.book1D(
"Jet2PtRaw",
"pt_{Raw}(jet2)", 60, 0., 300.);
256 hists_[
"dEtaJet1Jet2_"] = ibooker.book1D(
"DEtaJet1Jet2",
"#Delta#eta(jet1,jet2)", 80, -4., 4.);
258 hists_[
"dEtaJet1Lep1_"] = ibooker.book1D(
"DEtaJet1Lep1",
"#Delta#eta(jet1,lep1)", 80, -4., 4.);
260 hists_[
"dEtaLep1MET_"] = ibooker.book1D(
"DEtaLep1MET",
"#Delta#eta(lep1,MET)", 80, -4., 4.);
262 hists_[
"dEtaJet1MET_"] = ibooker.book1D(
"DEtaJet1MET",
"#Delta#eta(jet1,MET)", 80, -4., 4.);
264 hists_[
"dPhiJet1Jet2_"] = ibooker.book1D(
"DPhiJet1Jet2",
"#Delta#phi(jet1,jet2)", 64, -3.2, 3.2);
266 hists_[
"dPhiJet1Lep1_"] = ibooker.book1D(
"DPhiJet1Lep1",
"#Delta#phi(jet1,lep1)", 64, -3.2, 3.2);
268 hists_[
"dPhiLep1MET_"] = ibooker.book1D(
"DPhiLep1MET",
"#Delta#phi(lep1,MET)", 64, -3.2, 3.2);
270 hists_[
"dPhiJet1MET_"] = ibooker.book1D(
"DPhiJet1MET",
"#Delta#phi(jet1,MET)", 64, -3.2, 3.2);
272 hists_[
"diMuonLogger_"] = ibooker.book2D(
"DiMuonLogger",
"Logged DiMuon Events", 8, 0., 8., 10, 0., 10.);
274 hists_[
"diElecLogger_"] = ibooker.book2D(
"DiElecLogger",
"Logged DiElec Events", 8, 0., 8., 10, 0., 10.);
276 hists_[
"elecMuLogger_"] = ibooker.book2D(
"ElecMuLogger",
"Logged ElecMu Events", 8, 0., 8., 10, 0., 10.);
306 fill(
"InstLumi_", dummy);
316 std::vector<const reco::PFCandidate*> isoMuons;
325 if (muonit->muonRef().isNull())
329 if (muon->innerTrack().
isNull())
332 if (muon->isGlobalMuon()) {
333 fill(
"muonDelZ_", muon->innerTrack()->vz());
334 fill(
"muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
338 double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
339 double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
340 double phoEt = muon->pfIsolationR04().sumPhotonEt;
342 double pfRelIso = (chHadPt +
std::max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
345 fill(
"muonRelIso_", pfRelIso);
347 fill(
"muonChHadIso_", chHadPt);
348 fill(
"muonNeHadIso_", neHadEt);
349 fill(
"muonPhIso_", phoEt);
352 isoMuons.push_back(&(*muonit));
357 fill(
"muonMultIso_", isoMuons.size());
368 std::vector<const reco::PFCandidate*> isoElecs;
379 if (elec->gsfElectronRef().isNull()) {
387 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
388 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
389 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
391 (el_ChHadIso +
std::max(0., el_NeHadIso + el_PhIso - 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
393 fill(
"elecRelIso_", el_pfRelIso);
394 fill(
"elecChHadIso_", el_ChHadIso);
395 fill(
"elecNeHadIso_", el_NeHadIso);
396 fill(
"elecPhIso_", el_PhIso);
398 isoElecs.push_back(&(*elec));
402 fill(
"elecMultIso_", isoElecs.size());
415 if (setup.
find(edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>())) {
419 <<
"-----------------------------------------------------------------" 420 "-------------------- \n" 421 <<
" No JetCorrectionsRecord available from EventSetup: " 423 <<
" - Jets will not be corrected. " 425 <<
" - If you want to change this add the following lines to your " 429 <<
" ## load jet corrections " 432 "process.load(\"JetMETCorrections.Configuration." 433 "JetCorrectionServicesAllAlgos_cff\") \n" 434 <<
" process.prefer(\"ak5CaloL2L3\") " 438 <<
"-----------------------------------------------------------------" 439 "-------------------- \n";
443 unsigned int mult = 0;
445 std::vector<reco::Jet> leadingJets;
457 unsigned int idx =
jet - jets->begin();
458 if (
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
463 if (dynamic_cast<const reco::CaloJet*>(&*
jet)) {
467 if (!jetSelect(sel)) {
470 }
else if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
485 for (std::vector<const reco::PFCandidate*>::const_iterator elec = isoElecs.begin(); elec != isoElecs.end();
497 monitorJet.
scaleEnergy(corrector ? corrector->correction(*
jet) : 1.);
500 leadingJets.push_back(monitorJet);
501 fill(
"jet1Pt_", monitorJet.
pt());
506 leadingJets.push_back(monitorJet);
507 fill(
"jet2Pt_", monitorJet.
pt());
512 if (leadingJets.size() > 1) {
513 fill(
"dEtaJet1Jet2_", leadingJets[0].
eta() - leadingJets[1].
eta());
515 if (!isoMuons.empty()) {
516 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
517 fill(
"dEtaJet1Lep1_", isoMuons[0]->
eta() - leadingJets[0].
eta());
521 if (!isoElecs.empty()) {
522 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
523 fill(
"dEtaJet1Lep1_", isoElecs[0]->
eta() - leadingJets[0].
eta());
528 fill(
"jetMult_", mult);
546 if (met->begin() != met->end()) {
547 unsigned int idx = met_ -
mets_.begin();
549 caloMET = *met->begin();
550 fill(
"metCalo_", met->begin()->et());
551 if (!leadingJets.empty()) {
552 fill(
"dEtaJet1MET_", leadingJets[0].
eta() - met->begin()->eta());
555 if (!isoMuons.empty()) {
556 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
557 fill(
"dEtaLep1MET_", isoMuons[0]->
eta() - met->begin()->eta());
561 if (!isoElecs.empty()) {
562 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
563 fill(
"dEtaLep1MET_", isoElecs[0]->
eta() - met->begin()->eta());
569 fill(
"metTC_", met->begin()->et());
572 fill(
"metPflow_", met->begin()->et());
586 fill(
"lepMultIso_", isoMuons.size(), isoElecs.size());
589 fill(
"decayChannel_", 0.5);
590 double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).
mass();
592 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoMuons[0]->
eta());
593 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoMuons[0]->
eta()) / 2);
595 fill(
"elecPt_", isoElecs[0]->
pt());
596 fill(
"muonPt_", isoMuons[0]->
pt());
597 fill(
"lep1Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt() ? isoElecs[0]->
pt() : isoMuons[0]->
pt());
598 fill(
"lep2Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt() ? isoMuons[0]->
pt() : isoElecs[0]->
pt());
610 if (!leadingJets.empty())
612 if (leadingJets.size() > 1)
622 fill(
"decayChannel_", 1.5);
623 int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
624 double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).
mass();
626 fill(charge < 0 ?
"invMass_" :
"invMassWC_", mass);
627 fill(charge < 0 ?
"invMassLog_" :
"invMassWCLog_", log10(mass));
629 fill(
"dEtaL1L2_", isoMuons[0]->
eta() - isoMuons[1]->
eta());
630 fill(
"sumEtaL1L2_", (isoMuons[0]->
eta() + isoMuons[1]->
eta()) / 2);
632 fill(
"muonPt_", isoMuons[0]->
pt());
633 fill(
"muonPt_", isoMuons[1]->
pt());
634 fill(
"lep1Pt_", isoMuons[0]->
pt());
635 fill(
"lep2Pt_", isoMuons[1]->
pt());
647 if (!leadingJets.empty())
649 if (leadingJets.size() > 1)
659 fill(
"decayChannel_", 2.5);
660 int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
661 double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).
mass();
662 fill(charge < 0 ?
"invMass_" :
"invMassWC_", mass);
663 fill(charge < 0 ?
"invMassLog_" :
"invMassWCLog_", log10(mass));
665 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoElecs[1]->
eta());
666 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoElecs[1]->
eta()) / 2);
668 fill(
"elecPt_", isoElecs[0]->
pt());
669 fill(
"elecPt_", isoElecs[1]->
pt());
670 fill(
"lep1Pt_", isoElecs[0]->
pt());
671 fill(
"lep2Pt_", isoElecs[1]->
pt());
680 if (!leadingJets.empty())
682 if (leadingJets.size() > 1)
724 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
727 std::make_pair(
sel_.at(
i),
735 if (
type ==
"muons") {
738 if (
type ==
"elecs") {
744 if (
type ==
"jets") {
748 if (
type ==
"jets/pf") {
752 if (
type ==
"jets/calo") {
765 selIt->second.second->book(ibooker);
780 if (vertex->empty() || !(*vertexSelect_)(vertex->front()))
792 unsigned int nJetSteps = -1;
794 unsigned int nPFJetSteps = -1;
796 unsigned int nCaloJetSteps = -1;
802 if (
type ==
"empty") {
821 if (
JetSteps[nJetSteps] !=
nullptr) {
constexpr double deltaPhi(double phi1, double phi2)
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
T getParameter(std::string const &) const
std::string selectionStep(const std::string &label)
std::vector< std::string > selectionOrder_
EventAuxiliary const & eventAuxiliary() const override
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Jets made from CaloTowers.
virtual void scaleEnergy(double fScale)
scale energy of the jet
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::unique_ptr< SelectionStep< reco::CaloJet > > > CaloJetSteps
Base class for all types of Jets.
edm::EDGetTokenT< std::vector< reco::Vertex > > vertex_
primary vertex
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
double pt() const final
transverse momentum
void loggerBinLabels(std::string hist)
set labels for event logging histograms
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
std::vector< edm::ParameterSet > sel_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Jets made from PFObjects.
electronId
when omitted electron plots will be filled w/o cut on electronId
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
muonExtras
when omitted isolated electron multiplicity plot will be equi- valent to inclusive electron multiplic...
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
std::unique_ptr< SelectionStep< reco::PFCandidate > > MuonStep
double et() const final
transverse energy
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
double lowerEdge_
mass window upper and lower edge
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
triggerExtras
[optional] : when omitted no mass window will be applied for the W mass befor filling the event monit...
std::vector< std::string > elecMuPaths_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
std::unique_ptr< SelectionStep< reco::MET > > METStep
std::string jetCorrector_
jetCorrector
bool isNull() const
Checks for null.
TopDiLeptonOfflineDQM(const edm::ParameterSet &cfg)
default constructor
std::unique_ptr< SelectionStep< reco::PFCandidate > > ElectronStep
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::string label_
instance label
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< std::string, MonitorElement * > hists_
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
Templated helper class to allow a selection on a certain object collection.
select
when omitted electron plots will be filled w/o cut on electronId electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ), when omitted electron plots will be filled w/o additional pre- selection of the electron candidates
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::vector< std::string > triggerPaths_
trigger paths
bool isUninitialized() const
std::string objectType(const std::string &label)
DecayChannel decayChannel(const std::vector< const reco::PFCandidate * > &muons, const std::vector< const reco::PFCandidate * > &elecs) const
determine dileptonic decay channel
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< reco::BeamSpot > beamspot_
beamspot
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
elecExtras
[optional] : when omitted all monitoring plots for primary vertices will be filled w/o extras pvExtra...
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopDiLeptonOffline::MonitorEnsemble > > > selection_
jetExtras
when omitted isolated muon multiplicity plot will be equi- valent to inclusive muon multiplicity plot...
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
monitoring
[optional] : when omitted the verbosity level is set to STANDARD
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps