CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TopDiLeptonOffline::MonitorEnsemble Class Reference

#include <TopDiLeptonOfflineDQM.h>

Public Types

enum  DecayChannel { NONE, DIMUON, DIELEC, ELECMU }
 different decay channels More...
 
enum  Level { STANDARD, VERBOSE, DEBUG }
 different verbosity levels More...
 
typedef reco::LeafCandidate::LorentzVector LorentzVector
 

Public Member Functions

void book (DQMStore::IBooker &ibooker)
 book histograms in subdirectory directory More...
 
void fill (const edm::Event &event, const edm::EventSetup &setup)
 fill monitor histograms with electronId and jetCorrections More...
 
 MonitorEnsemble (const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 ~MonitorEnsemble ()
 default destructor More...
 

Private Member Functions

bool booked (const std::string histName) const
 check if histogram was booked More...
 
DecayChannel decayChannel (const std::vector< const reco::PFCandidate * > &muons, const std::vector< const reco::PFCandidate * > &elecs) const
 determine dileptonic decay channel More...
 
void fill (const edm::Event &event, const edm::TriggerResults &triggerTable, std::string channel, const std::vector< std::string > labels) const
 fill trigger monitoring histograms More...
 
void fill (const std::string histName, double value) const
 fill histogram if it had been booked before More...
 
void fill (const std::string histName, double xValue, double yValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
void fill (const std::string histName, double xValue, double yValue, double zValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
void loggerBinLabels (std::string hist)
 set labels for event logging histograms More...
 
std::string monitorPath (const std::string &label) const
 
std::string selectionPath (const std::string &label) const
 
void triggerBinLabels (std::string channel, const std::vector< std::string > labels)
 set configurable labels for trigger monitoring histograms More...
 

Private Attributes

int diElecLogged_
 
int diMuonLogged_
 
std::vector< std::string > diMuonPaths_
 trigger paths for di muon channel More...
 
std::string directory_
 
double eidCutValue_
 
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
 extra isolation criterion on electron More...
 
int elecMuLogged_
 number of logged interesting events More...
 
std::vector< std::string > elecMuPaths_
 
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
 
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
 extra selection on electrons More...
 
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
 electronId label More...
 
std::map< std::string, MonitorElement * > hists_
 
std::string jetCorrector_
 jetCorrector More...
 
edm::EDGetTokenT< reco::JetIDValueMapjetIDLabel_
 jetID as an extra selection type More...
 
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
 extra jetID selection on calo jets More...
 
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
 input sources for monitoring More...
 
std::string jetSelect_
 
std::string label_
 instance label More...
 
double lowerEdge_
 mass window upper and lower edge More...
 
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
 considers a vector of METs More...
 
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
 
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
 extra selection on muons More...
 
edm::EDGetTokenT< edm::TriggerResultstriggerTable_
 trigger table More...
 
double upperEdge_
 
Level verbosity_
 verbosity level for booking More...
 

Detailed Description

Definition at line 52 of file TopDiLeptonOfflineDQM.h.

Member Typedef Documentation

◆ LorentzVector

make clear which LorentzVector to use for jet, electrons and muon buffering

Definition at line 58 of file TopDiLeptonOfflineDQM.h.

Member Enumeration Documentation

◆ DecayChannel

different decay channels

Enumerator
NONE 
DIMUON 
DIELEC 
ELECMU 

Definition at line 60 of file TopDiLeptonOfflineDQM.h.

60 { NONE, DIMUON, DIELEC, ELECMU };

◆ Level

different verbosity levels

Enumerator
STANDARD 
VERBOSE 
DEBUG 

Definition at line 55 of file TopDiLeptonOfflineDQM.h.

55 { STANDARD, VERBOSE, DEBUG };

Constructor & Destructor Documentation

◆ MonitorEnsemble()

MonitorEnsemble::MonitorEnsemble ( const char *  label,
const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)

default contructor MonitorEnsemble(const char* label, const edm::ParameterSet& cfg);

Definition at line 17 of file TopDiLeptonOfflineDQM.cc.

18  : label_(label),
19  eidCutValue_(0.),
20  elecIso_(nullptr),
21  elecSelect_(nullptr),
22  muonIso_(nullptr),
23  muonSelect_(nullptr),
24  jetIDSelect_(nullptr),
25  lowerEdge_(-1.),
26  upperEdge_(-1.),
27  elecMuLogged_(0),
28  diMuonLogged_(0),
29  diElecLogged_(0) {
30  // sources have to be given; this PSet is not optional
31  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
34  jets_ = iC.consumes<edm::View<reco::Jet>>(sources.getParameter<edm::InputTag>("jets"));
35  for (edm::InputTag const& tag : sources.getParameter<std::vector<edm::InputTag>>("mets"))
36  mets_.push_back(iC.consumes<edm::View<reco::MET>>(tag));
37 
38  // elecExtras are optional; they may be omitted or empty
39  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
40  edm::ParameterSet elecExtras = cfg.getParameter<edm::ParameterSet>("elecExtras");
41  // select is optional; in case it's not found no
42  // selection will be applied
43  if (elecExtras.existsAs<std::string>("select")) {
44  elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
45  elecExtras.getParameter<std::string>("select"));
46  }
47  // isolation is optional; in case it's not found no
48  // isolation will be applied
49  if (elecExtras.existsAs<std::string>("isolation")) {
50  elecIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
51  elecExtras.getParameter<std::string>("isolation"));
52  }
53  // electronId is optional; in case it's not found the
54  // InputTag will remain empty
55  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
56  edm::ParameterSet elecId = elecExtras.getParameter<edm::ParameterSet>("electronId");
58  eidCutValue_ = elecId.getParameter<double>("cutValue");
59  // eidPattern_= elecId.getParameter<int>("pattern");
60  }
61  }
62  // muonExtras are optional; they may be omitted or empty
63  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
64  edm::ParameterSet muonExtras = cfg.getParameter<edm::ParameterSet>("muonExtras");
65  // select is optional; in case it's not found no
66  // selection will be applied
67  if (muonExtras.existsAs<std::string>("select")) {
68  muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
69  muonExtras.getParameter<std::string>("select"));
70  }
71  // isolation is optional; in case it's not found no
72  // isolation will be applied
73  if (muonExtras.existsAs<std::string>("isolation")) {
74  muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
75  muonExtras.getParameter<std::string>("isolation"));
76  }
77  }
78  // jetExtras are optional; they may be omitted or empty
79  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
80  edm::ParameterSet jetExtras = cfg.getParameter<edm::ParameterSet>("jetExtras");
81  // jetCorrector is optional; in case it's not found
82  // the InputTag will remain empty
83  if (jetExtras.existsAs<std::string>("jetCorrector")) {
84  jetCorrector_ = jetExtras.getParameter<std::string>("jetCorrector");
85  }
86  // read jetID information if it exists
87  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
88  edm::ParameterSet jetID = jetExtras.getParameter<edm::ParameterSet>("jetID");
90  jetIDSelect_ =
91  std::make_unique<StringCutObjectSelector<reco::JetID>>(jetID.getParameter<std::string>("select"));
92  }
93  // select is optional; in case it's not found no
94  // selection will be applied (only implemented for
95  // CaloJets at the moment)
96  if (jetExtras.existsAs<std::string>("select")) {
97  jetSelect_ = jetExtras.getParameter<std::string>("select");
98  }
99  }
100  // triggerExtras are optional; they may be omitted or empty
101  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
102  edm::ParameterSet triggerExtras = cfg.getParameter<edm::ParameterSet>("triggerExtras");
104  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsELECMU");
105  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsDIMUON");
106  }
107  // massExtras is optional; in case it's not found no mass
108  // window cuts are applied for the same flavor monitor
109  // histograms
110  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
111  edm::ParameterSet massExtras = cfg.getParameter<edm::ParameterSet>("massExtras");
112  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
113  upperEdge_ = massExtras.getParameter<double>("upperEdge");
114  }
115 
116  // setup the verbosity level for booking histograms;
117  // per default the verbosity level will be set to
118  // STANDARD. This will also be the chosen level in
119  // the case when the monitoring PSet is not found
121  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
122  edm::ParameterSet monitoring = cfg.getParameter<edm::ParameterSet>("monitoring");
123  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
124  verbosity_ = DEBUG;
125  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
127  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
129  }
130  // and don't forget to do the histogram booking
131  directory_ = cfg.getParameter<std::string>("directory");
132  }

References looper::cfg, DEBUG, diMuonPaths_, directory_, eidCutValue_, singleTopDQM_cfi::elecExtras, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::getParameter(), jetCorrector_, singleTopDQM_cfi::jetExtras, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, singleTopDQM_cfi::massExtras, mets_, singleTopDQM_cfi::monitoring, singleTopDQM_cfi::muonExtras, muonIso_, muons_, muonSelect_, CalibrationSummaryClient_cfi::sources, STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

◆ ~MonitorEnsemble()

TopDiLeptonOffline::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 67 of file TopDiLeptonOfflineDQM.h.

67 {};

Member Function Documentation

◆ book()

void MonitorEnsemble::book ( DQMStore::IBooker ibooker)

book histograms in subdirectory directory

Definition at line 134 of file TopDiLeptonOfflineDQM.cc.

134  {
135  // set up the current directory path
136  std::string current(directory_);
137  current += label_;
138  ibooker.setCurrentFolder(current);
139 
140  // determine number of bins for trigger monitoring
141  unsigned int nElecMu = elecMuPaths_.size();
142  unsigned int nDiMuon = diMuonPaths_.size();
143 
144  // --- [STANDARD] --- //
145  // Run Number
146  hists_["RunNumb_"] = ibooker.book1D("RunNumber", "Run Nr.", 1.e4, 1.5e5, 3.e5);
147  // invariant mass of opposite charge lepton pair (only filled for same flavor)
148  hists_["invMass_"] = ibooker.book1D("InvMass", "M(lep1, lep2)", 80, 0., 320.);
149  // invariant mass of opposite charge lepton pair (only filled for same flavor)
150  hists_["invMassLog_"] = ibooker.book1D("InvMassLog", "log_{10}(M(lep1, lep2))", 80, .1, 2.5);
151  // invariant mass of same charge lepton pair (log10 for low mass region, only
152  // filled for same flavor)
153  hists_["invMassWC_"] = ibooker.book1D("InvMassWC", "M_{WC}(L1, L2)", 80, 0., 320.);
154  // invariant mass of same charge lepton pair (log10 for low mass region, only
155  // filled for same flavor)
156  hists_["invMassWCLog_"] = ibooker.book1D("InvMassLogWC", "log_{10}(M_{WC})", 80, .1, 2.5);
157  // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon
158  hists_["decayChannel_"] = ibooker.book1D("DecayChannel", "Decay Channel", 3, 0, 3);
159  // trigger efficiency estimates for the electron muon channel
160  hists_["elecMuEff_"] = ibooker.book1D("ElecMuEff", "Eff(e/#mu paths)", nElecMu, 0., nElecMu);
161  // monitored trigger occupancy for the electron muon channel
162  hists_["elecMuMon_"] = ibooker.book1D("ElecMuMon", "Mon(e/#mu paths)", nElecMu, 0., nElecMu);
163  // trigger efficiency estimates for the di muon channel
164  hists_["diMuonEff_"] = ibooker.book1D("DiMuonEff", "Eff(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
165  // monitored trigger occupancy for the di muon channel
166  hists_["diMuonMon_"] = ibooker.book1D("DiMuonMon", "Mon(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
167  // pt of the leading lepton
168  hists_["lep1Pt_"] = ibooker.book1D("Lep1Pt", "pt(lep1)", 50, 0., 200.);
169  // pt of the 2. leading lepton
170  hists_["lep2Pt_"] = ibooker.book1D("Lep2Pt", "pt(lep2)", 50, 0., 200.);
171  // multiplicity of jets with pt>30 (corrected to L2+L3)
172  hists_["jetMult_"] = ibooker.book1D("JetMult", "N_{30}(jet)", 21, -0.5, 20.5);
173  // MET (calo)
174  hists_["metCalo_"] = ibooker.book1D("METCalo", "MET_{Calo}", 50, 0., 200.);
175 
176  // set bin labels for trigger monitoring
179  // set bin labels for decayChannel_
180  hists_["decayChannel_"]->setBinLabel(1, "#mu e", 1);
181  hists_["decayChannel_"]->setBinLabel(2, "#mu #mu", 1);
182  hists_["decayChannel_"]->setBinLabel(3, "e e", 1);
183 
184  if (verbosity_ == STANDARD)
185  return;
186 
187  // --- [VERBOSE] --- //
188  // mean eta of the candidate leptons
189  hists_["sumEtaL1L2_"] = ibooker.book1D("SumEtaL1L2", "<#eta>(lep1, lep2)", 100, -5., 5.);
190  // deltaEta between the 2 candidate leptons
191  hists_["dEtaL1L2_"] = ibooker.book1D("DEtaL1L2", "#Delta#eta(lep1,lep2)", 80, -4., 4.);
192  // deltaPhi between the 2 candidate leptons
193  hists_["dPhiL1L2_"] = ibooker.book1D("DPhiL1L2", "#Delta#phi(lep1,lep2)", 64, -3.2, 3.2);
194  // pt of the candidate electron (depending on the decay channel)
195  hists_["elecPt_"] = ibooker.book1D("ElecPt", "pt(e)", 50, 0., 200.);
196  // relative isolation of the candidate electron (depending on the decay
197  // channel)
198  hists_["elecRelIso_"] = ibooker.book1D("ElecRelIso", "Iso_{Rel}(e)", 50, 0., 1.);
199  // pt of the canddiate muon (depending on the decay channel)
200  hists_["muonPt_"] = ibooker.book1D("MuonPt", "pt(#mu)", 50, 0., 200.);
201  // relative isolation of the candidate muon (depending on the decay channel)
202  hists_["muonRelIso_"] = ibooker.book1D("MuonRelIso", "Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
203  // pt of the 1. leading jet (corrected to L2+L3)
204  hists_["jet1Pt_"] = ibooker.book1D("Jet1Pt", "pt_{L2L3}(jet1)", 60, 0., 300.);
205  // pt of the 2. leading jet (corrected to L2+L3)
206  hists_["jet2Pt_"] = ibooker.book1D("Jet2Pt", "pt_{L2L3}(jet2)", 60, 0., 300.);
207  // MET (PF)
208  hists_["metPflow_"] = ibooker.book1D("METPflow", "MET_{Pflow}", 50, 0., 200.);
209  // MET (TC)
210  hists_["metTC_"] = ibooker.book1D("METTC", "MET_{TC}", 50, 0., 200.);
211  // dz for muons (to suppress cosmis)
212  hists_["muonDelZ_"] = ibooker.book1D("MuonDelZ", "d_{z}(#mu)", 50, -25., 25.);
213  // dxy for muons (to suppress cosmics)
214  hists_["muonDelXY_"] = ibooker.book2D("MuonDelXY", "d_{xy}(#mu)", 50, -1., 1., 50, -1., 1.);
215  // lepton multiplicity after std isolation
216  hists_["lepMultIso_"] = ibooker.book2D("LepMultIso", "N_{Iso}(e) vs N_{Iso}(#mu)", 5, 0., 5., 5, 0., 5.);
217 
218  // set axes titles for dxy for muons
219  hists_["muonDelXY_"]->setAxisTitle("x [cm]", 1);
220  hists_["muonDelXY_"]->setAxisTitle("y [cm]", 2);
221  // set axes titles for lepton multiplicity after std isolation
222  hists_["lepMultIso_"]->setAxisTitle("N_{Iso}(#mu)", 1);
223  hists_["lepMultIso_"]->setAxisTitle("N_{Iso}(elec)", 2);
224 
225  if (verbosity_ == VERBOSE)
226  return;
227 
228  // --- [DEBUG] --- //
229  // electron multiplicity after std isolation
230  hists_["elecMultIso_"] = ibooker.book1D("ElecMultIso", "N_{Iso}(e)", 11, -0.5, 10.5);
231  // muon multiplicity after std isolation
232  hists_["muonMultIso_"] = ibooker.book1D("MuonMultIso", "N_{Iso}(#mu)", 11, -0.5, 10.5);
233  // charged hadron isolation component of the candidate muon (depending on the
234  // decay channel)
235  hists_["muonChHadIso_"] = ibooker.book1D("MuonChHadIsoComp", "ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
236  // neutral hadron isolation component of the candidate muon (depending on the
237  // decay channel)
238  hists_["muonNeHadIso_"] = ibooker.book1D("MuonNeHadIsoComp", "NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
239  // photon isolation component of the candidate muon (depending on the decay
240  // channel)
241  hists_["muonPhIso_"] = ibooker.book1D("MuonPhIsoComp", "Photon_{IsoComponent}(#mu)", 50, 0., 5.);
242  // charged hadron isolation component of the candidate electron (depending on
243  // the decay channel)
244  hists_["elecChHadIso_"] = ibooker.book1D("ElectronChHadIsoComp", "ChHad_{IsoComponent}(e)", 50, 0., 5.);
245  // neutral hadron isolation component of the candidate electron (depending on
246  // the decay channel)
247  hists_["elecNeHadIso_"] = ibooker.book1D("ElectronNeHadIsoComp", "NeHad_{IsoComponent}(e)", 50, 0., 5.);
248  // photon isolation component of the candidate electron (depending on the
249  // decay channel)
250  hists_["elecPhIso_"] = ibooker.book1D("ElectronPhIsoComp", "Photon_{IsoComponent}(e)", 50, 0., 5.);
251  // eta of the leading jet
252  hists_["jet1Eta_"] = ibooker.book1D("Jet1Eta", "#eta(jet1)", 30, -5., 5.);
253  // eta of the 2. leading jet
254  hists_["jet2Eta_"] = ibooker.book1D("Jet2Eta", "#eta(jet2)", 30, -5., 5.);
255  // pt of the 1. leading jet (not corrected)
256  hists_["jet1PtRaw_"] = ibooker.book1D("Jet1PtRaw", "pt_{Raw}(jet1)", 60, 0., 300.);
257  // pt of the 2. leading jet (not corrected)
258  hists_["jet2PtRaw_"] = ibooker.book1D("Jet2PtRaw", "pt_{Raw}(jet2)", 60, 0., 300.);
259  // deltaEta between the 2 leading jets
260  hists_["dEtaJet1Jet2_"] = ibooker.book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)", 80, -4., 4.);
261  // deltaEta between the lepton and the leading jet
262  hists_["dEtaJet1Lep1_"] = ibooker.book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)", 80, -4., 4.);
263  // deltaEta between the lepton and MET
264  hists_["dEtaLep1MET_"] = ibooker.book1D("DEtaLep1MET", "#Delta#eta(lep1,MET)", 80, -4., 4.);
265  // deltaEta between leading jet and MET
266  hists_["dEtaJet1MET_"] = ibooker.book1D("DEtaJet1MET", "#Delta#eta(jet1,MET)", 80, -4., 4.);
267  // deltaPhi of 2 leading jets
268  hists_["dPhiJet1Jet2_"] = ibooker.book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)", 64, -3.2, 3.2);
269  // deltaPhi of 1. lepton and 1. jet
270  hists_["dPhiJet1Lep1_"] = ibooker.book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)", 64, -3.2, 3.2);
271  // deltaPhi of 1. lepton and MET
272  hists_["dPhiLep1MET_"] = ibooker.book1D("DPhiLep1MET", "#Delta#phi(lep1,MET)", 64, -3.2, 3.2);
273  // deltaPhi of 1. jet and MET
274  hists_["dPhiJet1MET_"] = ibooker.book1D("DPhiJet1MET", "#Delta#phi(jet1,MET)", 64, -3.2, 3.2);
275  // selected dimuon events
276  hists_["diMuonLogger_"] = ibooker.book2D("DiMuonLogger", "Logged DiMuon Events", 8, 0., 8., 10, 0., 10.);
277  // selected dielec events
278  hists_["diElecLogger_"] = ibooker.book2D("DiElecLogger", "Logged DiElec Events", 8, 0., 8., 10, 0., 10.);
279  // selected elemu events
280  hists_["elecMuLogger_"] = ibooker.book2D("ElecMuLogger", "Logged ElecMu Events", 8, 0., 8., 10, 0., 10.);
281 
282  // set bin labels for trigger monitoring
283  loggerBinLabels(std::string("diMuonLogger_"));
284  loggerBinLabels(std::string("diElecLogger_"));
285  loggerBinLabels(std::string("elecMuLogger_"));
286  return;
287  }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), diMuonPaths_, directory_, vertexPlots::e4, elecMuPaths_, hists_, label_, loggerBinLabels(), dqm::implementation::NavigatorBase::setCurrentFolder(), STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), VERBOSE, and verbosity_.

◆ booked()

bool TopDiLeptonOffline::MonitorEnsemble::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 96 of file TopDiLeptonOfflineDQM.h.

96 { return hists_.find(histName) != hists_.end(); };

References hists_.

Referenced by fill().

◆ decayChannel()

MonitorEnsemble::DecayChannel MonitorEnsemble::decayChannel ( const std::vector< const reco::PFCandidate * > &  muons,
const std::vector< const reco::PFCandidate * > &  elecs 
) const
inlineprivate

determine dileptonic decay channel

Definition at line 231 of file TopDiLeptonOfflineDQM.h.

232  {
234  if (muons.size() > 1) {
235  type = DIMUON;
236  } else if (elecs.size() > 1) {
237  type = DIELEC;
238  } else if (!elecs.empty() && !muons.empty()) {
239  type = ELECMU;
240  }
241  return type;
242  }

References DIELEC, DIMUON, ELECMU, singleTopDQM_cfi::elecs, PDWG_BPHSkim_cff::muons, and NONE.

Referenced by fill().

◆ fill() [1/5]

void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 289 of file TopDiLeptonOfflineDQM.cc.

289  {
290  // fetch trigger event if configured such
293  if (!event.getByToken(triggerTable_, triggerTable))
294  return;
295  }
296  /*
297  ------------------------------------------------------------
298 
299  Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy
300  value=5.0)
301 
302  ------------------------------------------------------------
303  */
304 
305  if (!event.eventAuxiliary().run())
306  return;
307  fill("RunNumb_", event.eventAuxiliary().run());
308 
309  double dummy = 5.;
310  fill("InstLumi_", dummy);
311 
312  /*
313  ------------------------------------------------------------
314 
315  Muon Selection
316 
317  ------------------------------------------------------------
318  */
319 
320  std::vector<const reco::PFCandidate*> isoMuons;
321 
324 
325  if (!event.getByToken(muons_, muons))
326  return;
327 
328  for (edm::View<reco::PFCandidate>::const_iterator muonit = muons->begin(); muonit != muons->end(); ++muonit) {
329  if (muonit->muonRef().isNull())
330  continue;
331  reco::MuonRef muon = muonit->muonRef();
332 
333  if (muon->innerTrack().isNull())
334  continue;
335 
336  if (muon->isGlobalMuon()) {
337  fill("muonDelZ_", muon->innerTrack()->vz()); // CB using inner track!
338  fill("muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
339 
340  // apply selection
341  if (!muonSelect_ || (*muonSelect_)(*muonit)) {
342  double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
343  double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
344  double phoEt = muon->pfIsolationR04().sumPhotonEt;
345 
346  double pfRelIso = (chHadPt + std::max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
347  muon->pt(); // CB dBeta corrected iso!
348 
349  fill("muonRelIso_", pfRelIso);
350 
351  fill("muonChHadIso_", chHadPt);
352  fill("muonNeHadIso_", neHadEt);
353  fill("muonPhIso_", phoEt);
354 
355  if (!muonIso_ || (*muonIso_)(*muonit))
356  isoMuons.push_back(&(*muonit));
357  }
358  }
359  }
360 
361  fill("muonMultIso_", isoMuons.size());
362 
363  /*
364  ------------------------------------------------------------
365 
366  Electron Selection
367 
368  ------------------------------------------------------------
369  */
370 
371  // buffer isolated electronss
372  std::vector<const reco::PFCandidate*> isoElecs;
374  if (!electronId_.isUninitialized()) {
375  if (!event.getByToken(electronId_, electronId))
376  return;
377  }
379  if (!event.getByToken(elecs_, elecs))
380  return;
381 
382  for (edm::View<reco::PFCandidate>::const_iterator elec = elecs->begin(); elec != elecs->end(); ++elec) {
383  if (elec->gsfElectronRef().isNull()) {
384  continue;
385  }
386  reco::GsfElectronRef gsf_el = elec->gsfElectronRef();
387  // restrict to electrons with good electronId
388  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[gsf_el] >= eidCutValue_)) {
389  // apply preselection
390  if (!elecSelect_ || (*elecSelect_)(*elec)) {
391  double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
392  double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
393  double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
394  double el_pfRelIso =
395  (el_ChHadIso + std::max(0., el_NeHadIso + el_PhIso - 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
396  gsf_el->pt();
397  fill("elecRelIso_", el_pfRelIso);
398  fill("elecChHadIso_", el_ChHadIso);
399  fill("elecNeHadIso_", el_NeHadIso);
400  fill("elecPhIso_", el_PhIso);
401  if (!elecIso_ || (*elecIso_)(*elec))
402  isoElecs.push_back(&(*elec));
403  }
404  }
405  }
406  fill("elecMultIso_", isoElecs.size());
407 
408  /*
409  ------------------------------------------------------------
410 
411  Jet Selection
412 
413  ------------------------------------------------------------
414  */
415 
416  const JetCorrector* corrector = nullptr;
417  if (!jetCorrector_.empty()) {
418  // check whether a jet correcto is in the event setup or not
419  if (setup.find(edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>())) {
421  } else {
422  edm::LogVerbatim("TopDiLeptonOfflineDQM") << "\n"
423  << "-----------------------------------------------------------------"
424  "-------------------- \n"
425  << " No JetCorrectionsRecord available from EventSetup: "
426  " \n"
427  << " - Jets will not be corrected. "
428  " \n"
429  << " - If you want to change this add the following lines to your "
430  "cfg file: \n"
431  << " "
432  " \n"
433  << " ## load jet corrections "
434  " \n"
435  << " "
436  "process.load(\"JetMETCorrections.Configuration."
437  "JetCorrectionServicesAllAlgos_cff\") \n"
438  << " process.prefer(\"ak5CaloL2L3\") "
439  " \n"
440  << " "
441  " \n"
442  << "-----------------------------------------------------------------"
443  "-------------------- \n";
444  }
445  }
446 
447  unsigned int mult = 0;
448  // buffer leadingJets
449  std::vector<reco::Jet> leadingJets;
451  if (!event.getByToken(jets_, jets))
452  return;
453 
455  if (jetIDSelect_) {
456  if (!event.getByToken(jetIDLabel_, jetID))
457  return;
458  }
459 
460  for (edm::View<reco::Jet>::const_iterator jet = jets->begin(); jet != jets->end(); ++jet) {
461  unsigned int idx = jet - jets->begin();
462  if (jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
463  if (!(*jetIDSelect_)((*jetID)[jets->refAt(idx)]))
464  continue;
465  }
466  // chekc additional jet selection for calo, pf and bare reco jets
467  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
468  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet);
469  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
471  if (!jetSelect(sel)) {
472  continue;
473  }
474  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
475  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
476  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
478  if (!jetSelect(sel))
479  continue;
480  } else {
481  reco::Jet sel = *jet;
482  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
484  if (!jetSelect(sel))
485  continue;
486  }
487  // check for overlaps
488  bool overlap = false;
489  for (std::vector<const reco::PFCandidate*>::const_iterator elec = isoElecs.begin(); elec != isoElecs.end();
490  ++elec) {
491  if (reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi()) < 0.4) {
492  overlap = true;
493  break;
494  }
495  }
496  if (overlap) {
497  continue;
498  }
499  // prepare jet to fill monitor histograms
500  reco::Jet monitorJet = *jet;
501  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
502  ++mult; // determine jet multiplicity
503  if (idx == 0) {
504  leadingJets.push_back(monitorJet);
505  fill("jet1Pt_", monitorJet.pt());
506  fill("jet1PtRaw_", jet->pt());
507  fill("jet1Eta_", jet->eta());
508  }
509  if (idx == 1) {
510  leadingJets.push_back(monitorJet);
511  fill("jet2Pt_", monitorJet.pt());
512  fill("jet2PtRaw_", jet->pt());
513  fill("jet2Eta_", jet->eta());
514  }
515  }
516  if (leadingJets.size() > 1) {
517  fill("dEtaJet1Jet2_", leadingJets[0].eta() - leadingJets[1].eta());
518  fill("dPhiJet1Jet2_", reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi()));
519  if (!isoMuons.empty()) {
520  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
521  fill("dEtaJet1Lep1_", isoMuons[0]->eta() - leadingJets[0].eta());
522  fill("dPhiJet1Lep1_", reco::deltaPhi(isoMuons[0]->phi(), leadingJets[0].phi()));
523  }
524  }
525  if (!isoElecs.empty()) {
526  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
527  fill("dEtaJet1Lep1_", isoElecs[0]->eta() - leadingJets[0].eta());
528  fill("dPhiJet1Lep1_", reco::deltaPhi(isoElecs[0]->phi(), leadingJets[0].phi()));
529  }
530  }
531  }
532  fill("jetMult_", mult);
533 
534  /*
535  ------------------------------------------------------------
536 
537  MET Selection
538 
539  ------------------------------------------------------------
540  */
541 
542  // buffer for event logging
544  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET>>>::const_iterator met_ = mets_.begin(); met_ != mets_.end();
545  ++met_) {
547  if (!event.getByToken(*met_, met))
548  continue;
549 
550  if (met->begin() != met->end()) {
551  unsigned int idx = met_ - mets_.begin();
552  if (idx == 0) {
553  caloMET = *met->begin();
554  fill("metCalo_", met->begin()->et());
555  if (!leadingJets.empty()) {
556  fill("dEtaJet1MET_", leadingJets[0].eta() - met->begin()->eta());
557  fill("dPhiJet1MET_", reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi()));
558  }
559  if (!isoMuons.empty()) {
560  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
561  fill("dEtaLep1MET_", isoMuons[0]->eta() - met->begin()->eta());
562  fill("dPhiLep1MET_", reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi()));
563  }
564  }
565  if (!isoElecs.empty()) {
566  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
567  fill("dEtaLep1MET_", isoElecs[0]->eta() - met->begin()->eta());
568  fill("dPhiLep1MET_", reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi()));
569  }
570  }
571  }
572  if (idx == 1) {
573  fill("metTC_", met->begin()->et());
574  }
575  if (idx == 2) {
576  fill("metPflow_", met->begin()->et());
577  }
578  }
579  }
580 
581  /*
582  ------------------------------------------------------------
583 
584  Event Monitoring
585 
586  ------------------------------------------------------------
587  */
588 
589  // check number of isolated leptons
590  fill("lepMultIso_", isoMuons.size(), isoElecs.size());
591  // ELECMU channel
592  if (decayChannel(isoMuons, isoElecs) == ELECMU) {
593  fill("decayChannel_", 0.5);
594  double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).mass();
595  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
596  fill("dEtaL1L2_", isoElecs[0]->eta() - isoMuons[0]->eta());
597  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoMuons[0]->eta()) / 2);
598  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta()));
599  fill("elecPt_", isoElecs[0]->pt());
600  fill("muonPt_", isoMuons[0]->pt());
601  fill("lep1Pt_", isoElecs[0]->pt() > isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt());
602  fill("lep2Pt_", isoElecs[0]->pt() > isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt());
603  // fill plots for trigger monitoring
605  fill(event, *triggerTable, "elecMu", elecMuPaths_);
606  if (elecMuLogged_ <= hists_.find("elecMuLogger_")->second->getNbinsY()) {
607  // log runnumber, lumi block, event number & some
608  // more pysics infomation for interesting events
609  fill("elecMuLogger_", 0.5, elecMuLogged_ + 0.5, event.eventAuxiliary().run());
610  fill("elecMuLogger_", 1.5, elecMuLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
611  fill("elecMuLogger_", 2.5, elecMuLogged_ + 0.5, event.eventAuxiliary().event());
612  fill("elecMuLogger_", 3.5, elecMuLogged_ + 0.5, isoMuons[0]->pt());
613  fill("elecMuLogger_", 4.5, elecMuLogged_ + 0.5, isoElecs[0]->pt());
614  if (!leadingJets.empty())
615  fill("elecMuLogger_", 5.5, elecMuLogged_ + 0.5, leadingJets[0].pt());
616  if (leadingJets.size() > 1)
617  fill("elecMuLogger_", 6.5, elecMuLogged_ + 0.5, leadingJets[1].pt());
618  fill("elecMuLogger_", 7.5, elecMuLogged_ + 0.5, caloMET.et());
619  ++elecMuLogged_;
620  }
621  }
622  }
623 
624  // DIMUON channel
625  if (decayChannel(isoMuons, isoElecs) == DIMUON) {
626  fill("decayChannel_", 1.5);
627  int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
628  double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).mass();
629 
630  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
631  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
632  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
633  fill("dEtaL1L2_", isoMuons[0]->eta() - isoMuons[1]->eta());
634  fill("sumEtaL1L2_", (isoMuons[0]->eta() + isoMuons[1]->eta()) / 2);
635  fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(), isoMuons[1]->phi()));
636  fill("muonPt_", isoMuons[0]->pt());
637  fill("muonPt_", isoMuons[1]->pt());
638  fill("lep1Pt_", isoMuons[0]->pt());
639  fill("lep2Pt_", isoMuons[1]->pt());
640  // fill plots for trigger monitoring
642  fill(event, *triggerTable, "diMuon", diMuonPaths_);
643  if (diMuonLogged_ <= hists_.find("diMuonLogger_")->second->getNbinsY()) {
644  // log runnumber, lumi block, event number & some
645  // more pysics infomation for interesting events
646  fill("diMuonLogger_", 0.5, diMuonLogged_ + 0.5, event.eventAuxiliary().run());
647  fill("diMuonLogger_", 1.5, diMuonLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
648  fill("diMuonLogger_", 2.5, diMuonLogged_ + 0.5, event.eventAuxiliary().event());
649  fill("diMuonLogger_", 3.5, diMuonLogged_ + 0.5, isoMuons[0]->pt());
650  fill("diMuonLogger_", 4.5, diMuonLogged_ + 0.5, isoMuons[1]->pt());
651  if (!leadingJets.empty())
652  fill("diMuonLogger_", 5.5, diMuonLogged_ + 0.5, leadingJets[0].pt());
653  if (leadingJets.size() > 1)
654  fill("diMuonLogger_", 6.5, diMuonLogged_ + 0.5, leadingJets[1].pt());
655  fill("diMuonLogger_", 7.5, diMuonLogged_ + 0.5, caloMET.et());
656  ++diMuonLogged_;
657  }
658  }
659  }
660 
661  // DIELEC channel
662  if (decayChannel(isoMuons, isoElecs) == DIELEC) {
663  fill("decayChannel_", 2.5);
664  int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
665  double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).mass();
666  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
667  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
668  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
669  fill("dEtaL1L2_", isoElecs[0]->eta() - isoElecs[1]->eta());
670  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoElecs[1]->eta()) / 2);
671  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoElecs[1]->phi()));
672  fill("elecPt_", isoElecs[0]->pt());
673  fill("elecPt_", isoElecs[1]->pt());
674  fill("lep1Pt_", isoElecs[0]->pt());
675  fill("lep2Pt_", isoElecs[1]->pt());
676  if (diElecLogged_ <= hists_.find("diElecLogger_")->second->getNbinsY()) {
677  // log runnumber, lumi block, event number & some
678  // more pysics infomation for interesting events
679  fill("diElecLogger_", 0.5, diElecLogged_ + 0.5, event.eventAuxiliary().run());
680  fill("diElecLogger_", 1.5, diElecLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
681  fill("diElecLogger_", 2.5, diElecLogged_ + 0.5, event.eventAuxiliary().event());
682  fill("diElecLogger_", 3.5, diElecLogged_ + 0.5, isoElecs[0]->pt());
683  fill("diElecLogger_", 4.5, diElecLogged_ + 0.5, isoElecs[1]->pt());
684  if (!leadingJets.empty())
685  fill("diElecLogger_", 5.5, diElecLogged_ + 0.5, leadingJets[0].pt());
686  if (leadingJets.size() > 1)
687  fill("diElecLogger_", 6.5, diElecLogged_ + 0.5, leadingJets[1].pt());
688  fill("diElecLogger_", 7.5, diElecLogged_ + 0.5, caloMET.et());
689  ++diElecLogged_;
690  }
691  }
692  }
693  }

