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_, 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 
143  edm::ParameterSet btagCombVtx =
144  jetExtras.getParameter<edm::ParameterSet>("jetBTaggers")
145  .getParameter<edm::ParameterSet>("combinedSecondaryVertex");
147  btagCombVtx.getParameter<edm::InputTag>("label"));
148  btagCombVtxWP_ = btagCombVtx.getParameter<double>("workingPoint");
149  }
150  }
151 
152  // triggerExtras are optional; they may be omitted or empty
153  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
154  edm::ParameterSet triggerExtras =
155  cfg.getParameter<edm::ParameterSet>("triggerExtras");
157  triggerExtras.getParameter<edm::InputTag>("src"));
158  triggerPaths_ =
159  triggerExtras.getParameter<std::vector<std::string>>("paths");
160  }
161 
162  // massExtras is optional; in case it's not found no mass
163  // window cuts are applied for the same flavor monitor
164  // histograms
165  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
166  edm::ParameterSet massExtras =
167  cfg.getParameter<edm::ParameterSet>("massExtras");
168  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
169  upperEdge_ = massExtras.getParameter<double>("upperEdge");
170  }
171 
172  // setup the verbosity level for booking histograms;
173  // per default the verbosity level will be set to
174  // STANDARD. This will also be the chosen level in
175  // the case when the monitoring PSet is not found
177  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
178  edm::ParameterSet monitoring =
179  cfg.getParameter<edm::ParameterSet>("monitoring");
180  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
181  verbosity_ = DEBUG;
182  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
184  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
186  }
187  // and don't forget to do the histogram booking
188  directory_ = cfg.getParameter<std::string>("directory");
189 
190 
193 
194 
195 
198 
199 }
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_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso
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< 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 201 of file SingleTopTChannelLeptonDQM.cc.

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

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

References funct::abs(), btagCombVtx_, btagCombVtxWP_, 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().

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

double SingleTopTChannelLepton::MonitorEnsemble::btagEffWP_
private

btag working points

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

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

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

double SingleTopTChannelLepton::MonitorEnsemble::btagPurWP_
private

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

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

Definition at line 188 of file SingleTopTChannelLeptonDQM.h.

double SingleTopTChannelLepton::MonitorEnsemble::btagVtxWP_
private

Definition at line 192 of file SingleTopTChannelLeptonDQM.h.

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().