CMS 3D CMS Logo

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_
 
edm::EDGetTokenT< reco::JetCorrectorjetCorrector_
 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

◆ Level

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 20 of file TopDiLeptonOfflineDQM.cc.

References looper::cfg, DEBUG, diMuonPaths_, directory_, eidCutValue_, singleTopDQM_cfi::elecExtras, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::getParameter(), ProducerED_cfi::InputTag, 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, makeGlobalPositionRcd_cfg::tag, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

21  : label_(label),
22  eidCutValue_(0.),
23  elecIso_(nullptr),
24  elecSelect_(nullptr),
25  muonIso_(nullptr),
26  muonSelect_(nullptr),
27  jetIDSelect_(nullptr),
28  lowerEdge_(-1.),
29  upperEdge_(-1.),
30  elecMuLogged_(0),
31  diMuonLogged_(0),
32  diElecLogged_(0) {
33  // sources have to be given; this PSet is not optional
34  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
37  jets_ = iC.consumes<edm::View<reco::Jet>>(sources.getParameter<edm::InputTag>("jets"));
38  for (edm::InputTag const& tag : sources.getParameter<std::vector<edm::InputTag>>("mets"))
39  mets_.push_back(iC.consumes<edm::View<reco::MET>>(tag));
40 
41  // elecExtras are optional; they may be omitted or empty
42  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
43  edm::ParameterSet elecExtras = cfg.getParameter<edm::ParameterSet>("elecExtras");
44  // select is optional; in case it's not found no
45  // selection will be applied
46  if (elecExtras.existsAs<std::string>("select")) {
47  elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
48  elecExtras.getParameter<std::string>("select"));
49  }
50  // isolation is optional; in case it's not found no
51  // isolation will be applied
52  if (elecExtras.existsAs<std::string>("isolation")) {
53  elecIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
54  elecExtras.getParameter<std::string>("isolation"));
55  }
56  // electronId is optional; in case it's not found the
57  // InputTag will remain empty
58  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
59  edm::ParameterSet elecId = elecExtras.getParameter<edm::ParameterSet>("electronId");
61  eidCutValue_ = elecId.getParameter<double>("cutValue");
62  // eidPattern_= elecId.getParameter<int>("pattern");
63  }
64  }
65  // muonExtras are optional; they may be omitted or empty
66  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
67  edm::ParameterSet muonExtras = cfg.getParameter<edm::ParameterSet>("muonExtras");
68  // select is optional; in case it's not found no
69  // selection will be applied
70  if (muonExtras.existsAs<std::string>("select")) {
71  muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
72  muonExtras.getParameter<std::string>("select"));
73  }
74  // isolation is optional; in case it's not found no
75  // isolation will be applied
76  if (muonExtras.existsAs<std::string>("isolation")) {
77  muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
78  muonExtras.getParameter<std::string>("isolation"));
79  }
80  }
81  // jetExtras are optional; they may be omitted or empty
82  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
83  edm::ParameterSet jetExtras = cfg.getParameter<edm::ParameterSet>("jetExtras");
84  // jetCorrector is optional; in case it's not found
85  // the InputTag will remain empty
86  if (jetExtras.existsAs<std::string>("jetCorrector")) {
88  iC.consumes<reco::JetCorrector>(edm::InputTag(jetExtras.getParameter<std::string>("jetCorrector")));
89  }
90  // read jetID information if it exists
91  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
92  edm::ParameterSet jetID = jetExtras.getParameter<edm::ParameterSet>("jetID");
94  jetIDSelect_ =
95  std::make_unique<StringCutObjectSelector<reco::JetID>>(jetID.getParameter<std::string>("select"));
96  }
97  // select is optional; in case it's not found no
98  // selection will be applied (only implemented for
99  // CaloJets at the moment)
100  if (jetExtras.existsAs<std::string>("select")) {
101  jetSelect_ = jetExtras.getParameter<std::string>("select");
102  }
103  }
104  // triggerExtras are optional; they may be omitted or empty
105  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
106  edm::ParameterSet triggerExtras = cfg.getParameter<edm::ParameterSet>("triggerExtras");
108  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsELECMU");
109  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsDIMUON");
110  }
111  // massExtras is optional; in case it's not found no mass
112  // window cuts are applied for the same flavor monitor
113  // histograms
114  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
115  edm::ParameterSet massExtras = cfg.getParameter<edm::ParameterSet>("massExtras");
116  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
117  upperEdge_ = massExtras.getParameter<double>("upperEdge");
118  }
119 
120  // setup the verbosity level for booking histograms;
121  // per default the verbosity level will be set to
122  // STANDARD. This will also be the chosen level in
123  // the case when the monitoring PSet is not found
125  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
126  edm::ParameterSet monitoring = cfg.getParameter<edm::ParameterSet>("monitoring");
127  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
128  verbosity_ = DEBUG;
129  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
131  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
133  }
134  // and don't forget to do the histogram booking
135  directory_ = cfg.getParameter<std::string>("directory");
136  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
edm::EDGetTokenT< reco::JetCorrector > jetCorrector_
jetCorrector
char const * label
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
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::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_

◆ ~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 138 of file TopDiLeptonOfflineDQM.cc.

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

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

◆ booked()

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

check if histogram was booked

Definition at line 96 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by fill().

96 { return hists_.find(histName) != hists_.end(); };
std::map< std::string, MonitorElement * > hists_

◆ decayChannel()

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

◆ fill() [1/5]

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

fill monitor histograms with electronId and jetCorrections

Definition at line 293 of file TopDiLeptonOfflineDQM.cc.

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, hists_, heavyIonCSV_trainingSettings::idx, edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, PDWG_EXODelayedJetMET_cff::jets, jets_, jetSelect_, lowerEdge_, EgHLTOffHistBins_cfi::mass, SiStripPI::max, BTaggingMonitor_cfi::met, mets_, VarParsing::mult, muonIso_, PDWG_BPHSkim_cff::muons, muons_, muonSelect_, hltL1SingleMuFiltered5_cfi::overlap, edm::Handle< T >::product(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerTable_, funct::true, upperEdge_, and trackerHitRTTI::vector.

Referenced by fill().

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

◆ 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.

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

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  }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Definition: value.py:1
std::map< std::string, MonitorElement * > hists_
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const
Definition: event.py:1

◆ 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.

References booked(), and hists_.

98  {
99  if (booked(histName))
100  hists_.find(histName)->second->Fill(value);
101  };
bool booked(const std::string histName) const
check if histogram was booked
Definition: value.py:1
std::map< std::string, MonitorElement * > 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.

References booked(), and hists_.

103  {
104  if (booked(histName))
105  hists_.find(histName)->second->Fill(xValue, yValue);
106  };
bool booked(const std::string histName) const
check if histogram was booked
std::map< std::string, MonitorElement * > 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.

References booked(), and hists_.

108  {
109  if (booked(histName))
110  hists_.find(histName)->second->Fill(xValue, yValue, zValue);
111  };
bool booked(const std::string histName) const
check if histogram was booked
std::map< std::string, MonitorElement * > hists_

◆ loggerBinLabels()

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

set labels for event logging histograms

Definition at line 182 of file TopDiLeptonOfflineDQM.h.

References compareTotals::hist, and hists_.

Referenced by book().

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  }
std::map< std::string, MonitorElement * > hists_

◆ 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.

References label.

Referenced by fill(), and triggerBinLabels().

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

◆ 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.

References label.

Referenced by fill(), and triggerBinLabels().

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

◆ 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.

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

Referenced by book().

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  }
std::map< std::string, MonitorElement * > hists_
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const

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_

edm::EDGetTokenT<reco::JetCorrector> 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().