CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopDiLeptonHLTOfflineDQM.cc
Go to the documentation of this file.
1 //#include <algorithm>
15 
17 
19 
20 /*Originally from DQM/Physics by R. Wolf and J. Andrea*/
21 using namespace std;
22 namespace HLTOfflineDQMTopDiLepton {
23 
24  // maximal Delta to consider
25  // hlt and reco objects matched
26  static const double DRMIN = 0.05;
27 
28  MonitorDiLepton::MonitorDiLepton(const char* label, const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) :
29  label_(label), eidPattern_(0), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0),
30  lowerEdge_(-1.), upperEdge_(-1.), elecMuLogged_(0), diMuonLogged_(0), diElecLogged_(0)
31  {
32  // sources have to be given; this PSet is not optional
33  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
34  muons_= iC.consumes< edm::View<reco::Muon> >(sources.getParameter<edm::InputTag>("muons"));
35  elecs_= iC.consumes< edm::View<reco::GsfElectron> >(sources.getParameter<edm::InputTag>("elecs"));
36  jets_ = iC.consumes< edm::View<reco::Jet> >(sources.getParameter<edm::InputTag>("jets" ));
37 
38  const auto& mets = sources.getParameter<std::vector<edm::InputTag>>("mets");
39  for (const auto& met: mets) {
40  mets_.push_back(iC.consumes<edm::View<reco::MET>>(met));
41  }
42 
43  // elecExtras are optional; they may be omitted or empty
44  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
45  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
46  // select is optional; in case it's not found no
47  // selection will be applied
48  if( elecExtras.existsAs<std::string>("select") ){
50  }
51  // isolation is optional; in case it's not found no
52  // isolation will be applied
53  if( elecExtras.existsAs<std::string>("isolation") ){
55  }
56  // electronId is optional; in case it's not found the
57  // InputTag will remain empty
58  if( elecExtras.existsAs<edm::ParameterSet>("electronId") ){
59  edm::ParameterSet elecId=elecExtras.getParameter<edm::ParameterSet>("electronId");
60  electronId_= iC.consumes< edm::ValueMap<float> >(elecId.getParameter<edm::InputTag>("src"));
61  eidPattern_= elecId.getParameter<int>("pattern");
62  }
63  }
64  // muonExtras are optional; they may be omitted or empty
65  if( cfg.existsAs<edm::ParameterSet>("muonExtras") ){
66  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
67  // select is optional; in case it's not found no
68  // selection will be applied
69  if( muonExtras.existsAs<std::string>("select") ){
71  }
72  // isolation is optional; in case it's not found no
73  // isolation will be applied
74  if( muonExtras.existsAs<std::string>("isolation") ){
76  }
77  }
78  // jetExtras are optional; they may be omitted or empty
79  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
80  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
81  // jetCorrector is optional; in case it's not found
82  // the InputTag will remain empty
83  if( jetExtras.existsAs<std::string>("jetCorrector") ){
84  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
85  }
86  // read jetID information if it exists
87  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
88  edm::ParameterSet jetID=jetExtras.getParameter<edm::ParameterSet>("jetID");
89  jetIDLabel_ = iC.consumes< reco::JetIDValueMap >(jetID.getParameter<edm::InputTag>("label"));
91  }
92  // select is optional; in case it's not found no
93  // selection will be applied (only implemented for
94  // CaloJets at the moment)
95  if( jetExtras.existsAs<std::string>("select") ){
96  jetSelect_= jetExtras.getParameter<std::string>("select");
97  }
98  }
99  // triggerExtras are optional; they may be omitted or empty
100  processName_ = "HLT";
101  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
102  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
103  triggerTable_= iC.consumes< edm::TriggerResults >(triggerExtras.getParameter<edm::InputTag>("src"));
104  processName_ = triggerExtras.getParameter<edm::InputTag>("src").process();
105  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsELECMU");
106  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsDIMUON");
107  diElecPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsDIELEC");
108  }
109  // massExtras is optional; in case it's not found no mass
110  // window cuts are applied for the same flavor monitor
111  // histograms
112  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
113  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
114  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
115  upperEdge_= massExtras.getParameter<double>("upperEdge");
116  }
117 
118  // and don't forget to do the histogram booking
119  folder_=cfg.getParameter<std::string>("directory");
120 
121 // triggerEventWithRefsTag_ = iC.consumes< trigger::TriggerEventWithRefs >(edm::InputTag("hltTriggerSummaryRAW","",processName_));
122  triggerSummaryTokenRAW = iC.consumes <trigger::TriggerEventWithRefs>(edm::InputTag("hltTriggerSummaryRAW","",processName_));
123  triggerSummaryTokenAOD = iC.consumes <trigger::TriggerEventWithRefs> (edm::InputTag("hltTriggerSummaryAOD","",processName_));
124 
125  }
126 
127  void
129  {
130  //set up the current directory path
131  std::string current(folder_); current+=label_;
132  store_.setCurrentFolder(current);
133 
134  // determine number of bins for trigger monitoring
135  unsigned int nElecMu=elecMuPaths_.size();
136  unsigned int nDiMuon=diMuonPaths_.size();
137  unsigned int nDiElec=diElecPaths_.size();
138 
139  // invariant mass of opposite charge lepton pair (only filled for same flavor)
140  hists_["invMass_" ] = store_.book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.);
141  // invariant mass of same charge lepton pair (only filled for same flavor)
142  hists_["invMassWC_" ] = store_.book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.);
143  // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon
144  hists_["decayChannel_"] = store_.book1D("DecayChannel", "Decay Channel" , 3, 0, 3);
145  // // trigger efficiency estimates for the electron muon channel
146  // hists_["elecMuEff_" ] = store_.book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu);
147  // monitored trigger occupancy for the electron muon channel
148  hists_["elecMuMon_" ] = store_.book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu);
149  // // trigger efficiency estimates for the di muon channel
150  // hists_["diMuonEff_" ] = store_.book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
151  // monitored trigger occupancy for the di muon channel
152  hists_["diMuonMon_" ] = store_.book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
153  // // trigger efficiency estimates for the di electron channel
154  // hists_["diElecEff_" ] = store_.book1D("DiElecEff" , "Eff(e/e paths)" , nDiElec, 0., nDiElec);
155  // monitored trigger occupancy for the di electron channel
156  hists_["diElecMon_" ] = store_.book1D("DiElecMon" , "Mon(e/e paths)" , nDiElec, 0., nDiElec);
157  // multiplicity of jets with pt>30 (corrected to L2+L3)
158  hists_["jetMult_" ] = store_.book1D("JetMult" , "N_{30}(jet)" , 20, 0., 20.);
159 
160  // set bin labels for trigger monitoring
164  // set bin labels for decayChannel_
165  hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1);
166  hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1);
167  hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1);
168 
169  // selected dimuon events
170  hists_["diMuonLogger_"] = store_.book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.); //OK
171  // selected dielec events
172  hists_["diElecLogger_"] = store_.book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.); //OK
173  // selected elemu events
174  hists_["elecMuLogger_"] = store_.book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.); //OK
175 
176  // set bin labels for trigger monitoring
177  loggerBinLabels(std::string("diMuonLogger_"));
178  loggerBinLabels(std::string("diElecLogger_"));
179  loggerBinLabels(std::string("elecMuLogger_"));
180 
181  // deltaR min between hlt iso lepton and reco iso lepton wrt eta
182  hists_["leptDeltaREta_"] = store_.book2D("DeltaRMinEtaLepton", "#Delta R_{min}(leptons) wrt #eta", 30, -3, 3, 10, 0., 0.1);
183  // resolution in pT for matched isolated leptons
184  hists_["leptResolution_"] = store_.book1D("ResIsoLeptons", "#Delta p_{T}/p_{T}(matched leptons)", 20, 0., 0.1);
185  // matching monitoring
186  hists_["matchingMon_"] = store_.book1D("MatchingMon", "Mon(matching)", 3, 0., 3.);
187  // set axes titles for matching monitoring
188  hists_["matchingMon_"]->setBinLabel( 1 , "1st lepton" );
189  hists_["matchingMon_"]->setBinLabel( 2 , "2nd lepton" );
190  hists_["matchingMon_"]->setBinLabel( 3 , "both " );
191 
192  return;
193  }
194 
195  void
196  MonitorDiLepton::fill(const edm::Event& event, const edm::EventSetup& setup, const HLTConfigProvider& hltConfig, const std::vector<std::string> triggerPaths)
197  {
198  // fetch trigger event if configured such
201  if( !event.getByToken(triggerTable_, triggerTable) ) return;
202  }
203  /*
204  ------------------------------------------------------------
205 
206  Run information
207 
208  ------------------------------------------------------------
209  */
210 
211  if (!event.eventAuxiliary().run()) return;
212 
213  /*
214  ------------------------------------------------------------
215 
216  Muon Selection
217 
218  ------------------------------------------------------------
219  */
220 
221  // buffer isolated muons
222  std::vector<const reco::Muon*> isoMuons;
223 
225  if( !event.getByToken(muons_, muons) ) {
226  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
227  << "Muon collection not found \n";
228  return;
229  }
230 
231  for(edm::View<reco::Muon>::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){
232  // restrict to globalMuons
233  if( muon->isGlobalMuon() ){
234  // apply preselection
235  if(!muonSelect_ || (*muonSelect_)(*muon)){
236  if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon));
237  }
238  }
239  }
240 
241  /*
242  ------------------------------------------------------------
243 
244  Electron Selection
245 
246  ------------------------------------------------------------
247  */
248 
249  // buffer isolated electronss
250  std::vector<const reco::GsfElectron*> isoElecs;
251  edm::Handle<edm::ValueMap<float> > electronId;
253  if( !event.getByToken(electronId_, electronId) ) return;
254  }
255 
257  if( !event.getByToken(elecs_, elecs) ) {
258  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
259  << "Electron collection not found \n";
260  return;
261  }
262 
263  for(edm::View<reco::GsfElectron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){
264  // restrict to electrons with good electronId
265  int idx = elec-elecs->begin();
266  if( electronId_.isUninitialized() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){
267  // apply preselection
268  if(!elecSelect_ || (*elecSelect_)(*elec)){
269  if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec));
270  }
271  }
272  }
273 
274  /*
275  ------------------------------------------------------------
276 
277  Jet Selection
278 
279  ------------------------------------------------------------
280  */
281 
282  const JetCorrector* corrector=0;
283  if(!jetCorrector_.empty()){
284  // check whether a jet correcto is in the event setup or not
285  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
286  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
287  }
288  else{
289  edm::LogVerbatim( "TopDiLeptonHLTOfflineDQM" )
290  << "\n"
291  << "------------------------------------------------------------------------------------- \n"
292  << " No JetCorrectionsRecord available from EventSetup: \n"
293  << " - Jets will not be corrected. \n"
294  << " - If you want to change this add the following lines to your cfg file: \n"
295  << " \n"
296  << " ## load jet corrections \n"
297  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
298  << " process.prefer(\"ak5CaloL2L3\") \n"
299  << " \n"
300  << "------------------------------------------------------------------------------------- \n";
301  }
302  }
303 
304  unsigned int mult=0;
305  // buffer leadingJets
306  std::vector<reco::Jet> leadingJets;
308  if( !event.getByToken(jets_, jets) ) {
309  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
310  << "Jet collection not found \n";
311  return;
312  }
313 
315  if(jetIDSelect_){
316  if( !event.getByToken(jetIDLabel_, jetID) ) return;
317  }
318 
319  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
320  unsigned int idx=jet-jets->begin();
321  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
322  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
323  }
324  // chekc additional jet selection for calo, pf and bare reco jets
325  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
326  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
327  StringCutObjectSelector<reco::CaloJet> jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;}
328  }
329  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
330  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
331  StringCutObjectSelector<reco::PFJet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
332  }
333  else{
334  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
335  StringCutObjectSelector<reco::Jet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
336  }
337  // check for overlaps
338  bool overlap=false;
339  for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
340  if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;}
341  } if(overlap){continue;}
342  // prepare jet to fill monitor histograms
343  reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
344  ++mult; // determine jet multiplicity
345  if(idx==0) {
346  leadingJets.push_back(monitorJet);
347  }
348  if(idx==1) {
349  leadingJets.push_back(monitorJet);
350  }
351  }
352  fill("jetMult_", mult);
353  /*
354  ------------------------------------------------------------
355 
356  MET Selection
357 
358  ------------------------------------------------------------
359  */
360 
361  // buffer for event logging
362  reco::MET caloMET;
363  for(std::vector< edm::EDGetTokenT< edm::View<reco::MET> > >::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
364 
366  if( !event.getByToken(*met_, met) ) continue;
367 
368  if(met->begin()!=met->end()){
369  unsigned int idx=met_-mets_.begin();
370  if(idx==0){
371  caloMET=*met->begin();
372  }
373  }
374  }
375 
376  /*
377  ------------------------------------------------------------
378 
379  Event Monitoring
380 
381  ------------------------------------------------------------
382  */
383  const edm::TriggerNames& triggerNames = event.triggerNames(*triggerTable);
384  // loop over trigger paths
385  for(unsigned int i=0; i<triggerNames.triggerNames().size(); ++i){
386  bool elecmu = false;
387  bool dielec = false;
388  bool dimuon = false;
389  // consider only path from triggerPaths
390  string name = triggerNames.triggerNames()[i];
391  for (unsigned int j=0; j<triggerPaths.size(); j++) {
392  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("ele"), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("mu"), TString::kIgnoreCase)) elecmu = true;
393  else {
394  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("ele"), TString::kIgnoreCase)) dielec = true;
395  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("mu"), TString::kIgnoreCase)) dimuon = true;
396  }
397  }
398 
399  // ELECMU channel
400  if( elecmu ){
401  fill("decayChannel_", 0.5);
402  if( isoElecs.size()>0 && isoMuons.size()>0 ) {
403  double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass();
404  if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
405  // fill plots for trigger monitoring
406  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "elecMu", elecMuPaths_);
407  if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){
408  // log runnumber, lumi block, event number & some
409  // more pysics infomation for interesting events
410  // We're doing a static_cast here to denote the explicity of the cast
411  double runID = static_cast<double>(event.eventAuxiliary().run());
412  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
413  double eventID = static_cast<double>(event.eventAuxiliary().event());
414  fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, runID);
415  fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, luminosityBlockID);
416  fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, eventID);
417  fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt());
418  fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt());
419  if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt());
420  if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt());
421  fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et());
422  ++elecMuLogged_;
423  }
424  }
425  }
426  }
427 
428  // DIMUON channel
429  if( dimuon ){
430  fill("decayChannel_", 1.5);
431  if (isoMuons.size()>1) {
432  int charge = isoMuons[0]->charge()*isoMuons[1]->charge();
433  double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass();
434  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
435  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
436  // fill plots for trigger monitoring
437  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "diMuon", diMuonPaths_);
438  if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){
439  // log runnumber, lumi block, event number & some
440  // more pysics infomation for interesting events
441  // We're doing a static_cast here to denote the explicity of the cast
442  double runID = static_cast<double>(event.eventAuxiliary().run());
443  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
444  double eventID = static_cast<double>(event.eventAuxiliary().event());
445  fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, runID);
446  fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, luminosityBlockID);
447  fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, eventID);
448  fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt());
449  fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt());
450  if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt());
451  if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt());
452  fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et());
453  ++diMuonLogged_;
454  }
455  }
456  }
457  }
458 
459  // DIELEC channel
460  if( dielec ){
461  fill("decayChannel_", 2.5);
462  if( dielec && isoElecs.size()>1 ){
463  int charge = isoElecs[0]->charge()*isoElecs[1]->charge();
464  double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass();
465  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
466  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
467  // fill plots for trigger monitoring
468  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "diElec", diElecPaths_);
469  if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){
470  // log runnumber, lumi block, event number & some
471  // more pysics infomation for interesting events
472  // We're doing a static_cast here to denote the explicity of the cast
473  double runID = static_cast<double>(event.eventAuxiliary().run());
474  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
475  double eventID = static_cast<double>(event.eventAuxiliary().event());
476  fill("diElecLogger_", 0.5, diElecLogged_+0.5, runID);
477  fill("diElecLogger_", 1.5, diElecLogged_+0.5, luminosityBlockID);
478  fill("diElecLogger_", 2.5, diElecLogged_+0.5, eventID);
479  fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt());
480  fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt());
481  if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt());
482  if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt());
483  fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et());
484  ++diElecLogged_;
485  }
486  }
487  }
488  }
489  }
490 
491  /*
492  ------------------------------------------------------------
493 
494  HLT Objects Monitoring
495 
496  ------------------------------------------------------------
497  */
498 
499 // if(event.getByToken(triggerEventWithRefsTag_,triggerEventWithRefsHandle)) {
500 
501 
503  event.getByToken(triggerSummaryTokenRAW,rawTriggerEvent);
504 
506  event.getByToken(triggerSummaryTokenAOD,aodTriggerEvent);
507 
509  if(!rawTriggerEvent.isValid()){
510  hasRawTriggerSummary=false;
511 // edm::LogWarning( "TopDiLeptonHLTOfflineDQM" )
512 // << "No RAW trigger summary found! Returning... \n";
513  }
514 
515  if(!hasRawTriggerSummary && !aodTriggerEvent.isValid()){
516 // edm::LogWarning( "TopDiLeptonHLTOfflineDQM" )
517 // << "No AOD trigger summary found! Returning... \n";
518  return;
519  }
520 
521 
522  // loop over trigger paths
523  for(unsigned int i=0; i<triggerNames.triggerNames().size(); ++i){
524  // consider only path from triggerPaths
525  string name = triggerNames.triggerNames()[i].c_str();
526  bool isInteresting = false;
527  for (unsigned int j=0; j<triggerPaths.size(); j++) {
528  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase)) isInteresting = true;
529  }
530  if (!isInteresting) continue;
531  // dump infos on the considered trigger path
532  const unsigned int triggerIndex = triggerNames.triggerIndex(name);
533  // get modules for the considered trigger path
534  const vector<string>& moduleLabels(hltConfig.moduleLabels(triggerIndex));
535  const unsigned int moduleIndex(triggerTable->index(triggerIndex));
536  // Results from TriggerEvent product
537  electronIds_.clear(); electronRefs_.clear();
538  muonIds_.clear(); muonRefs_.clear();
539  // look only for modules actually run in this path
540  unsigned int kElec=0;
541  unsigned int kMuon=0;
542  for (unsigned int k=0; k<=moduleIndex; ++k) {
543  const string& moduleLabel(moduleLabels[k]);
544  const string moduleType(hltConfig.moduleType(moduleLabel));
545  // check whether the module is packed up in TriggerEventWithRef product
546 
547 // const unsigned int filterIndex(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
548 // if (filterIndex<triggerEventWithRefsHandle->size()) {
549 
551  const unsigned int filterIndex(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
552  if (filterIndex<rawTriggerEvent->size()) {
553  rawTriggerEvent->getObjects(filterIndex,electronIds_,electronRefs_);
554  const unsigned int nElectrons(electronIds_.size());
555  if (nElectrons>0) kElec = k;
556 
557  rawTriggerEvent->getObjects(filterIndex,muonIds_,muonRefs_);
558  const unsigned int nMuons(muonIds_.size());
559  if (nMuons>0) kMuon = k;
560  }
561  }
562 
563  else{
564  const unsigned int filterIndex(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
565  if (filterIndex<aodTriggerEvent->size()) {
566 
567  aodTriggerEvent->getObjects(filterIndex,electronIds_,electronRefs_);
568  const unsigned int nElectrons(electronIds_.size());
569  if (nElectrons>0) kElec = k;
570 
571  aodTriggerEvent->getObjects(filterIndex,muonIds_,muonRefs_);
572  const unsigned int nMuons(muonIds_.size());
573  if (nMuons>0) kMuon = k;
574  }
575  }
576  }
577 
578  bool l1Matched = false;
579  bool l2Matched = false;
580  double l1DeltaRMin = 500.;
581  double l2DeltaRMin = 500.;
582  unsigned int l1IndMatched = 500;
583  unsigned int l2IndMatched = 500;
584  // access to hlt dielecs
585  electronIds_.clear(); electronRefs_.clear();
586  if (kElec > 0 && kMuon < 1 && isoElecs.size()>0) {
587  const string& moduleLabelElec(moduleLabels[kElec]);
588  const string moduleTypeElec(hltConfig.moduleType(moduleLabelElec));
589 
590 // const unsigned int filterIndexElec(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
591 // triggerEventWithRefsHandle->getObjects(filterIndexElec,electronIds_,electronRefs_);
592 
594  const unsigned int filterIndexElec(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
595  rawTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
596  }
597  else{
598  const unsigned int filterIndexElec(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
599  aodTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
600 
601  }
602  const unsigned int nElectrons(electronIds_.size());
603  double deltar1 = 600.;
604  double deltar2 = 600.;
605  for (unsigned int inde = 0; inde < isoElecs.size(); inde++) {
606  if (nElectrons > 0) deltar1 = deltaR(*electronRefs_[0],*isoElecs[inde]);
607  if (nElectrons > 1) deltar2 = deltaR(*electronRefs_[1],*isoElecs[inde]);
608  if (deltar1 < deltar2 && deltar1 < l1DeltaRMin) {
609  l1DeltaRMin = deltar1;
610  l1IndMatched = inde;
611  }
612  if (deltar2 < deltar1 && deltar2 < l2DeltaRMin) {
613  l2DeltaRMin = deltar2;
614  l2IndMatched = inde;
615  }
616  }
617  if (nElectrons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoElecs[l1IndMatched]->eta(), l1DeltaRMin);
618  if (nElectrons > 1 && l2IndMatched < 500) fill("leptDeltaREta_", isoElecs[l2IndMatched]->eta(), l2DeltaRMin);
619  if (l1DeltaRMin < DRMIN) {
620  l1Matched = true;
621  fill("matchingMon_", 0.5 );
622  fill("leptResolution_", fabs(isoElecs[l1IndMatched]->pt()-electronRefs_[0]->pt())/isoElecs[l1IndMatched]->pt() );
623  }
624  if (l2DeltaRMin < DRMIN) {
625  l2Matched = true;
626  fill("matchingMon_", 1.5 );
627  fill("leptResolution_", fabs(isoElecs[l2IndMatched]->pt()-electronRefs_[1]->pt())/isoElecs[l2IndMatched]->pt() );
628  }
629  }
630  // access to hlt dimuons
631  muonIds_.clear(); muonRefs_.clear();
632  l1DeltaRMin = 500.; l2DeltaRMin = 500.; double l3DeltaRMin = 500.;
633  l1IndMatched = 500; l2IndMatched = 500; double l3IndMatched = 500;
634  if (kMuon > 0 && kElec < 1 && isoMuons.size()>0) {
635  const string& moduleLabelMuon(moduleLabels[kMuon]);
636  const string moduleTypeMuon(hltConfig.moduleType(moduleLabelMuon));
637 
638 // const unsigned int filterIndexMuon(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
639 // triggerEventWithRefsHandle->getObjects(filterIndexMuon,muonIds_,muonRefs_);
640 
642  const unsigned int filterIndexMuon(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
643  rawTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
644  }
645 
646  else{
647  const unsigned int filterIndexMuon(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
648  aodTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
649  }
650 
651  trigger::VRmuon myMuonRefs;
652  const unsigned int nMuons(muonIds_.size());
653  for (unsigned int l=0; l<nMuons; l++) {
654  bool isNew = true;
655  for (unsigned int ll=0; ll<myMuonRefs.size(); ll++) {
656  if (fabs((myMuonRefs[ll]->pt()-muonRefs_[l]->pt())/muonRefs_[l]->pt()) < 1e-5) isNew = false;
657  }
658  if (isNew) myMuonRefs.push_back(muonRefs_[l]);
659  }
660  const unsigned int nMyMuons(myMuonRefs.size());
661  double deltar1 = 600.;
662  double deltar2 = 600.;
663  double deltar3 = 600.;
664  for (unsigned int indm = 0; indm < isoMuons.size(); indm++) {
665  if (nMyMuons > 0) deltar1 = deltaR(*myMuonRefs[0],*isoMuons[indm]);
666  if (nMyMuons > 1) deltar2 = deltaR(*myMuonRefs[1],*isoMuons[indm]);
667  if (nMyMuons > 2) deltar3 = deltaR(*myMuonRefs[2],*isoMuons[indm]);
668  if (nMyMuons > 0 && (nMyMuons<1 || deltar1 < deltar2) && (nMyMuons<2 || deltar1<deltar3) && deltar1 < l1DeltaRMin) {
669  l1DeltaRMin = deltar1;
670  l1IndMatched = indm;
671  }
672  if (nMyMuons > 1 && deltar2 < deltar1 && (nMyMuons<3 || deltar2<deltar3) && deltar2 < l2DeltaRMin) {
673  l2DeltaRMin = deltar2;
674  l2IndMatched = indm;
675  }
676  if (nMyMuons > 2 && deltar3 < deltar1 && deltar3 < deltar2 && deltar3 < l3DeltaRMin) {
677  l3DeltaRMin = deltar3;
678  l3IndMatched = indm;
679  }
680  }
681  if (nMyMuons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoMuons[l1IndMatched]->eta(), l1DeltaRMin);
682  if (nMyMuons > 1 && l2IndMatched < 500) fill("leptDeltaREta_", isoMuons[l2IndMatched]->eta(), l2DeltaRMin);
683  if (nMyMuons > 2 && l3IndMatched < 500) fill("leptDeltaREta_", isoMuons[l3IndMatched]->eta(), l3DeltaRMin);
684  if (l1DeltaRMin < DRMIN) {
685  l1Matched = true;
686  fill("matchingMon_", 0.5 );
687  fill("leptResolution_", fabs(isoMuons[l1IndMatched]->pt()-myMuonRefs[0]->pt())/isoMuons[l1IndMatched]->pt() );
688  if (l2DeltaRMin < DRMIN) {
689  l2Matched = true;
690  fill("matchingMon_", 1.5 );
691  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-myMuonRefs[1]->pt())/isoMuons[l2IndMatched]->pt() );
692  } else if (l3DeltaRMin < DRMIN) {
693  l2Matched = true;
694  fill("matchingMon_", 1.5 );
695  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
696  }
697  } else {
698  if (l2DeltaRMin < DRMIN) {
699  l1Matched = true;
700  fill("matchingMon_", 0.5 );
701  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-myMuonRefs[1]->pt())/isoMuons[l2IndMatched]->pt() );
702  if (l3DeltaRMin < DRMIN) {
703  l2Matched = true;
704  fill("matchingMon_", 1.5 );
705  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
706  }
707  }
708  if (l3DeltaRMin < DRMIN) {
709  l1Matched = true;
710  fill("matchingMon_", 0.5 );
711  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
712  }
713  }
714  }
715  // access to hlt elec-muon
716  electronIds_.clear(); electronRefs_.clear();
717  muonIds_.clear(); muonRefs_.clear();
718  l1DeltaRMin = 500.; l2DeltaRMin = 500.;
719  l1IndMatched = 500; l2IndMatched = 500;
720  if (kElec > 0 && kMuon > 0 && isoElecs.size()>0) {
721  const string& moduleLabelElec(moduleLabels[kElec]);
722  const string moduleTypeElec(hltConfig.moduleType(moduleLabelElec));
723 
724 // const unsigned int filterIndexElec(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
725 // triggerEventWithRefsHandle->getObjects(filterIndexElec,electronIds_,electronRefs_);
726 
728  const unsigned int filterIndexElec(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
729  rawTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
730  }
731  else{
732  const unsigned int filterIndexElec(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
733  aodTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
734  }
735 
736  const unsigned int nElectrons(electronIds_.size());
737  double deltar = 600.;
738  for (unsigned int inde = 0; inde < isoElecs.size(); inde++) {
739  if (nElectrons > 0) deltar = deltaR(*electronRefs_[0],*isoElecs[inde]);
740  if (deltar < l1DeltaRMin) {
741  l1DeltaRMin = deltar;
742  l1IndMatched = inde;
743  }
744  }
745  if (nElectrons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoElecs[l1IndMatched]->eta(), l1DeltaRMin);
746  if (l1DeltaRMin < DRMIN) {
747  l1Matched = true;
748  fill("matchingMon_", 0.5 );
749  fill("leptResolution_", fabs(isoElecs[l1IndMatched]->pt()-electronRefs_[0]->pt())/isoElecs[l1IndMatched]->pt() );
750  }
751  }
752  if (kElec > 0 && kMuon > 0 && isoMuons.size()>0) {
753  const string& moduleLabelMuon(moduleLabels[kMuon]);
754  const string moduleTypeMuon(hltConfig.moduleType(moduleLabelMuon));
755 
756 // const unsigned int filterIndexMuon(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
757 // triggerEventWithRefsHandle->getObjects(filterIndexMuon,muonIds_,muonRefs_);
758 
760  const unsigned int filterIndexMuon(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
761  rawTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
762  }
763  else{
764  const unsigned int filterIndexMuon(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
765  aodTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
766  }
767 
768  const unsigned int nMuons(muonIds_.size());
769  if (isoMuons.size()<1) continue;
770  double deltar = 600.;
771  for (unsigned int indm = 0; indm < isoMuons.size(); indm++) {
772  if (nMuons > 0) deltar = deltaR(*muonRefs_[0],*isoMuons[indm]);
773  if (deltar < l2DeltaRMin) {
774  l2DeltaRMin = deltar;
775  l2IndMatched = indm;
776  }
777  }
778  if (nMuons > 0 && l2IndMatched < 500) fill("leptDeltaREta_", isoMuons[l2IndMatched]->eta(), l2DeltaRMin);
779  if (l2DeltaRMin < DRMIN) {
780  l2Matched = true;
781  fill("matchingMon_", 1.5 );
782  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-muonRefs_[0]->pt())/isoMuons[l2IndMatched]->pt() );
783  }
784  }
785  if (l1Matched && l2Matched) fill("matchingMon_", 2.5 );
786  }
787 // }
788 
789  }
790 
791 }
792 
793 TopDiLeptonHLTOfflineDQM::TopDiLeptonHLTOfflineDQM(const edm::ParameterSet& cfg): vertexSelect_(0), beamspotSelect_(0)
794 {
795  // configure the preselection
796  edm::ParameterSet presel=cfg.getParameter<edm::ParameterSet>("preselection");
797  if( presel.existsAs<edm::ParameterSet>("trigger") ){
798  edm::ParameterSet trigger=presel.getParameter<edm::ParameterSet>("trigger");
799  triggerTable_= consumes< edm::TriggerResults >(trigger.getParameter<edm::InputTag>("src"));
800  triggerPaths_=trigger.getParameter<std::vector<std::string> >("select");
801  }
802  if( presel.existsAs<edm::ParameterSet>("vertex" ) ){
803  edm::ParameterSet vertex=presel.getParameter<edm::ParameterSet>("vertex");
804  vertex_= consumes< std::vector<reco::Vertex> >(vertex.getParameter<edm::InputTag>("src"));
806  }
807  if( presel.existsAs<edm::ParameterSet>("beamspot" ) ){
809  beamspot_= consumes< reco::BeamSpot >(beamspot.getParameter<edm::InputTag>("src"));
811  }
812 
813  // configure the selection
814  std::vector<edm::ParameterSet> sel=cfg.getParameter<std::vector<edm::ParameterSet> >("selection");
815  for(unsigned int i=0; i<sel.size(); ++i){
816  selectionOrder_.push_back(sel.at(i).getParameter<std::string>("label"));
818  }
819 
820  for (const std::string& s: selectionOrder_) {
822 
823  if (selection_.find(key) == selection_.end())
824  continue;
825 
826  if (type == "muons"){
828  }
829  if (type == "elecs"){
831  }
832  if (type == "jets"){
834  }
835  if (type == "jets/pf"){
837  }
838  if (type == "jets/calo"){
840  }
841  if (type == "met"){
843  }
844  }
845 }
846 
847  void
849 {
850  using namespace std;
851  using namespace edm;
852 
853  bool changed(true);
854  if (!hltConfig_.init(iRun,iSetup,"*",changed)) {
855  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
856  << "Config extraction failure with process name "
858  << "\n";
859  return;
860  }
861 }
862 
863  void
865 {
868  if( !event.getByToken(triggerTable_, triggerTable) ) return;
869  if(!acceptHLT(event, *triggerTable, triggerPaths_)) return;
870  }
871  if(!vertex_.isUninitialized()){
873  if( !event.getByToken(vertex_, vertex) ) return;
874  if(vertex->empty() || !(*vertexSelect_)(vertex->front())) return;
875  }
876  if(!beamspot_.isUninitialized()){
878  if( !event.getByToken(beamspot_, beamspot) ) return;
879  if(!(*beamspotSelect_)(*beamspot)) return;
880  }
881  // apply selection steps
882  for(std::vector<std::string>::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){
883  std::string key = selectionStep(*selIt), type = objectType(*selIt);
884  if(selection_.find(key)!=selection_.end()){
885 
886  if(type=="empty"){
887  selection_[key].second->fill(event, setup, hltConfig_, triggerPaths_);
888  continue;
889  }
890  if(type=="Hlt" ){
891  selection_[key].second->fill(event, setup, hltConfig_, triggerPaths_);
892  continue;
893  }
894 
895  bool passSel = true;
896 
897  for(std::vector<std::string>::const_iterator selIt2=selectionOrder_.begin(); selIt2<=selIt; ++selIt2){
898  std::string key2 = selectionStep(*selIt2), type2 = objectType(*selIt2);
899  if(selection_.find(key2)==selection_.end()) continue;
900 
901  if(type2=="Hlt" || type2=="empty" ) continue;
902  if (!selectmap_[type2]->select(event)) passSel=false;
903 
904  } // end 2nd loop
905 
906  // Apply cumulative event selection
907  if ( !passSel ) continue;
908 
909  selection_[key].second->fill(event, setup, hltConfig_, triggerPaths_);
910 
911  }
912  }
913 }
914 
915  void
917 {
918  for (auto& sel: selection_) {
919  sel.second.second->book(i);
920  }
921 }
TopDiLeptonHLTOfflineDQM(const edm::ParameterSet &cfg)
default constructor
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
tuple cfg
Definition: looper.py:293
const std::string moduleType(const std::string &module) const
C++ class name of module.
double lowerEdge_
mass window upper and lower edge
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
edm::EDGetTokenT< reco::BeamSpot > beamspot_
beamspot
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
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
RunNumber_t run() const
std::string selectionStep(const std::string &label)
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
int elecMuLogged_
number of logged interesting events
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
Jets made from PFObjects.
Definition: PFJet.h:21
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< std::string > triggerPaths_
trigger paths
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::map< std::string, SelectionStepHLTBase * > selectmap_
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
tuple corrector
Definition: mvaPFMET_cff.py:86
Definition: MET.h:42
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
vector< PseudoJet > jets
void loggerBinLabels(std::string hist)
set labels for event logging histograms
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< std::string > diElecPaths_
trigger paths for di electron channel
int j
Definition: DBlmapReader.cc:9
virtual void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c)
do this during the event loop
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenAOD
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:75
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::map< std::string, MonitorElement * > hists_
histogram container
void fill(const edm::Event &event, const edm::EventSetup &setup, const HLTConfigProvider &hltConfig, const std::vector< std::string > triggerPaths)
fill monitor histograms with electronId and jetCorrections
void triggerBinLabels(std::string channel, const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
const std::string & processName() const
process name
std::map< std::string, std::pair< edm::ParameterSet, HLTOfflineDQMTopDiLepton::MonitorDiLepton * > > selection_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:77
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< std::string > selectionOrder_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
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
void book(DQMStore::IBooker &store_)
book histograms in subdirectory directory
std::string objectType(const std::string &label)
std::vector< reco::RecoChargedCandidateRef > VRmuon
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
tuple muons
Definition: patZpeak.py:38
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
virtual double et() const final
transverse energy
bool isUninitialized() const
Definition: EDGetToken.h:73
tuple process
Definition: LaserDQM_cfg.py:3
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
edm::EDGetTokenT< std::vector< reco::Vertex > > vertex_
primary vertex
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
tuple size
Write out results.
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
Definition: Run.h:43
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector