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.);
247 hists_[
"MTWm_"] = ibooker.
book1D(
"MTWm",
"M_{T}^{W}(#mu)", 60, 0., 300.);
249 hists_[
"mMTT_"] = ibooker.
book1D(
"mMTT",
"M_{T}^{t}(#mu)", 50, 0., 500.);
252 hists_[
"MTWe_"] = ibooker.
book1D(
"MTWe",
"M_{T}^{W}(e)", 60, 0., 300.);
254 hists_[
"eMTT_"] = ibooker.
book1D(
"eMTT",
"M_{T}^{t}(e)", 50, 0., 500.);
265 hists_[
"muonEta_"] = ibooker.
book1D(
"MuonEta",
"#eta(#mu TightId,TightIso)", 30, -3., 3.);
267 hists_[
"muonPhi_"] = ibooker.
book1D(
"MuonPhi",
"#phi(#mu TightId,TightIso)", 40, -4., 4.);
269 "MuonRelIso",
"Iso_{Rel}(#mu TightId) (#Delta#beta Corrected)", 50, 0., 1.);
272 hists_[
"elecEta_"] = ibooker.
book1D(
"ElecEta",
"#eta(e TightId, TightIso)", 30, -3., 3.);
273 hists_[
"elecPhi_"] = ibooker.
book1D(
"ElecPhi",
"#phi(e TightId, TightIso)", 40, -4., 4.);
275 hists_[
"elecRelIso_"] = ibooker.
book1D(
"ElecRelIso",
"Iso_{Rel}(e TightId)", 50, 0., 1.);
277 hists_[
"elecMultTight_"] = ibooker.
book1D(
"ElecMultTight",
278 "N_{TightIso,TightId}(e)", 10, 0., 10.);
290 hists_[
"jet1Eta_"] = ibooker.
book1D(
"Jet1Eta",
"#eta_{30,loose}(jet1)", 60, -3., 3.);
292 hists_[
"jet1Pt_"] = ibooker.
book1D(
"Jet1Pt",
"pt_{30,loose}(jet1)", 60, 0., 300.);
294 hists_[
"jet2Eta_"] = ibooker.
book1D(
"Jet2Eta",
"#eta_{30,loose}(jet2)", 60, -3., 3.);
296 hists_[
"jet2Pt_"] = ibooker.
book1D(
"Jet2Pt",
"pt_{30,loose}(jet2)", 60, 0., 300.);
306 hists_[
"slimmedMETsNoHF_"] = ibooker.
book1D(
"slimmedMETsNoHF",
"MET_{slimmedNoHF}", 40, 0., 200.);
308 hists_[
"slimmedMETsPuppi_"] = ibooker.
book1D(
"slimmedMETsPuppi",
"MET_{slimmedPuppi}", 40, 0., 200.);
310 hists_[
"muonDelZ_"] = ibooker.
book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
313 "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
316 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
317 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
324 hists_[
"muonChHadIso_"] = ibooker.
book1D(
"MuonChHadIsoComp",
325 "ChHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
328 hists_[
"muonNeHadIso_"] = ibooker.
book1D(
"MuonNeHadIsoComp",
329 "NeHad_{IsoComponent}(#mu TightId)", 50, 0., 5.);
333 "Photon_{IsoComponent}(#mu TightId)", 50, 0., 5.);
336 hists_[
"elecChHadIso_"] = ibooker.
book1D(
"ElectronChHadIsoComp",
337 "ChHad_{IsoComponent}(e TightId)", 50, 0., 5.);
340 hists_[
"elecNeHadIso_"] = ibooker.
book1D(
"ElectronNeHadIsoComp",
341 "NeHad_{IsoComponent}(e TightId)", 50, 0., 5.);
344 hists_[
"elecPhIso_"] = ibooker.
book1D(
"ElectronPhIsoComp",
345 "Photon_{IsoComponent}(e TightId)", 50, 0., 5.);
360 hists_[
"jetMultBCSVM_"] = ibooker.
book1D(
"JetMultBCSVM",
"N_{30}(CSVM)", 10, 0., 10.);
362 hists_[
"jetBCSV_"] = ibooker.
book1D(
"JetDiscCSV",
"BJet Disc_{CSV}(JET)", 100, -1., 2.);
373 "Logged Events", 9, 0., 9., 10, 0., 10.);
376 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
377 hists_[
"eventLogger_"]->setBinLabel(1,
"Run", 1);
378 hists_[
"eventLogger_"]->setBinLabel(2,
"Block", 1);
379 hists_[
"eventLogger_"]->setBinLabel(3,
"Event", 1);
380 hists_[
"eventLogger_"]->setBinLabel(4,
"pt_{L2L3}(jet1)", 1);
381 hists_[
"eventLogger_"]->setBinLabel(5,
"pt_{L2L3}(jet2)", 1);
382 hists_[
"eventLogger_"]->setBinLabel(6,
"pt_{L2L3}(jet3)", 1);
383 hists_[
"eventLogger_"]->setBinLabel(7,
"pt_{L2L3}(jet4)", 1);
384 hists_[
"eventLogger_"]->setBinLabel(8,
"M_{W}", 1);
385 hists_[
"eventLogger_"]->setBinLabel(9,
"M_{Top}", 1);
386 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts", 2);
411 unsigned int pvMult = 0;
414 pv != pvs->end(); ++
pv) {
416 bool isGood = ( !(
pv->isFake()) &&
417 (
pv->ndof() > 4.0) &&
418 (
abs(
pv->z()) < 24.0) &&
419 (
abs(
pv->position().Rho()) < 2.0)
421 if( !isGood )
continue;
427 fill(
"pvMult_", pvMult);
458 event.getByLabel(
rhoTag,_rhoHandle);
469 unsigned int eMultIso = 0, eMult = 0;
470 std::vector<const pat::Electron*> isoElecs;
475 elec != elecs->end(); ++elec) {
480 double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
481 double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
482 double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
484 double rho = _rhoHandle.
isValid() ? (
float)(*_rhoHandle) : 0;
485 double absEta =
abs(elec->superCluster()->eta());
487 if (absEta < 1.000) eA = 0.1703;
488 else if (absEta < 1.479) eA = 0.1715;
489 else if (absEta < 2.000) eA = 0.1213;
490 else if (absEta < 2.200) eA = 0.1230;
491 else if (absEta < 2.300) eA = 0.1635;
492 else if (absEta < 2.400) eA = 0.1937;
493 else if (absEta < 5.000) eA = 0.2393;
496 double el_pfRelIso = (el_ChHadIso +
max(0., el_NeHadIso + el_PhIso - rho * eA)) /elec->pt();
501 fill(
"elecRelIso_", el_pfRelIso);
502 fill(
"elecChHadIso_", el_ChHadIso);
503 fill(
"elecNeHadIso_", el_NeHadIso);
504 fill(
"elecPhIso_", el_PhIso);
510 if(!((el_pfRelIso<0.0588 && absEta<1.479)||(el_pfRelIso<0.0571 && absEta>1.479)))
continue;
518 fill(
"elecPt_", elec->pt());
519 fill(
"elecEta_", elec->eta());
520 fill(
"elecPhi_", elec->phi());
526 fill(
"elecMultTight_", eMultIso);
541 unsigned int mMult = 0, mTight=0;
556 if (
muon->isGlobalMuon()) {
557 fill(
"muonDelZ_",
muon->innerTrack()->vz());
558 fill(
"muonDelXY_",
muon->innerTrack()->vx(),
muon->innerTrack()->vy());
568 double chHadPt =
muon->pfIsolationR04().sumChargedHadronPt;
569 double neHadEt =
muon->pfIsolationR04().sumNeutralHadronEt;
570 double phoEt =
muon->pfIsolationR04().sumPhotonEt;
572 double pfRelIso = (chHadPt +
max(0., neHadEt + phoEt - 0.5 *
muon->pfIsolationR04().sumPUPt)) /
muon->pt();
574 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;
578 fill(
"muonRelIso_", pfRelIso);
579 fill(
"muonChHadIso_", chHadPt);
580 fill(
"muonNeHadIso_", neHadEt);
581 fill(
"muonPhIso_", phoEt);
582 fill(
"muonRelIso_",pfRelIso);
586 if(!(pfRelIso<0.15))
continue;
603 fill(
"muonMult_", mMult);
604 fill(
"muonMultTight_", mTight);
617 std::vector<pat::Jet> correctedJets;
618 std::vector<double> JetTagValues;
620 vector<double> bJetDiscVal;
622 unsigned int mult = 0, loosemult=0, multBCSVM = 0;
630 jet != jets->end(); ++
jet) {
650 correctedJets.push_back(monitorJet);
653 fill(
"jetBCSV_", monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
654 if (monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags") > 0.89){
657 TaggedJetCand = monitorJet;
658 bJetDiscVal.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
659 }
else if(multBCSVM == 1){
660 bJetDiscVal.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
661 if (bJetDiscVal[1] > bJetDiscVal[0]) TaggedJetCand = monitorJet;
671 JetTagValues.push_back(monitorJet.
bDiscriminator(
"pfCombinedInclusiveSecondaryVertexV2BJetTags"));
674 if (loosemult == 1) {
677 fill(
"jet1Pt_", monitorJet.
pt());
679 fill(
"jet1Eta_", monitorJet.
eta());
681 if (loosemult == 2) {
682 fill(
"jet2Pt_", monitorJet.
pt());
684 fill(
"jet2Eta_", monitorJet.
eta());
689 fill(
"jetMult_", mult);
690 fill(
"jetLooseMult_", loosemult);
691 fill(
"jetMultBCSVM_", multBCSVM);
706 met_ =
mets_.begin();
707 met_ !=
mets_.end(); ++met_) {
710 if (met->begin() != met->end()) {
711 unsigned int idx = met_ -
mets_.begin();
712 if (idx == 0)
fill(
"slimmedMETs_", met->begin()->et());
713 if (idx == 1)
fill(
"slimmedMETsNoHF_", met->begin()->et());
714 if (idx == 2)
fill(
"slimmedMETsPuppi_", met->begin()->et());
729 double wMass = eventKinematics.massWBoson(correctedJets);
730 double topMass = eventKinematics.massTopQuark(correctedJets);
731 if (wMass >= 0 && topMass >= 0) {
732 fill(
"massW_", wMass);
733 fill(
"massTop_", topMass);
750 if (
logged_ <=
hists_.find(
"eventLogger_")->second->getNbinsY()) {
756 if (correctedJets.size() > 0)
757 fill(
"eventLogger_", 3.5,
logged_ + 0.5, correctedJets[0].
pt());
758 if (correctedJets.size() > 1)
759 fill(
"eventLogger_", 4.5,
logged_ + 0.5, correctedJets[1].
pt());
760 if (correctedJets.size() > 2)
761 fill(
"eventLogger_", 5.5,
logged_ + 0.5, correctedJets[2].
pt());
762 if (correctedJets.size() > 3)
763 fill(
"eventLogger_", 6.5,
logged_ + 0.5, correctedJets[3].
pt());
771 if (multBCSVM != 0 && mTight == 1) {
773 double mtW = eventKinematics.tmassWBoson(&mu, mET, TaggedJetCand);
775 double MTT = eventKinematics.tmassTopQuark(&mu, mET, TaggedJetCand);
779 if (multBCSVM != 0 && eMultIso == 1) {
780 double mtW = eventKinematics.tmassWBoson(&e, mET, TaggedJetCand);
782 double MTT = eventKinematics.tmassTopQuark(&e, mET, TaggedJetCand);
825 for (
unsigned int i = 0;
i <
sel_.size(); ++
i) {
829 std::unique_ptr<SingleTopTChannelLepton_miniAOD::MonitorEnsemble>(
834 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
838 if (
type ==
"muons") {
842 if (
type ==
"elecs") {
850 if (
type ==
"jets") {
866 selIt->second.second->book(ibooker);
884 unsigned int nJetSteps = -1;
886 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
890 if (
type ==
"empty") {
912 if (
PvStep->selectVertex(event)) {
919 if (
type ==
"jets") {
Analysis-level MET class.
std::vector< std::string > selectionOrder_
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
EventAuxiliary const & eventAuxiliary() const override
std::map< std::string, MonitorElement * > hists_
histogram container
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
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::vector< std::string > triggerPaths_
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< edm::View< pat::Electron > > elecs_
Level verbosity_
verbosity level for booking
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
def setup(process, global_tag, zero_tesla=False)
double pt() const final
transverse momentum
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
int neutralMultiplicity() const
neutralMultiplicity
static const double WMASS
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)
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecIso_
extra isolation criterion on electron
const Point & position() const
position
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
input sources for monitoring
double lowerEdge_
mass window upper and lower edge
std::string jetCorrector_
jetCorrector
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int logged_
number of logged interesting events
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
MonitorElement * book1D(Args &&...args)
std::string objectType(const std::string &label)
Abs< T >::type abs(const T &t)
std::vector< edm::ParameterSet > sel_
edm::InputTag beamspot_
beamspot
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecSelect_
extra selection on electrons
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< std::string > triggerPaths_
trigger paths
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
Analysis-level electron class.
Analysis-level calorimeter jet class.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Templated helper class to allow a selection on a certain object collection.
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::unique_ptr< StringCutObjectSelector< pat::Jet > > jetSelect
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
bool isUninitialized() const
std::string label_
instance label
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
std::vector< edm::EDGetTokenT< edm::View< pat::MET > > > mets_
considers a vector of METs
SingleTopTChannelLeptonDQM_miniAOD(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
Analysis-level muon class.
int chargedMultiplicity() const
chargedMultiplicity
EventNumber_t event() const
static const unsigned int MAXJETS
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep