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
SingleTopTChannelLepton::MonitorEnsemble Class Reference

#include <SingleTopTChannelLeptonDQM.h>

Public Types

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

Public Member Functions

void book (std::string directory)
 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, const edm::VParameterSet &vcfg, 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
btagCombVtx_
 
double btagCombVtxWP_
 
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_
 
double eidCutValue_
 
std::string elecIso_
 extra isolation criterion on electron More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
elecs_
 
edm::EDGetTokenT< edm::View
< reco::GsfElectron > > 
elecs_gsf_
 
std::string 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::string muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
muons_
 
std::string muonSelect_
 extra selection on muons More...
 
edm::EDGetTokenT< edm::View
< reco::Vertex > > 
pvs_
 
std::unique_ptr
< StringCutObjectSelector
< reco::Vertex > > 
pvSelect_
 
DQMStorestore_
 storage manager More...
 
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 54 of file SingleTopTChannelLeptonDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

default contructor

Definition at line 25 of file SingleTopTChannelLeptonDQM.cc.

References book(), btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, DEBUG, eidCutValue_, elecIso_, elecs_, elecs_gsf_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), includeBTag_, jetCorrector_, bTagSequences_cff::jetID, 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_.

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

default destructor

Definition at line 68 of file SingleTopTChannelLeptonDQM.h.

68 {}

Member Function Documentation

void MonitorEnsemble::book ( std::string  directory)

book histograms in subdirectory directory

Definition at line 205 of file SingleTopTChannelLeptonDQM.cc.

References cond::rpcobimon::current, hists_, label_, cppFunctionSkipper::operator, STANDARD, store_, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), triggerPaths_, VERBOSE, and verbosity_.

Referenced by MonitorEnsemble().

205  {
206  // set up the current directory path
208  current += label_;
210  store_->setCurrentFolder(current);
211 
212  // determine number of bins for trigger monitoring
213  unsigned int nPaths = triggerPaths_.size();
214 
215  // --- [STANDARD] --- //
216  // number of selected primary vertices
217  hists_["pvMult_"] = store_->book1D("PvMult", "N_{pvs}", 100, 0., 100.);
218  // pt of the leading muon
219  hists_["muonPt_"] = store_->book1D("MuonPt", "pt(#mu)", 50, 0., 250.);
220  // muon multiplicity before std isolation
221  hists_["muonMult_"] = store_->book1D("MuonMult", "N_{20}(#mu)", 10, 0., 10.);
222  // muon multiplicity after std isolation
223  hists_["muonMultIso_"] =
224  store_->book1D("MuonMultIso", "N_{Iso}(#mu)", 10, 0., 10.);
225  // pt of the leading electron
226  hists_["elecPt_"] = store_->book1D("ElecPt", "pt(e)", 50, 0., 250.);
227  // electron multiplicity before std isolation
228  hists_["elecMult_"] = store_->book1D("ElecMult", "N_{30}(e)", 10, 0., 10.);
229  // electron multiplicity after std isolation
230  hists_["elecMultIso_"] =
231  store_->book1D("ElecMultIso", "N_{Iso}(e)", 10, 0., 10.);
232  // multiplicity of jets with pt>20 (corrected to L2+L3)
233  hists_["jetMult_"] = store_->book1D("JetMult", "N_{30}(jet)", 10, 0., 10.);
234  // trigger efficiency estimates for single lepton triggers
235  hists_["triggerEff_"] =
236  store_->book1D("TriggerEff", "Eff(trigger)", nPaths, 0., nPaths);
237  // monitored trigger occupancy for single lepton triggers
238  hists_["triggerMon_"] =
239  store_->book1D("TriggerMon", "Mon(trigger)", nPaths, 0., nPaths);
240  // MET (calo)
241  hists_["metCalo_"] = store_->book1D("METCalo", "MET_{Calo}", 50, 0., 200.);
242  // W mass estimate
243  hists_["massW_"] = store_->book1D("MassW", "M(W)", 60, 0., 300.);
244  // Top mass estimate
245  hists_["massTop_"] = store_->book1D("MassTop", "M(Top)", 50, 0., 500.);
246  // W mass transverse estimate mu
247  hists_["MTWm_"] = store_->book1D("MTWm", "M_{T}^{W}(#mu)", 60, 0., 300.);
248  // Top mass transverse estimate mu
249  hists_["mMTT_"] = store_->book1D("mMTT", "M_{T}^{t}(#mu)", 50, 0., 500.);
250 
251  // W mass transverse estimate e
252  hists_["MTWe_"] = store_->book1D("MTWe", "M_{T}^{W}(e)", 60, 0., 300.);
253  // Top mass transverse estimate e
254  hists_["eMTT_"] = store_->book1D("eMTT", "M_{T}^{t}(e)", 50, 0., 500.);
255 
256  // set bin labels for trigger monitoring
258 
259  if (verbosity_ == STANDARD) return;
260 
261  // --- [VERBOSE] --- //
262 
263  // eta of the leading muon
264  hists_["muonEta_"] = store_->book1D("MuonEta", "#eta(#mu)", 30, -3., 3.);
265  // std isolation variable of the leading muon
266  hists_["muonPFRelIso_"] =
267  store_->book1D("MuonPFRelIso", "PFIso_{Rel}(#mu)", 50, 0., 1.);
268  hists_["muonRelIso_"] =
269  store_->book1D("MuonRelIso", "Iso_{Rel}(#mu)", 50, 0., 1.);
270 
271  // eta of the leading electron
272  hists_["elecEta_"] = store_->book1D("ElecEta", "#eta(e)", 30, -3., 3.);
273  // std isolation variable of the leading electron
274  hists_["elecRelIso_"] =
275  store_->book1D("ElecRelIso", "Iso_{Rel}(e)", 50, 0., 1.);
276  hists_["elecPFRelIso_"] =
277  store_->book1D("ElecPFRelIso", "PFIso_{Rel}(e)", 50, 0., 1.);
278 
279  // multiplicity of btagged jets (for track counting high efficiency) with
280  // pt(L2L3)>30
281  hists_["jetMultBEff_"] =
282  store_->book1D("JetMultBEff", "N_{30}(b/eff)", 10, 0., 10.);
283  // btag discriminator for track counting high efficiency for jets with
284  // pt(L2L3)>30
285  hists_["jetBDiscEff_"] =
286  store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.);
287 
288  // eta of the 1. leading jet
289  hists_["jet1Eta_"] = store_->book1D("Jet1Eta", "#eta (jet1)", 50, -5., 5.);
290  // eta of the 2. leading jet
291  hists_["jet2Eta_"] = store_->book1D("Jet2Eta", "#eta (jet2)", 50, -5., 5.);
292 
293  // pt of the 1. leading jet (corrected to L2+L3)
294  hists_["jet1Pt_"] = store_->book1D("Jet1Pt", "pt_{L2L3}(jet1)", 60, 0., 300.);
295  // pt of the 2. leading jet (corrected to L2+L3)
296  hists_["jet2Pt_"] = store_->book1D("Jet2Pt", "pt_{L2L3}(jet2)", 60, 0., 300.);
297 
298  // eta and pt of the b-tagged jet (filled only when nJets==2)
299  hists_["TaggedJetEta_"] =
300  store_->book1D("TaggedJetEta", "#eta (Tagged jet)", 50, -5., 5.);
301  hists_["TaggedJetPt_"] =
302  store_->book1D("TaggedJetPt", "pt_{L2L3}(Tagged jet)", 60, 0., 300.);
303 
304  // eta and pt of the jet not passing b-tag (filled only when nJets==2)
305  hists_["UnTaggedJetEta_"] =
306  store_->book1D("UnTaggedJetEta", "#eta (UnTagged jet)", 50, -5., 5.);
307  hists_["UnTaggedJetPt_"] =
308  store_->book1D("UnTaggedJetPt", "pt_{L2L3}(UnTagged jet)", 60, 0., 300.);
309 
310  // eta and pt of the most forward jet in the event with nJets==2
311  hists_["FwdJetEta_"] =
312  store_->book1D("FwdJetEta", "#eta (Fwd jet)", 50, -5., 5.);
313  hists_["FwdJetPt_"] =
314  store_->book1D("FwdJetPt", "pt_{L2L3}(Fwd jet)", 60, 0., 300.);
315 
316  // 2D histogram (pt,eta) of the b-tagged jet (filled only when nJets==2)
317  hists_["TaggedJetPtEta_"] =
318  store_->book2D("TaggedJetPt_Eta", "(pt vs #eta)_{L2L3}(Tagged jet)", 60,
319  0., 300., 50, -5., 5.);
320 
321  // 2D histogram (pt,eta) of the not-b tagged jet (filled only when nJets==2)
322  hists_["UnTaggedJetPtEta_"] =
323  store_->book2D("UnTaggedJetPt_Eta", "(pt vs #eta)_{L2L3}(UnTagged jet)",
324  60, 0., 300., 50, -5., 5.);
325 
326  // MET (tc)
327  hists_["metTC_"] = store_->book1D("METTC", "MET_{TC}", 50, 0., 200.);
328  // MET (pflow)
329  hists_["metPflow_"] = store_->book1D("METPflow", "MET_{Pflow}", 50, 0., 200.);
330 
331  // dz for muons (to suppress cosmis)
332  hists_["muonDelZ_"] = store_->book1D("MuonDelZ", "d_{z}(#mu)", 50, -25., 25.);
333  // dxy for muons (to suppress cosmics)
334  hists_["muonDelXY_"] =
335  store_->book2D("MuonDelXY", "d_{xy}(#mu)", 50, -0.1, 0.1, 50, -0.1, 0.1);
336 
337  // set axes titles for dxy for muons
338  hists_["muonDelXY_"]->setAxisTitle("x [cm]", 1);
339  hists_["muonDelXY_"]->setAxisTitle("y [cm]", 2);
340 
341  if (verbosity_ == VERBOSE) return;
342 
343  // --- [DEBUG] --- //
344 
345  // relative muon isolation from charged hadrons for the leading muon
346  hists_["muonChHadIso_"] =
347  store_->book1D("MuonChHadIso", "Iso_{ChHad}(#mu)", 100, 0., 1.);
348  // relative muon isolation from neutral hadrons for the leading muon
349  hists_["muonNeuHadIso_"] =
350  store_->book1D("MuonNeuHadIso", "Iso_{NeuHad}(#mu)", 100, 0., 1.);
351  // relative muon isolation from photons for the leading muon
352  hists_["muonPhIso_"] =
353  store_->book1D("MuonPhIso", "Iso_{Ph}(#mu)", 100, 0., 1.);
354 
355  // relative electron isolation from charged hadrons for the leading electron
356  hists_["elecChHadIso_"] =
357  store_->book1D("ElecChHadIso", "Iso_{ChHad}(e)", 100, 0., 1.);
358  // relative electron isolation from neutral hadrons for the leading electron
359  hists_["elecNeuHadIso_"] =
360  store_->book1D("ElecNeuHadIso", "Iso_{NeuHad}(e)", 100, 0., 1.);
361  // relative electron isolation from photons for the leading electron
362  hists_["elecPhIso_"] =
363  store_->book1D("ElecPhIso", "Iso_{Ph}(e)", 100, 0., 1.);
364 
365  // multiplicity of btagged jets (for track counting high purity) with
366  // pt(L2L3)>30
367  hists_["jetMultBPur_"] =
368  store_->book1D("JetMultBPur", "N_{30}(b/pur)", 10, 0., 10.);
369  // btag discriminator for track counting high purity
370  hists_["jetBDiscPur_"] =
371  store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 200, -10., 10.);
372  // btag discriminator for track counting high purity for 1. leading jet
373  hists_["jet1BDiscPur_"] =
374  store_->book1D("Jet1BDiscPur", "Disc_{b/pur}(Jet1)", 200, -10., 10.);
375  // btag discriminator for track counting high purity for 2. leading jet
376  hists_["jet2BDiscPur_"] =
377  store_->book1D("Jet2BDiscPur", "Disc_{b/pur}(Jet2)", 200, -10., 10.);
378 
379  // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30
380  hists_["jetMultBVtx_"] =
381  store_->book1D("JetMultBVtx", "N_{30}(b/vtx)", 10, 0., 10.);
382  // btag discriminator for simple secondary vertex
383  hists_["jetBDiscVtx_"] =
384  store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.);
385 
386  // multiplicity of btagged jets (for combined secondary vertex) with
387  // pt(L2L3)>30
388  hists_["jetMultBCombVtx_"] =
389  store_->book1D("JetMultBCombVtx", "N_{30}(b/CSV)", 10, 0., 10.);
390  // btag discriminator for combined secondary vertex
391  hists_["jetBDiscCombVtx_"] =
392  store_->book1D("JetBDiscCombVtx", "Disc_{b/CSV}(Jet)", 60, -1., 2.);
393  // btag discriminator for combined secondary vertex for 1. leading jet
394  hists_["jet1BDiscCombVtx_"] =
395  store_->book1D("Jet1BDiscCombVtx", "Disc_{b/CSV}(Jet1)", 60, -1., 2.);
396  // btag discriminator for combined secondary vertex for 2. leading jet
397  hists_["jet2BDiscCombVtx_"] =
398  store_->book1D("Jet2BDiscCombVtx", "Disc_{b/CSV}(Jet2)", 60, -1., 2.);
399 
400  // pt of the 1. leading jet (uncorrected)
401  hists_["jet1PtRaw_"] =
402  store_->book1D("Jet1PtRaw", "pt_{Raw}(jet1)", 60, 0., 300.);
403  // pt of the 2. leading jet (uncorrected)
404  hists_["jet2PtRaw_"] =
405  store_->book1D("Jet2PtRaw", "pt_{Raw}(jet2)", 60, 0., 300.);
406 
407  // selected events
408  hists_["eventLogger_"] =
409  store_->book2D("EventLogger", "Logged Events", 9, 0., 9., 10, 0., 10.);
410 
411  // set axes titles for selected events
412  hists_["eventLogger_"]->getTH1()->SetOption("TEXT");
413  hists_["eventLogger_"]->setBinLabel(1, "Run", 1);
414  hists_["eventLogger_"]->setBinLabel(2, "Block", 1);
415  hists_["eventLogger_"]->setBinLabel(3, "Event", 1);
416  hists_["eventLogger_"]->setBinLabel(4, "pt_{L2L3}(jet1)", 1);
417  hists_["eventLogger_"]->setBinLabel(5, "pt_{L2L3}(jet2)", 1);
418  hists_["eventLogger_"]->setBinLabel(6, "pt_{L2L3}(jet3)", 1);
419  hists_["eventLogger_"]->setBinLabel(7, "pt_{L2L3}(jet4)", 1);
420  hists_["eventLogger_"]->setBinLabel(8, "M_{W}", 1);
421  hists_["eventLogger_"]->setBinLabel(9, "M_{Top}", 1);
422  hists_["eventLogger_"]->setAxisTitle("logged evts", 2);
423  return;
424 }
std::map< std::string, MonitorElement * > hists_
histogram container
Level verbosity_
verbosity level for booking
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
bool SingleTopTChannelLepton::MonitorEnsemble::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 95 of file SingleTopTChannelLeptonDQM.h.

References hists_.

Referenced by fill().

95  {
96  return hists_.find(histName.c_str()) != hists_.end();
97  };
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 426 of file SingleTopTChannelLeptonDQM.cc.

References funct::abs(), btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, JetCorrector::correction(), alignCSCRings::e, eidCutValue_, elecIso_, elecs_, elecs_gsf_, elecSelect_, electronId_, reco::LeafCandidate::eta(), edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), hists_, customizeTrackingMonitorSeedNumber::idx, includeBTag_, edm::Ref< C, T, F >::isNull(), edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, logged_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), edm::eventsetup::EventSetupRecordKey::makeKey(), Calculate::massTopQuark(), Calculate::massWBoson(), max(), SingleTopTChannelLepton::MAXJETS, caloMETBenchmarkGeneric_cfi::met, mets_, RPCpg::mu, VarParsing::mult, trackingTruthProducerFastSim_cfi::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, RecoTauCleanerPlugins::pt, reco::LeafCandidate::pt(), pvs_, pvSelect_, edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, Calculate::tmassTopQuark(), Calculate::tmassWBoson(), triggerPaths_, triggerTable_, upperEdge_, and SingleTopTChannelLepton::WMASS.

Referenced by fill().

427  {
428  // fetch trigger event if configured such
431  if (!event.getByToken(triggerTable_, triggerTable)) return;
432  }
433 
434  /*
435  ------------------------------------------------------------
436 
437  Primary Vertex Monitoring
438 
439  ------------------------------------------------------------
440  */
441 
442  // fill monitoring plots for primary vertices
444  if (!event.getByToken(pvs_, pvs)) return;
445  unsigned int pvMult = 0;
446  for (edm::View<reco::Vertex>::const_iterator pv = pvs->begin();
447  pv != pvs->end(); ++pv) {
448  if (!pvSelect_ || (*pvSelect_)(*pv)) pvMult++;
449  }
450  fill("pvMult_", pvMult);
451 
452  /*
453  ------------------------------------------------------------
454 
455  Electron Monitoring
456 
457  ------------------------------------------------------------
458  */
459 
460  // fill monitoring plots for electrons
467 
468  if (!event.getByToken(elecs_, elecs)) return;
469 
470  if (!event.getByToken(elecs_gsf_, elecs_gsf)) return;
471 
472  // check availability of electron id
474  if (!electronId_.isUninitialized()) {
475  if (!event.getByToken(electronId_, electronId)) {
476  return;
477  }
478  }
479  // loop electron collection
480  unsigned int eMult = 0, eMultIso = 0;
481  std::vector<const reco::GsfElectron*> isoElecs;
483 
484  unsigned int idx_gsf = 0;
485  for (elec_it = elecs->begin(); elec_it != elecs->end(); ++elec_it) {
486  if (elec_it->gsfElectronRef().isNull()) continue;
487 
488  reco::GsfElectronRef elec = elec_it->gsfElectronRef();
489  if (elec->gsfTrack().isNull()) continue;
490 
491  // restrict to electrons with good electronId
492  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[elec] >=
493  eidCutValue_)) {
494  if ((elecSelect)(*elec_it)) {
495  double isolationRel =
496  (elec->dr03TkSumPt() + elec->dr03EcalRecHitSumEt() +
497  elec->dr03HcalTowerSumEt()) /
498  elec->pt();
499 
500  double isolationChHad =
501  elec->pt() /
502  (elec->pt() + elec->pfIsolationVariables().sumChargedHadronPt);
503  double isolationNeuHad =
504  elec->pt() /
505  (elec->pt() + elec->pfIsolationVariables().sumNeutralHadronEt);
506  double isolationPhoton =
507  elec->pt() /
508  (elec->pt() + elec->pfIsolationVariables().sumPhotonEt);
509  double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
510  double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
511  double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
512  double PFisolationRel =
513  (el_ChHadIso +
514  max(0., el_NeHadIso + el_PhIso -
515  0.5 * elec->pfIsolationVariables().sumPUPt)) /
516  elec->pt();
517 
518  if (eMult == 0) {
519  // restrict to the leading electron
520  fill("elecPt_", elec->pt());
521  fill("elecEta_", elec->eta());
522  fill("elecRelIso_", isolationRel);
523  fill("elecPFRelIso_", PFisolationRel);
524  fill("elecChHadIso_", isolationChHad);
525  fill("elecNeuHadIso_", isolationNeuHad);
526  fill("elecPhIso_", isolationPhoton);
527  }
528  // in addition to the multiplicity counter buffer the iso
529  // electron candidates for later overlap check with jets
530  ++eMult;
531  if ((elecIso)(*elec_it)) {
532  if (eMultIso == 0) e = *elec;
533  isoElecs.push_back(&(*elec));
534  ++eMultIso;
535  }
536  }
537  }
538  idx_gsf++;
539  }
540 
541  fill("elecMult_", eMult);
542  fill("elecMultIso_", eMultIso);
543 
544  /*
545  ------------------------------------------------------------
546 
547  Muon Monitoring
548 
549  ------------------------------------------------------------
550  */
551 
552  // fill monitoring plots for muons
553  unsigned int mMult = 0, mMultIso = 0;
554 
560  reco::Muon mu;
561 
562  if (!event.getByToken(muons_, muons)) return;
563  for (muonit = muons->begin(); muonit != muons->end();
564  ++muonit) { // for now, to use Reco::Muon need to substitute muonit
565  // with muon
566  // and comment the MuonRef and PFCandidate parts
567 
568  if (muonit->muonRef().isNull()) continue;
569  reco::MuonRef muon = muonit->muonRef();
570 
571  if (muon->innerTrack().isNull()) continue;
572 
573  // restrict to globalMuons
574  if (muon->isGlobalMuon()) {
575  fill("muonDelZ_", muon->globalTrack()->vz());
576  fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy());
577 
578  // apply selection
579  if (muonSelect(*muonit)) {
580 
581  double isolationRel =
582  (muon->isolationR03().sumPt + muon->isolationR03().emEt +
583  muon->isolationR03().hadEt) /
584  muon->pt();
585  double isolationChHad =
586  muon->pt() /
587  (muon->pt() + muon->pfIsolationR04().sumChargedHadronPt);
588  double isolationNeuHad =
589  muon->pt() /
590  (muon->pt() + muon->pfIsolationR04().sumNeutralHadronEt);
591  double isolationPhoton =
592  muon->pt() / (muon->pt() + muon->pfIsolationR04().sumPhotonEt);
593  double PFisolationRel = (muon->pfIsolationR04().sumChargedHadronPt +
594  muon->pfIsolationR04().sumNeutralHadronEt +
595  muon->pfIsolationR04().sumPhotonEt) /
596  muon->pt();
597 
598  if (mMult == 0) {
599  // restrict to leading muon
600  fill("muonPt_", muon->pt());
601  fill("muonEta_", muon->eta());
602  fill("muonRelIso_", isolationRel);
603  fill("muonChHadIso_", isolationChHad);
604  fill("muonNeuHadIso_", isolationNeuHad);
605  fill("muonPhIso_", isolationPhoton);
606  fill("muonPFRelIso_", PFisolationRel);
607  }
608  ++mMult;
609 
610  if (muonIso(*muonit)) {
611  if (mMultIso == 0) mu = *muon;
612  ++mMultIso;
613  }
614  }
615  }
616  }
617  fill("muonMult_", mMult);
618  fill("muonMultIso_", mMultIso);
619 
620  /*
621  ------------------------------------------------------------
622 
623  Jet Monitoring
624 
625  ------------------------------------------------------------
626  */
627  // check availability of the btaggers
628  edm::Handle<reco::JetTagCollection> btagEff, btagPur, btagVtx, btagCombVtx;
629  if (includeBTag_) {
630  if (!event.getByToken(btagEff_, btagEff)) return;
631  if (!event.getByToken(btagPur_, btagPur)) return;
632  if (!event.getByToken(btagVtx_, btagVtx)) return;
633  if (!event.getByToken(btagCombVtx_, btagCombVtx)) return;
634  }
635 
636  // load jet corrector if configured such
637  const JetCorrector* corrector = 0;
638  if (!jetCorrector_.empty()) {
639  // check whether a jet correcto is in the event setup or not
641  JetCorrectionsRecord>())) {
642  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
643  } else {
644  edm::LogVerbatim("SingleTopTChannelLeptonDQM")
645  << "\n"
646  << "-----------------------------------------------------------------"
647  "-------------------- \n"
648  << " No JetCorrectionsRecord available from EventSetup:\n"
649  << " - Jets will not be corrected.\n"
650  << " - If you want to change this add the following lines to your "
651  "cfg file:\n"
652  << "\n"
653  << " ## load jet corrections\n"
654  << " "
655  "process.load(\"JetMETCorrections.Configuration."
656  "JetCorrectionServicesAllAlgos_cff\") \n"
657  << " process.prefer(\"ak5CaloL2L3\")\n"
658  << "\n"
659  << "-----------------------------------------------------------------"
660  "-------------------- \n";
661  }
662  }
663 
664  // loop jet collection
665  std::vector<reco::Jet> correctedJets;
666  unsigned int mult = 0, multBEff = 0, multBPur = 0, multNoBPur = 0,
667  multBVtx = 0, multBCombVtx = 0;
668 
670  if (!event.getByToken(jets_, jets)) return;
671 
673  if (jetIDSelect_) {
674  if (!event.getByToken(jetIDLabel_, jetID)) return;
675  }
676 
677  vector<double> bJetDiscVal;
678  vector<double> NobJetDiscVal;
679  reco::Jet TaggedJetCand;
680  reco::Jet UnTaggedJetCand;
681  reco::Jet FwdJetCand;
682  for (edm::View<reco::Jet>::const_iterator jet = jets->begin();
683  jet != jets->end(); ++jet) {
684  // check jetID for calo jets
685  unsigned int idx = jet - jets->begin();
686  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
687  if (jetIDSelect_ &&
688  dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
689  if (!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
690  }
691  }
692 
693  // check additional jet selection for calo, pf and bare reco jets
694  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
695  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet);
696  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
698  if (!jetSelect(sel)) {
699  continue;
700  }
701  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
702  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
703  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
705  if (!jetSelect(sel)) continue;
706  } else {
707  reco::Jet sel = *jet;
708  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
710  if (!jetSelect(sel)) continue;
711  }
712  // check for overlaps -- comment this to be synchronous with the selection
713  // bool overlap=false;
714  // for(std::vector<const reco::GsfElectron*>::const_iterator
715  // elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
716  // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(),
717  // jet->phi())<0.4){overlap=true; break;}
718  //} if(overlap){continue;}
719 
720  // prepare jet to fill monitor histograms
721  reco::Jet monitorJet = *jet;
722  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
723  correctedJets.push_back(monitorJet);
724 
725  ++mult; // determine jet multiplicity
726  if (includeBTag_) {
727  // fill b-discriminators
728  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
729  if ((*btagVtx)[jetRef] > btagVtxWP_) ++multBVtx;
730  if ((*btagCombVtx)[jetRef] > btagCombVtxWP_) ++multBCombVtx;
731  if ((*btagPur)[jetRef] > btagPurWP_) {
732  if (multBPur == 0) {
733  TaggedJetCand = monitorJet;
734  // TaggedJetCand = *jet;
735  bJetDiscVal.push_back((*btagPur)[jetRef]);
736 
737  } else if (multBPur == 1) {
738  bJetDiscVal.push_back((*btagPur)[jetRef]);
739  if (bJetDiscVal[1] > bJetDiscVal[0]) TaggedJetCand = monitorJet;
740  // TaggedJetCand = *jet;
741  }
742  ++multBPur;
743  } else {
744  if (multNoBPur == 0) {
745  UnTaggedJetCand = monitorJet;
746  NobJetDiscVal.push_back((*btagPur)[jetRef]);
747 
748  } else if (multNoBPur == 1) {
749  NobJetDiscVal.push_back((*btagPur)[jetRef]);
750  if (NobJetDiscVal[1] < NobJetDiscVal[0]) UnTaggedJetCand = monitorJet;
751  }
752 
753  ++multNoBPur;
754  }
755 
756  if ((*btagEff)[jetRef] > btagEffWP_) ++multBEff;
757 
758  if (mult == 1) {
759  fill("jet1BDiscPur_", (*btagPur)[jetRef]);
760  fill("jet1BDiscCombVtx_", (*btagCombVtx)[jetRef]);
761  } else if (mult == 2) {
762  fill("jet2BDiscPur_", (*btagPur)[jetRef]);
763  fill("jet2BDiscCombVtx_", (*btagCombVtx)[jetRef]);
764  }
765 
766  fill("jetBDiscEff_", (*btagEff)[jetRef]);
767  fill("jetBDiscPur_", (*btagPur)[jetRef]);
768  fill("jetBDiscVtx_", (*btagVtx)[jetRef]);
769  fill("jetBDiscCombVtx_", (*btagCombVtx)[jetRef]);
770  }
771  // fill pt (raw or L2L3) for the leading jets
772  if (mult == 1) {
773  fill("jet1Pt_", monitorJet.pt());
774  fill("jet1Eta_", monitorJet.eta());
775  fill("jet1PtRaw_", jet->pt());
776  FwdJetCand = monitorJet;
777  }
778 
779  if (mult == 2) {
780  fill("jet2Pt_", monitorJet.pt());
781  fill("jet2Eta_", monitorJet.eta());
782  fill("jet2PtRaw_", jet->pt());
783 
784  if (abs(monitorJet.eta()) > abs(FwdJetCand.eta())) {
785  FwdJetCand = monitorJet;
786  }
787 
788  fill("FwdJetPt_", FwdJetCand.pt());
789  fill("FwdJetEta_", FwdJetCand.eta());
790  }
791  }
792 
793  if (multNoBPur == 1 && multBPur == 1) {
794 
795  fill("TaggedJetPtEta_", TaggedJetCand.pt(), TaggedJetCand.eta());
796  fill("UnTaggedJetPtEta_", UnTaggedJetCand.pt(), UnTaggedJetCand.eta());
797 
798  fill("TaggedJetPt_", TaggedJetCand.pt());
799  fill("TaggedJetEta_", TaggedJetCand.eta());
800  fill("UnTaggedJetPt_", UnTaggedJetCand.pt());
801  fill("UnTaggedJetEta_", UnTaggedJetCand.eta());
802  }
803 
804  fill("jetMult_", mult);
805  fill("jetMultBEff_", multBEff);
806  fill("jetMultBPur_", multBPur);
807  fill("jetMultBVtx_", multBVtx);
808  fill("jetMultBCombVtx_", multBCombVtx);
809 
810  /*
811  ------------------------------------------------------------
812 
813  MET Monitoring
814 
815  ------------------------------------------------------------
816  */
817 
818  // fill monitoring histograms for met
819  reco::MET mET;
820  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET>>>::const_iterator
821  met_ = mets_.begin();
822  met_ != mets_.end(); ++met_) {
824  if (!event.getByToken(*met_, met)) continue;
825  if (met->begin() != met->end()) {
826  unsigned int idx = met_ - mets_.begin();
827  if (idx == 0) {
828  fill("metCalo_", met->begin()->et());
829  }
830  if (idx == 1) {
831  fill("metTC_", met->begin()->et());
832  }
833  if (idx == 2) {
834  fill("metPflow_", met->begin()->et());
835  mET = *(met->begin());
836  }
837  }
838  }
839 
840  /*
841  ------------------------------------------------------------
842 
843  Event Monitoring
844 
845  ------------------------------------------------------------
846  */
847 
848  // fill W boson and top mass estimates
849  Calculate eventKinematics(MAXJETS, WMASS);
850  double wMass = eventKinematics.massWBoson(correctedJets);
851  double topMass = eventKinematics.massTopQuark(correctedJets);
852  if (wMass >= 0 && topMass >= 0) {
853  fill("massW_", wMass);
854  fill("massTop_", topMass);
855  }
856  // fill plots for trigger monitoring
857  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
858  (lowerEdge_ < wMass && wMass < upperEdge_)) {
860  fill(event, *triggerTable, "trigger", triggerPaths_);
861  if (logged_ <= hists_.find("eventLogger_")->second->getNbinsY()) {
862  // log runnumber, lumi block, event number & some
863  // more pysics infomation for interesting events
864  fill("eventLogger_", 0.5, logged_ + 0.5, event.eventAuxiliary().run());
865  fill("eventLogger_", 1.5, logged_ + 0.5,
866  event.eventAuxiliary().luminosityBlock());
867  fill("eventLogger_", 2.5, logged_ + 0.5, event.eventAuxiliary().event());
868  if (correctedJets.size() > 0)
869  fill("eventLogger_", 3.5, logged_ + 0.5, correctedJets[0].pt());
870  if (correctedJets.size() > 1)
871  fill("eventLogger_", 4.5, logged_ + 0.5, correctedJets[1].pt());
872  if (correctedJets.size() > 2)
873  fill("eventLogger_", 5.5, logged_ + 0.5, correctedJets[2].pt());
874  if (correctedJets.size() > 3)
875  fill("eventLogger_", 6.5, logged_ + 0.5, correctedJets[3].pt());
876  fill("eventLogger_", 7.5, logged_ + 0.5, wMass);
877  fill("eventLogger_", 8.5, logged_ + 0.5, topMass);
878  ++logged_;
879  }
880  }
881  if (multBPur != 0 && mMultIso == 1) {
882 
883  double mtW = eventKinematics.tmassWBoson(&mu, mET, TaggedJetCand);
884  fill("MTWm_", mtW);
885  double MTT = eventKinematics.tmassTopQuark(&mu, mET, TaggedJetCand);
886  fill("mMTT_", MTT);
887  }
888 
889  if (multBPur != 0 && eMultIso == 1) {
890  double mtW = eventKinematics.tmassWBoson(&e, mET, TaggedJetCand);
891  fill("MTWe_", mtW);
892  double MTT = eventKinematics.tmassTopQuark(&e, mET, TaggedJetCand);
893  fill("eMTT_", MTT);
894  }
895 }
std::map< std::string, MonitorElement * > hists_
histogram container
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetTagCollection > btagCombVtx_
RunNumber_t run() const
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:444
std::string muonIso_
extra isolation criterion on muon
std::string muonSelect_
extra selection on muons
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Jets made from PFObjects.
Definition: PFJet.h:21
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
Helper class for the calculation of a top and a W boson mass estime.
Definition: TopDQMHelpers.h:68
std::string elecSelect_
extra selection on electrons
double lowerEdge_
mass window upper and lower edge
const T & max(const T &a, const T &b)
Definition: MET.h:42
vector< PseudoJet > jets
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_gsf_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
bool isNull() const
Checks for null.
Definition: Ref.h:247
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:69
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
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
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
static const unsigned int MAXJETS
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
tuple muons
Definition: patZpeak.py:38
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
static EventSetupRecordKey makeKey()
bool isUninitialized() const
Definition: EDGetToken.h:71
virtual float pt() const GCC11_FINAL
transverse momentum
EventNumber_t event() const
std::string elecIso_
extra isolation criterion on electron
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 217 of file SingleTopTChannelLeptonDQM.h.

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

