CMS 3D CMS Logo

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

#include <TopSingleLeptonDQM.h>

Public Types

enum  Level { STANDARD, VERBOSE, DEBUG }
 different verbosity levels More...
 

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)
 default contructor More...
 
 ~MonitorEnsemble ()
 default destructor More...
 

Private Member Functions

bool booked (const std::string histName) const
 check if histogram was booked 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...
 
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

edm::EDGetTokenT
< reco::JetTagCollection
btagCSV_
 
double btagCSVWP_
 
edm::EDGetTokenT
< reco::JetTagCollection
btagEff_
 btag discriminator labels More...
 
double btagEffWP_
 btag working points More...
 
edm::EDGetTokenT
< reco::JetTagCollection
btagPur_
 
double btagPurWP_
 
edm::EDGetTokenT
< reco::JetTagCollection
btagVtx_
 
double btagVtxWP_
 
std::string directory_
 
double eidCutValue_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate > > 
elecIso_
 extra isolation criterion on electron More...
 
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_
 histogram container More...
 
bool includeBTag_
 
std::string jetCorrector_
 jetCorrector More...
 
edm::EDGetTokenT
< reco::JetIDValueMap
jetIDLabel_
 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...
 
int logged_
 number of logged interesting events 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 > > 
muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
muons_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate > > 
muonSelect_
 extra selection on muons More...
 
edm::EDGetTokenT< edm::View
< reco::Vertex > > 
pvs_
 
std::unique_ptr
< StringCutObjectSelector
< reco::Vertex > > 
pvSelect_
 
edm::EDConsumerBase tmpConsumerBase
 
std::vector< std::string > triggerPaths_
 
edm::EDGetTokenT
< edm::TriggerResults
triggerTable_
 trigger table More...
 
double upperEdge_
 
Level verbosity_
 verbosity level for booking More...
 

Detailed Description

Definition at line 52 of file TopSingleLeptonDQM.h.

Member Enumeration Documentation

different verbosity levels

Enumerator
STANDARD 
VERBOSE 
DEBUG 

Definition at line 55 of file TopSingleLeptonDQM.h.

Constructor & Destructor Documentation

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

default contructor

Definition at line 22 of file TopSingleLeptonDQM.cc.

References btagCSV_, btagCSVWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, DEBUG, directory_, eidCutValue_, elecIso_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), includeBTag_, jetCorrector_, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, mets_, muonIso_, muons_, muonSelect_, pvs_, pvSelect_, STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, triggerPaths_, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