References slimmedMETs_cfi::caloMET, ALCARECOTkAlJpsiMuMu_cff::charge, pfClustersFromHGC3DClusters_cfi::corrector, decayChannel(), reco::deltaPhi(), reco::deltaR(), DIELEC, diElecLogged_, DIMUON, diMuonLogged_, diMuonPaths_, eidCutValue_, elecIso_, ELECMU, elecMuLogged_, elecMuPaths_, singleTopDQM_cfi::elecs, elecs_, elecSelect_, topSingleLeptonDQM_PU_cfi::electronId, electronId_, PVValHelper::eta, JetCorrector::getJetCorrector(), hists_, heavyIonCSV_trainingSettings::idx, edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, singleTopDQM_cfi::jets, jets_, jetSelect_, lowerEdge_, EgHLTOffHistBins_cfi::mass, SiStripPI::max, BTaggingMonitor_cfi::met, mets_, VarParsing::mult, muonIso_, PDWG_BPHSkim_cff::muons, muons_, muonSelect_, goodZToMuMu_cfi::overlap, DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, singleTopDQM_cfi::setup, triggerTable_, funct::true, upperEdge_, and trackerHitRTTI::vector.

Referenced by fill().

◆ fill() [2/5]

void MonitorEnsemble::fill ( const edm::Event event,
const edm::TriggerResults triggerTable,
std::string  channel,
const std::vector< std::string >  labels 
) const
inlineprivate

fill trigger monitoring histograms

Definition at line 215 of file TopDiLeptonOfflineDQM.h.

218  {
219  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
220  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
221  fill(channel + "Mon_", idx + 0.5);
222  // take care to fill triggerMon_ before evts is being called
223  int evts = hists_.find(channel + "Mon_")->second->getBinContent(idx + 1);
224  double value = hists_.find(channel + "Eff_")->second->getBinContent(idx + 1);
225  fill(
226  channel + "Eff_", idx + 0.5, 1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) - value));
227  }
228  }
229  }

References accept(), fill(), hists_, heavyIonCSV_trainingSettings::idx, SummaryClient_cfi::labels, monitorPath(), and selectionPath().

◆ fill() [3/5]

void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 98 of file TopDiLeptonOfflineDQM.h.

98  {
99  if (booked(histName))
100  hists_.find(histName)->second->Fill(value);
101  };

References booked(), and hists_.

◆ fill() [4/5]

void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 103 of file TopDiLeptonOfflineDQM.h.

103  {
104  if (booked(histName))
105  hists_.find(histName)->second->Fill(xValue, yValue);
106  };

References booked(), and hists_.

◆ fill() [5/5]

void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue,
double  zValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 108 of file TopDiLeptonOfflineDQM.h.

108  {
109  if (booked(histName))
110  hists_.find(histName)->second->Fill(xValue, yValue, zValue);
111  };

References booked(), and hists_.

◆ loggerBinLabels()

void MonitorEnsemble::loggerBinLabels ( std::string  hist)
inlineprivate

set labels for event logging histograms

Definition at line 182 of file TopDiLeptonOfflineDQM.h.

182  {
183  // set axes titles for selected events
184  hists_[hist]->getTH1()->SetOption("TEXT");
185  hists_[hist]->setBinLabel(1, "Run", 1);
186  hists_[hist]->setBinLabel(2, "Block", 1);
187  hists_[hist]->setBinLabel(3, "Event", 1);
188  hists_[hist]->setBinLabel(6, "pt_{L2L3}(jet1)", 1);
189  hists_[hist]->setBinLabel(7, "pt_{L2L3}(jet2)", 1);
190  hists_[hist]->setBinLabel(8, "MET_{Calo}", 1);
191  hists_[hist]->setAxisTitle("logged evts", 2);
192 
193  if (hist == "diMuonLogger_") {
194  hists_[hist]->setBinLabel(4, "pt(muon)", 1);
195  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
196  }
197  if (hist == "diElecLogger_") {
198  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
199  hists_[hist]->setBinLabel(5, "pt(elec)", 1);
200  }
201  if (hist == "elecMuLogger_") {
202  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
203  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
204  }
205  }

References compare::hist, and hists_.

Referenced by book().

◆ monitorPath()

std::string TopDiLeptonOffline::MonitorEnsemble::monitorPath ( const std::string &  label) const
inlineprivate

deduce monitorPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 77 of file TopDiLeptonOfflineDQM.h.

77 { return label.substr(label.find(':') + 1); };

References label.

Referenced by fill(), and triggerBinLabels().

◆ selectionPath()

std::string TopDiLeptonOffline::MonitorEnsemble::selectionPath ( const std::string &  label) const
inlineprivate

deduce selectionPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 80 of file TopDiLeptonOfflineDQM.h.

80 { return label.substr(0, label.find(':')); };

References label.

Referenced by fill(), and triggerBinLabels().

◆ triggerBinLabels()

void MonitorEnsemble::triggerBinLabels ( std::string  channel,
const std::vector< std::string >  labels 
)
inlineprivate

set configurable labels for trigger monitoring histograms

Definition at line 207 of file TopDiLeptonOfflineDQM.h.

207  {
208  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
209  hists_[channel + "Mon_"]->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
210  hists_[channel + "Eff_"]->setBinLabel(
211  idx + 1, "[" + selectionPath(labels[idx]) + "]|[" + monitorPath(labels[idx]) + "]", 1);
212  }
213  }

References hists_, heavyIonCSV_trainingSettings::idx, SummaryClient_cfi::labels, monitorPath(), and selectionPath().

Referenced by book().

Member Data Documentation

◆ diElecLogged_

int TopDiLeptonOffline::MonitorEnsemble::diElecLogged_
private

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

◆ diMuonLogged_

int TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
private

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

◆ diMuonPaths_

std::vector<std::string> TopDiLeptonOffline::MonitorEnsemble::diMuonPaths_
private

trigger paths for di muon channel

Definition at line 132 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), fill(), and MonitorEnsemble().

◆ directory_

std::string TopDiLeptonOffline::MonitorEnsemble::directory_
private

Definition at line 179 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().

◆ eidCutValue_

double TopDiLeptonOffline::MonitorEnsemble::eidCutValue_
private

electronId pattern we expect the following pattern: 0: fails 1: passes electron ID only 2: passes electron Isolation only 3: passes electron ID and Isolation only 4: passes conversion rejection 5: passes conversion rejection and ID 6: passes conversion rejection and Isolation 7: passes the whole selection As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID

Definition at line 149 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ elecIso_

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecIso_
private

extra isolation criterion on electron

Definition at line 151 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ elecMuLogged_

int TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
private

number of logged interesting events

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

◆ elecMuPaths_

std::vector<std::string> TopDiLeptonOffline::MonitorEnsemble::elecMuPaths_
private

trigger paths for monitoring, expected to be of form signalPath:MonitorPath

Definition at line 130 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), fill(), and MonitorEnsemble().

◆ elecs_

edm::EDGetTokenT<edm::View<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecs_
private

Definition at line 121 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ elecSelect_

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecSelect_
private

extra selection on electrons

Definition at line 153 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ electronId_

edm::EDGetTokenT<edm::ValueMap<float> > TopDiLeptonOffline::MonitorEnsemble::electronId_
private

electronId label

Definition at line 135 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ hists_

std::map<std::string, MonitorElement*> TopDiLeptonOffline::MonitorEnsemble::hists_
private

storage manager histogram container

Definition at line 177 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), booked(), fill(), loggerBinLabels(), and triggerBinLabels().

◆ jetCorrector_

std::string TopDiLeptonOffline::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 162 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ jetIDLabel_

edm::EDGetTokenT<reco::JetIDValueMap> TopDiLeptonOffline::MonitorEnsemble::jetIDLabel_
private

jetID as an extra selection type

Definition at line 164 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ jetIDSelect_

std::unique_ptr<StringCutObjectSelector<reco::JetID> > TopDiLeptonOffline::MonitorEnsemble::jetIDSelect_
private

extra jetID selection on calo jets

Definition at line 166 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ jets_

edm::EDGetTokenT<edm::View<reco::Jet> > TopDiLeptonOffline::MonitorEnsemble::jets_
private

input sources for monitoring

Definition at line 119 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ jetSelect_

std::string TopDiLeptonOffline::MonitorEnsemble::jetSelect_
private

extra selection on jets (here given as std::string as it depends on the the jet type, which selections are valid and which not)

Definition at line 169 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ label_

std::string TopDiLeptonOffline::MonitorEnsemble::label_
private

◆ lowerEdge_

double TopDiLeptonOffline::MonitorEnsemble::lowerEdge_
private

mass window upper and lower edge

Definition at line 171 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ mets_

std::vector<edm::EDGetTokenT<edm::View<reco::MET> > > TopDiLeptonOffline::MonitorEnsemble::mets_
private

considers a vector of METs

Definition at line 124 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ muonIso_

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > TopDiLeptonOffline::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 156 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ muons_

edm::EDGetTokenT<edm::View<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::muons_
private

Definition at line 120 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ muonSelect_

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > TopDiLeptonOffline::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 159 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ triggerTable_

edm::EDGetTokenT<edm::TriggerResults> TopDiLeptonOffline::MonitorEnsemble::triggerTable_
private

trigger table

Definition at line 127 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ upperEdge_

double TopDiLeptonOffline::MonitorEnsemble::upperEdge_
private

Definition at line 171 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

◆ verbosity_

Level TopDiLeptonOffline::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 111 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().

SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
reco::Jet::scaleEnergy
virtual void scaleEnergy(double fScale)
scale energy of the jet
TopDiLeptonOffline::MonitorEnsemble::elecSelect_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
Definition: TopDiLeptonOfflineDQM.h:153
TopDiLeptonOffline::MonitorEnsemble::mets_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
Definition: TopDiLeptonOfflineDQM.h:124
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
TopDiLeptonOffline::MonitorEnsemble::diMuonPaths_
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
Definition: TopDiLeptonOfflineDQM.h:132
muon
Definition: MuonCocktails.h:17
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
edm::EDGetTokenT
Definition: EDGetToken.h:33
TopDiLeptonOffline::MonitorEnsemble::decayChannel
DecayChannel decayChannel(const std::vector< const reco::PFCandidate * > &muons, const std::vector< const reco::PFCandidate * > &elecs) const
determine dileptonic decay channel
Definition: TopDiLeptonOfflineDQM.h:231
singleTopDQM_cfi.elecExtras
elecExtras
Definition: singleTopDQM_cfi.py:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
CalibrationSummaryClient_cfi.sources
sources
Definition: CalibrationSummaryClient_cfi.py:23
TopDiLeptonOffline::MonitorEnsemble::loggerBinLabels
void loggerBinLabels(std::string hist)
set labels for event logging histograms
Definition: TopDiLeptonOfflineDQM.h:182
TopDiLeptonOffline::MonitorEnsemble::DIMUON
Definition: TopDiLeptonOfflineDQM.h:60
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
TopDiLeptonOffline::MonitorEnsemble::DEBUG
Definition: TopDiLeptonOfflineDQM.h:55
topSingleLeptonDQM_PU_cfi.electronId
electronId
when omitted electron plots will be filled w/o cut on electronId
Definition: topSingleLeptonDQM_PU_cfi.py:39
edm::Handle< edm::TriggerResults >
TopDiLeptonOffline::MonitorEnsemble::jetIDLabel_
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
Definition: TopDiLeptonOfflineDQM.h:164
JetCorrector
Definition: JetCorrector.h:19
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
slimmedMETs_cfi.caloMET
caloMET
Definition: slimmedMETs_cfi.py:17
TopDiLeptonOffline::MonitorEnsemble::muons_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Definition: TopDiLeptonOfflineDQM.h:120
edm::Ref< MuonCollection >
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
TopDiLeptonOffline::MonitorEnsemble::triggerTable_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
Definition: TopDiLeptonOfflineDQM.h:127
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TopDiLeptonOffline::MonitorEnsemble::jetIDSelect_
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
Definition: TopDiLeptonOfflineDQM.h:166
pfClustersFromHGC3DClusters_cfi.corrector
corrector
Definition: pfClustersFromHGC3DClusters_cfi.py:5
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
TopDiLeptonOffline::MonitorEnsemble::electronId_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
Definition: TopDiLeptonOfflineDQM.h:135
TopDiLeptonOffline::MonitorEnsemble::triggerBinLabels
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
Definition: TopDiLeptonOfflineDQM.h:207
reco::MET
Definition: MET.h:41
TopDiLeptonOffline::MonitorEnsemble::NONE
Definition: TopDiLeptonOfflineDQM.h:60
compare.hist
hist
Definition: compare.py:376
TopDiLeptonOffline::MonitorEnsemble::elecMuPaths_
std::vector< std::string > elecMuPaths_
Definition: TopDiLeptonOfflineDQM.h:130
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
TopDiLeptonOffline::MonitorEnsemble::directory_
std::string directory_
Definition: TopDiLeptonOfflineDQM.h:179
PVValHelper::eta
Definition: PVValidationHelpers.h:69
singleTopDQM_cfi.muonExtras
muonExtras
Definition: singleTopDQM_cfi.py:56
DecayChannel
Definition: DecayChannel.h:22
TopDiLeptonOffline::MonitorEnsemble::VERBOSE
Definition: TopDiLeptonOfflineDQM.h:55
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
TopDiLeptonOffline::MonitorEnsemble::ELECMU
Definition: TopDiLeptonOfflineDQM.h:60
singleTopDQM_cfi.elecs
elecs
Definition: singleTopDQM_cfi.py:41
TopDiLeptonOffline::MonitorEnsemble::label_
std::string label_
instance label
Definition: TopDiLeptonOfflineDQM.h:117
TopDiLeptonOffline::MonitorEnsemble::lowerEdge_
double lowerEdge_
mass window upper and lower edge
Definition: TopDiLeptonOfflineDQM.h:171
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TopDiLeptonOffline::MonitorEnsemble::jetCorrector_
std::string jetCorrector_
jetCorrector
Definition: TopDiLeptonOfflineDQM.h:162
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
TopDiLeptonOffline::MonitorEnsemble::eidCutValue_
double eidCutValue_
Definition: TopDiLeptonOfflineDQM.h:149
singleTopDQM_cfi.massExtras
massExtras
Definition: singleTopDQM_cfi.py:70
edm::View< reco::PFCandidate >
funct::true
true
Definition: Factorize.h:173
TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
int diMuonLogged_
Definition: TopDiLeptonOfflineDQM.h:174
edm::ParameterSet
Definition: ParameterSet.h:47
TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
int elecMuLogged_
number of logged interesting events
Definition: TopDiLeptonOfflineDQM.h:174
TopDiLeptonOffline::MonitorEnsemble::upperEdge_
double upperEdge_
Definition: TopDiLeptonOfflineDQM.h:171
PVValHelper::phi
Definition: PVValidationHelpers.h:68
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TopDiLeptonOffline::MonitorEnsemble::monitorPath
std::string monitorPath(const std::string &label) const
Definition: TopDiLeptonOfflineDQM.h:77
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
TopDiLeptonOffline::MonitorEnsemble::diElecLogged_
int diElecLogged_
Definition: TopDiLeptonOfflineDQM.h:174
value
Definition: value.py:1
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
JetCorrector::getJetCorrector
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing
Definition: JetCorrector.cc:48
goodZToMuMu_cfi.overlap
overlap
Definition: goodZToMuMu_cfi.py:108
TopDiLeptonOffline::MonitorEnsemble::elecIso_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
Definition: TopDiLeptonOfflineDQM.h:151
looper.cfg
cfg
Definition: looper.py:297
TopDiLeptonOffline::MonitorEnsemble::muonSelect_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
Definition: TopDiLeptonOfflineDQM.h:159
singleTopDQM_cfi.jetExtras
jetExtras
Definition: singleTopDQM_cfi.py:60
singleTopDQM_cfi.monitoring
monitoring
Definition: singleTopDQM_cfi.py:46
TopDiLeptonOffline::MonitorEnsemble::DIELEC
Definition: TopDiLeptonOfflineDQM.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ValueMap< float >
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
StringCutObjectSelector< reco::CaloJet >
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
TopDiLeptonOffline::MonitorEnsemble::jetSelect_
std::string jetSelect_
Definition: TopDiLeptonOfflineDQM.h:169
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
VarParsing.mult
mult
Definition: VarParsing.py:659
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
TopDiLeptonOffline::MonitorEnsemble::elecs_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
Definition: TopDiLeptonOfflineDQM.h:121
dummy
Definition: DummySelector.h:38
TopDiLeptonOffline::MonitorEnsemble::booked
bool booked(const std::string histName) const
check if histogram was booked
Definition: TopDiLeptonOfflineDQM.h:96
TopDiLeptonOffline::MonitorEnsemble::STANDARD
Definition: TopDiLeptonOfflineDQM.h:55
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
event
Definition: event.py:1
TopDiLeptonOffline::MonitorEnsemble::verbosity_
Level verbosity_
verbosity level for booking
Definition: TopDiLeptonOfflineDQM.h:111
TopDiLeptonOffline::MonitorEnsemble::jets_
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
Definition: TopDiLeptonOfflineDQM.h:119
TopDiLeptonOffline::MonitorEnsemble::muonIso_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
Definition: TopDiLeptonOfflineDQM.h:156
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::TriggerResults
Definition: TriggerResults.h:35
vertexPlots.e4
e4
Definition: vertexPlots.py:64
TopDiLeptonOffline::MonitorEnsemble::hists_
std::map< std::string, MonitorElement * > hists_
Definition: TopDiLeptonOfflineDQM.h:177
TopDiLeptonOffline::MonitorEnsemble::fill
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Definition: TopDiLeptonOfflineDQM.cc:289
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
TopDiLeptonOffline::MonitorEnsemble::selectionPath
std::string selectionPath(const std::string &label) const
Definition: TopDiLeptonOfflineDQM.h:80