220  {
221  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
222  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
223  fill((channel + "Mon_").c_str(), idx + 0.5);
224  // take care to fill triggerMon_ before evts is being called
225  int evts = hists_.find((channel + "Mon_").c_str())
226  ->second->getBinContent(idx + 1);
227  double value = hists_.find((channel + "Eff_").c_str())
228  ->second->getBinContent(idx + 1);
229  fill(
230  (channel + "Eff_").c_str(), idx + 0.5,
231  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
232  value));
233  }
234  }
235 }
std::map< std::string, MonitorElement * > hists_
histogram container
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const
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
void SingleTopTChannelLepton::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 99 of file SingleTopTChannelLeptonDQM.h.

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

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

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

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

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

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

Referenced by fill(), and triggerBinLabels().

78  {
79  return label.substr(label.find(':') + 1);
80  };
std::string SingleTopTChannelLepton::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 83 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and triggerBinLabels().

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

set configurable labels for trigger monitoring histograms

Definition at line 205 of file SingleTopTChannelLeptonDQM.h.

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

Referenced by book().

206  {
207  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
208  hists_[(channel + "Mon_").c_str()]
209  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
210  hists_[(channel + "Eff_").c_str()]
211  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
212  monitorPath(labels[idx]) + "]",
213  1);
214  }
215 }
std::map< std::string, MonitorElement * > hists_
histogram container
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