25  : label_(label),
26  elecIso_(nullptr),
27  elecSelect_(nullptr),
28  pvSelect_(nullptr),
29  muonIso_(nullptr),
30  muonSelect_(nullptr),
31  jetIDSelect_(nullptr),
32  includeBTag_(false),
33  lowerEdge_(-1.),
34  upperEdge_(-1.),
35  logged_(0) {
36 
37  // sources have to be given; this PSet is not optional
38  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
40  sources.getParameter<edm::InputTag>("muons"));
42  sources.getParameter<edm::InputTag>("elecs"));
44  sources.getParameter<edm::InputTag>("pvs"));
46  sources.getParameter<edm::InputTag>("jets"));
47  for (edm::InputTag const& tag :
48  sources.getParameter<std::vector<edm::InputTag> >("mets"))
49  mets_.push_back(iC.consumes<edm::View<reco::MET> >(tag));
50  // electronExtras are optional; they may be omitted or
51  // empty
52  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
53  // rho for PF isolation with EA corrections
54  // eventrhoToken_ =
55  // iC.consumes<double>(edm::InputTag("fixedGridRhoFastjetAll"));
56 
57  edm::ParameterSet elecExtras =
58  cfg.getParameter<edm::ParameterSet>("elecExtras");
59  // select is optional; in case it's not found no
60  // selection will be applied
61  if (elecExtras.existsAs<std::string>("select")) {
63  elecExtras.getParameter<std::string>("select")));
64  }
65  // isolation is optional; in case it's not found no
66  // isolation will be applied
67  if (elecExtras.existsAs<std::string>("isolation")) {
69  elecExtras.getParameter<std::string>("isolation")));
70  }
71  // electronId is optional; in case it's not found the
72  // InputTag will remain empty
73  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
74  edm::ParameterSet elecId =
75  elecExtras.getParameter<edm::ParameterSet>("electronId");
77  elecId.getParameter<edm::InputTag>("src"));
78  eidCutValue_ = elecId.getParameter<double>("cutValue");
79  }
80  }
81  // pvExtras are opetional; they may be omitted or empty
82  if (cfg.existsAs<edm::ParameterSet>("pvExtras")) {
83  edm::ParameterSet pvExtras =
84  cfg.getParameter<edm::ParameterSet>("pvExtras");
85  // select is optional; in case it's not found no
86  // selection will be applied
87  if (pvExtras.existsAs<std::string>("select")) {
89  pvExtras.getParameter<std::string>("select")));
90  }
91  }
92  // muonExtras are optional; they may be omitted or empty
93  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
94  edm::ParameterSet muonExtras =
95  cfg.getParameter<edm::ParameterSet>("muonExtras");
96  // select is optional; in case it's not found no
97  // selection will be applied
98  if (muonExtras.existsAs<std::string>("select")) {
100  muonExtras.getParameter<std::string>("select")));
101  }
102  // isolation is optional; in case it's not found no
103  // isolation will be applied
104  if (muonExtras.existsAs<std::string>("isolation")) {
106  muonExtras.getParameter<std::string>("isolation")));
107  }
108  }
109 
110  // jetExtras are optional; they may be omitted or
111  // empty
112  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
113  edm::ParameterSet jetExtras =
114  cfg.getParameter<edm::ParameterSet>("jetExtras");
115  // jetCorrector is optional; in case it's not found
116  // the InputTag will remain empty
117  if (jetExtras.existsAs<std::string>("jetCorrector")) {
118  jetCorrector_ = jetExtras.getParameter<std::string>("jetCorrector");
119  }
120  // read jetID information if it exists
121  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
122  edm::ParameterSet jetID =
123  jetExtras.getParameter<edm::ParameterSet>("jetID");
125  jetID.getParameter<edm::InputTag>("label"));
127  jetID.getParameter<std::string>("select")));
128  }
129  // select is optional; in case it's not found no
130  // selection will be applied (only implemented for
131  // CaloJets at the moment)
132  if (jetExtras.existsAs<std::string>("select")) {
133  jetSelect_ = jetExtras.getParameter<std::string>("select");
134  }
135  // jetBDiscriminators are optional; in case they are
136  // not found the InputTag will remain empty; they
137  // consist of pairs of edm::JetFlavorAssociation's &
138  // corresponding working points
139  includeBTag_ = jetExtras.existsAs<edm::ParameterSet>("jetBTaggers");
140  if (includeBTag_) {
141  edm::ParameterSet btagEff =
142  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
143  .getParameter<edm::ParameterSet>("trackCountingEff");
145  btagEff.getParameter<edm::InputTag>("label"));
146  btagEffWP_ = btagEff.getParameter<double>("workingPoint");
147  edm::ParameterSet btagPur =
148  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
149  .getParameter<edm::ParameterSet>("trackCountingPur");
151  btagPur.getParameter<edm::InputTag>("label"));
152  btagPurWP_ = btagPur.getParameter<double>("workingPoint");
153  edm::ParameterSet btagVtx =
154  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
155  .getParameter<edm::ParameterSet>("secondaryVertex");
157  btagVtx.getParameter<edm::InputTag>("label"));
158  btagVtxWP_ = btagVtx.getParameter<double>("workingPoint");
159  edm::ParameterSet btagCSV =
160  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
161  .getParameter<edm::ParameterSet>("cvsVertex");
163  btagCSV.getParameter<edm::InputTag>("label"));
164  btagCSVWP_ = btagCSV.getParameter<double>("workingPoint");
165  }
166  }
167 
168  // triggerExtras are optional; they may be omitted or empty
169  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
170  edm::ParameterSet triggerExtras =
171  cfg.getParameter<edm::ParameterSet>("triggerExtras");
173  triggerExtras.getParameter<edm::InputTag>("src"));
174  triggerPaths_ =
175  triggerExtras.getParameter<std::vector<std::string> >("paths");
176  }
177 
178  // massExtras is optional; in case it's not found no mass
179  // window cuts are applied for the same flavor monitor
180  // histograms
181  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
182  edm::ParameterSet massExtras =
183  cfg.getParameter<edm::ParameterSet>("massExtras");
184  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
185  upperEdge_ = massExtras.getParameter<double>("upperEdge");
186  }
187 
188  // setup the verbosity level for booking histograms;
189  // per default the verbosity level will be set to
190  // STANDARD. This will also be the chosen level in
191  // the case when the monitoring PSet is not found
193  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
194  edm::ParameterSet monitoring =
195  cfg.getParameter<edm::ParameterSet>("monitoring");
196  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
197  verbosity_ = DEBUG;
198  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
200  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
202  }
203  // and don't forget to do the histogram booking
204  directory_ = cfg.getParameter<std::string>("directory");
205  // book(ibooker);
206 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
double btagEffWP_
btag working points
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::vector< std::string > triggerPaths_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
Level verbosity_
verbosity level for booking
double lowerEdge_
mass window upper and lower edge
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
std::string label_
instance label
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
std::string jetCorrector_
jetCorrector
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonIso_
extra isolation criterion on muon
TopSingleLepton::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 66 of file TopSingleLeptonDQM.h.

66 {};

Member Function Documentation

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

book histograms in subdirectory directory

Definition at line 208 of file TopSingleLeptonDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), cond::rpcobimon::current, directory_, hists_, label_, DQMStore::IBooker::setCurrentFolder(), STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), triggerPaths_, VERBOSE, and verbosity_.

208  {
209  // set up the current directory path
211  current += label_;
212  ibooker.setCurrentFolder(current);
213 
214  // determine number of bins for trigger monitoring
215  unsigned int nPaths = triggerPaths_.size();
216 
217  // --- [STANDARD] --- //
218  // Run Number
219  hists_["RunNumb_"] = ibooker.book1D("RunNumber", "Run Nr.", 1.e4, 1.5e5, 3.e5);
220  // instantaneous luminosity
221  hists_["InstLumi_"] = ibooker.book1D("InstLumi", "Inst. Lumi.", 100, 0., 1.e3);
222  // number of selected primary vertices
223  hists_["pvMult_"] = ibooker.book1D("PvMult", "N_{pvs}", 100, 0., 100.);
224  // pt of the leading muon
225  hists_["muonPt_"] = ibooker.book1D("MuonPt", "pt(#mu)", 50, 0., 250.);
226  // muon multiplicity before std isolation
227  hists_["muonMult_"] = ibooker.book1D("MuonMult", "N_{All}(#mu)", 10, 0., 10.);
228  // muon multiplicity after std isolation
229  hists_["muonMultIso_"] = ibooker.book1D("MuonMultIso",
230  "N_{Iso}(#mu)", 10, 0., 10.);
231  // pt of the leading electron
232  hists_["elecPt_"] = ibooker.book1D("ElecPt", "pt(e)", 50, 0., 250.);
233  // electron multiplicity before std isolation
234  hists_["elecMult_"] = ibooker.book1D("ElecMult", "N_{All}(e)", 10, 0., 10.);
235  // electron multiplicity after std isolation
236  hists_["elecMultIso_"] = ibooker.book1D("ElecMultIso", "N_{Iso}(e)", 10, 0., 10.);
237  // multiplicity of jets with pt>20 (corrected to L2+L3)
238  hists_["jetMult_"] = ibooker.book1D("JetMult", "N_{30}(jet)", 10, 0., 10.);
239  // trigger efficiency estimates for single lepton triggers
240  hists_["triggerEff_"] = ibooker.book1D("TriggerEff",
241  "Eff(trigger)", nPaths, 0., nPaths);
242  // monitored trigger occupancy for single lepton triggers
243  hists_["triggerMon_"] = ibooker.book1D("TriggerMon",
244  "Mon(trigger)", nPaths, 0., nPaths);
245  // MET (calo)
246  hists_["metCalo_"] = ibooker.book1D("METCalo", "MET_{Calo}", 50, 0., 200.);
247  // W mass estimate
248  hists_["massW_"] = ibooker.book1D("MassW", "M(W)", 60, 0., 300.);
249  // Top mass estimate
250  hists_["massTop_"] = ibooker.book1D("MassTop", "M(Top)", 50, 0., 500.);
251  // b-tagged Top mass
252  hists_["massBTop_"] = ibooker.book1D("MassBTop", "M(Top, 1 b-tag)", 50, 0., 500.);
253  // set bin labels for trigger monitoring
255 
256  if (verbosity_ == STANDARD) return;
257 
258  // --- [VERBOSE] --- //
259  // eta of the leading muon
260  hists_["muonEta_"] = ibooker.book1D("MuonEta", "#eta(#mu)", 30, -3., 3.);
261  // relative isolation of the candidate muon (depending on the decay channel)
262  hists_["muonRelIso_"] = ibooker.book1D(
263  "MuonRelIso", "Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
264  // eta of the leading electron
265  hists_["elecEta_"] = ibooker.book1D("ElecEta", "#eta(e)", 30, -3., 3.);
266  // std isolation variable of the leading electron
267  hists_["elecRelIso_"] = ibooker.book1D("ElecRelIso", "Iso_{Rel}(e)", 50, 0., 1.);
268  // multiplicity of btagged jets (for track counting high efficiency) with
269  // pt(L2L3)>30
270  hists_["jetMultBEff_"] = ibooker.book1D("JetMultBEff",
271  "N_{30}(TCHE)", 10, 0., 10.);
272  // btag discriminator for track counting high efficiency for jets with
273  // pt(L2L3)>30
274  hists_["jetBDiscEff_"] = ibooker.book1D("JetBDiscEff",
275  "Disc_{TCHE}(jet)", 100, 0., 10.);
276  // eta of the 1. leading jet (corrected to L2+L3)
277  hists_["jet1Eta_"] = ibooker.book1D("Jet1Eta", "#eta_{L2L3}(jet1)", 60, -3., 3.);
278  // pt of the 1. leading jet (corrected to L2+L3)
279  hists_["jet1Pt_"] = ibooker.book1D("Jet1Pt", "pt_{L2L3}(jet1)", 60, 0., 300.);
280  // eta of the 2. leading jet (corrected to L2+L3)
281  hists_["jet2Eta_"] = ibooker.book1D("Jet2Eta", "#eta_{L2L3}(jet2)", 60, -3., 3.);
282  // pt of the 2. leading jet (corrected to L2+L3)
283  hists_["jet2Pt_"] = ibooker.book1D("Jet2Pt", "pt_{L2L3}(jet2)", 60, 0., 300.);
284  // eta of the 3. leading jet (corrected to L2+L3)
285  hists_["jet3Eta_"] = ibooker.book1D("Jet3Eta", "#eta_{L2L3}(jet3)", 60, -3., 3.);
286  // pt of the 3. leading jet (corrected to L2+L3)
287  hists_["jet3Pt_"] = ibooker.book1D("Jet3Pt", "pt_{L2L3}(jet3)", 60, 0., 300.);
288  // eta of the 4. leading jet (corrected to L2+L3)
289  hists_["jet4Eta_"] = ibooker.book1D("Jet4Eta", "#eta_{L2L3}(jet4)", 60, -3., 3.);
290  // pt of the 4. leading jet (corrected to L2+L3)
291  hists_["jet4Pt_"] = ibooker.book1D("Jet4Pt", "pt_{L2L3}(jet4)", 60, 0., 300.);
292  // MET (tc)
293  hists_["metTC_"] = ibooker.book1D("METTC", "MET_{TC}", 50, 0., 200.);
294  // MET (pflow)
295  hists_["metPflow_"] = ibooker.book1D("METPflow", "MET_{Pflow}", 50, 0., 200.);
296  // dz for muons (to suppress cosmis)
297  hists_["muonDelZ_"] = ibooker.book1D("MuonDelZ", "d_{z}(#mu)", 50, -25., 25.);
298  // dxy for muons (to suppress cosmics)
299  hists_["muonDelXY_"] = ibooker.book2D("MuonDelXY",
300  "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
301 
302  // set axes titles for dxy for muons
303  hists_["muonDelXY_"]->setAxisTitle("x [cm]", 1);
304  hists_["muonDelXY_"]->setAxisTitle("y [cm]", 2);
305 
306  if (verbosity_ == VERBOSE) return;
307 
308  // --- [DEBUG] --- //
309  // charged hadron isolation component of the candidate muon (depending on the
310  // decay channel)
311  hists_["muonChHadIso_"] = ibooker.book1D("MuonChHadIsoComp",
312  "ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
313  // neutral hadron isolation component of the candidate muon (depending on the
314  // decay channel)
315  hists_["muonNeHadIso_"] = ibooker.book1D("MuonNeHadIsoComp",
316  "NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
317  // photon isolation component of the candidate muon (depending on the decay
318  // channel)
319  hists_["muonPhIso_"] = ibooker.book1D("MuonPhIsoComp",
320  "Photon_{IsoComponent}(#mu)", 50, 0., 5.);
321  // charged hadron isolation component of the candidate electron (depending on
322  // the decay channel)
323  hists_["elecChHadIso_"] = ibooker.book1D("ElectronChHadIsoComp",
324  "ChHad_{IsoComponent}(e)", 50, 0., 5.);
325  // neutral hadron isolation component of the candidate electron (depending on
326  // the decay channel)
327  hists_["elecNeHadIso_"] = ibooker.book1D("ElectronNeHadIsoComp",
328  "NeHad_{IsoComponent}(e)", 50, 0., 5.);
329  // photon isolation component of the candidate electron (depending on the
330  // decay channel)
331  hists_["elecPhIso_"] = ibooker.book1D("ElectronPhIsoComp",
332  "Photon_{IsoComponent}(e)", 50, 0., 5.);
333  // multiplicity of btagged jets (for track counting high purity) with
334  // pt(L2L3)>30
335  hists_["jetMultBPur_"] = ibooker.book1D("JetMultBPur",
336  "N_{30}(TCHP)", 10, 0., 10.);
337  // btag discriminator for track counting high purity
338  hists_["jetBDiscPur_"] = ibooker.book1D("JetBDiscPur",
339  "Disc_{TCHP}(Jet)", 100, 0., 10.);
340  // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30
341  hists_["jetMultBVtx_"] = ibooker.book1D("JetMultBVtx",
342  "N_{30}(SSVHE)", 10, 0., 10.);
343  // btag discriminator for simple secondary vertex
344  hists_["jetBDiscVtx_"] = ibooker.book1D("JetBDiscVtx",
345  "Disc_{SSVHE}(Jet)", 35, -1., 6.);
346  // multiplicity for combined secondary vertex
347  hists_["jetMultCSVtx_"] = ibooker.book1D("JetMultCSV", "N_{30}(CSV)", 10, 0., 10.);
348  // btag discriminator for combined secondary vertex
349  hists_["jetBCVtx_"] = ibooker.book1D("JetDiscCSV",
350  "Disc_{CSV}(JET)", 100, -1., 2.);
351  // pt of the 1. leading jet (uncorrected)
352  hists_["jet1PtRaw_"] = ibooker.book1D("Jet1PtRaw", "pt_{Raw}(jet1)", 60, 0., 300.);
353  // pt of the 2. leading jet (uncorrected)
354  hists_["jet2PtRaw_"] = ibooker.book1D("Jet2PtRaw", "pt_{Raw}(jet2)", 60, 0., 300.);
355  // pt of the 3. leading jet (uncorrected)
356  hists_["jet3PtRaw_"] = ibooker.book1D("Jet3PtRaw", "pt_{Raw}(jet3)", 60, 0., 300.);
357  // pt of the 4. leading jet (uncorrected)
358  hists_["jet4PtRaw_"] = ibooker.book1D("Jet4PtRaw", "pt_{Raw}(jet4)", 60, 0., 300.);
359  // selected events
360  hists_["eventLogger_"] = ibooker.book2D("EventLogger",
361  "Logged Events", 9, 0., 9., 10, 0., 10.);
362 
363  // set axes titles for selected events
364  hists_["eventLogger_"]->getTH1()->SetOption("TEXT");
365  hists_["eventLogger_"]->setBinLabel(1, "Run", 1);
366  hists_["eventLogger_"]->setBinLabel(2, "Block", 1);
367  hists_["eventLogger_"]->setBinLabel(3, "Event", 1);
368  hists_["eventLogger_"]->setBinLabel(4, "pt_{L2L3}(jet1)", 1);
369  hists_["eventLogger_"]->setBinLabel(5, "pt_{L2L3}(jet2)", 1);
370  hists_["eventLogger_"]->setBinLabel(6, "pt_{L2L3}(jet3)", 1);
371  hists_["eventLogger_"]->setBinLabel(7, "pt_{L2L3}(jet4)", 1);
372  hists_["eventLogger_"]->setBinLabel(8, "M_{W}", 1);
373  hists_["eventLogger_"]->setBinLabel(9, "M_{Top}", 1);
374  hists_["eventLogger_"]->setAxisTitle("logged evts", 2);
375  return;
376 }
std::map< std::string, MonitorElement * > hists_
histogram container
std::vector< std::string > triggerPaths_
Level verbosity_
verbosity level for booking
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string label_
instance label
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
bool TopSingleLepton::MonitorEnsemble::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 93 of file TopSingleLeptonDQM.h.

References hists_.

Referenced by fill().

93  {
94  return hists_.find(histName.c_str()) != hists_.end();
95  };
std::map< std::string, MonitorElement * > hists_
histogram container
void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 378 of file TopSingleLeptonDQM.cc.

References btagCSV_, btagCSVWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, JetCorrector::correction(), mvaPFMET_cff::corrector, eidCutValue_, elecIso_, elecs_, elecSelect_, electronId_, reco::LeafCandidate::eta(), edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), hists_, customizeTrackingMonitorSeedNumber::idx, includeBTag_, edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, logged_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), edm::eventsetup::EventSetupRecordKey::makeKey(), Calculate::massBTopQuark(), Calculate::massTopQuark(), Calculate::massWBoson(), bookConverter::max, TopSingleLepton::MAXJETS, objects.METAnalyzer::met, mets_, VarParsing::mult, metsig::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, EnergyCorrector::pt, reco::LeafCandidate::pt(), MetAnalyzer::pv(), pvs_, pvSelect_, edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerPaths_, triggerTable_, upperEdge_, and TopSingleLepton::WMASS.

Referenced by fill().

379  {
380  // fetch trigger event if configured such
382 
384  if (!event.getByToken(triggerTable_, triggerTable)) return;
385  }
386 
387  /*
388  ------------------------------------------------------------
389 
390  Primary Vertex Monitoring
391 
392  ------------------------------------------------------------
393  */
394  // fill monitoring plots for primary verices
396  if (!event.getByToken(pvs_, pvs)) return;
397  unsigned int pvMult = 0;
398  for (edm::View<reco::Vertex>::const_iterator pv = pvs->begin();
399  pv != pvs->end(); ++pv) {
400  if (!pvSelect_ || (*pvSelect_)(*pv)) pvMult++;
401  }
402  fill("pvMult_", pvMult);
403 
404  /*
405  ------------------------------------------------------------
406 
407  Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy
408  value=5.0)
409 
410  ------------------------------------------------------------
411  */
412  if (!event.eventAuxiliary().run()) return;
413  fill("RunNumb_", event.eventAuxiliary().run());
414 
415  double dummy = 5.;
416  fill("InstLumi_", dummy);
417 
418  /*
419  ------------------------------------------------------------
420 
421  Electron Monitoring
422 
423  ------------------------------------------------------------
424  */
425 
426  // fill monitoring plots for electrons
428  if (!event.getByToken(elecs_, elecs)) return;
429 
430  // check availability of electron id
432  if (!electronId_.isUninitialized()) {
433  if (!event.getByToken(electronId_, electronId)) return;
434  }
435 
436  // loop electron collection
437  unsigned int eMult = 0, eMultIso = 0;
438  std::vector<const reco::PFCandidate*> isoElecs;
439  for (edm::View<reco::PFCandidate>::const_iterator elec = elecs->begin();
440  elec != elecs->end(); ++elec) {
441  if (elec->gsfElectronRef().isNull()) {
442  continue;
443  }
444  reco::GsfElectronRef gsf_el = elec->gsfElectronRef();
445  // restrict to electrons with good electronId
446  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[gsf_el] >=
447  eidCutValue_)) {
448  if (!elecSelect_ || (*elecSelect_)(*elec)) {
449 
450  double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
451  double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
452  double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
453  double el_pfRelIso =
454  (el_ChHadIso +
455  max(0., el_NeHadIso + el_PhIso -
456  0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
457  gsf_el->pt();
458  if (eMult == 0) {
459  // restrict to the leading electron
460  fill("elecPt_", elec->pt());
461  fill("elecEta_", elec->eta());
462  fill("elecRelIso_", el_pfRelIso);
463  fill("elecChHadIso_", el_ChHadIso);
464  fill("elecNeHadIso_", el_NeHadIso);
465  fill("elecPhIso_", el_PhIso);
466  }
467  // in addition to the multiplicity counter buffer the iso
468  // electron candidates for later overlap check with jets
469  ++eMult;
470  if (!elecIso_ || (*elecIso_)(*elec)) {
471  isoElecs.push_back(&(*elec));
472  ++eMultIso;
473  }
474  }
475  }
476  }
477  fill("elecMult_", eMult);
478  fill("elecMultIso_", eMultIso);
479 
480  /*
481  ------------------------------------------------------------
482 
483  Muon Monitoring
484 
485  ------------------------------------------------------------
486  */
487 
488  // fill monitoring plots for muons
489  unsigned int mMult = 0, mMultIso = 0;
490 
493 
494  if (!event.getByToken(muons_, muons)) return;
495 
496  for (edm::View<reco::PFCandidate>::const_iterator muonit = muons->begin();
497  muonit != muons->end(); ++muonit) {
498 
499  if (muonit->muonRef().isNull()) continue;
500  reco::MuonRef muon = muonit->muonRef();
501 
502  // restrict to globalMuons
503  if (muon->isGlobalMuon()) {
504  fill("muonDelZ_", muon->innerTrack()->vz()); // CB using inner track!
505  fill("muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
506 
507  // apply preselection
508  if (!muonSelect_ || (*muonSelect_)(*muonit)) {
509 
510  double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
511  double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
512  double phoEt = muon->pfIsolationR04().sumPhotonEt;
513 
514  double pfRelIso =
515  (chHadPt +
516  max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
517  muon->pt(); // CB dBeta corrected iso!
518 
519  if (mMult == 0) {
520  // restrict to leading muon
521  fill("muonPt_", muon->pt());
522  fill("muonEta_", muon->eta());
523 
524  fill("muonRelIso_", pfRelIso);
525 
526  fill("muonChHadIso_", chHadPt);
527  fill("muonNeHadIso_", neHadEt);
528  fill("muonPhIso_", phoEt);
529  }
530  ++mMult;
531  if (!muonIso_ || (*muonIso_)(*muonit)) ++mMultIso;
532  }
533  }
534  }
535  fill("muonMult_", mMult);
536  fill("muonMultIso_", mMultIso);
537 
538  /*
539  ------------------------------------------------------------
540 
541  Jet Monitoring
542 
543  ------------------------------------------------------------
544  */
545 
546  // check availability of the btaggers
547  edm::Handle<reco::JetTagCollection> btagEff, btagPur, btagVtx, btagCSV;
548  if (includeBTag_) {
549  if (!event.getByToken(btagEff_, btagEff)) return;
550  if (!event.getByToken(btagPur_, btagPur)) return;
551  if (!event.getByToken(btagVtx_, btagVtx)) return;
552  if (!event.getByToken(btagCSV_, btagCSV)) return;
553  }
554  // load jet corrector if configured such
555  const JetCorrector* corrector = 0;
556  if (!jetCorrector_.empty()) {
557  // check whether a jet correcto is in the event setup or not
559  JetCorrectionsRecord>())) {
560  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
561  } else {
562  edm::LogVerbatim("TopSingleLeptonDQM")
563  << "\n"
564  << "-----------------------------------------------------------------"
565  "-------------------- \n"
566  << " No JetCorrectionsRecord available from EventSetup: "
567  " \n"
568  << " - Jets will not be corrected. "
569  " \n"
570  << " - If you want to change this add the following lines to your "
571  "cfg file: \n"
572  << " "
573  " \n"
574  << " ## load jet corrections "
575  " \n"
576  << " "
577  "process.load(\"JetMETCorrections.Configuration."
578  "JetCorrectionServicesAllAlgos_cff\") \n"
579  << " process.prefer(\"ak5CaloL2L3\") "
580  " \n"
581  << " "
582  " \n"
583  << "-----------------------------------------------------------------"
584  "-------------------- \n";
585  }
586  }
587 
588  // loop jet collection
589  std::vector<reco::Jet> correctedJets;
590  std::vector<double> JetTagValues;
591  unsigned int mult = 0, multBEff = 0, multBPur = 0, multBVtx = 0, multCSV = 0;
592 
594  if (!event.getByToken(jets_, jets)) {
595  return;
596  }
597 
599  if (jetIDSelect_) {
600  if (!event.getByToken(jetIDLabel_, jetID)) return;
601  }
602 
603  for (edm::View<reco::Jet>::const_iterator jet = jets->begin();
604  jet != jets->end(); ++jet) {
605  // check jetID for calo jets
606  unsigned int idx = jet - jets->begin();
607  if (jetIDSelect_ &&
608  dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
609  if (!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
610  }
611  // chekc additional jet selection for calo, pf and bare reco jets
612  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
613  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet);
614  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
616  if (!jetSelect(sel)) {
617  continue;
618  }
619  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
620  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
621  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
623  if (!jetSelect(sel)) continue;
624  } else {
625  reco::Jet sel = *jet;
626  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
628  if (!jetSelect(sel)) continue;
629  }
630 
631  // prepare jet to fill monitor histograms
632  reco::Jet monitorJet = *jet;
633  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
634  correctedJets.push_back(monitorJet);
635  ++mult; // determine jet multiplicity
636  if (includeBTag_) {
637  // fill b-discriminators
638  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
639  fill("jetBDiscEff_", (*btagEff)[jetRef]);
640  if ((*btagEff)[jetRef] > btagEffWP_) ++multBEff;
641  fill("jetBDiscPur_", (*btagPur)[jetRef]);
642  if ((*btagPur)[jetRef] > btagPurWP_) ++multBPur;
643  fill("jetBDiscVtx_", (*btagVtx)[jetRef]);
644  if ((*btagVtx)[jetRef] > btagVtxWP_) ++multBVtx;
645  fill("jetBCVtx_", (*btagCSV)[jetRef]);
646  if ((*btagCSV)[jetRef] > btagCSVWP_) ++multCSV;
647 
648  // Fill a vector with Jet b-tag WP for later M3+1tag calculation: CSV
649  // tagger
650  JetTagValues.push_back((*btagCSV)[jetRef]);
651  }
652  // fill pt (raw or L2L3) for the leading four jets
653  if (idx == 0) {
654  fill("jet1Pt_", monitorJet.pt());
655  fill("jet1PtRaw_", jet->pt());
656  fill("jet1Eta_", monitorJet.eta());
657  };
658  if (idx == 1) {
659  fill("jet2Pt_", monitorJet.pt());
660  fill("jet2PtRaw_", jet->pt());
661  fill("jet2Eta_", monitorJet.eta());
662  }
663  if (idx == 2) {
664  fill("jet3Pt_", monitorJet.pt());
665  fill("jet3PtRaw_", jet->pt());
666  fill("jet3Eta_", monitorJet.eta());
667  }
668  if (idx == 3) {
669  fill("jet4Pt_", monitorJet.pt());
670  fill("jet4PtRaw_", jet->pt());
671  fill("jet4Eta_", monitorJet.eta());
672  }
673  }
674  fill("jetMult_", mult);
675  fill("jetMultBEff_", multBEff);
676  fill("jetMultBPur_", multBPur);
677  fill("jetMultBVtx_", multBVtx);
678  fill("jetMultCSVtx_", multCSV);
679 
680  /*
681  ------------------------------------------------------------
682 
683  MET Monitoring
684 
685  ------------------------------------------------------------
686  */
687 
688  // fill monitoring histograms for met
689  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET> > >::const_iterator
690  met_ = mets_.begin();
691  met_ != mets_.end(); ++met_) {
693  if (!event.getByToken(*met_, met)) continue;
694  if (met->begin() != met->end()) {
695  unsigned int idx = met_ - mets_.begin();
696  if (idx == 0) fill("metCalo_", met->begin()->et());
697  if (idx == 1) fill("metTC_", met->begin()->et());
698  if (idx == 2) fill("metPflow_", met->begin()->et());
699  }
700  }
701 
702  /*
703  ------------------------------------------------------------
704 
705  Event Monitoring
706 
707  ------------------------------------------------------------
708  */
709 
710  // fill W boson and top mass estimates
711 
712  Calculate eventKinematics(MAXJETS, WMASS);
713  double wMass = eventKinematics.massWBoson(correctedJets);
714  double topMass = eventKinematics.massTopQuark(correctedJets);
715  if (wMass >= 0 && topMass >= 0) {
716  fill("massW_", wMass);
717  fill("massTop_", topMass);
718  }
719 
720  // Fill M3 with Btag (CSV Tight) requirement
721 
722  if (!includeBTag_) return;
723  if (correctedJets.size() != JetTagValues.size()) return;
724  double btopMass =
725  eventKinematics.massBTopQuark(correctedJets, JetTagValues, btagCSVWP_);
726  if (btopMass >= 0) fill("massBTop_", btopMass);
727 
728  // fill plots for trigger monitoring
729  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
730  (lowerEdge_ < wMass && wMass < upperEdge_)) {
732  fill(event, *triggerTable, "trigger", triggerPaths_);
733  if (logged_ <= hists_.find("eventLogger_")->second->getNbinsY()) {
734  // log runnumber, lumi block, event number & some
735  // more pysics infomation for interesting events
736  fill("eventLogger_", 0.5, logged_ + 0.5, event.eventAuxiliary().run());
737  fill("eventLogger_", 1.5, logged_ + 0.5,
738  event.eventAuxiliary().luminosityBlock());
739  fill("eventLogger_", 2.5, logged_ + 0.5, event.eventAuxiliary().event());
740  if (correctedJets.size() > 0)
741  fill("eventLogger_", 3.5, logged_ + 0.5, correctedJets[0].pt());
742  if (correctedJets.size() > 1)
743  fill("eventLogger_", 4.5, logged_ + 0.5, correctedJets[1].pt());
744  if (correctedJets.size() > 2)
745  fill("eventLogger_", 5.5, logged_ + 0.5, correctedJets[2].pt());
746  if (correctedJets.size() > 3)
747  fill("eventLogger_", 6.5, logged_ + 0.5, correctedJets[3].pt());
748  fill("eventLogger_", 7.5, logged_ + 0.5, wMass);
749  fill("eventLogger_", 8.5, logged_ + 0.5, topMass);
750  ++logged_;
751  }
752  }
753 }
std::map< std::string, MonitorElement * > hists_
histogram container
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
double btagEffWP_
btag working points
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
std::vector< std::string > triggerPaths_
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:20
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonSelect_
extra selection on muons
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
RunNumber_t run() const
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
Jets made from PFObjects.
Definition: PFJet.h:21
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
static const double WMASS
double lowerEdge_
mass window upper and lower edge
Helper class for the calculation of a top and a W boson mass estime.
Definition: TopDQMHelpers.h:67
tuple corrector
Definition: mvaPFMET_cff.py:89
vector< PseudoJet > jets
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:76
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
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:50
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
tuple muons
Definition: patZpeak.py:38
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:85
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
static EventSetupRecordKey makeKey()
bool isUninitialized() const
Definition: EDGetToken.h:73
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
std::string jetCorrector_
jetCorrector
static const unsigned int MAXJETS
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > muonIso_
extra isolation criterion on muon
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 204 of file TopSingleLeptonDQM.h.

References accept(), fill(), hists_, customizeTrackingMonitorSeedNumber::idx, monitorPath(), selectionPath(), and relativeConstraints::value.

207  {
208  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
209  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
210  fill((channel + "Mon_").c_str(), idx + 0.5);
211  // take care to fill triggerMon_ before evts is being called
212  int evts = hists_.find((channel + "Mon_").c_str())
213  ->second->getBinContent(idx + 1);
214  double value = hists_.find((channel + "Eff_").c_str())
215  ->second->getBinContent(idx + 1);
216  fill(
217  (channel + "Eff_").c_str(), idx + 0.5,
218  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
219  value));
220  }
221  }
222 }
std::map< std::string, MonitorElement * > hists_
histogram container
std::string selectionPath(const std::string &label) const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:24
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
std::string monitorPath(const std::string &label) const
void TopSingleLepton::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 97 of file TopSingleLeptonDQM.h.

References booked(), hists_, and edm::second().

97  {
98  if (booked(histName.c_str()))
99  hists_.find(histName.c_str())->second->Fill(value);
100  };
std::map< std::string, MonitorElement * > hists_
histogram container
U second(std::pair< T, U > const &p)
bool booked(const std::string histName) const
check if histogram was booked
void TopSingleLepton::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 102 of file TopSingleLeptonDQM.h.

References booked(), hists_, and edm::second().

102  {
103  if (booked(histName.c_str()))
104  hists_.find(histName.c_str())->second->Fill(xValue, yValue);
105  };
std::map< std::string, MonitorElement * > hists_
histogram container
U second(std::pair< T, U > const &p)
bool booked(const std::string histName) const
check if histogram was booked
void TopSingleLepton::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 107 of file TopSingleLeptonDQM.h.

References booked(), hists_, and edm::second().

108  {
109  if (booked(histName.c_str()))
110  hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue);
111  };
std::map< std::string, MonitorElement * > hists_
histogram container
U second(std::pair< T, U > const &p)
bool booked(const std::string histName) const
check if histogram was booked
std::string TopSingleLepton::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 76 of file TopSingleLeptonDQM.h.

Referenced by fill(), and triggerBinLabels().

76  {
77  return label.substr(label.find(':') + 1);
78  };
std::string TopSingleLepton::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 81 of file TopSingleLeptonDQM.h.

Referenced by fill(), and triggerBinLabels().

81  {
82  return label.substr(0, label.find(':'));
83  };
void MonitorEnsemble::triggerBinLabels ( std::string  channel,
const std::vector< std::string >  labels 
)
inlineprivate

set configurable labels for trigger monitoring histograms

