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::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
elecIso
 
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::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
elecSelect
 
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::unique_ptr
< StringCutObjectSelector
< reco::CaloJet > > 
jetSelectCalo
 
std::unique_ptr
< StringCutObjectSelector
< reco::Jet > > 
jetSelectJet
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFJet > > 
jetSelectPF
 
std::string label_
 instance label More...
 
int logged_
 number of logged interesting events More...
 
double lowerEdge_
 mass window upper and lower edge More...
 
std::vector< edm::EDGetTokenT
< edm::View< reco::MET > > > 
mets_
 considers a vector of METs More...
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
muonIso
 
std::string muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
muons_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
muonSelect
 
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 24 of file SingleTopTChannelLeptonDQM.cc.

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

28  : label_(label),
29  pvSelect_(nullptr),
30  jetIDSelect_(nullptr),
31  includeBTag_(false),
32  lowerEdge_(-1.),
33  upperEdge_(-1.),
34  logged_(0) {
35  // sources have to be given; this PSet is not optional
36  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
38  sources.getParameter<edm::InputTag>("muons"));
40  sources.getParameter<edm::InputTag>("elecs_gsf"));
42  sources.getParameter<edm::InputTag>("elecs"));
44  sources.getParameter<edm::InputTag>("jets"));
45  for (edm::InputTag const& tag :
46  sources.getParameter<std::vector<edm::InputTag>>("mets"))
47  mets_.push_back(iC.consumes<edm::View<reco::MET>>(tag));
49  sources.getParameter<edm::InputTag>("pvs"));
50  // electronExtras are optional; they may be omitted or
51  // empty
52  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
53  edm::ParameterSet elecExtras =
54  cfg.getParameter<edm::ParameterSet>("elecExtras");
55  // select is optional; in case it's not found no
56  // selection will be applied
57  if (elecExtras.existsAs<std::string>("select")) {
58  elecSelect_ = vcfg[1].getParameter<std::string>("select");
59  }
60  // isolation is optional; in case it's not found no
61  // isolation will be applied
62  if (elecExtras.existsAs<std::string>("isolation")) {
63  elecIso_ = elecExtras.getParameter<std::string>("isolation");
64  }
65 
66 
67  // electronId is optional; in case it's not found the
68  // InputTag will remain empty
69  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
70  edm::ParameterSet elecId =
71  elecExtras.getParameter<edm::ParameterSet>("electronId");
73  elecId.getParameter<edm::InputTag>("src"));
74  eidCutValue_ = elecId.getParameter<double>("cutValue");
75  }
76  }
77  // pvExtras are opetional; they may be omitted or empty
78  if (cfg.existsAs<edm::ParameterSet>("pvExtras")) {
79  edm::ParameterSet pvExtras =
80  cfg.getParameter<edm::ParameterSet>("pvExtras");
81  // select is optional; in case it's not found no
82  // selection will be applied
83  if (pvExtras.existsAs<std::string>("select")) {
85  pvExtras.getParameter<std::string>("select")));
86  }
87  }
88  // muonExtras are optional; they may be omitted or empty
89  if (cfg.existsAs<edm::ParameterSet>(
90  "muonExtras")) { // && vcfg.existsAs<std::vector<edm::ParameterSet>
91  // >("selection")){
92  edm::ParameterSet muonExtras =
93  cfg.getParameter<edm::ParameterSet>("muonExtras");
94 
95  // select is optional; in case it's not found no
96  // selection will be applied
97  if (muonExtras.existsAs<std::string>("select")) {
98  muonSelect_ = vcfg[1].getParameter<std::string>("select");
99  }
100  // isolation is optional; in case it's not found no
101  // isolation will be applied
102  if (muonExtras.existsAs<std::string>("isolation")) {
103  muonIso_ = muonExtras.getParameter<std::string>("isolation");
104  }
105  }
106 
107 
108  // jetExtras are optional; they may be omitted or
109  // empty
110  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
111  edm::ParameterSet jetExtras =
112  cfg.getParameter<edm::ParameterSet>("jetExtras");
113  // jetCorrector is optional; in case it's not found
114  // the InputTag will remain empty
115  if (jetExtras.existsAs<std::string>("jetCorrector")) {
116  jetCorrector_ = jetExtras.getParameter<std::string>("jetCorrector");
117  }
118  // read jetID information if it exists
119  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
120  edm::ParameterSet jetID =
121  jetExtras.getParameter<edm::ParameterSet>("jetID");
123  jetID.getParameter<edm::InputTag>("label"));
125  jetID.getParameter<std::string>("select")));
126  }
127  // select is optional; in case it's not found no
128  // selection will be applied (only implemented for
129  // CaloJets at the moment)
130  if (jetExtras.existsAs<std::string>("select")) {
131 
132  jetSelect_ = jetExtras.getParameter<std::string>("select");
133  jetSelect_ = vcfg[2].getParameter<std::string>("select");
134  }
135 
136  // jetBDiscriminators are optional; in case they are
137  // not found the InputTag will remain empty; they
138  // consist of pairs of edm::JetFlavorAssociation's &
139  // corresponding working points
140  includeBTag_ = jetExtras.existsAs<edm::ParameterSet>("jetBTaggers");
141  if (includeBTag_) {
142  edm::ParameterSet btagEff =
143  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
144  .getParameter<edm::ParameterSet>("trackCountingEff");
146  btagEff.getParameter<edm::InputTag>("label"));
147  btagEffWP_ = btagEff.getParameter<double>("workingPoint");
148  edm::ParameterSet btagPur =
149  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
150  .getParameter<edm::ParameterSet>("trackCountingPur");
152  btagPur.getParameter<edm::InputTag>("label"));
153  btagPurWP_ = btagPur.getParameter<double>("workingPoint");
154  edm::ParameterSet btagVtx =
155  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
156  .getParameter<edm::ParameterSet>("secondaryVertex");
158  btagVtx.getParameter<edm::InputTag>("label"));
159  btagVtxWP_ = btagVtx.getParameter<double>("workingPoint");
160  edm::ParameterSet btagCombVtx =
161  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
162  .getParameter<edm::ParameterSet>("combinedSecondaryVertex");
164  btagCombVtx.getParameter<edm::InputTag>("label"));
165  btagCombVtxWP_ = btagCombVtx.getParameter<double>("workingPoint");
166  }
167  }
168 
169  // triggerExtras are optional; they may be omitted or empty
170  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
171  edm::ParameterSet triggerExtras =
172  cfg.getParameter<edm::ParameterSet>("triggerExtras");
174  triggerExtras.getParameter<edm::InputTag>("src"));
175  triggerPaths_ =
176  triggerExtras.getParameter<std::vector<std::string>>("paths");
177  }
178 
179  // massExtras is optional; in case it's not found no mass
180  // window cuts are applied for the same flavor monitor
181  // histograms
182  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
183  edm::ParameterSet massExtras =
184  cfg.getParameter<edm::ParameterSet>("massExtras");
185  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
186  upperEdge_ = massExtras.getParameter<double>("upperEdge");
187  }
188 
189  // setup the verbosity level for booking histograms;
190  // per default the verbosity level will be set to
191  // STANDARD. This will also be the chosen level in
192  // the case when the monitoring PSet is not found
194  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
195  edm::ParameterSet monitoring =
196  cfg.getParameter<edm::ParameterSet>("monitoring");
197  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
198  verbosity_ = DEBUG;
199  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
201  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
203  }
204  // and don't forget to do the histogram booking
205  directory_ = cfg.getParameter<std::string>("directory");
206 
207 
210 
211  //jetSelectCalo=0;
212  //jetSelectPF=0;
213  //jetSelectJet=0;
214 
217 
218 }
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:186
Level verbosity_
verbosity level for booking
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > elecSelect
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_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > elecIso
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::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect
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 220 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_.

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