Member Data Documentation

edm::EDGetTokenT<reco::JetTagCollection> SingleTopTChannelLepton::MonitorEnsemble::btagCombVtx_
private

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagCombVtxWP_
private

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

btag discriminator labels

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagEffWP_
private

btag working points

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagPurWP_
private

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagVtxWP_
private

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::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 157 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::elecIso_
private

extra isolation criterion on electron

Definition at line 159 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 127 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::View<reco::GsfElectron> > SingleTopTChannelLepton::MonitorEnsemble::elecs_gsf_
private

Definition at line 126 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::elecSelect_
private

extra selection on electrons

Definition at line 161 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

electronId label

Definition at line 142 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

histogram container

Definition at line 201 of file SingleTopTChannelLeptonDQM.h.

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

bool SingleTopTChannelLepton::MonitorEnsemble::includeBTag_
private

include btag information or not to be determined from the cfg

Definition at line 185 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 173 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

jetID as an extra selection type

Definition at line 175 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

extra jetID selection on calo jets

Definition at line 178 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

input sources for monitoring

Definition at line 124 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::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 182 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::label_
private
int SingleTopTChannelLepton::MonitorEnsemble::logged_
private

number of logged interesting events

Definition at line 197 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill().

double SingleTopTChannelLepton::MonitorEnsemble::lowerEdge_
private

mass window upper and lower edge

Definition at line 194 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

considers a vector of METs

Definition at line 121 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 168 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 125 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 170 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 128 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

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

Definition at line 165 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

DQMStore* SingleTopTChannelLepton::MonitorEnsemble::store_
private

storage manager

Definition at line 199 of file SingleTopTChannelLeptonDQM.h.

Referenced by book().

edm::EDConsumerBase SingleTopTChannelLepton::MonitorEnsemble::tmpConsumerBase
private

Definition at line 202 of file SingleTopTChannelLeptonDQM.h.

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

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

Definition at line 138 of file SingleTopTChannelLeptonDQM.h.

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

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

trigger table

Definition at line 134 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::upperEdge_
private

Definition at line 194 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level SingleTopTChannelLepton::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 113 of file SingleTopTChannelLeptonDQM.h.

Referenced by book(), and MonitorEnsemble().