Definition at line 192 of file TopSingleLeptonDQM.h.

References hists_, customizeTrackingMonitorSeedNumber::idx, monitorPath(), and selectionPath().

Referenced by book().

193  {
194  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
195  hists_[(channel + "Mon_").c_str()]
196  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
197  hists_[(channel + "Eff_").c_str()]
198  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
199  monitorPath(labels[idx]) + "]",
200  1);
201  }
202 }
std::map< std::string, MonitorElement * > hists_
histogram container
std::string selectionPath(const std::string &label) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::string monitorPath(const std::string &label) const

Member Data Documentation

edm::EDGetTokenT<reco::JetTagCollection> TopSingleLepton::MonitorEnsemble::btagCSV_
private

Definition at line 175 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopSingleLepton::MonitorEnsemble::btagCSVWP_
private

Definition at line 178 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<reco::JetTagCollection> TopSingleLepton::MonitorEnsemble::btagEff_
private

btag discriminator labels

Definition at line 175 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopSingleLepton::MonitorEnsemble::btagEffWP_
private

btag working points

Definition at line 178 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<reco::JetTagCollection> TopSingleLepton::MonitorEnsemble::btagPur_
private

Definition at line 175 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopSingleLepton::MonitorEnsemble::btagPurWP_
private

Definition at line 178 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<reco::JetTagCollection> TopSingleLepton::MonitorEnsemble::btagVtx_
private

Definition at line 175 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopSingleLepton::MonitorEnsemble::btagVtxWP_
private

Definition at line 178 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopSingleLepton::MonitorEnsemble::directory_
private

Definition at line 189 of file TopSingleLeptonDQM.h.

Referenced by book(), and MonitorEnsemble().

double TopSingleLepton::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 146 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

extra isolation criterion on electron

Definition at line 148 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 123 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

extra selection on electrons

Definition at line 150 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

electronId label

Definition at line 132 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

histogram container

Definition at line 186 of file TopSingleLeptonDQM.h.

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

bool TopSingleLepton::MonitorEnsemble::includeBTag_
private

include btag information or not to be determined from the cfg

Definition at line 173 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopSingleLepton::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 163 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

jetID as an extra selection type

Definition at line 165 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

extra jetID selection on calo jets

Definition at line 167 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

input sources for monitoring

Definition at line 121 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopSingleLepton::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 170 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopSingleLepton::MonitorEnsemble::label_
private

instance label

Definition at line 117 of file TopSingleLeptonDQM.h.

Referenced by Mixins._Labelable::_findDependencies(), book(), and Mixins._Labelable::setLabel().

int TopSingleLepton::MonitorEnsemble::logged_
private

number of logged interesting events

Definition at line 183 of file TopSingleLeptonDQM.h.

Referenced by fill().

double TopSingleLepton::MonitorEnsemble::lowerEdge_
private

mass window upper and lower edge

Definition at line 180 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

considers a vector of METs

Definition at line 119 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopSingleLepton::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 157 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 122 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopSingleLepton::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 160 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::View<reco::Vertex> > TopSingleLepton::MonitorEnsemble::pvs_
private

Definition at line 124 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::Vertex> > TopSingleLepton::MonitorEnsemble::pvSelect_
private

extra selection on primary vertices; meant to investigate the pile-up effect

Definition at line 154 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDConsumerBase TopSingleLepton::MonitorEnsemble::tmpConsumerBase
private

Definition at line 187 of file TopSingleLeptonDQM.h.

std::vector<std::string> TopSingleLepton::MonitorEnsemble::triggerPaths_
private

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

Definition at line 129 of file TopSingleLeptonDQM.h.

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

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

trigger table

Definition at line 126 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopSingleLepton::MonitorEnsemble::upperEdge_
private

Definition at line 180 of file TopSingleLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level TopSingleLepton::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 111 of file TopSingleLeptonDQM.h.

Referenced by book(), and MonitorEnsemble().