Referenced by fill().

430  {
431  // fetch trigger event if configured such
434  if (!event.getByToken(triggerTable_, triggerTable)) return;
435  }
436 
437  /*
438  ------------------------------------------------------------
439 
440  Primary Vertex Monitoring
441 
442  ------------------------------------------------------------
443  */
444 
445  // fill monitoring plots for primary vertices
447  if (!event.getByToken(pvs_, pvs)) return;
448  unsigned int pvMult = 0;
449  for (edm::View<reco::Vertex>::const_iterator pv = pvs->begin();
450  pv != pvs->end(); ++pv) {
451  if (!pvSelect_ || (*pvSelect_)(*pv)) pvMult++;
452  }
453  fill("pvMult_", pvMult);
454 
455  /*
456  ------------------------------------------------------------
457 
458  Electron Monitoring
459 
460  ------------------------------------------------------------
461  */
462 
463  // fill monitoring plots for electrons
467 
469 
470  if (!event.getByToken(elecs_, elecs)) return;
471 
472  if (!event.getByToken(elecs_gsf_, elecs_gsf)) return;
473 
474  // check availability of electron id
476  if (!electronId_.isUninitialized()) {
477  if (!event.getByToken(electronId_, electronId)) {
478  return;
479  }
480  }
481  // loop electron collection
482  unsigned int eMult = 0, eMultIso = 0;
483  std::vector<const reco::GsfElectron*> isoElecs;
485 
486  unsigned int idx_gsf = 0;
487  for (elec_it = elecs->begin(); elec_it != elecs->end(); ++elec_it) {
488  if (elec_it->gsfElectronRef().isNull()) continue;
489 
490  reco::GsfElectronRef elec = elec_it->gsfElectronRef();
491  if (elec->gsfTrack().isNull()) continue;
492 
493  // restrict to electrons with good electronId
494  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[elec] >=
495  eidCutValue_)) {
496  if ((*elecSelect)(*elec_it)) {
497  double isolationRel =
498  (elec->dr03TkSumPt() + elec->dr03EcalRecHitSumEt() +
499  elec->dr03HcalTowerSumEt()) /
500  elec->pt();
501 
502  double isolationChHad =
503  elec->pt() /
504  (elec->pt() + elec->pfIsolationVariables().sumChargedHadronPt);
505  double isolationNeuHad =
506  elec->pt() /
507  (elec->pt() + elec->pfIsolationVariables().sumNeutralHadronEt);
508  double isolationPhoton =
509  elec->pt() /
510  (elec->pt() + elec->pfIsolationVariables().sumPhotonEt);
511  double el_ChHadIso = elec->pfIsolationVariables().sumChargedHadronPt;
512  double el_NeHadIso = elec->pfIsolationVariables().sumNeutralHadronEt;
513  double el_PhIso = elec->pfIsolationVariables().sumPhotonEt;
514  double PFisolationRel =
515  (el_ChHadIso +
516  max(0., el_NeHadIso + el_PhIso -
517  0.5 * elec->pfIsolationVariables().sumPUPt)) /
518  elec->pt();
519 
520  if (eMult == 0) {
521  // restrict to the leading electron
522  fill("elecPt_", elec->pt());
523  fill("elecEta_", elec->eta());
524  fill("elecRelIso_", isolationRel);
525  fill("elecPFRelIso_", PFisolationRel);
526  fill("elecChHadIso_", isolationChHad);
527  fill("elecNeuHadIso_", isolationNeuHad);
528  fill("elecPhIso_", isolationPhoton);
529  }
530  // in addition to the multiplicity counter buffer the iso
531  // electron candidates for later overlap check with jets
532  ++eMult;
533  if ((*elecIso)(*elec_it)) {
534  if (eMultIso == 0) e = *elec;
535  isoElecs.push_back(&(*elec));
536  ++eMultIso;
537  }
538  }
539  }
540  idx_gsf++;
541  }
542 
543  fill("elecMult_", eMult);
544  fill("elecMultIso_", eMultIso);
545 
546  /*
547  ------------------------------------------------------------
548 
549  Muon Monitoring
550 
551  ------------------------------------------------------------
552  */
553 
554  // fill monitoring plots for muons
555  unsigned int mMult = 0, mMultIso = 0;
556 
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.);
697  if ( jetSelectCalo==0)
699  if (!((*jetSelectCalo)(sel))) {
700  continue;
701  }
702  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
703  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
704  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
705  if ( jetSelectPF==0)
707  if (!((*jetSelectPF)(sel))) continue;
708  } else {
709  reco::Jet sel = *jet;
710  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
711  if ( jetSelectJet==0)
713 
714  if (!((*jetSelectJet)(sel))) continue;
715  }
716  // check for overlaps -- comment this to be synchronous with the selection
717  // bool overlap=false;
718  // for(std::vector<const reco::GsfElectron*>::const_iterator
719  // elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
720  // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(),
721  // jet->phi())<0.4){overlap=true; break;}
722  //} if(overlap){continue;}
723 
724  // prepare jet to fill monitor histograms
725  reco::Jet monitorJet = *jet;
726  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
727  correctedJets.push_back(monitorJet);
728 
729  ++mult; // determine jet multiplicity
730  if (includeBTag_) {
731  // fill b-discriminators
732  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
733  if ((*btagVtx)[jetRef] > btagVtxWP_) ++multBVtx;
734  if ((*btagCombVtx)[jetRef] > btagCombVtxWP_) ++multBCombVtx;
735  if ((*btagPur)[jetRef] > btagPurWP_) {
736  if (multBPur == 0) {
737  TaggedJetCand = monitorJet;
738  // TaggedJetCand = *jet;
739  bJetDiscVal.push_back((*btagPur)[jetRef]);
740 
741  } else if (multBPur == 1) {
742  bJetDiscVal.push_back((*btagPur)[jetRef]);
743  if (bJetDiscVal[1] > bJetDiscVal[0]) TaggedJetCand = monitorJet;
744  // TaggedJetCand = *jet;
745  }
746  ++multBPur;
747  } else {
748  if (multNoBPur == 0) {
749  UnTaggedJetCand = monitorJet;
750  NobJetDiscVal.push_back((*btagPur)[jetRef]);
751 
752  } else if (multNoBPur == 1) {
753  NobJetDiscVal.push_back((*btagPur)[jetRef]);
754  if (NobJetDiscVal[1] < NobJetDiscVal[0]) UnTaggedJetCand = monitorJet;
755  }
756 
757  ++multNoBPur;
758  }
759 
760  if ((*btagEff)[jetRef] > btagEffWP_) ++multBEff;
761 
762  if (mult == 1) {
763  fill("jet1BDiscPur_", (*btagPur)[jetRef]);
764  fill("jet1BDiscCombVtx_", (*btagCombVtx)[jetRef]);
765  } else if (mult == 2) {
766  fill("jet2BDiscPur_", (*btagPur)[jetRef]);
767  fill("jet2BDiscCombVtx_", (*btagCombVtx)[jetRef]);
768  }
769 
770  fill("jetBDiscEff_", (*btagEff)[jetRef]);
771  fill("jetBDiscPur_", (*btagPur)[jetRef]);
772  fill("jetBDiscVtx_", (*btagVtx)[jetRef]);
773  fill("jetBDiscCombVtx_", (*btagCombVtx)[jetRef]);
774  }
775  // fill pt (raw or L2L3) for the leading jets
776  if (mult == 1) {
777  fill("jet1Pt_", monitorJet.pt());
778  fill("jet1Eta_", monitorJet.eta());
779  fill("jet1PtRaw_", jet->pt());
780  FwdJetCand = monitorJet;
781  }
782 
783  if (mult == 2) {
784  fill("jet2Pt_", monitorJet.pt());
785  fill("jet2Eta_", monitorJet.eta());
786  fill("jet2PtRaw_", jet->pt());
787 
788  if (abs(monitorJet.eta()) > abs(FwdJetCand.eta())) {
789  FwdJetCand = monitorJet;
790  }
791 
792  fill("FwdJetPt_", FwdJetCand.pt());
793  fill("FwdJetEta_", FwdJetCand.eta());
794  }
795  }
796 
797  if (multNoBPur == 1 && multBPur == 1) {
798 
799  fill("TaggedJetPtEta_", TaggedJetCand.pt(), TaggedJetCand.eta());
800  fill("UnTaggedJetPtEta_", UnTaggedJetCand.pt(), UnTaggedJetCand.eta());
801 
802  fill("TaggedJetPt_", TaggedJetCand.pt());
803  fill("TaggedJetEta_", TaggedJetCand.eta());
804  fill("UnTaggedJetPt_", UnTaggedJetCand.pt());
805  fill("UnTaggedJetEta_", UnTaggedJetCand.eta());
806  }
807 
808  fill("jetMult_", mult);
809  fill("jetMultBEff_", multBEff);
810  fill("jetMultBPur_", multBPur);
811  fill("jetMultBVtx_", multBVtx);
812  fill("jetMultBCombVtx_", multBCombVtx);
813 
814  /*
815  ------------------------------------------------------------
816 
817  MET Monitoring
818 
819  ------------------------------------------------------------
820  */
821 
822  // fill monitoring histograms for met
823  reco::MET mET;
824  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET>>>::const_iterator
825  met_ = mets_.begin();
826  met_ != mets_.end(); ++met_) {
828  if (!event.getByToken(*met_, met)) continue;
829  if (met->begin() != met->end()) {
830  unsigned int idx = met_ - mets_.begin();
831  if (idx == 0) {
832  fill("metCalo_", met->begin()->et());
833  }
834  if (idx == 1) {
835  fill("metTC_", met->begin()->et());
836  }
837  if (idx == 2) {
838  fill("metPflow_", met->begin()->et());
839  mET = *(met->begin());
840  }
841  }
842  }
843 
844  /*
845  ------------------------------------------------------------
846 
847  Event Monitoring
848 
849  ------------------------------------------------------------
850  */
851 
852  // fill W boson and top mass estimates
853  Calculate eventKinematics(MAXJETS, WMASS);
854  double wMass = eventKinematics.massWBoson(correctedJets);
855  double topMass = eventKinematics.massTopQuark(correctedJets);
856  if (wMass >= 0 && topMass >= 0) {
857  fill("massW_", wMass);
858  fill("massTop_", topMass);
859  }
860  // fill plots for trigger monitoring
861  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
862  (lowerEdge_ < wMass && wMass < upperEdge_)) {
864  fill(event, *triggerTable, "trigger", triggerPaths_);
865  if (logged_ <= hists_.find("eventLogger_")->second->getNbinsY()) {
866  // log runnumber, lumi block, event number & some
867  // more pysics infomation for interesting events
868  fill("eventLogger_", 0.5, logged_ + 0.5, event.eventAuxiliary().run());
869  fill("eventLogger_", 1.5, logged_ + 0.5,
870  event.eventAuxiliary().luminosityBlock());
871  fill("eventLogger_", 2.5, logged_ + 0.5, event.eventAuxiliary().event());
872  if (correctedJets.size() > 0)
873  fill("eventLogger_", 3.5, logged_ + 0.5, correctedJets[0].pt());
874  if (correctedJets.size() > 1)
875  fill("eventLogger_", 4.5, logged_ + 0.5, correctedJets[1].pt());
876  if (correctedJets.size() > 2)
877  fill("eventLogger_", 5.5, logged_ + 0.5, correctedJets[2].pt());
878  if (correctedJets.size() > 3)
879  fill("eventLogger_", 6.5, logged_ + 0.5, correctedJets[3].pt());
880  fill("eventLogger_", 7.5, logged_ + 0.5, wMass);
881  fill("eventLogger_", 8.5, logged_ + 0.5, topMass);
882  ++logged_;
883  }
884  }
885  if (multBPur != 0 && mMultIso == 1) {
886 
887  double mtW = eventKinematics.tmassWBoson(&mu, mET, TaggedJetCand);
888  fill("MTWm_", mtW);
889  double MTT = eventKinematics.tmassTopQuark(&mu, mET, TaggedJetCand);
890  fill("mMTT_", MTT);
891  }
892 
893  if (multBPur != 0 && eMultIso == 1) {
894  double mtW = eventKinematics.tmassWBoson(&e, mET, TaggedJetCand);
895  fill("MTWe_", mtW);
896  double MTT = eventKinematics.tmassTopQuark(&e, mET, TaggedJetCand);
897  fill("eMTT_", MTT);
898  }
899 }
std::unique_ptr< StringCutObjectSelector< reco::PFJet > > jetSelectPF
std::map< std::string, MonitorElement * > hists_
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::unique_ptr< StringCutObjectSelector< reco::CaloJet > > jetSelectCalo
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > elecSelect
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Jets made from PFObjects.
Definition: PFJet.h:21
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
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
double lowerEdge_
mass window upper and lower edge
tuple corrector
Definition: mvaPFMET_cff.py:89
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_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso
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:249
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > elecIso
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:71
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:85
static EventSetupRecordKey makeKey()
bool isUninitialized() const
Definition: EDGetToken.h:71
EventNumber_t event() const
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect
std::unique_ptr< StringCutObjectSelector< reco::Jet > > jetSelectJet
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 230 of file SingleTopTChannelLeptonDQM.h.

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

233  {
234  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
235  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
236  fill((channel + "Mon_").c_str(), idx + 0.5);
237  // take care to fill triggerMon_ before evts is being called
238  int evts = hists_.find((channel + "Mon_").c_str())
239  ->second->getBinContent(idx + 1);
240  double value = hists_.find((channel + "Eff_").c_str())
241  ->second->getBinContent(idx + 1);
242  fill(
243  (channel + "Eff_").c_str(), idx + 0.5,
244  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
245  value));
246  }
247  }
248 }
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 218 of file SingleTopTChannelLeptonDQM.h.

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

Referenced by book().

219  {
220  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
221  hists_[(channel + "Mon_").c_str()]
222  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
223  hists_[(channel + "Eff_").c_str()]
224  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
225  monitorPath(labels[idx]) + "]",
226  1);
227  }
228 }
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::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > SingleTopTChannelLepton::MonitorEnsemble::elecIso
private

Definition at line 213 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 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::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > SingleTopTChannelLepton::MonitorEnsemble::elecSelect
private

Definition at line 212 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 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::unique_ptr<StringCutObjectSelector<reco::CaloJet> > SingleTopTChannelLepton::MonitorEnsemble::jetSelectCalo
private

Definition at line 208 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill().

std::unique_ptr<StringCutObjectSelector<reco::Jet> > SingleTopTChannelLepton::MonitorEnsemble::jetSelectJet
private

Definition at line 210 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill().

std::unique_ptr<StringCutObjectSelector<reco::PFJet> > SingleTopTChannelLepton::MonitorEnsemble::jetSelectPF
private

Definition at line 209 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill().

std::string SingleTopTChannelLepton::MonitorEnsemble::label_
private

instance label

Definition at line 119 of file SingleTopTChannelLeptonDQM.h.

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

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::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > SingleTopTChannelLepton::MonitorEnsemble::muonIso
private

Definition at line 206 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 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::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > SingleTopTChannelLepton::MonitorEnsemble::muonSelect
private

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