12 namespace TopDiLeptonOffline {
38 sources.
getParameter<std::vector<edm::InputTag> >(
"mets"))
117 triggerExtras.
getParameter<std::vector<std::string> >(
"pathsELECMU");
119 triggerExtras.
getParameter<std::vector<std::string> >(
"pathsDIMUON");
155 store_->setCurrentFolder(current);
164 store_->book1D(
"RunNumber",
"Run Nr.", 1.e4, 1.5e5, 3.e5);
166 hists_[
"invMass_"] =
store_->book1D(
"InvMass",
"M(lep1, lep2)", 80, 0., 320.);
169 store_->book1D(
"InvMassLog",
"log_{10}(M(lep1, lep2))", 80, .1, 2.5);
173 store_->book1D(
"InvMassWC",
"M_{WC}(L1, L2)", 80, 0., 320.);
177 store_->book1D(
"InvMassLogWC",
"log_{10}(M_{WC})", 80, .1, 2.5);
180 store_->book1D(
"DecayChannel",
"Decay Channel", 3, 0, 3);
183 store_->book1D(
"ElecMuEff",
"Eff(e/#mu paths)", nElecMu, 0., nElecMu);
186 store_->book1D(
"ElecMuMon",
"Mon(e/#mu paths)", nElecMu, 0., nElecMu);
189 store_->book1D(
"DiMuonEff",
"Eff(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
192 store_->book1D(
"DiMuonMon",
"Mon(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
194 hists_[
"lep1Pt_"] =
store_->book1D(
"Lep1Pt",
"pt(lep1)", 50, 0., 200.);
196 hists_[
"lep2Pt_"] =
store_->book1D(
"Lep2Pt",
"pt(lep2)", 50, 0., 200.);
198 hists_[
"jetMult_"] =
store_->book1D(
"JetMult",
"N_{30}(jet)", 21, -0.5, 20.5);
200 hists_[
"metCalo_"] =
store_->book1D(
"METCalo",
"MET_{Calo}", 50, 0., 200.);
206 hists_[
"decayChannel_"]->setBinLabel(1,
"#mu e", 1);
207 hists_[
"decayChannel_"]->setBinLabel(2,
"#mu #mu", 1);
208 hists_[
"decayChannel_"]->setBinLabel(3,
"e e", 1);
215 store_->book1D(
"SumEtaL1L2",
"<#eta>(lep1, lep2)", 100, -5., 5.);
218 store_->book1D(
"DEtaL1L2",
"#Delta#eta(lep1,lep2)", 80, -4., 4.);
221 store_->book1D(
"DPhiL1L2",
"#Delta#phi(lep1,lep2)", 64, -3.2, 3.2);
223 hists_[
"elecPt_"] =
store_->book1D(
"ElecPt",
"pt(e)", 50, 0., 200.);
227 store_->book1D(
"ElecRelIso",
"Iso_{Rel}(e)", 50, 0., 1.);
229 hists_[
"muonPt_"] =
store_->book1D(
"MuonPt",
"pt(#mu)", 50, 0., 200.);
232 "MuonRelIso",
"Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
234 hists_[
"jet1Pt_"] =
store_->book1D(
"Jet1Pt",
"pt_{L2L3}(jet1)", 60, 0., 300.);
236 hists_[
"jet2Pt_"] =
store_->book1D(
"Jet2Pt",
"pt_{L2L3}(jet2)", 60, 0., 300.);
238 hists_[
"metPflow_"] =
store_->book1D(
"METPflow",
"MET_{Pflow}", 50, 0., 200.);
240 hists_[
"metTC_"] =
store_->book1D(
"METTC",
"MET_{TC}", 50, 0., 200.);
242 hists_[
"muonDelZ_"] =
store_->book1D(
"MuonDelZ",
"d_{z}(#mu)", 50, -25., 25.);
245 store_->book2D(
"MuonDelXY",
"d_{xy}(#mu)", 50, -1., 1., 50, -1., 1.);
248 "LepMultIso",
"N_{Iso}(e) vs N_{Iso}(#mu)", 5, 0., 5., 5, 0., 5.);
251 hists_[
"muonDelXY_"]->setAxisTitle(
"x [cm]", 1);
252 hists_[
"muonDelXY_"]->setAxisTitle(
"y [cm]", 2);
254 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(#mu)", 1);
255 hists_[
"lepMultIso_"]->setAxisTitle(
"N_{Iso}(elec)", 2);
262 store_->book1D(
"ElecMultIso",
"N_{Iso}(e)", 11, -0.5, 10.5);
265 store_->book1D(
"MuonMultIso",
"N_{Iso}(#mu)", 11, -0.5, 10.5);
269 "MuonChHadIsoComp",
"ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
273 "MuonNeHadIsoComp",
"NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
277 store_->book1D(
"MuonPhIsoComp",
"Photon_{IsoComponent}(#mu)", 50, 0., 5.);
281 "ElectronChHadIsoComp",
"ChHad_{IsoComponent}(e)", 50, 0., 5.);
285 "ElectronNeHadIsoComp",
"NeHad_{IsoComponent}(e)", 50, 0., 5.);
288 hists_[
"elecPhIso_"] =
store_->book1D(
"ElectronPhIsoComp",
289 "Photon_{IsoComponent}(e)", 50, 0., 5.);
291 hists_[
"jet1Eta_"] =
store_->book1D(
"Jet1Eta",
"#eta(jet1)", 30, -5., 5.);
293 hists_[
"jet2Eta_"] =
store_->book1D(
"Jet2Eta",
"#eta(jet2)", 30, -5., 5.);
296 store_->book1D(
"Jet1PtRaw",
"pt_{Raw}(jet1)", 60, 0., 300.);
299 store_->book1D(
"Jet2PtRaw",
"pt_{Raw}(jet2)", 60, 0., 300.);
302 store_->book1D(
"DEtaJet1Jet2",
"#Delta#eta(jet1,jet2)", 80, -4., 4.);
305 store_->book1D(
"DEtaJet1Lep1",
"#Delta#eta(jet1,lep1)", 80, -4., 4.);
308 store_->book1D(
"DEtaLep1MET",
"#Delta#eta(lep1,MET)", 80, -4., 4.);
311 store_->book1D(
"DEtaJet1MET",
"#Delta#eta(jet1,MET)", 80, -4., 4.);
314 store_->book1D(
"DPhiJet1Jet2",
"#Delta#phi(jet1,jet2)", 64, -3.2, 3.2);
317 store_->book1D(
"DPhiJet1Lep1",
"#Delta#phi(jet1,lep1)", 64, -3.2, 3.2);
320 store_->book1D(
"DPhiLep1MET",
"#Delta#phi(lep1,MET)", 64, -3.2, 3.2);
323 store_->book1D(
"DPhiJet1MET",
"#Delta#phi(jet1,MET)", 64, -3.2, 3.2);
326 "DiMuonLogger",
"Logged DiMuon Events", 8, 0., 8., 10, 0., 10.);
329 "DiElecLogger",
"Logged DiElec Events", 8, 0., 8., 10, 0., 10.);
332 "ElecMuLogger",
"Logged ElecMu Events", 8, 0., 8., 10, 0., 10.);
361 fill(
"InstLumi_", dummy);
371 std::vector<const reco::PFCandidate*> isoMuons;
379 muonit != muons->end(); ++muonit) {
381 if (muonit->muonRef().isNull())
continue;
384 if (muon->innerTrack().
isNull())
continue;
386 if (muon->isGlobalMuon()) {
387 fill(
"muonDelZ_", muon->innerTrack()->vz());
388 fill(
"muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
393 double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
394 double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
395 double phoEt = muon->pfIsolationR04().sumPhotonEt;
399 max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
402 fill(
"muonRelIso_", pfRelIso);
404 fill(
"muonChHadIso_", chHadPt);
405 fill(
"muonNeHadIso_", neHadEt);
406 fill(
"muonPhIso_", phoEt);
413 fill(
"muonMultIso_", isoMuons.size());
424 std::vector<const reco::PFCandidate*> isoElecs;
433 elec != elecs->end(); ++elec) {
434 if (elec->gsfElectronRef().isNull()) {
443 double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
444 double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
445 double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
448 max(0., el_NeHadIso + el_PhIso -
449 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
451 fill(
"elecRelIso_", el_pfRelIso);
452 fill(
"elecChHadIso_", el_ChHadIso);
453 fill(
"elecNeHadIso_", el_NeHadIso);
454 fill(
"elecPhIso_", el_PhIso);
459 fill(
"elecMultIso_", isoElecs.size());
478 <<
"-----------------------------------------------------------------"
479 "-------------------- \n"
480 <<
" No JetCorrectionsRecord available from EventSetup: "
482 <<
" - Jets will not be corrected. "
484 <<
" - If you want to change this add the following lines to your "
488 <<
" ## load jet corrections "
491 "process.load(\"JetMETCorrections.Configuration."
492 "JetCorrectionServicesAllAlgos_cff\") \n"
493 <<
" process.prefer(\"ak5CaloL2L3\") "
497 <<
"-----------------------------------------------------------------"
498 "-------------------- \n";
502 unsigned int mult = 0;
504 std::vector<reco::Jet> leadingJets;
514 jet != jets->end(); ++
jet) {
515 unsigned int idx =
jet - jets->begin();
517 dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
518 if (!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
521 if (dynamic_cast<const reco::CaloJet*>(&*
jet)) {
525 if (!jetSelect(sel)) {
528 }
else if (dynamic_cast<const reco::PFJet*>(&*
jet)) {
532 if (!jetSelect(sel))
continue;
537 if (!jetSelect(sel))
continue;
541 for (std::vector<const reco::PFCandidate*>::const_iterator elec =
543 elec != isoElecs.end(); ++elec) {
555 monitorJet.
scaleEnergy(corrector ? corrector->correction(*
jet) : 1.);
558 leadingJets.push_back(monitorJet);
559 fill(
"jet1Pt_", monitorJet.
pt());
564 leadingJets.push_back(monitorJet);
565 fill(
"jet2Pt_", monitorJet.
pt());
570 if (leadingJets.size() > 1) {
571 fill(
"dEtaJet1Jet2_", leadingJets[0].
eta() - leadingJets[1].
eta());
572 fill(
"dPhiJet1Jet2_",
574 if (!isoMuons.empty()) {
575 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
576 fill(
"dEtaJet1Lep1_", isoMuons[0]->
eta() - leadingJets[0].
eta());
577 fill(
"dPhiJet1Lep1_",
581 if (!isoElecs.empty()) {
582 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
583 fill(
"dEtaJet1Lep1_", isoElecs[0]->
eta() - leadingJets[0].
eta());
584 fill(
"dPhiJet1Lep1_",
589 fill(
"jetMult_", mult);
602 met_ =
mets_.begin();
603 met_ !=
mets_.end(); ++met_) {
608 if (met->begin() != met->end()) {
609 unsigned int idx = met_ -
mets_.begin();
611 caloMET = *met->begin();
612 fill(
"metCalo_", met->begin()->et());
613 if (!leadingJets.empty()) {
614 fill(
"dEtaJet1MET_", leadingJets[0].
eta() - met->begin()->eta());
618 if (!isoMuons.empty()) {
619 if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
620 fill(
"dEtaLep1MET_", isoMuons[0]->
eta() - met->begin()->eta());
625 if (!isoElecs.empty()) {
626 if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
627 fill(
"dEtaLep1MET_", isoElecs[0]->
eta() - met->begin()->eta());
634 fill(
"metTC_", met->begin()->et());
637 fill(
"metPflow_", met->begin()->et());
651 fill(
"lepMultIso_", isoMuons.size(), isoElecs.size());
654 fill(
"decayChannel_", 0.5);
655 double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).mass();
659 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoMuons[0]->
eta());
660 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoMuons[0]->
eta()) / 2);
662 fill(
"elecPt_", isoElecs[0]->
pt());
663 fill(
"muonPt_", isoMuons[0]->
pt());
664 fill(
"lep1Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt()
666 : isoMuons[0]->
pt());
667 fill(
"lep2Pt_", isoElecs[0]->
pt() > isoMuons[0]->
pt()
669 : isoElecs[0]->
pt());
684 if (leadingJets.size() > 0)
686 if (leadingJets.size() > 1)
696 fill(
"decayChannel_", 1.5);
697 int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
698 double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).mass();
700 fill(charge < 0 ?
"invMass_" :
"invMassWC_", mass);
701 fill(charge < 0 ?
"invMassLog_" :
"invMassWCLog_", log10(mass));
704 fill(
"dEtaL1L2_", isoMuons[0]->
eta() - isoMuons[1]->
eta());
705 fill(
"sumEtaL1L2_", (isoMuons[0]->
eta() + isoMuons[1]->
eta()) / 2);
707 fill(
"muonPt_", isoMuons[0]->
pt());
708 fill(
"muonPt_", isoMuons[1]->
pt());
709 fill(
"lep1Pt_", isoMuons[0]->
pt());
710 fill(
"lep2Pt_", isoMuons[1]->
pt());
725 if (leadingJets.size() > 0)
727 if (leadingJets.size() > 1)
737 fill(
"decayChannel_", 2.5);
738 int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
739 double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).mass();
740 fill(charge < 0 ?
"invMass_" :
"invMassWC_", mass);
741 fill(charge < 0 ?
"invMassLog_" :
"invMassWCLog_", log10(mass));
744 fill(
"dEtaL1L2_", isoElecs[0]->
eta() - isoElecs[1]->
eta());
745 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta() + isoElecs[1]->
eta()) / 2);
747 fill(
"elecPt_", isoElecs[0]->
pt());
748 fill(
"elecPt_", isoElecs[1]->
pt());
749 fill(
"lep1Pt_", isoElecs[0]->
pt());
750 fill(
"lep2Pt_", isoElecs[1]->
pt());
762 if (leadingJets.size() > 0)
764 if (leadingJets.size() > 1)
797 vertex_ = consumes<std::vector<reco::Vertex> >(
812 std::vector<edm::ParameterSet>
sel =
813 cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
814 for (
unsigned int i = 0;
i < sel.size(); ++
i) {
822 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
826 if (
type ==
"muons") {
830 if (
type ==
"elecs") {
838 if (
type ==
"jets") {
842 if (
type ==
"jets/pf") {
846 if (
type ==
"jets/calo") {
868 if (vertex->empty() || !(*vertexSelect_)(vertex->front()))
return;
875 unsigned int passed = 0;
877 unsigned int nJetSteps = -1;
879 unsigned int nPFJetSteps = -1;
881 unsigned int nCaloJetSteps = -1;
883 for (std::vector<std::string>::const_iterator selIt =
selectionOrder_.begin();
887 if (
type ==
"empty") {
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
T getParameter(std::string const &) const
std::string selectionStep(const std::string &label)
DQMStore * store_
storage manager
std::vector< std::string > selectionOrder_
std::map< std::string, std::pair< edm::ParameterSet, TopDiLeptonOffline::MonitorEnsemble * > > selection_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Jets made from CaloTowers.
bool select(const edm::Event &event)
apply selection
Level verbosity_
verbosity level for booking
virtual float pt() const
transverse momentum
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
virtual double et() const
transverse energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
SelectionStep< reco::MET > * METStep
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)
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
SelectionStep< reco::PFCandidate > * ElectronStep
void loggerBinLabels(std::string hist)
set labels for event logging histograms
virtual void scaleEnergy(double fScale)
scale energy of the jet
double deltaR(const T1 &t1, const T2 &t2)
SelectionStep< reco::Vertex > * PvStep
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.
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
SelectionStep< reco::PFCandidate > * MuonStep
std::vector< SelectionStep< reco::CaloJet > * > CaloJetSteps
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
StringCutObjectSelector< reco::PFCandidate > * elecIso_
extra isolation criterion on electron
const T & max(const T &a, const T &b)
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::string jetCorrector_
jetCorrector
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isNull() const
Checks for null.
StringCutObjectSelector< reco::PFCandidate, true > * muonIso_
extra isolation criterion on muon
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
TopDiLeptonOfflineDQM(const edm::ParameterSet &cfg)
default constructor
void book(std::string directory)
book histograms in subdirectory directory
StringCutObjectSelector< reco::PFCandidate > * elecSelect_
extra selection on electrons
double deltaPhi(double phi1, double phi2)
EventAuxiliary const & eventAuxiliary() const
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::string label_
instance label
std::vector< SelectionStep< reco::Jet > * > JetSteps
std::map< std::string, MonitorElement * > hists_
histogram container
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::vector< std::string > triggerPaths_
trigger paths
static EventSetupRecordKey makeKey()
bool isUninitialized() const
std::string objectType(const std::string &label)
StringCutObjectSelector< reco::PFCandidate, true > * muonSelect_
extra selection on muons
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
std::vector< SelectionStep< reco::PFJet > * > PFJetSteps
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< reco::BeamSpot > beamspot_
beamspot
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
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_