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 (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, 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_
 
std::string directory_
 
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_
 
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_
 
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 btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, DEBUG, directory_, 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  directory_ = 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
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 ( DQMStore::IBooker ibooker)

book histograms in subdirectory directory

Definition at line 205 of file SingleTopTChannelLeptonDQM.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_.

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

fill monitor histograms with electronId and jetCorrections

Definition at line 414 of file SingleTopTChannelLeptonDQM.cc.

References funct::abs(), btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, JetCorrector::correction(), mvaPFMET_cff::corrector, 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(), bookConverter::max, SingleTopTChannelLepton::MAXJETS, caloMETBenchmarkGeneric_cfi::met, mets_, RPCpg::mu, VarParsing::mult, trackingTruthProducerFastSim_cfi::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, Calculate::tmassTopQuark(), Calculate::tmassWBoson(), triggerPaths_, triggerTable_, upperEdge_, and SingleTopTChannelLepton::WMASS.

Referenced by fill().

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

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

221  {
222  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
223  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
224  fill((channel + "Mon_").c_str(), idx + 0.5);
225  // take care to fill triggerMon_ before evts is being called
226  int evts = hists_.find((channel + "Mon_").c_str())
227  ->second->getBinContent(idx + 1);
228  double value = hists_.find((channel + "Eff_").c_str())
229  ->second->getBinContent(idx + 1);
230  fill(
231  (channel + "Eff_").c_str(), idx + 0.5,
232  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
233  value));
234  }
235  }
236 }
std::map< std::string, MonitorElement * > hists_
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_
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_
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_
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 206 of file SingleTopTChannelLeptonDQM.h.

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

Referenced by book().

207  {
208  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
209  hists_[(channel + "Mon_").c_str()]
210  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
211  hists_[(channel + "Eff_").c_str()]
212  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
213  monitorPath(labels[idx]) + "]",
214  1);
215  }
216 }
std::map< std::string, MonitorElement * > hists_
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().

std::string SingleTopTChannelLepton::MonitorEnsemble::directory_
private

Definition at line 203 of file SingleTopTChannelLeptonDQM.h.

Referenced by book(), 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

storage manager histogram container

Definition at line 200 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().

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

Definition at line 201 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().