27 static const double WMASS = 80.4;
29 MonitorEnsemble::MonitorEnsemble(
const char*
label,
38 jetIDSelect_(nullptr),
39 jetlooseSelection_(nullptr),
40 jetSelection_(nullptr),
64 elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
86 std::make_unique<StringCutObjectSelector<reco::Vertex>>(
pvExtras.getParameter<
std::string>(
"select"));
95 muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
101 muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
130 "chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && " 131 "neutralHadronEnergyFraction()<0.99 && neutralEmEnergyFraction()<0.99 && " 132 "(chargedMultiplicity()+neutralMultiplicity())>1");
190 hists_[
"pvMult_"] = ibooker.
book1D(
"PvMult",
"N_{good pvs}", 50, 0., 50.);
192 hists_[
"muonPt_"] = ibooker.
book1D(
"MuonPt",
"pt(#mu TightId, TightIso)", 40, 0., 200.);
194 hists_[
"muonMult_"] = ibooker.
book1D(
"MuonMult",
"N_{loose}(#mu)", 10, 0., 10.);
196 hists_[
"muonMultTight_"] = ibooker.
book1D(
"MuonMultTight",
"N_{TightIso,TightId}(#mu)", 10, 0., 10.);
198 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_[
"jetLooseMult_"] = ibooker.
book1D(
"JetLooseMult",
"N_{30,loose}(jet)", 10, 0., 10.);
205 hists_[
"metPflow_"] = ibooker.
book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
207 hists_[
"massW_"] = ibooker.
book1D(
"MassW",
"M(W)", 60, 0., 300.);
209 hists_[
"massTop_"] = ibooker.
book1D(
"MassTop",
"M(Top)", 50, 0., 500.);
211 hists_[
"MTWm_"] = ibooker.
book1D(
"MTWm",
"M_{T}^{W}(#mu)", 60, 0., 300.);
213 hists_[
"mMTT_"] = ibooker.
book1D(
"mMTT",
"M_{T}^{t}(#mu)", 50, 0., 500.);
216 hists_[
"MTWe_"] = ibooker.
book1D(
"MTWe",
"M_{T}^{W}(e)", 60, 0., 300.);
218 hists_[
"eMTT_"] = ibooker.
book1D(
"eMTT",
"M_{T}^{t}(e)", 50, 0., 500.);
229 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId, TightIso)", 30, -3., 3.);
231 hists_[
"muonRelIso_"] = ibooker.
book1D(
"MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
233 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId, TightIso)", 40, -4., 4.);
235 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e tightId, TightIso)", 30, -3., 3.);
237 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId)", 50, 0., 1.);
239 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e tightId, TightIso)", 40, -4., 4.);
241 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
"N_{TightIso,TightId}(e)", 10, 0., 10.);
243 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
245 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
247 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
249 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
252 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
254 hists_[
"muonDelXY_"] = ibooker.
book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
257 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
258 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
266 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
269 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
272 hists_[
"muonPhIso_"] = ibooker.
book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu TightId)", 50, 0., 5.);
275 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e tightId)", 50, 0., 5.);
278 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e tightId)", 50, 0., 5.);
281 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
"Photon_{IsoComponent}(e tightId)", 50, 0., 5.);
284 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
286 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
296 hists_[
"eventLogger_"] = ibooker.
book2D(
"EventLogger",
"Logged Events", 9, 0., 9., 10, 0., 10.);
299 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
300 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
301 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
302 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
303 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{30,loose}(jet1)", 1);
304 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{30,loose}(jet2)", 1);
305 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{30,loose}(jet3)", 1);
306 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{30,loose}(jet4)", 1);
307 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
308 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
309 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
331 unsigned int pvMult = 0;
336 fill(
"pvMult_", pvMult);
349 event.getByLabel(
rhoTag, _rhoHandle);
362 unsigned int eMult = 0, eMultIso = 0;
363 std::vector<const reco::PFCandidate*> isoElecs;
366 if (elec->gsfElectronRef().isNull()) {
376 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
377 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
378 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
379 double absEta =
std::abs(gsf_el->superCluster()->eta());
385 else if (absEta < 1.479)
387 else if (absEta < 2.000)
389 else if (absEta < 2.200)
391 else if (absEta < 2.300)
393 else if (absEta < 2.400)
395 else if (absEta < 5.000)
398 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
399 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) / gsf_el->pt();
403 fill(
"elecRelIso_", el_pfRelIso);
404 fill(
"elecChHadIso_", el_ChHadIso);
405 fill(
"elecNeHadIso_", el_NeHadIso);
406 fill(
"elecPhIso_", el_PhIso);
410 if (!((el_pfRelIso < 0.0588 && absEta < 1.479) || (el_pfRelIso < 0.0571 && absEta > 1.479)))
416 fill(
"elecPt_", gsf_el->pt());
417 fill(
"elecEta_", gsf_el->eta());
418 fill(
"elecPhi_", gsf_el->phi());
425 fill(
"elecMultTight_", eMultIso);
436 unsigned int mMult = 0, mTight = 0, mTightId = 0;
447 if (muonit->muonRef().isNull())
452 if (
muon->isGlobalMuon()) {
453 fill(
"muonDelZ_",
muon->innerTrack()->vz());
454 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
459 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
460 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
461 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
462 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
465 if (!(
muon->isGlobalMuon() &&
muon->isPFMuon() &&
muon->globalTrack()->normalizedChi2() < 10. &&
466 muon->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
muon->numberOfMatchedStations() > 1 &&
467 muon->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
468 muon->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
469 fabs(
muon->muonBestTrack()->dxy(Pvertex.
position())) < 0.2 &&
470 fabs(
muon->muonBestTrack()->dz(Pvertex.
position())) < 0.5))
474 fill(
"muonRelIso_", pfRelIso);
475 fill(
"muonChHadIso_", chHadPt);
476 fill(
"muonNeHadIso_", neHadEt);
477 fill(
"muonPhIso_", phoEt);
481 if (!(pfRelIso < 0.15))
494 fill(
"muonMult_", mMult);
495 fill(
"muonMultTight_", mTight);
518 if (correctorHandle.
isValid()) {
523 <<
"-----------------------------------------------------------------" 524 "-------------------- \n" 525 <<
" No JetCorrector available from Event:\n" 526 <<
" - Jets will not be corrected.\n" 527 <<
"-----------------------------------------------------------------" 528 "-------------------- \n";
532 std::vector<reco::Jet> correctedJets;
533 std::vector<double> JetTagValues;
535 unsigned int mult = 0, multLoose = 0, multCSV = 0;
536 vector<double> bJetDiscVal;
555 if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
571 correctedJets.push_back(monitorJet);
575 fill(
"jetBCSV_", (*btagCSV)[jetRef]);
578 TaggedJetCand = monitorJet;
579 bJetDiscVal.push_back((*btagCSV)[jetRef]);
580 }
else if (multCSV == 1) {
581 bJetDiscVal.push_back((*btagCSV)[jetRef]);
582 if (bJetDiscVal[1] > bJetDiscVal[0])
583 TaggedJetCand = monitorJet;
587 JetTagValues.push_back((*btagCSV)[jetRef]);
591 if (multLoose == 0) {
592 fill(
"jet1Pt_", monitorJet.
pt());
593 fill(
"jet1Eta_", monitorJet.
eta());
595 if (multLoose == 1) {
596 fill(
"jet2Pt_", monitorJet.
pt());
597 fill(
"jet2Eta_", monitorJet.
eta());
603 fill(
"jetMultLoose_", multLoose);
604 fill(
"jetMultBCSVM_", multCSV);
621 if (
met->begin() !=
met->end()) {
622 unsigned int idx = met_ -
mets_.begin();
624 fill(
"metPflow_",
met->begin()->et());
625 mET = *(
met->begin());
641 double topMass = eventKinematics.
massTopQuark(correctedJets);
642 if (
wMass >= 0 && topMass >= 0) {
644 fill(
"massTop_", topMass);
650 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
654 fill(
"eventLogger_", 1.5,
logged_ + 0.5,
event.eventAuxiliary().luminosityBlock());
656 if (!correctedJets.empty())
657 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
658 if (correctedJets.size() > 1)
659 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
660 if (correctedJets.size() > 2)
661 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
662 if (correctedJets.size() > 3)
663 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
669 if (multCSV != 0 && mTight == 1) {
670 double mtW = eventKinematics.
tmassWBoson(&
mu, mET, TaggedJetCand);
676 if (multCSV != 0 && eMultIso == 1) {
677 double mtW = eventKinematics.
tmassWBoson(&
e, mET, TaggedJetCand);
679 double MTT = eventKinematics.
tmassTopQuark(&
e, mET, TaggedJetCand);
686 : vertexSelect_(nullptr),
688 beamspotSelect_(nullptr),
691 ElectronStep(nullptr),
692 PFElectronStep(nullptr),
710 std::make_unique<StringCutObjectSelector<reco::BeamSpot>>(
beamspot.getParameter<
std::string>(
"select"));
713 std::vector<edm::ParameterSet>
sel =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection");
715 for (
unsigned int i = 0;
i <
sel.size(); ++
i) {
718 std::make_pair(
sel.at(
i),
719 std::make_unique<SingleTopTChannelLepton::MonitorEnsemble>(
722 cfg.getParameter<std::vector<edm::ParameterSet>>(
"selection"),
731 if (
type ==
"muons") {
734 if (
type ==
"muons/pf") {
737 if (
type ==
"elecs") {
740 if (
type ==
"elecs/pf") {
746 if (
type ==
"jets") {
749 if (
type ==
"jets/pf") {
752 if (
type ==
"jets/calo") {
764 selIt->second.second->book(ibooker);
783 unsigned int nJetSteps = -1;
784 unsigned int nPFJetSteps = -1;
785 unsigned int nCaloJetSteps = -1;
790 if (
type ==
"empty") {
793 if (
type ==
"presel") {
821 if (
type ==
"jets") {
830 if (
type ==
"jets/pf") {
839 if (
type ==
"jets/calo") {
std::vector< std::string > selectionOrder_
std::map< std::string, MonitorElement * > hists_
Log< level::Info, true > LogVerbatim
std::string objectType(const std::string &label)
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
T getParameter(std::string const &) const
virtual void scaleEnergy(double fScale)
scale energy of the jet
std::vector< std::string > triggerPaths_
trigger paths
Level verbosity_
verbosity level for booking
double pt() const final
transverse momentum
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetlooseSelection_
virtual void setCurrentFolder(std::string const &fullpath)
static const double WMASS
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
const Point & position() const
position
std::vector< ParameterSet > VParameterSet
Base class for all types of Jets.
int logged_
number of logged interesting events
std::vector< std::unique_ptr< SelectionStep< reco::CaloJet > > > CaloJetSteps
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
T const * product() const
constexpr bool isUninitialized() const noexcept
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
edm::InputTag beamspot_
beamspot
std::vector< std::string > triggerPaths_
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Jets made from PFObjects.
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
SingleTopTChannelLeptonDQM(const edm::ParameterSet &cfg)
default constructor
electronId
when omitted electron plots will be filled w/o cut on electronId
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
Helper class for the calculation of a top and a W boson mass estime.
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonIso_
extra isolation criterion on muon
double lowerEdge_
mass window upper and lower edge
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
std::vector< edm::ParameterSet > sel
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Abs< T >::type abs(const T &t)
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
key
prepare the HTCondor submission files and eventually submit them
double tmassTopQuark(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< SelectionStep< reco::PFCandidate > > PFElectronStep
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::EDGetTokenT< reco::JetCorrector > jetCorrector_
jetCorrector
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
std::string selectionStep(const std::string &label)
double tmassWBoson(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
std::unique_ptr< SelectionStep< reco::GsfElectron > > ElectronStep
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
std::unique_ptr< SelectionStep< reco::MET > > METStep
static const unsigned int MAXJETS
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
Templated helper class to allow a selection on a certain object collection.
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
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())
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton::MonitorEnsemble > > > selection_
std::unique_ptr< SelectionStep< reco::Muon > > MuonStep
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
std::unique_ptr< SelectionStep< reco::PFCandidate > > PFMuonStep
std::string label_
instance label
double eta() const final
momentum pseudorapidity