27 jetIDSelect_(nullptr),
47 elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
53 elecIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
71 muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
77 muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
152 hists_[
"invMass_"] = ibooker.
book1D(
"InvMass",
"M(lep1, lep2)", 80, 0., 320.);
154 hists_[
"invMassLog_"] = ibooker.
book1D(
"InvMassLog",
"log_{10}(M(lep1, lep2))", 80, .1, 2.5);
157 hists_[
"invMassWC_"] = ibooker.
book1D(
"InvMassWC",
"M_{WC}(L1, L2)", 80, 0., 320.);
160 hists_[
"invMassWCLog_"] = ibooker.
book1D(
"InvMassLogWC",
"log_{10}(M_{WC})", 80, .1, 2.5);
162 hists_[
"decayChannel_"] = ibooker.
book1D(
"DecayChannel",
"Decay Channel", 3, 0, 3);
164 hists_[
"elecMuEff_"] = ibooker.
book1D(
"ElecMuEff",
"Eff(e/#mu paths)", nElecMu, 0., nElecMu);
166 hists_[
"elecMuMon_"] = ibooker.
book1D(
"ElecMuMon",
"Mon(e/#mu paths)", nElecMu, 0., nElecMu);
168 hists_[
"diMuonEff_"] = ibooker.
book1D(
"DiMuonEff",
"Eff(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
170 hists_[
"diMuonMon_"] = ibooker.
book1D(
"DiMuonMon",
"Mon(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
172 hists_[
"lep1Pt_"] = ibooker.
book1D(
"Lep1Pt",
"pt(lep1)", 50, 0., 200.);
174 hists_[
"lep2Pt_"] = ibooker.
book1D(
"Lep2Pt",
"pt(lep2)", 50, 0., 200.);
176 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 21, -0.5, 20.5);
178 hists_[
"metCalo_"] = ibooker.
book1D(
"METCalo",
"MET_{Calo}", 50, 0., 200.);
184 hists_[
"decayChannel_"]->setBinLabel(1,
"#mu e", 1);
185 hists_[
"decayChannel_"]->setBinLabel(2,
"#mu #mu", 1);
186 hists_[
"decayChannel_"]->setBinLabel(3,
"e e", 1);
193 hists_[
"sumEtaL1L2_"] = ibooker.
book1D(
"SumEtaL1L2",
"<#eta>(lep1, lep2)", 100, -5., 5.);
195 hists_[
"dEtaL1L2_"] = ibooker.
book1D(
"DEtaL1L2",
"#Delta#eta(lep1,lep2)", 80, -4., 4.);
197 hists_[
"dPhiL1L2_"] = ibooker.
book1D(
"DPhiL1L2",
"#Delta#phi(lep1,lep2)", 64, -3.2, 3.2);
199 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e)", 50, 0., 200.);
202 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e)", 50, 0., 1.);
204 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu)", 50, 0., 200.);
206 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
208 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{L2L3}(jet1)", 60, 0., 300.);
210 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{L2L3}(jet2)", 60, 0., 300.);
212 hists_[
"metPflow_"] = ibooker.
book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
214 hists_[
"metTC_"] = ibooker.
book1D(
"METTC",
"MET_{TC}", 50, 0., 200.);
216 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
218 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -1., 1., 50, -1., 1.);
220 hists_[
"lepMultIso_"] = ibooker.
book2D(
"LepMultIso",
"N_{Iso}(e) vs N_{Iso}(#mu)", 5, 0., 5., 5, 0., 5.);
223 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
224 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
226 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(#mu)", 1);
227 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(elec)", 2);
234 hists_[
"elecMultIso_"] = ibooker.
book1D(
"ElecMultIso",
"N_{Iso}(e)", 11, -0.5, 10.5);
236 hists_[
"muonMultIso_"] = ibooker.
book1D(
"MuonMultIso",
"N_{Iso}(#mu)", 11, -0.5, 10.5);
239 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
242 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
245 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu)", 50, 0., 5.);
248 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e)", 50, 0., 5.);
251 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e)", 50, 0., 5.);
254 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e)", 50, 0., 5.);
256 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta(jet1)", 30, -5., 5.);
258 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta(jet2)", 30, -5., 5.);
260 hists_[
"jet1PtRaw_"] = ibooker.
book1D(
"Jet1PtRaw",
"pt_{Raw}(jet1)", 60, 0., 300.);
262 hists_[
"jet2PtRaw_"] = ibooker.
book1D(
"Jet2PtRaw",
"pt_{Raw}(jet2)", 60, 0., 300.);
264 hists_[
"dEtaJet1Jet2_"] = ibooker.
book1D(
"DEtaJet1Jet2",
"#Delta#eta(jet1,jet2)", 80, -4., 4.);
266 hists_[
"dEtaJet1Lep1_"] = ibooker.
book1D(
"DEtaJet1Lep1",
"#Delta#eta(jet1,lep1)", 80, -4., 4.);
268 hists_[
"dEtaLep1MET_"] = ibooker.
book1D(
"DEtaLep1MET",
"#Delta#eta(lep1,MET)", 80, -4., 4.);
270 hists_[
"dEtaJet1MET_"] = ibooker.
book1D(
"DEtaJet1MET",
"#Delta#eta(jet1,MET)", 80, -4., 4.);
272 hists_[
"dPhiJet1Jet2_"] = ibooker.
book1D(
"DPhiJet1Jet2",
"#Delta#phi(jet1,jet2)", 64, -3.2, 3.2);
274 hists_[
"dPhiJet1Lep1_"] = ibooker.
book1D(
"DPhiJet1Lep1",
"#Delta#phi(jet1,lep1)", 64, -3.2, 3.2);
276 hists_[
"dPhiLep1MET_"] = ibooker.
book1D(
"DPhiLep1MET",
"#Delta#phi(lep1,MET)", 64, -3.2, 3.2);
278 hists_[
"dPhiJet1MET_"] = ibooker.
book1D(
"DPhiJet1MET",
"#Delta#phi(jet1,MET)", 64, -3.2, 3.2);
280 hists_[
"diMuonLogger_"] = ibooker.
book2D(
"DiMuonLogger",
"Logged DiMuon Events", 8, 0., 8., 10, 0., 10.);
282 hists_[
"diElecLogger_"] = ibooker.
book2D(
"DiElecLogger",
"Logged DiElec Events", 8, 0., 8., 10, 0., 10.);
284 hists_[
"elecMuLogger_"] = ibooker.
book2D(
"ElecMuLogger",
"Logged ElecMu Events", 8, 0., 8., 10, 0., 10.);
309 if (!
event.eventAuxiliary().run())
311 fill(
"RunNumb_",
event.eventAuxiliary().run());
324 std::vector<const reco::PFCandidate*> isoMuons;
333 if (muonit->muonRef().isNull())
337 if (
muon->innerTrack().isNull())
340 if (
muon->isGlobalMuon()) {
341 fill(
"muonDelZ_",
muon->innerTrack()->vz());
342 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
346 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
347 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
348 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
350 double pfRelIso = (chHadPt +
std::max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
353 fill(
"muonRelIso_", pfRelIso);
355 fill(
"muonChHadIso_", chHadPt);
356 fill(
"muonNeHadIso_", neHadEt);
357 fill(
"muonPhIso_", phoEt);
360 isoMuons.push_back(&(*muonit));
365 fill(
"muonMultIso_", isoMuons.size());
376 std::vector<const reco::PFCandidate*> isoElecs;
387 if (elec->gsfElectronRef().isNull()) {
395 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
396 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
397 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
399 (el_ChHadIso +
std::max(0., el_NeHadIso + el_PhIso - 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
401 fill(
"elecRelIso_", el_pfRelIso);
402 fill(
"elecChHadIso_", el_ChHadIso);
403 fill(
"elecNeHadIso_", el_NeHadIso);
404 fill(
"elecPhIso_", el_PhIso);
406 isoElecs.push_back(&(*elec));
410 fill(
"elecMultIso_", isoElecs.size());
424 if (correctorHandle.
isValid()) {
428 <<
"-----------------------------------------------------------------" 429 "-------------------- \n" 430 <<
" No JetCorrector available from Event:\n" 431 <<
" - Jets will not be corrected. " 433 <<
"-----------------------------------------------------------------" 434 "-------------------- \n";
438 unsigned int mult = 0;
440 std::vector<reco::Jet> leadingJets;
458 if (dynamic_cast<const reco::CaloJet*>(&*
jet)) {
462 if (!jetSelect(
sel)) {
465 }
else if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
480 for (std::vector<const reco::PFCandidate*>::const_iterator elec = isoElecs.begin(); elec != isoElecs.end();
495 leadingJets.push_back(monitorJet);
496 fill(
"jet1Pt_", monitorJet.
pt());
501 leadingJets.push_back(monitorJet);
502 fill(
"jet2Pt_", monitorJet.
pt());
507 if (leadingJets.size() > 1) {
508 fill(
"dEtaJet1Jet2_", leadingJets[0].
eta() - leadingJets[1].
eta());
510 if (!isoMuons.empty()) {
511 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
512 fill(
"dEtaJet1Lep1_", isoMuons[0]->
eta() - leadingJets[0].
eta());
516 if (!isoElecs.empty()) {
517 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
518 fill(
"dEtaJet1Lep1_", isoElecs[0]->
eta() - leadingJets[0].
eta());
541 if (
met->begin() !=
met->end()) {
542 unsigned int idx = met_ -
mets_.begin();
545 fill(
"metCalo_",
met->begin()->et());
546 if (!leadingJets.empty()) {
547 fill(
"dEtaJet1MET_", leadingJets[0].
eta() -
met->begin()->eta());
550 if (!isoMuons.empty()) {
551 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
552 fill(
"dEtaLep1MET_", isoMuons[0]->
eta() -
met->begin()->eta());
556 if (!isoElecs.empty()) {
557 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
558 fill(
"dEtaLep1MET_", isoElecs[0]->
eta() -
met->begin()->eta());
564 fill(
"metTC_",
met->begin()->et());
567 fill(
"metPflow_",
met->begin()->et());
581 fill(
"lepMultIso_", isoMuons.size(), isoElecs.size());
584 fill(
"decayChannel_", 0.5);
585 double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).
mass();
587 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoMuons[0]->
eta());
588 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoMuons[0]->
eta()) / 2);
590 fill(
"elecPt_", isoElecs[0]->
pt());
591 fill(
"muonPt_", isoMuons[0]->
pt());
592 fill(
"lep1Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt() ? isoElecs[0]->
pt() : isoMuons[0]->
pt());
593 fill(
"lep2Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt() ? isoMuons[0]->
pt() : isoElecs[0]->
pt());
605 if (!leadingJets.empty())
607 if (leadingJets.size() > 1)
617 fill(
"decayChannel_", 1.5);
618 int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
619 double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).
mass();
624 fill(
"dEtaL1L2_", isoMuons[0]->
eta() - isoMuons[1]->
eta());
625 fill(
"sumEtaL1L2_", (isoMuons[0]->
eta() + isoMuons[1]->
eta()) / 2);
627 fill(
"muonPt_", isoMuons[0]->
pt());
628 fill(
"muonPt_", isoMuons[1]->
pt());
629 fill(
"lep1Pt_", isoMuons[0]->
pt());
630 fill(
"lep2Pt_", isoMuons[1]->
pt());
642 if (!leadingJets.empty())
644 if (leadingJets.size() > 1)
654 fill(
"decayChannel_", 2.5);
655 int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
656 double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).
mass();
660 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoElecs[1]->
eta());
661 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoElecs[1]->
eta()) / 2);
663 fill(
"elecPt_", isoElecs[0]->
pt());
664 fill(
"elecPt_", isoElecs[1]->
pt());
665 fill(
"lep1Pt_", isoElecs[0]->
pt());
666 fill(
"lep2Pt_", isoElecs[1]->
pt());
675 if (!leadingJets.empty())
677 if (leadingJets.size() > 1)
688 : vertexSelect_(nullptr),
689 beamspotSelect_(nullptr),
691 ElectronStep(nullptr),
714 std::make_unique<StringCutObjectSelector<reco::BeamSpot>>(
beamspot.getParameter<
std::string>(
"select"));
718 sel_ =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
720 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
723 std::make_pair(
sel_.at(
i),
724 std::make_unique<TopDiLeptonOffline::MonitorEnsemble>(
731 if (
type ==
"muons") {
734 if (
type ==
"elecs") {
740 if (
type ==
"jets") {
743 if (
type ==
"jets/pf") {
746 if (
type ==
"jets/calo") {
759 selIt->second.second->book(ibooker);
774 if (
vertex->empty() || !(*vertexSelect_)(
vertex->front()))
784 unsigned int nJetSteps = -1;
786 unsigned int nPFJetSteps = -1;
788 unsigned int nCaloJetSteps = -1;
794 if (
type ==
"empty") {
811 if (
JetSteps[nJetSteps] !=
nullptr) {
constexpr double deltaPhi(double phi1, double phi2)
Log< level::Info, true > LogVerbatim
std::string selectionStep(const std::string &label)
std::vector< std::string > selectionOrder_
T getParameter(std::string const &) const
Jets made from CaloTowers.
virtual void scaleEnergy(double fScale)
scale energy of the jet
double pt() const final
transverse momentum
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
virtual void setCurrentFolder(std::string const &fullpath)
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)
T const * product() const
constexpr bool isUninitialized() const noexcept
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
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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
edm::EDGetTokenT< reco::JetCorrector > jetCorrector_
jetCorrector
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
DecayChannel decayChannel(const std::vector< const reco::PFCandidate *> &muons, const std::vector< const reco::PFCandidate *> &elecs) const
determine dileptonic decay channel
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
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
std::vector< std::string > elecMuPaths_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
std::unique_ptr< SelectionStep< reco::MET > > METStep
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_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
Templated helper class to allow a selection on a certain object collection.
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
std::string objectType(const std::string &label)
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< reco::BeamSpot > beamspot_
beamspot
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopDiLeptonOffline::MonitorEnsemble > > > selection_
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_
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps