27 static const double WMASS = 80.4;
29 MonitorEnsemble::MonitorEnsemble(
const char*
label,
62 sources.
getParameter<std::vector<edm::InputTag> >(
"mets"))
161 triggerExtras.
getParameter<std::vector<std::string> >(
"paths");
209 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{good pvs}", 50, 0., 50.);
211 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu TightId, TightIso)", 40, 0., 200.);
213 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{loose}(#mu)", 10, 0., 10.);
218 hists_[
"muonMultTight_"] = ibooker.
book1D(
"MuonMultTight",
219 "N_{TightIso,TightId}(#mu)", 10, 0., 10.);
222 hists_[
"elecPt_"] = ibooker.
book1D(
"ElecPt",
"pt(e TightId, TightIso)", 40, 0., 200.);
228 hists_[
"jetMult_"] = ibooker.
book1D(
"JetMult",
"N_{30}(jet)", 10, 0., 10.);
229 hists_[
"jetLooseMult_"] = ibooker.
book1D(
"JetLooseMult",
"N_{30,loose}(jet)", 10, 0., 10.);
238 hists_[
"slimmedMETs_"] = ibooker.
book1D(
"slimmedMETs",
"MET_{slimmed}", 40, 0., 200.);
240 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
242 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
244 hists_[
"massBTop_"] = ibooker.
book1D(
"MassBTop",
"M(Top, 1 b-tag)", 50, 0., 500.);
252 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId,TightIso)", 30, -3., 3.);
254 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId,TightIso)", 40, -4., 4.);
256 "MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
259 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e TightId, TightIso)", 30, -3., 3.);
260 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e TightId, TightIso)", 40, -4., 4.);
262 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId)", 50, 0., 1.);
264 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
265 "N_{TightIso,TightId}(e)", 10, 0., 10.);
277 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
279 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
281 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
283 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
285 hists_[
"jet3Eta_"] = ibooker.
book1D(
"Jet3Eta",
"#eta_{30,loose}(jet3)", 60, -3., 3.);
287 hists_[
"jet3Pt_"] = ibooker.
book1D(
"Jet3Pt",
"pt_{30,loose}(jet3)", 60, 0., 300.);
289 hists_[
"jet4Eta_"] = ibooker.
book1D(
"Jet4Eta",
"#eta_{30,loose}(jet4)", 60, -3., 3.);
291 hists_[
"jet4Pt_"] = ibooker.
book1D(
"Jet4Pt",
"pt_{30,loose}(jet4)", 60, 0., 300.);
293 hists_[
"slimmedMETsNoHF_"] = ibooker.
book1D(
"slimmedMETsNoHF",
"MET_{slimmedNoHF}", 40, 0., 200.);
295 hists_[
"slimmedMETsPuppi_"] = ibooker.
book1D(
"slimmedMETsPuppi",
"MET_{slimmedPuppi}", 40, 0., 200.);
297 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
300 "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
303 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
304 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
311 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
312 "ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
315 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
316 "NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
320 "Photon_{IsoComponent}(#mu TightId)", 50, 0., 5.);
323 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
324 "ChHad_{IsoComponent}(e TightId)", 50, 0., 5.);
327 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
328 "NeHad_{IsoComponent}(e TightId)", 50, 0., 5.);
331 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
332 "Photon_{IsoComponent}(e TightId)", 50, 0., 5.);
347 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
349 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
360 "Logged Events", 9, 0., 9., 10, 0., 10.);
363 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
364 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
365 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
366 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
367 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
368 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
369 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
370 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
371 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
372 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
373 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
398 unsigned int pvMult = 0;
401 pv != pvs->end(); ++
pv) {
403 bool isGood = ( !(
pv->isFake()) &&
404 (
pv->ndof() > 4.0) &&
405 (
abs(
pv->z()) < 24.0) &&
406 (
abs(
pv->position().Rho()) < 2.0)
408 if( !isGood )
continue;
414 fill(
"pvMult_", pvMult);
445 event.getByLabel(
rhoTag,_rhoHandle);
456 unsigned int eMultIso = 0, eMult = 0;
457 std::vector<const pat::Electron*> isoElecs;
461 elec != elecs->end(); ++elec) {
466 double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
467 double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
468 double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
470 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
471 double absEta =
abs(elec->superCluster()->eta());
473 if (absEta < 1.000) eA = 0.1703;
474 else if (absEta < 1.479) eA = 0.1715;
475 else if (absEta < 2.000) eA = 0.1213;
476 else if (absEta < 2.200) eA = 0.1230;
477 else if (absEta < 2.300) eA = 0.1635;
478 else if (absEta < 2.400) eA = 0.1937;
479 else if (absEta < 5.000) eA = 0.2393;
482 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) /elec->pt();
487 fill(
"elecRelIso_", el_pfRelIso);
488 fill(
"elecChHadIso_", el_ChHadIso);
489 fill(
"elecNeHadIso_", el_NeHadIso);
490 fill(
"elecPhIso_", el_PhIso);
496 if(!((el_pfRelIso<0.0588 && absEta<1.479)||(el_pfRelIso<0.0571 && absEta>1.479)))
continue;
501 fill(
"elecPt_", elec->pt());
502 fill(
"elecEta_", elec->eta());
503 fill(
"elecPhi_", elec->phi());
509 fill(
"elecMultTight_", eMultIso);
524 unsigned int mMult = 0, mTight=0;
536 if (
muon->isGlobalMuon()) {
537 fill(
"muonDelZ_",
muon->innerTrack()->vz());
538 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
548 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
549 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
550 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
552 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
muon->pt();
554 if(!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 && fabs(
muon->muonBestTrack()->dxy(pver.
position())) < 0.2 && fabs(
muon->muonBestTrack()->dz(pver.
position())) < 0.5 &&
muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 ) )
continue;
558 fill(
"muonRelIso_", pfRelIso);
559 fill(
"muonChHadIso_", chHadPt);
560 fill(
"muonNeHadIso_", neHadEt);
561 fill(
"muonPhIso_", phoEt);
562 fill(
"muonRelIso_",pfRelIso);
566 if(!(pfRelIso<0.15))
continue;
584 fill(
"muonMult_", mMult);
585 fill(
"muonMultTight_", mTight);
598 std::vector<pat::Jet> correctedJets;
599 std::vector<double> JetTagValues;
600 unsigned int mult = 0, loosemult=0, multBCSVM = 0;
608 jet != jets->end(); ++
jet) {
625 correctedJets.push_back(monitorJet);
628 fill(
"jetBCSV_", monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
629 if (monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags") > 0.89) ++multBCSVM;
634 JetTagValues.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
637 if (loosemult == 1) {
640 fill(
"jet1Pt_", monitorJet.
pt());
642 fill(
"jet1Eta_", monitorJet.
eta());
644 if (loosemult == 2) {
645 fill(
"jet2Pt_", monitorJet.
pt());
647 fill(
"jet2Eta_", monitorJet.
eta());
649 if (loosemult == 3) {
650 fill(
"jet3Pt_", monitorJet.
pt());
652 fill(
"jet3Eta_", monitorJet.
eta());
654 if (loosemult == 4) {
655 fill(
"jet4Pt_", monitorJet.
pt());
657 fill(
"jet4Eta_", monitorJet.
eta());
662 fill(
"jetMult_", mult);
663 fill(
"jetLooseMult_", loosemult);
664 fill(
"jetMultBCSVM_", multBCSVM);
676 met_ =
mets_.begin();
677 met_ !=
mets_.end(); ++met_) {
680 if (met->begin() != met->end()) {
681 unsigned int idx = met_ -
mets_.begin();
682 if (idx == 0)
fill(
"slimmedMETs_", met->begin()->et());
683 if (idx == 1)
fill(
"slimmedMETsNoHF_", met->begin()->et());
684 if (idx == 2)
fill(
"slimmedMETsPuppi_", met->begin()->et());
699 double wMass = eventKinematics.massWBoson(correctedJets);
700 double topMass = eventKinematics.massTopQuark(correctedJets);
701 if (wMass >= 0 && topMass >= 0) {
702 fill(
"massW_", wMass);
703 fill(
"massTop_", topMass);
709 if (correctedJets.size() != JetTagValues.size())
return;
711 eventKinematics.massBTopQuark(correctedJets, JetTagValues, 0.89);
713 if (btopMass >= 0)
fill(
"massBTop_", btopMass);
720 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
728 if(!correctedJets.empty())
fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
729 if (correctedJets.size() > 1)
fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
730 if (correctedJets.size() > 2)
fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
731 if (correctedJets.size() > 3)
fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
778 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
782 std::unique_ptr<TopSingleLepton_miniAOD::MonitorEnsemble>(
787 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
791 if (
type ==
"muons") {
795 if (
type ==
"elecs") {
803 if (
type ==
"jets") {
819 selIt->second.second->book(ibooker);
837 unsigned int nJetSteps = -1;
839 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
843 if (
type ==
"empty") {
865 if (
PvStep->selectVertex(event)) {
872 if (
type ==
"jets") {
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
T getParameter(std::string const &) const
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
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
EventAuxiliary const & eventAuxiliary() const override
double eta() const final
momentum pseudorapidity
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
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
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
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
edm::EDGetTokenT< edm::View< pat::Electron > > elecs_
static const unsigned int MAXJETS
def setup(process, global_tag, zero_tesla=False)
double pt() const final
transverse momentum
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
int neutralMultiplicity() const
neutralMultiplicity
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)
const Point & position() const
position
std::vector< edm::ParameterSet > sel_
std::vector< std::string > selectionOrder_
TopSingleLeptonDQM_miniAOD(const edm::ParameterSet &cfg)
default constructor
LuminosityBlockNumber_t luminosityBlock() const
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)
Abs< T >::type abs(const T &t)
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.
int logged_
number of logged interesting events
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
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
Level verbosity_
verbosity level for booking
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
int chargedMultiplicity() const
chargedMultiplicity
EventNumber_t event() const
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type