|
|
Go to the documentation of this file.
20 static const double WMASS = 80.4;
28 jetIDSelect_(nullptr),
29 jetlooseSelection_(nullptr),
30 jetSelection_(nullptr),
117 "chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && "
118 "neutralHadronEnergyFraction()<0.99 && neutralEmEnergyFraction()<0.99 && "
119 "(chargedMultiplicity()+neutralMultiplicity())>1"));
183 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{good pvs}", 50, 0., 50.);
185 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu TightId, TightIso)", 40, 0., 200.);
187 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{loose}(#mu)", 10, 0., 10.);
192 hists_[
"muonMultTight_"] = ibooker.
book1D(
"MuonMultTight",
"N_{TightIso,TightId}(#mu)", 10, 0., 10.);
194 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e TightId, TightIso)", 40, 0., 200.);
200 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
202 hists_[
"jetMultLoose_"] = ibooker.
book1D(
"JetMultLoose",
"N_{30, loose}(jet)", 10, 0., 10.);
211 hists_[
"metPflow_"] = ibooker.
book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
213 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
215 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
217 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
226 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId, TightIso)", 30, -3., 3.);
228 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
230 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId, TightIso)", 40, -4., 4.);
232 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e tightId)", 30, -3., 3.);
234 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId, TightIso)", 50, 0., 1.);
236 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e tightId)", 40, -4., 4.);
238 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
"N_{TightIso,TightId}(e)", 10, 0., 10.);
248 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
250 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
252 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
254 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
256 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{30,loose}(jet3)", 60, -3., 3.);
258 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{30,loose}(jet3)", 60, 0., 300.);
260 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{30,loose}(jet4)", 60, -3., 3.);
262 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{30,loose}(jet4)", 60, 0., 300.);
264 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
266 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
269 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
270 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
278 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
281 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
284 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu )", 50, 0., 5.);
287 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e tightId)", 50, 0., 5.);
290 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e tightId)", 50, 0., 5.);
293 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e tightId)", 50, 0., 5.);
296 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
298 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
308 hists_[
"eventLogger_"] = ibooker.
book2D(
"EventLogger",
"Logged Events", 9, 0., 9., 10, 0., 10.);
311 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
312 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
313 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
314 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
315 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{30,loose}(jet1)", 1);
316 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{30,loose}(jet2)", 1);
317 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{30,loose}(jet3)", 1);
318 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{30,loose}(jet4)", 1);
319 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
320 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
321 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
347 unsigned int pvMult = 0;
352 fill(
"pvMult_", pvMult);
365 event.getByLabel(
rhoTag, _rhoHandle);
377 unsigned int eMult = 0, eMultIso = 0;
378 std::vector<const reco::PFCandidate*> isoElecs;
380 if (elec->gsfElectronRef().isNull()) {
390 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
391 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
392 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
393 double absEta = std::fabs(gsf_el->superCluster()->eta());
399 else if (absEta < 1.479)
401 else if (absEta < 2.000)
403 else if (absEta < 2.200)
405 else if (absEta < 2.300)
407 else if (absEta < 2.400)
409 else if (absEta < 5.000)
412 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
413 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) / gsf_el->pt();
417 fill(
"elecRelIso_", el_pfRelIso);
418 fill(
"elecChHadIso_", el_ChHadIso);
419 fill(
"elecNeHadIso_", el_NeHadIso);
420 fill(
"elecPhIso_", el_PhIso);
424 if (!((el_pfRelIso < 0.0588 && absEta < 1.479) || (el_pfRelIso < 0.0571 && absEta > 1.479)))
429 fill(
"elecPt_", elec->pt());
430 fill(
"elecEta_", elec->eta());
431 fill(
"elecPhi_", elec->phi());
438 fill(
"elecMultTight_", eMultIso);
449 unsigned int mMult = 0, mTight = 0, mTightId = 0;
458 if (muonit->muonRef().isNull())
463 if (
muon->isGlobalMuon()) {
464 fill(
"muonDelZ_",
muon->innerTrack()->vz());
465 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
470 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
471 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
472 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
473 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
476 if (!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
477 muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 &&
478 muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
479 muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
480 fabs(
muon->muonBestTrack()->dxy(Pvertex.
position())) < 0.2 &&
481 fabs(
muon->muonBestTrack()->dz(Pvertex.
position())) < 0.5))
485 fill(
"muonRelIso_", pfRelIso);
486 fill(
"muonChHadIso_", chHadPt);
487 fill(
"muonNeHadIso_", neHadEt);
488 fill(
"muonPhIso_", phoEt);
492 if (!(pfRelIso < 0.15))
504 fill(
"muonMult_", mMult);
505 fill(
"muonMultTight_", mTight);
528 std::vector<reco::Jet> correctedJets;
529 std::vector<double> JetTagValues;
530 unsigned int mult = 0, multLoose = 0, multCSV = 0;
538 bool isLoose =
false;
540 if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
557 correctedJets.push_back(monitorJet);
561 fill(
"jetBCSV_", (*btagCSV)[jetRef]);
566 JetTagValues.push_back((*btagCSV)[jetRef]);
570 if (multLoose == 0) {
571 fill(
"jet1Pt_", monitorJet.
pt());
572 fill(
"jet1Eta_", monitorJet.
eta());
574 if (multLoose == 1) {
575 fill(
"jet2Pt_", monitorJet.
pt());
576 fill(
"jet2Eta_", monitorJet.
eta());
578 if (multLoose == 2) {
579 fill(
"jet3Pt_", monitorJet.
pt());
580 fill(
"jet3Eta_", monitorJet.
eta());
582 if (multLoose == 3) {
583 fill(
"jet4Pt_", monitorJet.
pt());
584 fill(
"jet4Eta_", monitorJet.
eta());
590 fill(
"jetMultLoose_", multLoose);
591 fill(
"jetMultBCSVM_", multCSV);
607 if (
met->begin() !=
met->end()) {
608 unsigned int idx = met_ -
mets_.begin();
610 fill(
"metPflow_",
met->begin()->et());
626 double topMass = eventKinematics.
massTopQuark(correctedJets);
627 if (
wMass >= 0 && topMass >= 0) {
629 fill(
"massTop_", topMass);
636 if (correctedJets.size() != JetTagValues.size())
640 fill(
"massBTop_", btopMass);
646 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
650 fill(
"eventLogger_", 1.5,
logged_ + 0.5,
event.eventAuxiliary().luminosityBlock());
652 if (!correctedJets.empty())
653 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
654 if (correctedJets.size() > 1)
655 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
656 if (correctedJets.size() > 2)
657 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
658 if (correctedJets.size() > 3)
659 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
669 : vertexSelect_(nullptr),
671 beamspotSelect_(nullptr),
673 ElectronStep(nullptr),
694 sel_ =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
696 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
699 std::make_pair(
sel_.at(
i),
707 if (
type ==
"muons") {
710 if (
type ==
"elecs") {
716 if (
type ==
"jets") {
720 if (
type ==
"jets/pf") {
724 if (
type ==
"jets/calo") {
736 selIt->second.second->book(ibooker);
756 unsigned int nJetSteps = -1;
757 unsigned int nPFJetSteps = -1;
758 unsigned int nCaloJetSteps = -1;
763 if (
type ==
"empty") {
792 if (
type ==
"jets") {
794 if (
JetSteps[nJetSteps] !=
nullptr) {
802 if (
type ==
"jets/pf") {
812 if (
type ==
"jets/calo") {
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
std::string jetSelect_
extra selection on jets
Base class for all types of Jets.
std::vector< edm::ParameterSet > sel_
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps
edm::EDGetTokenT< reco::BeamSpot > beamspot__
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
std::string label_
instance label
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
static const double WMASS
virtual void setCurrentFolder(std::string const &fullpath)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const Point & position() const
position
double pt() const final
transverse momentum
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
electronId
when omitted electron plots will be filled w/o cut on electronId
Helper class for the calculation of a top and a W boson mass estime.
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton::MonitorEnsemble > > > selection_
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetlooseSelection_
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
std::unique_ptr< SelectionStep< reco::PFCandidate > > ElectronStep
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
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
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
bool isUninitialized() const
std::unique_ptr< SelectionStep< reco::MET > > METStep
std::vector< std::string > triggerPaths_
trigger paths
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonIso_
extra isolation criterion on muon
std::string selectionStep(const std::string &label)
int logged_
number of logged interesting events
std::string objectType(const std::string &label)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double eta() const final
momentum pseudorapidity
std::map< std::string, MonitorElement * > hists_
histogram container
std::unique_ptr< SelectionStep< reco::PFCandidate > > MuonStep
TopSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
std::vector< std::string > selectionOrder_
edm::InputTag beamspot_
beamspot
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
std::vector< std::string > triggerPaths_
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
double lowerEdge_
mass window upper and lower edge
double massBTopQuark(const std::vector< reco::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Jets made from PFObjects.
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
Templated helper class to allow a selection on a certain object collection.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetCorrector > mJetCorrector
std::vector< std::unique_ptr< SelectionStep< reco::CaloJet > > > CaloJetSteps
static const unsigned int MAXJETS
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetSelection_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_