CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EwkElecDQM Class Reference

#include <EwkElecDQM.h>

Inheritance diagram for EwkElecDQM:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
double calcDeltaPhi (double phi1, double phi2)
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 EwkElecDQM (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotTag_
 
MonitorElementdetainbarrel_after_
 
MonitorElementdetainbarrel_before_
 
double detainCutBarrel_
 
double detainCutEndcap_
 
MonitorElementdetainendcap_after_
 
MonitorElementdetainendcap_before_
 
MonitorElementecalisobarrel_after_
 
MonitorElementecalisobarrel_before_
 
double ecalIsoCutBarrel_
 
double ecalIsoCutEndcap_
 
MonitorElementecalisoendcap_after_
 
MonitorElementecalisoendcap_before_
 
double eJetMin_
 
edm::EDGetTokenT< edm::View
< reco::GsfElectron > > 
elecTag_
 
const std::vector< std::string > elecTrig_
 
MonitorElementeta_after_
 
MonitorElementeta_before_
 
double etaCut_
 
MonitorElementhcalisobarrel_after_
 
MonitorElementhcalisobarrel_before_
 
double hcalIsoCutBarrel_
 
double hcalIsoCutEndcap_
 
MonitorElementhcalisoendcap_after_
 
MonitorElementhcalisoendcap_before_
 
HLTPrescaleProvider hltPrescaleProvider_
 
MonitorElementinvmass_after_
 
MonitorElementinvmass_before_
 
MonitorElementinvmassPU_afterZ_
 
MonitorElementinvmassPU_before_
 
bool isValidHltConfig_
 
MonitorElementjet_et_after_
 
MonitorElementjet_et_before_
 
MonitorElementjet_eta_after_
 
MonitorElementjet_eta_before_
 
edm::InputTag jetTag_
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
jetToken_
 
MonitorElementmet_after_
 
MonitorElementmet_before_
 
bool metIncludesMuons_
 
double metMax_
 
double metMin_
 
edm::InputTag metTag_
 
edm::EDGetTokenT< edm::View
< reco::MET > > 
metToken_
 
MonitorElementmt_after_
 
MonitorElementmt_before_
 
double mtMax_
 
double mtMin_
 
unsigned int nall
 
unsigned int neid
 
MonitorElementnelectrons_after_
 
MonitorElementnelectrons_before_
 
unsigned int nGoodElectrons
 
unsigned int niso
 
int nJetMax_
 
MonitorElementnjets_after_
 
MonitorElementnjets_before_
 
MonitorElementnpvs_afterZ_
 
MonitorElementnpvs_before_
 
unsigned int nrec
 
unsigned int nsel
 
MonitorElementpt_after_
 
MonitorElementpt_before_
 
double ptCut_
 
unsigned int PUBinCount_
 
unsigned int PUMax_
 
MonitorElementsieiebarrel_after_
 
MonitorElementsieiebarrel_before_
 
double sieieCutBarrel_
 
double sieieCutEndcap_
 
MonitorElementsieieendcap_after_
 
MonitorElementsieieendcap_before_
 
MonitorElementtrig_after_
 
MonitorElementtrig_before_
 
edm::EDGetTokenT
< edm::TriggerResults
trigTag_
 
MonitorElementtrkisobarrel_after_
 
MonitorElementtrkisobarrel_before_
 
double trkIsoCutBarrel_
 
double trkIsoCutEndcap_
 
MonitorElementtrkisoendcap_after_
 
MonitorElementtrkisoendcap_before_
 
edm::EDGetTokenT< edm::View
< reco::Vertex > > 
vertexTag_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

DQM offline for EWK Electrons

Definition at line 29 of file EwkElecDQM.h.

Constructor & Destructor Documentation

EwkElecDQM::EwkElecDQM ( const edm::ParameterSet cfg)

Definition at line 41 of file EwkElecDQM.cc.

References isValidHltConfig_.

42  :
43  // Input collections
45  edm::InputTag("met"))),
47  "JetTag", edm::InputTag("sisCone5CaloJets"))),
48  trigTag_(consumes<edm::TriggerResults>(
50  "TrigTag", edm::InputTag("TriggerResults::HLT")))),
53  "ElecTag", edm::InputTag("gsfElectrons")))),
56  edm::InputTag("met")))),
59  "JetTag", edm::InputTag("sisCone5CaloJets")))),
62  "VertexTag", edm::InputTag("offlinePrimaryVertices")))),
64  consumes<reco::BeamSpot>(cfg.getUntrackedParameter<edm::InputTag>(
65  "BeamSpotTag", edm::InputTag("BeamSpot")))),
66 
67  // Main cuts
68  // muonTrig_(cfg.getUntrackedParameter<std::string> ("MuonTrig",
69  // "HLT_Mu9")),
70  // elecTrig_(cfg.getUntrackedParameter<std::vector< std::string >
71  // >("ElecTrig", "HLT_Ele10_SW_L1R")),
72  elecTrig_(
73  cfg.getUntrackedParameter<std::vector<std::string> >("ElecTrig")),
74  // ptCut_(cfg.getUntrackedParameter<double>("PtCut", 25.)),
75  ptCut_(cfg.getUntrackedParameter<double>("PtCut", 10.)),
76  // etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.1)),
77  etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.4)),
78  sieieCutBarrel_(cfg.getUntrackedParameter<double>("SieieBarrel", 0.01)),
79  sieieCutEndcap_(cfg.getUntrackedParameter<double>("SieieEndcap", 0.028)),
81  cfg.getUntrackedParameter<double>("DetainBarrel", 0.0071)),
83  cfg.getUntrackedParameter<double>("DetainEndcap", 0.0066)),
84  // isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso",
85  // true)),
86  // isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso",
87  // false)),
88  // isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03", 0.1)),
90  cfg.getUntrackedParameter<double>("EcalIsoCutBarrel", 5.7)),
92  cfg.getUntrackedParameter<double>("EcalIsoCutEndcap", 5.0)),
94  cfg.getUntrackedParameter<double>("HcalIsoCutBarrel", 8.1)),
96  cfg.getUntrackedParameter<double>("HcalIsoCutEndcap", 3.4)),
98  cfg.getUntrackedParameter<double>("TrkIsoCutBarrel", 7.2)),
100  cfg.getUntrackedParameter<double>("TrkIsoCutEndcap", 5.1)),
101  mtMin_(cfg.getUntrackedParameter<double>("MtMin", -999999)),
102  mtMax_(cfg.getUntrackedParameter<double>("MtMax", 999999.)),
103  metMin_(cfg.getUntrackedParameter<double>("MetMin", -999999.)),
104  metMax_(cfg.getUntrackedParameter<double>("MetMax", 999999.)),
105  // acopCut_(cfg.getUntrackedParameter<double>("AcopCut", 2.)),
106 
107  // Muon quality cuts
108  // dxyCut_(cfg.getUntrackedParameter<double>("DxyCut", 0.2)),
109  // normalizedChi2Cut_(cfg.getUntrackedParameter<double>("NormalizedChi2Cut",
110  // 10.)),
111  // trackerHitsCut_(cfg.getUntrackedParameter<int>("TrackerHitsCut",
112  // 11)),
113  // isAlsoTrackerMuon_(cfg.getUntrackedParameter<bool>("IsAlsoTrackerMuon",
114  // true)),
115 
116  // Z rejection
117  // ptThrForZ1_(cfg.getUntrackedParameter<double>("PtThrForZ1", 20.)),
118  // ptThrForZ2_(cfg.getUntrackedParameter<double>("PtThrForZ2", 10.)),
119 
120  // Top rejection
121  eJetMin_(cfg.getUntrackedParameter<double>("EJetMin", 999999.)),
122  nJetMax_(cfg.getUntrackedParameter<int>("NJetMax", 999999)),
123  PUMax_(cfg.getUntrackedParameter<unsigned int>("PUMax", 60)),
124  PUBinCount_(cfg.getUntrackedParameter<unsigned int>("PUBinCount", 12)),
126  // caloJetCollection_(cfg.getUntrackedParameter<edm:InputTag>("CaloJetCollection","sisCone5CaloJets"))
127 {
128  isValidHltConfig_ = false;
129 }
T getUntrackedParameter(std::string const &, T const &) const
double metMax_
Definition: EwkElecDQM.h:76
double sieieCutBarrel_
Definition: EwkElecDQM.h:58
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
Definition: EwkElecDQM.h:50
edm::InputTag jetTag_
Definition: EwkElecDQM.h:44
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
double ecalIsoCutEndcap_
Definition: EwkElecDQM.h:68
double detainCutEndcap_
Definition: EwkElecDQM.h:61
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
Definition: EwkElecDQM.h:46
double metMin_
Definition: EwkElecDQM.h:75
double trkIsoCutEndcap_
Definition: EwkElecDQM.h:72
unsigned int PUBinCount_
Definition: EwkElecDQM.h:91
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int nJetMax_
Definition: EwkElecDQM.h:88
double ecalIsoCutBarrel_
Definition: EwkElecDQM.h:67
double trkIsoCutBarrel_
Definition: EwkElecDQM.h:71
edm::InputTag metTag_
Definition: EwkElecDQM.h:43
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
Definition: EwkElecDQM.h:48
unsigned int PUMax_
Definition: EwkElecDQM.h:91
double etaCut_
Definition: EwkElecDQM.h:56
double hcalIsoCutBarrel_
Definition: EwkElecDQM.h:69
bool isValidHltConfig_
Definition: EwkElecDQM.h:93
double sieieCutEndcap_
Definition: EwkElecDQM.h:59
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
Definition: EwkElecDQM.h:49
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
Definition: EwkElecDQM.h:47
edm::EDGetTokenT< edm::TriggerResults > trigTag_
Definition: EwkElecDQM.h:45
double eJetMin_
Definition: EwkElecDQM.h:87
double mtMax_
Definition: EwkElecDQM.h:74
double detainCutBarrel_
Definition: EwkElecDQM.h:60
const std::vector< std::string > elecTrig_
Definition: EwkElecDQM.h:54
HLTPrescaleProvider hltPrescaleProvider_
Definition: EwkElecDQM.h:94
double hcalIsoCutEndcap_
Definition: EwkElecDQM.h:70
double mtMin_
Definition: EwkElecDQM.h:73
double ptCut_
Definition: EwkElecDQM.h:55

Member Function Documentation

void EwkElecDQM::analyze ( const edm::Event ev,
const edm::EventSetup iSet 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 384 of file EwkElecDQM.cc.

References beamSpotTag_, calcDeltaPhi(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), detainbarrel_after_, detainbarrel_before_, detainCutBarrel_, detainCutEndcap_, detainendcap_after_, detainendcap_before_, reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::dr03HcalTowerSumEt(), reco::GsfElectron::dr04TkSumPt(), ecalisobarrel_after_, ecalisobarrel_before_, ecalIsoCutBarrel_, ecalIsoCutEndcap_, ecalisoendcap_after_, ecalisoendcap_before_, eJetMin_, elecTag_, elecTrig_, metsig::electron, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), eta, reco::LeafCandidate::eta(), eta_after_, eta_before_, etaCut_, MonitorElement::Fill(), newFWLiteAna::found, edm::Event::getByToken(), hcalisobarrel_after_, hcalisobarrel_before_, hcalIsoCutBarrel_, hcalIsoCutEndcap_, hcalisoendcap_after_, hcalisoendcap_before_, HLTPrescaleProvider::hltConfigProvider(), hltPrescaleProvider_, i, cmsHarvester::index, invmass_after_, invmass_before_, invmassPU_afterZ_, invmassPU_before_, GeomDetEnumerators::isBarrel(), GeomDetEnumerators::isEndcap(), reco::Vertex::isValid(), j, metsig::jet, jet_et_after_, jet_et_before_, jet_eta_after_, jet_eta_before_, jetToken_, relval_2017::k, LogTrace, reco::LeafCandidate::massSqr(), objects.METAnalyzer::met, met_after_, met_before_, MT2Analyzer::metCollection, metMax_, metMin_, metToken_, mt_after_, mt_before_, mtMax_, mtMin_, nall, neid, nelectrons_after_, nelectrons_before_, nGoodElectrons, niso, nJetMax_, HLT_25ns10e33_v2_cff::njets, njets_after_, njets_before_, npvs_afterZ_, npvs_before_, nrec, nsel, reco::LeafCandidate::phi(), HLTPrescaleProvider::prescaleSet(), HLTConfigProvider::prescaleValue(), EnergyCorrector::pt, reco::LeafCandidate::pt(), pt_after_, pt_before_, ptCut_, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), sieiebarrel_after_, sieiebarrel_before_, sieieCutBarrel_, sieieCutEndcap_, sieieendcap_after_, sieieendcap_before_, reco::GsfElectron::sigmaIetaIeta(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, trig_after_, trig_before_, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerResults, trigNames, trigTag_, trkisobarrel_after_, trkisobarrel_before_, trkIsoCutBarrel_, trkIsoCutEndcap_, trkisoendcap_after_, trkisoendcap_before_, GoodVertex_cfg::vertexCollection, and vertexTag_.

384  {
385 
386  // Reset global event selection flags
387  bool rec_sel = false;
388  bool eid_sel = false;
389  bool iso_sel = false;
390  bool all_sel = false;
391 
392  // Electron collection
393  Handle<View<GsfElectron> > electronCollection;
394  if (!ev.getByToken(elecTag_, electronCollection)) {
395  // LogWarning("") << ">>> Electron collection does not exist !!!";
396  return;
397  }
398  unsigned int electronCollectionSize = electronCollection->size();
399 
400  // Beam spot
401  Handle<reco::BeamSpot> beamSpotHandle;
402  if (!ev.getByToken(beamSpotTag_, beamSpotHandle)) {
403  // LogWarning("") << ">>> No beam spot found !!!";
404  return;
405  }
406 
407  // MET
408  double met_px = 0.;
409  double met_py = 0.;
411  if (!ev.getByToken(metToken_, metCollection)) {
412  // LogWarning("") << ">>> MET collection does not exist !!!";
413  return;
414  }
415 
416  const MET& met = metCollection->at(0);
417  met_px = met.px();
418  met_py = met.py();
419  // if (!metIncludesMuons_) {
420  // for (unsigned int i=0; i<muonCollectionSize; i++) {
421  // const Muon& mu = muonCollection->at(i);
422  // if (!mu.isGlobalMuon()) continue;
423  // met_px -= mu.px();
424  // met_py -= mu.py();
425  // }
426  // }
427  double met_et = sqrt(met_px * met_px + met_py * met_py);
428  LogTrace("") << ">>> MET, MET_px, MET_py: " << met_et << ", " << met_px
429  << ", " << met_py << " [GeV]";
430  met_before_->Fill(met_et);
431 
432  // Vertices in the event
433  int npvCount = 0;
435  if (!ev.getByToken(vertexTag_, vertexCollection)) {
436  LogError("") << ">>> Vertex collection does not exist !!!";
437  return;
438  }
439 
440  for (unsigned int i = 0; i < vertexCollection->size(); i++) {
441  const Vertex& vertex = vertexCollection->at(i);
442  if (vertex.isValid()) npvCount++;
443  }
444  npvs_before_->Fill(npvCount);
445 
446  // Trigger
448  if (!ev.getByToken(trigTag_, triggerResults)) {
449  // LogWarning("") << ">>> TRIGGER collection does not exist !!!";
450  return;
451  }
452  const edm::TriggerNames& trigNames = ev.triggerNames(*triggerResults);
453  bool trigger_fired = false;
454 
455  HLTConfigProvider const& hltConfigProvider = hltPrescaleProvider_.hltConfigProvider();
456 
457  /* very old code
458  for (unsigned int i=0; i<triggerResults->size(); i++) {
459  if (triggerResults->accept(i)) {
460  LogTrace("") << "Accept by: " << i << ", Trigger: " <<
461  trigNames.triggerName(i);
462  }
463  }
464  */
465 
466  // the following gives error on CRAFT08 data where itrig1=19 (vector index out
467  // of range)
468  /*
469  int itrig1 = trigNames.triggerIndex(muonTrig_);
470  if (triggerResults->accept(itrig1)) trigger_fired = true;
471  */
472  // suggested replacement: lm250909
473  /* Fix buggy trigger logic
474  for (unsigned int i=0; i<triggerResults->size(); i++)
475  {
476  std::string trigName = trigNames.triggerName(i);
477  bool found=false;
478 
479 // for (unsigned int j = 0; j < elecTrig_.size(); j++)
480 // {
481 // if ( trigName == elecTrig_.at(j) && triggerResults->accept(i))
482 // {
483 // trigger_fired = true;
484 // }
485 // }
486 
487 
488  for(unsigned int index=0; index<elecTrig_.size() && found==false; index++)
489 {
490  size_t trigPath = trigName.find(elecTrig_.at(index)); // 0 if found, pos
491 if not
492  if (trigPath==0) found=true;
493  }
494  if(!found) continue;
495 
496  bool prescaled=false;
497  for (unsigned int ps= 0; ps< hltConfigProvider.prescaleSize();
498 ps++){
499  const unsigned int prescaleValue =
500 hltConfigProvider.prescaleValue(ps, trigName) ;
501  if (prescaleValue != 1) prescaled =true;
502  }
503 
504  if(triggerResults->accept(i) && !prescaled) trigger_fired=true;
505 
506  }
507  */
508 
509  // get the prescale set for this event
510  const int prescaleSet = hltPrescaleProvider_.prescaleSet(ev, iSet);
511  if (prescaleSet == -1) {
512  LogTrace("") << "Failed to determine prescaleSet\n";
513  // std::cout << "Failed to determine prescaleSet. Check cmsRun GlobalTag\n";
514  return;
515  }
516 
517  for (unsigned int i = 0;
518  (i < triggerResults->size()) && (trigger_fired == false); i++) {
519  // skip trigger, if it did not fire
520  if (!triggerResults->accept(i)) continue;
521 
522  // skip trigger, if it is not on our list
523  bool found = false;
524  const std::string trigName = trigNames.triggerName(i);
525  for (unsigned int index = 0; index < elecTrig_.size() && found == false;
526  index++) {
527  if (trigName.find(elecTrig_.at(index)) == 0) found = true;
528  }
529  if (!found) continue;
530 
531  // skip trigger, if it is prescaled
532  if (hltConfigProvider.prescaleValue(prescaleSet, trigName) != 1) continue;
533 
534  // std::cout << "found unprescaled trigger that fired: " << trigName <<
535  // "\n";
536  trigger_fired = true;
537  }
538 
539  LogTrace("") << ">>> Trigger bit: " << trigger_fired << " for one of ( ";
540  for (unsigned int k = 0; k < elecTrig_.size(); k++) {
541  LogTrace("") << elecTrig_.at(k) << " ";
542  }
543  LogTrace("") << ")";
544  trig_before_->Fill(trigger_fired);
545 
546  // Jet collection
547  Handle<View<Jet> > jetCollection;
548  if (!ev.getByToken(jetToken_, jetCollection)) {
549  // LogError("") << ">>> JET collection does not exist !!!";
550  return;
551  }
552  float electron_et = -8.0;
553  float electron_eta = -8.0;
554  float electron_phi = -8.0;
555  float electron2_et = -9.0;
556  float electron2_eta = -9.0;
557  float electron2_phi = -9.0;
558  // need to get some electron info so jets can be cleaned of them
559  for (unsigned int i = 0; i < electronCollectionSize; i++) {
560  const GsfElectron& elec = electronCollection->at(i);
561 
562  if (i < 1) {
563  electron_et = elec.pt();
564  electron_eta = elec.eta();
565  electron_phi = elec.phi();
566  }
567  if (i == 2) {
568  electron2_et = elec.pt();
569  electron2_eta = elec.eta();
570  electron2_phi = elec.phi();
571  }
572  }
573 
574  float jet_et = -8.0;
575  float jet_eta = -8.0;
576  int jet_count = 0;
577  float jet2_et = -9.0;
578  unsigned int jetCollectionSize = jetCollection->size();
579  int njets = 0;
580  for (unsigned int i = 0; i < jetCollectionSize; i++) {
581  const Jet& jet = jetCollection->at(i);
582 
583  float jet_current_et = jet.et();
584  // cout << "jet_current_et " << jet_current_et << endl;
585  // if it overlaps with electron, it is not a jet
586  if (electron_et > 0.0 && fabs(jet.eta() - electron_eta) < 0.2 &&
587  calcDeltaPhi(jet.phi(), electron_phi) < 0.2)
588  continue;
589  if (electron2_et > 0.0 && fabs(jet.eta() - electron2_eta) < 0.2 &&
590  calcDeltaPhi(jet.phi(), electron2_phi) < 0.2)
591  continue;
592 
593  // if it has too low Et, throw away
594  // if (jet_current_et < eJetMin_) continue; //Keep if only want to plot
595  // above jet cut
596 
597  if (jet.et() > eJetMin_) {
598  njets++;
599  jet_count++;
600  }
601  if (jet_current_et > jet_et) {
602  jet2_et = jet_et; // 2nd highest jet get's et from current highest
603  jet_et = jet.et(); // current highest jet gets et from the new highest
604  jet_eta = jet.eta();
605  } else if (jet_current_et > jet2_et) {
606  jet2_et = jet.et();
607  }
608  }
609 
610  // Fill After all electron cuts (or both before and after)
611  if (jet_et > 10) // don't want low energy "jets"
612  {
613  jet_et_before_->Fill(jet_et);
614  // jet2_et_before_ ->Fill(jet2_et);
615  jet_eta_before_->Fill(jet_eta);
616  }
617 
618  LogTrace("") << ">>> Total number of jets: " << jetCollectionSize;
619  LogTrace("") << ">>> Number of jets above " << eJetMin_
620  << " [GeV]: " << njets;
621  njets_before_->Fill(njets);
622 
623  // Start counting
624  nall++;
625 
626  // Histograms per event should be done only once, so keep track of them
627  bool hlt_hist_done = false;
628  // bool minv_hist_done = false;
629  bool met_hist_done = false;
630  // bool nz1_hist_done = false;
631  // bool nz2_hist_done = false;
632  bool njets_hist_done = false;
633 
634  // Central selection criteria
635  // const int NFLAGS = 13; // number of individual selection criteria
636  const int NFLAGS = 11; // number of individual selection criteria
637  // 0: pt cut | rec
638  // 1: eta cut | rec
639  // 2: sieie | eid
640  // 3: detain | eid
641  // 4: ecal iso | iso
642  // 5: hcal iso | iso
643  // 6: trk iso | iso
644  // 7: trigger fired | hlt/all
645  bool electron_sel[NFLAGS];
646 
647  // for invariant mass calculation
648  // keep track of highest-pt electrons for initial (RECO) electrons
649  // and "good" electrons (passing all cuts)
650  // first array dimension is for first or second good electron
651  // second array dimension is for relevant quantities of good electron
652  // [0]: 1 for electron found or 0 for not found (if 0, no other quantities
653  // filled)
654  // [1]: mSqr
655  // [2]: E
656  // [3]: px
657  // [4]: py
658  // [5]: pz
659  // inv mass = sqrt(m_1^2 + m_2^2 + 2*(E_1*E_2 - (px1*px2 + py1*py2 + pz1+pz2)
660  // ) )
661  double electron[2][6];
662  double goodElectron[2][6];
663  nGoodElectrons = 0;
664  for (unsigned int i = 0; i < 2; i++) {
665  for (unsigned int j = 0; j < 6; j++) {
666  electron[i][j] = 0.;
667  goodElectron[i][j] = 0.;
668  }
669  }
670 
671  for (unsigned int i = 0; i < electronCollectionSize; i++) {
672  for (int j = 0; j < NFLAGS; ++j) {
673  electron_sel[j] = false;
674  }
675 
676  const GsfElectron& elec = electronCollection->at(i);
677  // if (!mu.isGlobalMuon()) continue;
678  // if (mu.globalTrack().isNull()) continue;
679  // if (mu.innerTrack().isNull()) continue;
680 
681  LogTrace("") << "> elec: processing electron number " << i << "...";
682  // reco::TrackRef gm = mu.globalTrack();
683  // reco::TrackRef tk = mu.innerTrack();
684  // should have stuff for electron track?
685 
686  if (i < 2) {
687  electron[i][0] = 1.;
688  electron[i][1] = elec.massSqr();
689  electron[i][2] = elec.energy();
690  electron[i][3] = elec.px();
691  electron[i][4] = elec.py();
692  electron[i][5] = elec.pz();
693  }
694 
695  // Pt,eta cuts
696  double pt = elec.pt();
697  double px = elec.px();
698  double py = elec.py();
699  double eta = elec.eta();
700  LogTrace("") << "\t... pt, eta: " << pt << " [GeV], " << eta;
701  ;
702  if (pt > ptCut_) electron_sel[0] = true;
703  if (fabs(eta) < etaCut_) electron_sel[1] = true;
704 
705  bool isBarrel = false;
706  bool isEndcap = false;
707  if (eta < 1.4442 && eta > -1.4442) {
708  isBarrel = true;
709  } else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4)) {
710  isEndcap = true;
711  }
712 
713  // // d0, chi2, nhits quality cuts
714  // double dxy = tk->dxy(beamSpotHandle->position());
715  // double normalizedChi2 = gm->normalizedChi2();
716  // double trackerHits = tk->numberOfValidHits();
717  // LogTrace("") << "\t... dxy, normalizedChi2, trackerHits,
718  // isTrackerMuon?: " << dxy << " [cm], " << normalizedChi2 << ", " <<
719  // trackerHits << ", " << mu.isTrackerMuon();
720  // if (fabs(dxy)<dxyCut_) muon_sel[2] = true;
721  // if (normalizedChi2<normalizedChi2Cut_) muon_sel[3] = true;
722  // if (trackerHits>=trackerHitsCut_) muon_sel[4] = true;
723  // if (mu.isTrackerMuon()) muon_sel[5] = true;
724 
725  pt_before_->Fill(pt);
726  eta_before_->Fill(eta);
727  // dxy_before_->Fill(dxy);
728  // chi2_before_->Fill(normalizedChi2);
729  // nhits_before_->Fill(trackerHits);
730  // tkmu_before_->Fill(mu.isTrackerMuon());
731 
732  // Electron ID cuts
733  double sieie = (double)elec.sigmaIetaIeta();
734  double detain =
735  (double)elec.deltaEtaSuperClusterTrackAtVtx(); // think this is detain
736  if (sieie < sieieCutBarrel_ && isBarrel) electron_sel[2] = true;
737  if (sieie < sieieCutEndcap_ && isEndcap) electron_sel[2] = true;
738  if (detain < detainCutBarrel_ && isBarrel) electron_sel[3] = true;
739  if (detain < detainCutEndcap_ && isEndcap) electron_sel[3] = true;
740  if (isBarrel) {
741  LogTrace("") << "\t... sieie value " << sieie << " (barrel), pass? "
742  << electron_sel[2];
743  LogTrace("") << "\t... detain value " << detain << " (barrel), pass? "
744  << electron_sel[3];
745  } else if (isEndcap) {
746  LogTrace("") << "\t... sieie value " << sieie << " (endcap), pass? "
747  << electron_sel[2];
748  LogTrace("") << "\t... detain value " << detain << " (endcap), pass? "
749  << electron_sel[2];
750  }
751 
752  if (isBarrel) {
753  sieiebarrel_before_->Fill(sieie);
754  detainbarrel_before_->Fill(detain);
755  } else if (isEndcap) {
756  sieieendcap_before_->Fill(sieie);
757  detainendcap_before_->Fill(detain);
758  }
759 
760  // Isolation cuts
761  // double isovar = mu.isolationR03().sumPt;
762  double ecalisovar = elec.dr03EcalRecHitSumEt(); // picked one set!
763  double hcalisovar = elec.dr03HcalTowerSumEt(); // try others if
764  double trkisovar = elec.dr04TkSumPt(); // doesn't work
765  // if (isCombinedIso_) {
766  // isovar += mu.isolationR03().emEt;
767  // isovar += mu.isolationR03().hadEt;
768  //}
769  // if (isRelativeIso_) isovar /= pt;
770  if (ecalisovar < ecalIsoCutBarrel_ && isBarrel) electron_sel[4] = true;
771  if (ecalisovar < ecalIsoCutEndcap_ && isEndcap) electron_sel[4] = true;
772  if (hcalisovar < hcalIsoCutBarrel_ && isBarrel) electron_sel[5] = true;
773  if (hcalisovar < hcalIsoCutEndcap_ && isEndcap) electron_sel[5] = true;
774  if (trkisovar < trkIsoCutBarrel_ && isBarrel) electron_sel[6] = true;
775  if (trkisovar < trkIsoCutEndcap_ && isEndcap) electron_sel[6] = true;
776  if (isBarrel) {
777  LogTrace("") << "\t... ecal isolation value " << ecalisovar
778  << " (barrel), pass? " << electron_sel[4];
779  LogTrace("") << "\t... hcal isolation value " << hcalisovar
780  << " (barrel), pass? " << electron_sel[5];
781  LogTrace("") << "\t... trk isolation value " << trkisovar
782  << " (barrel), pass? " << electron_sel[6];
783  } else if (isEndcap) {
784  LogTrace("") << "\t... ecal isolation value " << ecalisovar
785  << " (endcap), pass? " << electron_sel[4];
786  LogTrace("") << "\t... hcal isolation value " << hcalisovar
787  << " (endcap), pass? " << electron_sel[5];
788  LogTrace("") << "\t... trk isolation value " << trkisovar
789  << " (endcap), pass? " << electron_sel[6];
790  }
791 
792  // iso_before_->Fill(isovar);
793  if (isBarrel) {
794  ecalisobarrel_before_->Fill(ecalisovar);
795  hcalisobarrel_before_->Fill(hcalisovar);
796  trkisobarrel_before_->Fill(trkisovar);
797  } else if (isEndcap) {
798  ecalisoendcap_before_->Fill(ecalisovar);
799  hcalisoendcap_before_->Fill(hcalisovar);
800  trkisoendcap_before_->Fill(trkisovar);
801  }
802 
803  // HLT
804  if (trigger_fired) electron_sel[7] = true;
805 
806  // // MET/MT cuts
807  double w_et = met_et + pt;
808  double w_px = met_px + px;
809  double w_py = met_py + py;
810 
811  double massT = w_et * w_et - w_px * w_px - w_py * w_py;
812  massT = (massT > 0) ? sqrt(massT) : 0;
813 
814  LogTrace("") << "\t... W mass, W_et, W_px, W_py: " << massT << ", " << w_et
815  << ", " << w_px << ", " << w_py << " [GeV]";
816  if (massT > mtMin_ && massT < mtMax_) electron_sel[8] = true;
817  mt_before_->Fill(massT);
818  if (met_et > metMin_ && met_et < metMax_) electron_sel[9] = true;
819 
820  // // Acoplanarity cuts
821  // Geom::Phi<double> deltaphi(mu.phi()-atan2(met_py,met_px));
822  // double acop = deltaphi.value();
823  // if (acop<0) acop = - acop;
824  // acop = M_PI - acop;
825  // LogTrace("") << "\t... acoplanarity: " << acop;
826  // if (acop<acopCut_) muon_sel[10] = true;
827  // acop_before_->Fill(acop);
828 
829  // // Remaining flags (from global event information)
830  // if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[11] = true;
831  if (njets <= nJetMax_) electron_sel[10] = true;
832 
833  // Collect necessary flags "per electron"
834  int flags_passed = 0;
835  bool rec_sel_this = true;
836  bool eid_sel_this = true;
837  bool iso_sel_this = true;
838  bool all_sel_this = true;
839  for (int j = 0; j < NFLAGS; ++j) {
840  if (electron_sel[j]) flags_passed += 1;
841  if (j < 2 && !electron_sel[j]) rec_sel_this = false;
842  if (j < 4 && !electron_sel[j]) eid_sel_this = false;
843  if (j < 7 && !electron_sel[j]) iso_sel_this = false;
844  if (!electron_sel[j]) all_sel_this = false;
845  }
846 
847  if (all_sel_this) {
848  if (nGoodElectrons < 2) {
849  goodElectron[nGoodElectrons][0] = 1.;
850  goodElectron[nGoodElectrons][1] = elec.massSqr();
851  goodElectron[nGoodElectrons][2] = elec.energy();
852  goodElectron[nGoodElectrons][3] = elec.px();
853  goodElectron[nGoodElectrons][4] = elec.py();
854  goodElectron[nGoodElectrons][5] = elec.pz();
855  }
856  nGoodElectrons++;
857  }
858 
859  // // "rec" => pt,eta and quality cuts are satisfied
860  // if (rec_sel_this) rec_sel = true;
861  // // "iso" => "rec" AND "muon is isolated"
862  // if (iso_sel_this) iso_sel = true;
863  // // "hlt" => "iso" AND "event is triggered"
864  // if (hlt_sel_this) hlt_sel = true;
865  // // "all" => "met" AND "Z/top rejection cuts"
866  // if (all_sel_this) all_sel = true;
867 
868  // "rec" => pt,eta cuts are satisfied
869  if (rec_sel_this) rec_sel = true;
870  // "eid" => "rec" AND "electron passes ID"
871  if (eid_sel_this) iso_sel = true;
872  // "iso" => "eid" AND "electron is isolated"
873  if (iso_sel_this) iso_sel = true;
874  // "met" => "iso" AND "MET/MT"
875  // "all" => "met" AND "event is triggered"
876  if (all_sel_this) all_sel = true;
877 
878  // Do N-1 histograms now (and only once for global event quantities)
879  if (flags_passed >= (NFLAGS - 1)) {
880  if (!electron_sel[0] || flags_passed == NFLAGS) {
881  pt_after_->Fill(pt);
882  }
883  if (!electron_sel[1] || flags_passed == NFLAGS) {
884  eta_after_->Fill(eta);
885  }
886  if (!electron_sel[2] || flags_passed == NFLAGS) {
887  if (isBarrel) {
888  sieiebarrel_after_->Fill(sieie);
889  } else if (isEndcap) {
890  sieieendcap_after_->Fill(sieie);
891  }
892  }
893  if (!electron_sel[3] || flags_passed == NFLAGS) {
894  if (isBarrel) {
895  detainbarrel_after_->Fill(detain);
896  } else if (isEndcap) {
897  detainendcap_after_->Fill(detain);
898  }
899  }
900  if (!electron_sel[4] || flags_passed == NFLAGS) {
901  if (isBarrel) {
902  ecalisobarrel_after_->Fill(ecalisovar);
903  } else if (isEndcap) {
904  ecalisoendcap_after_->Fill(ecalisovar);
905  }
906  }
907  if (!electron_sel[5] || flags_passed == NFLAGS) {
908  if (isBarrel) {
909  hcalisobarrel_after_->Fill(hcalisovar);
910  } else if (isEndcap) {
911  hcalisoendcap_after_->Fill(hcalisovar);
912  }
913  }
914  if (!electron_sel[6] || flags_passed == NFLAGS) {
915  if (isBarrel) {
916  trkisobarrel_after_->Fill(trkisovar);
917  } else if (isEndcap) {
918  trkisoendcap_after_->Fill(trkisovar);
919  }
920  }
921  // if (!electron_sel[3] || flags_passed==NFLAGS)
922  // {
923  // detain_after_->Fill(detain);
924  // }
925  // if (!electron_sel[4] || flags_passed==NFLAGS)
926  // {
927  // ecaliso_after_->Fill(trackerHits);
928  // }
929  // if (!electron_sel[5] || flags_passed==NFLAGS)
930  // {
931  // tkelectr_after_->Fill(electr.isTrackerElectron());
932  // }
933  // if (!electron_sel[6] || flags_passed==NFLAGS)
934  // {
935  // iso_after_->Fill(isovar);
936  // }
937  if (!electron_sel[7] || flags_passed == NFLAGS) {
938  if (!hlt_hist_done) {
939  trig_after_->Fill(trigger_fired);
940  }
941  }
942  hlt_hist_done = true;
943  if (!electron_sel[8] || flags_passed == NFLAGS) {
944  mt_after_->Fill(massT);
945  }
946  if (!electron_sel[9] || flags_passed == NFLAGS) {
947  if (!met_hist_done) {
948  met_after_->Fill(met_et);
949  }
950  }
951  met_hist_done = true;
952  // if (!muon_sel[10] || flags_passed==NFLAGS)
953  // acop_after_->Fill(acop);
954  // if (!muon_sel[11] || flags_passed==NFLAGS)
955  // if (!nz1_hist_done)
956  // nz1_after_->Fill(nmuonsForZ1);
957  // nz1_hist_done = true;
958  // if (!muon_sel[11] || flags_passed==NFLAGS)
959  // if (!nz2_hist_done)
960  // nz2_after_->Fill(nmuonsForZ2);
961  // nz2_hist_done = true;
962  if (!electron_sel[10] || flags_passed == NFLAGS) {
963  if (!njets_hist_done) {
964  njets_after_->Fill(njets);
965  if (jet_et > 10) // don't want low energy "jets"
966  {
967  jet_et_after_->Fill(jet_et);
968  jet_eta_after_->Fill(jet_eta);
969  }
970  }
971  }
972  njets_hist_done = true;
973 
974  } // end N-1 histos block
975 
976  } // end loop through electrons
977 
978  // inv mass = sqrt(m_1^2 + m_2^2 + 2*(E_1*E_2 - (px1*px2 + py1*py2 + pz1+pz2)
979  // ) )
980  double invMass = 0;
981 
982  nelectrons_before_->Fill(electronCollectionSize);
983  if (electronCollectionSize > 1) {
984  invMass = sqrt(electron[0][1] + electron[1][1] +
985  2 * (electron[0][2] * electron[1][2] -
986  (electron[0][3] * electron[1][3] +
987  electron[0][4] * electron[1][4] +
988  electron[0][5] * electron[1][5])));
989  invmass_before_->Fill(invMass);
990  invmassPU_before_->Fill(invMass, npvCount);
991  }
992 
994  if (nGoodElectrons > 1) {
995  invMass = sqrt(goodElectron[0][1] + goodElectron[1][1] +
996  2 * (goodElectron[0][2] * goodElectron[1][2] -
997  (goodElectron[0][3] * goodElectron[1][3] +
998  goodElectron[0][4] * goodElectron[1][4] +
999  goodElectron[0][5] * goodElectron[1][5])));
1000  invmass_after_->Fill(invMass);
1001  invmassPU_afterZ_->Fill(invMass, npvCount);
1002  npvs_afterZ_->Fill(npvCount);
1003  }
1004 
1005  // Collect final flags
1006  if (rec_sel) nrec++;
1007  if (eid_sel) neid++;
1008  if (iso_sel) niso++;
1009  // if (hlt_sel) nhlt++;
1010  // if (met_sel) nmet++;
1011 
1012  if (all_sel) {
1013  nsel++;
1014  LogTrace("") << ">>>> Event ACCEPTED";
1015  } else {
1016  LogTrace("") << ">>>> Event REJECTED";
1017  }
1018 
1019  return;
1020 }
MonitorElement * ecalisoendcap_after_
Definition: EwkElecDQM.h:141
MonitorElement * jet_et_after_
Definition: EwkElecDQM.h:188
int i
Definition: DBlmapReader.cc:9
unsigned int nGoodElectrons
Definition: EwkElecDQM.h:105
MonitorElement * invmass_after_
Definition: EwkElecDQM.h:159
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
unsigned int nall
Definition: EwkElecDQM.h:96
MonitorElement * hcalisobarrel_after_
Definition: EwkElecDQM.h:144
unsigned int nsel
Definition: EwkElecDQM.h:102
double metMax_
Definition: EwkElecDQM.h:76
MonitorElement * nelectrons_before_
Definition: EwkElecDQM.h:167
double sieieCutBarrel_
Definition: EwkElecDQM.h:58
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
Definition: EwkElecDQM.h:50
virtual double energy() const final
energy
MonitorElement * sieieendcap_before_
Definition: EwkElecDQM.h:116
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
MonitorElement * sieieendcap_after_
Definition: EwkElecDQM.h:117
Base class for all types of Jets.
Definition: Jet.h:20
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:60
MonitorElement * ecalisobarrel_before_
Definition: EwkElecDQM.h:137
bool isBarrel(GeomDetEnumerators::SubDetector m)
MonitorElement * sieiebarrel_before_
Definition: EwkElecDQM.h:113
MonitorElement * hcalisobarrel_before_
Definition: EwkElecDQM.h:143
virtual double phi() const final
momentum azimuthal angle
float dr04TkSumPt() const
Definition: GsfElectron.h:502
MonitorElement * detainbarrel_after_
Definition: EwkElecDQM.h:120
MonitorElement * ecalisobarrel_after_
Definition: EwkElecDQM.h:138
MonitorElement * detainendcap_before_
Definition: EwkElecDQM.h:122
MonitorElement * trig_before_
Definition: EwkElecDQM.h:155
MonitorElement * sieiebarrel_after_
Definition: EwkElecDQM.h:114
MonitorElement * detainbarrel_before_
Definition: EwkElecDQM.h:119
tuple vertexCollection
MonitorElement * mt_before_
Definition: EwkElecDQM.h:170
MonitorElement * nelectrons_after_
Definition: EwkElecDQM.h:168
MonitorElement * hcalisoendcap_before_
Definition: EwkElecDQM.h:146
MonitorElement * npvs_afterZ_
Definition: EwkElecDQM.h:165
void Fill(long long x)
unsigned int niso
Definition: EwkElecDQM.h:99
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkElecDQM.cc:1023
MonitorElement * mt_after_
Definition: EwkElecDQM.h:171
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
double ecalIsoCutEndcap_
Definition: EwkElecDQM.h:68
float sigmaIetaIeta() const
Definition: GsfElectron.h:416
MonitorElement * jet_et_before_
Definition: EwkElecDQM.h:187
double detainCutEndcap_
Definition: EwkElecDQM.h:61
MonitorElement * njets_after_
Definition: EwkElecDQM.h:186
MonitorElement * pt_before_
Definition: EwkElecDQM.h:107
MonitorElement * pt_after_
Definition: EwkElecDQM.h:108
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
Definition: EwkElecDQM.h:46
double metMin_
Definition: EwkElecDQM.h:75
double trkIsoCutEndcap_
Definition: EwkElecDQM.h:72
Definition: MET.h:42
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int nrec
Definition: EwkElecDQM.h:97
MonitorElement * hcalisoendcap_after_
Definition: EwkElecDQM.h:147
int nJetMax_
Definition: EwkElecDQM.h:88
int j
Definition: DBlmapReader.cc:9
double ecalIsoCutBarrel_
Definition: EwkElecDQM.h:67
double trkIsoCutBarrel_
Definition: EwkElecDQM.h:71
virtual double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
Definition: EwkElecDQM.h:48
MonitorElement * invmass_before_
Definition: EwkElecDQM.h:158
MonitorElement * ecalisoendcap_before_
Definition: EwkElecDQM.h:140
static std::string const triggerResults
Definition: EdmProvDump.cc:41
MonitorElement * jet_eta_after_
Definition: EwkElecDQM.h:190
MonitorElement * trig_after_
Definition: EwkElecDQM.h:156
bool isEndcap(GeomDetEnumerators::SubDetector m)
virtual double pz() const final
z coordinate of momentum vector
#define LogTrace(id)
MonitorElement * jet_eta_before_
Definition: EwkElecDQM.h:189
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
unsigned int neid
Definition: EwkElecDQM.h:98
double etaCut_
Definition: EwkElecDQM.h:56
double hcalIsoCutBarrel_
Definition: EwkElecDQM.h:69
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
MonitorElement * detainendcap_after_
Definition: EwkElecDQM.h:123
MonitorElement * njets_before_
Definition: EwkElecDQM.h:185
MonitorElement * invmassPU_afterZ_
Definition: EwkElecDQM.h:161
MonitorElement * trkisobarrel_before_
Definition: EwkElecDQM.h:149
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
double sieieCutEndcap_
Definition: EwkElecDQM.h:59
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
Definition: EwkElecDQM.h:49
MonitorElement * met_before_
Definition: EwkElecDQM.h:173
MonitorElement * trkisoendcap_before_
Definition: EwkElecDQM.h:152
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
Definition: EwkElecDQM.h:47
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
HLTConfigProvider const & hltConfigProvider() const
edm::EDGetTokenT< edm::TriggerResults > trigTag_
Definition: EwkElecDQM.h:45
MonitorElement * met_after_
Definition: EwkElecDQM.h:174
double eJetMin_
Definition: EwkElecDQM.h:87
MonitorElement * trkisobarrel_after_
Definition: EwkElecDQM.h:150
double mtMax_
Definition: EwkElecDQM.h:74
MonitorElement * eta_after_
Definition: EwkElecDQM.h:111
double detainCutBarrel_
Definition: EwkElecDQM.h:60
const std::vector< std::string > elecTrig_
Definition: EwkElecDQM.h:54
MonitorElement * npvs_before_
Definition: EwkElecDQM.h:163
MonitorElement * trkisoendcap_after_
Definition: EwkElecDQM.h:153
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:495
HLTPrescaleProvider hltPrescaleProvider_
Definition: EwkElecDQM.h:94
virtual double px() const final
x coordinate of momentum vector
virtual double et() const final
transverse energy
virtual double eta() const final
momentum pseudorapidity
string metCollection
Definition: MT2Analyzer.py:466
double hcalIsoCutEndcap_
Definition: EwkElecDQM.h:70
MonitorElement * eta_before_
Definition: EwkElecDQM.h:110
MonitorElement * invmassPU_before_
Definition: EwkElecDQM.h:160
virtual double massSqr() const final
mass squared
double mtMin_
Definition: EwkElecDQM.h:73
virtual double pt() const final
transverse momentum
double ptCut_
Definition: EwkElecDQM.h:55
void EwkElecDQM::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 151 of file EwkElecDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), detainbarrel_after_, detainbarrel_before_, detainendcap_after_, detainendcap_before_, ecalisobarrel_after_, ecalisobarrel_before_, ecalisoendcap_after_, ecalisoendcap_before_, eJetMin_, eta_after_, eta_before_, hcalisobarrel_after_, hcalisobarrel_before_, hcalisoendcap_after_, hcalisoendcap_before_, invmass_after_, invmass_before_, invmassPU_afterZ_, invmassPU_before_, jet_et_after_, jet_et_before_, jet_eta_after_, jet_eta_before_, jetTag_, edm::InputTag::label(), met_after_, met_before_, metTag_, mt_after_, mt_before_, nelectrons_after_, nelectrons_before_, njets_after_, njets_before_, npvs_afterZ_, npvs_before_, pt_after_, pt_before_, PUBinCount_, PUMax_, DQMStore::IBooker::setCurrentFolder(), sieiebarrel_after_, sieiebarrel_before_, sieieendcap_after_, sieieendcap_before_, trig_after_, trig_before_, trkisobarrel_after_, trkisobarrel_before_, trkisoendcap_after_, and trkisoendcap_before_.

152  {
153 
154  ibooker.setCurrentFolder("Physics/EwkElecDQM");
155 
156  char chtitle[256] = "";
157 
158  pt_before_ = ibooker.book1D("PT_BEFORECUTS",
159  "Electron transverse momentum [GeV]", 100, 0., 100.);
160  pt_after_ = ibooker.book1D("PT_LASTCUT",
161  "Electron transverse momentum [GeV]", 100, 0., 100.);
162 
163  eta_before_ = ibooker.book1D("ETA_BEFORECUTS",
164  "Electron pseudo-rapidity", 50, -2.5, 2.5);
165  eta_after_ = ibooker.book1D("ETA_LASTCUT",
166  "Electron pseudo-rapidity", 50, -2.5, 2.5);
167 
168  sieiebarrel_before_ = ibooker.book1D("SIEIEBARREL_BEFORECUTS",
169  "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
170  sieiebarrel_after_ = ibooker.book1D("SIEIEBARREL_LASTCUT",
171  "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
172 
173  sieieendcap_before_ = ibooker.book1D("SIEIEENDCAP_BEFORECUTS",
174  "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
175  sieieendcap_after_ = ibooker.book1D("SIEIEENDCAP_LASTCUT",
176  "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
177 
178  detainbarrel_before_ = ibooker.book1D("DETAINBARREL_BEFORECUTS",
179  "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
180  detainbarrel_after_ = ibooker.book1D("DETAINBARREL_LASTCUT",
181  "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
182 
183  detainendcap_before_ = ibooker.book1D("DETAINENDCAP_BEFORECUTS",
184  "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
185  detainendcap_after_ = ibooker.book1D("DETAINENDCAP_LASTCUT",
186  "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
187 
188  ecalisobarrel_before_ = ibooker.book1D("ECALISOBARREL_BEFORECUTS",
189  "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
190  ecalisobarrel_after_ = ibooker.book1D("ECALISOBARREL_LASTCUT",
191  "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
192 
193  ecalisoendcap_before_ = ibooker.book1D("ECALISOENDCAP_BEFORECUTS",
194  "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
195  ecalisoendcap_after_ = ibooker.book1D("ECALISOENDCAP_LASTCUT",
196  "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
197 
198  hcalisobarrel_before_ = ibooker.book1D("HCALISOBARREL_BEFORECUTS",
199  "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
200  hcalisobarrel_after_ = ibooker.book1D("HCALISOBARREL_LASTCUT",
201  "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
202 
203  hcalisoendcap_before_ = ibooker.book1D("HCALISOENDCAP_BEFORECUTS",
204  "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
205  hcalisoendcap_after_ = ibooker.book1D("HCALISOENDCAP_LASTCUT",
206  "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
207 
208  trkisobarrel_before_ = ibooker.book1D("TRKISOBARREL_BEFORECUTS",
209  "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
210  trkisobarrel_after_ = ibooker.book1D("TRKISOBARREL_LASTCUT",
211  "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
212 
213  trkisoendcap_before_ = ibooker.book1D("TRKISOENDCAP_BEFORECUTS",
214  "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
215  trkisoendcap_after_ = ibooker.book1D("TRKISOENDCAP_LASTCUT",
216  "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
217 
218  trig_before_ = ibooker.book1D("TRIG_BEFORECUTS", "Trigger response", 2, -0.5,
219  1.5); // elecTrig_ is now a vector of strings!
220  trig_after_ = ibooker.book1D("TRIG_LASTCUT", "Trigger response", 2, -0.5, 1.5);
221 
222  invmass_before_ = ibooker.book1D("INVMASS_BEFORECUTS",
223  "Di-electron invariant mass [GeV]", 100, 0., 200.);
224  invmass_after_ = ibooker.book1D("INVMASS_AFTERCUTS",
225  "Di-electron invariant mass [GeV]", 100, 0., 200.);
226 
227  invmassPU_before_ = ibooker.book2D("INVMASS_PU_BEFORECUTS",
228  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
229  200., PUBinCount_, -0.5, PUMax_ + 0.5);
230  invmassPU_afterZ_ = ibooker.book2D("INVMASS_PU_AFTERZCUTS",
231  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
232  200., PUBinCount_, -0.5, PUMax_ + 0.5);
233 
234  npvs_before_ = ibooker.book1D("NPVs_BEFORECUTS",
235  "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
236 
237  npvs_afterZ_ = ibooker.book1D("NPVs_AFTERZCUTS",
238  "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
239 
240  nelectrons_before_ = ibooker.book1D("NELECTRONS_BEFORECUTS",
241  "Number of electrons in event", 10, -0.5, 9.5);
242  nelectrons_after_ = ibooker.book1D("NELECTRONS_AFTERCUTS",
243  "Number of electrons in event", 10, -0.5, 9.5);
244 
245  snprintf(chtitle, 255, "Transverse mass (%s) [GeV]", metTag_.label().data());
246  mt_before_ = ibooker.book1D("MT_BEFORECUTS", chtitle, 150, 0., 300.);
247  mt_after_ = ibooker.book1D("MT_LASTCUT", chtitle, 150, 0., 300.);
248 
249 
250  snprintf(chtitle, 255, "Missing transverse energy (%s) [GeV]",
251  metTag_.label().data());
252  met_before_ = ibooker.book1D("MET_BEFORECUTS", chtitle, 100, 0., 200.);
253  met_after_ = ibooker.book1D("MET_LASTCUT", chtitle, 100, 0., 200.);
254 
255  snprintf(chtitle, 255, "Number of jets (%s) above %.2f GeV",
256  jetTag_.label().data(), eJetMin_);
257  njets_before_ = ibooker.book1D("NJETS_BEFORECUTS", chtitle, 10, -0.5, 9.5);
258  njets_after_ = ibooker.book1D("NJETS_LASTCUT", chtitle, 10, -0.5, 9.5);
259 
260  snprintf(chtitle, 255, "Jet with highest E_{T} (%s)", jetTag_.label().data());
261  jet_et_before_ = ibooker.book1D("JETET1_BEFORECUTS", chtitle, 20, 0., 200.0);
262  jet_et_after_ = ibooker.book1D("JETET1_AFTERCUTS", chtitle, 20, 0., 200.0);
263 
264  snprintf(chtitle, 255, "Eta of Jet with highest E_{T} (%s)",
265  jetTag_.label().data());
266  jet_eta_before_ = ibooker.book1D("JETETA1_BEFORECUTS", chtitle, 20, -5, 5);
267  jet_eta_after_ = ibooker.book1D("JETETA1_AFTERCUTS", chtitle, 20, -5, 5);
268 
269 }
MonitorElement * ecalisoendcap_after_
Definition: EwkElecDQM.h:141
MonitorElement * jet_et_after_
Definition: EwkElecDQM.h:188
MonitorElement * invmass_after_
Definition: EwkElecDQM.h:159
MonitorElement * hcalisobarrel_after_
Definition: EwkElecDQM.h:144
MonitorElement * nelectrons_before_
Definition: EwkElecDQM.h:167
MonitorElement * sieieendcap_before_
Definition: EwkElecDQM.h:116
MonitorElement * sieieendcap_after_
Definition: EwkElecDQM.h:117
MonitorElement * ecalisobarrel_before_
Definition: EwkElecDQM.h:137
edm::InputTag jetTag_
Definition: EwkElecDQM.h:44
MonitorElement * sieiebarrel_before_
Definition: EwkElecDQM.h:113
MonitorElement * hcalisobarrel_before_
Definition: EwkElecDQM.h:143
MonitorElement * detainbarrel_after_
Definition: EwkElecDQM.h:120
MonitorElement * ecalisobarrel_after_
Definition: EwkElecDQM.h:138
MonitorElement * detainendcap_before_
Definition: EwkElecDQM.h:122
MonitorElement * trig_before_
Definition: EwkElecDQM.h:155
MonitorElement * sieiebarrel_after_
Definition: EwkElecDQM.h:114
MonitorElement * detainbarrel_before_
Definition: EwkElecDQM.h:119
MonitorElement * mt_before_
Definition: EwkElecDQM.h:170
MonitorElement * nelectrons_after_
Definition: EwkElecDQM.h:168
MonitorElement * hcalisoendcap_before_
Definition: EwkElecDQM.h:146
MonitorElement * npvs_afterZ_
Definition: EwkElecDQM.h:165
MonitorElement * mt_after_
Definition: EwkElecDQM.h:171
MonitorElement * jet_et_before_
Definition: EwkElecDQM.h:187
MonitorElement * njets_after_
Definition: EwkElecDQM.h:186
MonitorElement * pt_before_
Definition: EwkElecDQM.h:107
MonitorElement * pt_after_
Definition: EwkElecDQM.h:108
unsigned int PUBinCount_
Definition: EwkElecDQM.h:91
MonitorElement * hcalisoendcap_after_
Definition: EwkElecDQM.h:147
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
edm::InputTag metTag_
Definition: EwkElecDQM.h:43
MonitorElement * invmass_before_
Definition: EwkElecDQM.h:158
MonitorElement * ecalisoendcap_before_
Definition: EwkElecDQM.h:140
unsigned int PUMax_
Definition: EwkElecDQM.h:91
MonitorElement * jet_eta_after_
Definition: EwkElecDQM.h:190
MonitorElement * trig_after_
Definition: EwkElecDQM.h:156
MonitorElement * jet_eta_before_
Definition: EwkElecDQM.h:189
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * detainendcap_after_
Definition: EwkElecDQM.h:123
MonitorElement * njets_before_
Definition: EwkElecDQM.h:185
MonitorElement * invmassPU_afterZ_
Definition: EwkElecDQM.h:161
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * trkisobarrel_before_
Definition: EwkElecDQM.h:149
MonitorElement * met_before_
Definition: EwkElecDQM.h:173
MonitorElement * trkisoendcap_before_
Definition: EwkElecDQM.h:152
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * met_after_
Definition: EwkElecDQM.h:174
double eJetMin_
Definition: EwkElecDQM.h:87
MonitorElement * trkisobarrel_after_
Definition: EwkElecDQM.h:150
MonitorElement * eta_after_
Definition: EwkElecDQM.h:111
MonitorElement * npvs_before_
Definition: EwkElecDQM.h:163
MonitorElement * trkisoendcap_after_
Definition: EwkElecDQM.h:153
MonitorElement * eta_before_
Definition: EwkElecDQM.h:110
MonitorElement * invmassPU_before_
Definition: EwkElecDQM.h:160
double EwkElecDQM::calcDeltaPhi ( double  phi1,
double  phi2 
)

Definition at line 1023 of file EwkElecDQM.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi.

Referenced by analyze().

1023  {
1024 
1025  double deltaPhi = phi1 - phi2;
1026 
1027  if (deltaPhi < 0) deltaPhi = -deltaPhi;
1028 
1029  if (deltaPhi > 3.1415926) {
1030  deltaPhi = 2 * 3.1415926 - deltaPhi;
1031  }
1032 
1033  return deltaPhi;
1034 }
void EwkElecDQM::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSet 
)
virtual

Reimplemented from DQMEDAnalyzer.

Definition at line 131 of file EwkElecDQM.cc.

References hltPrescaleProvider_, HLTPrescaleProvider::init(), isValidHltConfig_, LogTrace, nall, neid, niso, nrec, and nsel.

131  {
132  nall = 0;
133  nsel = 0;
134 
135  nrec = 0;
136  neid = 0;
137  niso = 0;
138  // nhlt = 0;
139  // nmet = 0;
140 
141  // passed as parameter to HLTConfigProvider::init(), not yet used
142  bool isConfigChanged = false;
143  // isValidHltConfig_ could be used to short-circuit analyze() in case of
144  // problems
146  hltPrescaleProvider_.init(iRun, iSet, "HLT", isConfigChanged);
147 
148  LogTrace("") << "isValidHltConfig_=" << isValidHltConfig_ << "\n";
149 }
unsigned int nall
Definition: EwkElecDQM.h:96
unsigned int nsel
Definition: EwkElecDQM.h:102
unsigned int niso
Definition: EwkElecDQM.h:99
unsigned int nrec
Definition: EwkElecDQM.h:97
#define LogTrace(id)
unsigned int neid
Definition: EwkElecDQM.h:98
bool isValidHltConfig_
Definition: EwkElecDQM.h:93
HLTPrescaleProvider hltPrescaleProvider_
Definition: EwkElecDQM.h:94
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
void EwkElecDQM::endRun ( const edm::Run r,
const edm::EventSetup  
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 271 of file EwkElecDQM.cc.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor::all(), nall, neid, niso, nrec, nsel, pileupDistInMC::num, and mathSSE::sqrt().

271  {
272 
273  // overall
274  double all = nall;
275  double esel = nsel / all;
276  LogVerbatim("") << "\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
277  LogVerbatim("") << "Total number of events analyzed: " << nall << " [events]";
278  LogVerbatim("") << "Total number of events selected: " << nsel << " [events]";
279  LogVerbatim("") << "Overall efficiency: "
280  << "(" << setprecision(4) << esel * 100. << " +/- "
281  << setprecision(2) << sqrt(esel * (1 - esel) / all) * 100.
282  << ")%";
283 
284  double erec = nrec / all;
285  double eeid = neid / all;
286  double eiso = niso / all;
287  // double ehlt = nhlt/all;
288  // double emet = nmet/all;
289 
290  // general reconstruction step??
291  double num = nrec;
292  double eff = erec;
293  double err = sqrt(eff * (1 - eff) / all);
294  LogVerbatim("") << "Passing Pt/Eta/Quality cuts: " << num << " [events], ("
295  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
296  << err * 100. << ")%";
297 
298  // electron ID step
299  num = neid;
300  eff = eeid;
301  err = sqrt(eff * (1 - eff) / all);
302  double effstep = 0.;
303  double errstep = 0.;
304  if (nrec > 0) effstep = eeid / erec;
305  if (nrec > 0) errstep = sqrt(effstep * (1 - effstep) / nrec);
306  LogVerbatim("") << "Passing eID cuts: " << num << " [events], ("
307  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
308  << err * 100. << ")%, to previous step: (" << setprecision(4)
309  << effstep * 100. << " +/- " << setprecision(2)
310  << errstep * 100. << ")%";
311 
312  // isolation step
313  num = niso;
314  eff = eiso;
315  err = sqrt(eff * (1 - eff) / all);
316  effstep = 0.;
317  errstep = 0.;
318  if (neid > 0) effstep = eiso / eeid;
319  if (neid > 0) errstep = sqrt(effstep * (1 - effstep) / neid);
320  LogVerbatim("") << "Passing isolation cuts: " << num << " [events], ("
321  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
322  << err * 100. << ")%, to previous step: (" << setprecision(4)
323  << effstep * 100. << " +/- " << setprecision(2)
324  << errstep * 100. << ")%";
325 
326  // // trigger step
327  // num = nhlt;
328  // eff = ehlt;
329  // err = sqrt(eff*(1-eff)/all);
330  // effstep = 0.;
331  // errstep = 0.;
332  // if (niso>0) effstep = ehlt/eiso;
333  // if (niso>0) errstep = sqrt(effstep*(1-effstep)/niso);
334  // LogVerbatim("") << "Passing HLT criteria: " << num << "
335  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
336  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
337  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
338 
339  // trigger step
340  num = nsel;
341  eff = esel;
342  err = sqrt(eff * (1 - eff) / all);
343  effstep = 0.;
344  errstep = 0.;
345  if (niso > 0) effstep = esel / eiso;
346  if (niso > 0) errstep = sqrt(effstep * (1 - effstep) / niso);
347  LogVerbatim("") << "Passing HLT criteria: " << num << " [events], ("
348  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
349  << err * 100. << ")%, to previous step: (" << setprecision(4)
350  << effstep * 100. << " +/- " << setprecision(2)
351  << errstep * 100. << ")%";
352 
353  // // met/acoplanarity cuts
354  // num = nmet;
355  // eff = emet;
356  // err = sqrt(eff*(1-eff)/all);
357  // effstep = 0.;
358  // errstep = 0.;
359  // if (nhlt>0) effstep = emet/ehlt;
360  // if (nhlt>0) errstep = sqrt(effstep*(1-effstep)/nhlt);
361  // LogVerbatim("") << "Passing MET/acoplanarity cuts: " << num << "
362  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
363  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
364  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
365 
366  // // Z/top selection cuts ALSO LAST STEP so "sel" for "selection"
367  // num = nsel;
368  // eff = esel;
369  // err = sqrt(eff*(1-eff)/all);
370  // effstep = 0.;
371  // errstep = 0.;
372  // if (nmet>0) effstep = esel/emet;
373  // if (nmet>0) errstep = sqrt(effstep*(1-effstep)/nmet);
374  // LogVerbatim("") << "Passing Z/top rejection cuts: " << num << "
375  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
376  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
377  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
378 
379  LogVerbatim("") << ">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
380 }
unsigned int nall
Definition: EwkElecDQM.h:96
unsigned int nsel
Definition: EwkElecDQM.h:102
unsigned int niso
Definition: EwkElecDQM.h:99
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int nrec
Definition: EwkElecDQM.h:97
unsigned int neid
Definition: EwkElecDQM.h:98

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> EwkElecDQM::beamSpotTag_
private

Definition at line 50 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::detainbarrel_after_
private

Definition at line 120 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::detainbarrel_before_
private

Definition at line 119 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::detainCutBarrel_
private

Definition at line 60 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::detainCutEndcap_
private

Definition at line 61 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::detainendcap_after_
private

Definition at line 123 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::detainendcap_before_
private

Definition at line 122 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::ecalisobarrel_after_
private

Definition at line 138 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::ecalisobarrel_before_
private

Definition at line 137 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::ecalIsoCutBarrel_
private

Definition at line 67 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::ecalIsoCutEndcap_
private

Definition at line 68 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::ecalisoendcap_after_
private

Definition at line 141 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::ecalisoendcap_before_
private

Definition at line 140 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::eJetMin_
private

Definition at line 87 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::View<reco::GsfElectron> > EwkElecDQM::elecTag_
private

Definition at line 46 of file EwkElecDQM.h.

Referenced by analyze().

const std::vector<std::string> EwkElecDQM::elecTrig_
private

Definition at line 54 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::eta_after_
private

Definition at line 111 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::eta_before_
private

Definition at line 110 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::etaCut_
private

Definition at line 56 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::hcalisobarrel_after_
private

Definition at line 144 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::hcalisobarrel_before_
private

Definition at line 143 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::hcalIsoCutBarrel_
private

Definition at line 69 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::hcalIsoCutEndcap_
private

Definition at line 70 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::hcalisoendcap_after_
private

Definition at line 147 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::hcalisoendcap_before_
private

Definition at line 146 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

HLTPrescaleProvider EwkElecDQM::hltPrescaleProvider_
private

Definition at line 94 of file EwkElecDQM.h.

Referenced by analyze(), and dqmBeginRun().

MonitorElement* EwkElecDQM::invmass_after_
private

Definition at line 159 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::invmass_before_
private

Definition at line 158 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::invmassPU_afterZ_
private

Definition at line 161 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::invmassPU_before_
private

Definition at line 160 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

bool EwkElecDQM::isValidHltConfig_
private

Definition at line 93 of file EwkElecDQM.h.

Referenced by dqmBeginRun(), and EwkElecDQM().

MonitorElement* EwkElecDQM::jet_et_after_
private

Definition at line 188 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::jet_et_before_
private

Definition at line 187 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::jet_eta_after_
private

Definition at line 190 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::jet_eta_before_
private

Definition at line 189 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag EwkElecDQM::jetTag_
private

Definition at line 44 of file EwkElecDQM.h.

Referenced by bookHistograms().

edm::EDGetTokenT<edm::View<reco::Jet> > EwkElecDQM::jetToken_
private

Definition at line 48 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::met_after_
private

Definition at line 174 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::met_before_
private

Definition at line 173 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

bool EwkElecDQM::metIncludesMuons_
private

Definition at line 51 of file EwkElecDQM.h.

double EwkElecDQM::metMax_
private

Definition at line 76 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::metMin_
private

Definition at line 75 of file EwkElecDQM.h.

Referenced by analyze().

edm::InputTag EwkElecDQM::metTag_
private

Definition at line 43 of file EwkElecDQM.h.

Referenced by bookHistograms().

edm::EDGetTokenT<edm::View<reco::MET> > EwkElecDQM::metToken_
private

Definition at line 47 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::mt_after_
private

Definition at line 171 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::mt_before_
private

Definition at line 170 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::mtMax_
private

Definition at line 74 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::mtMin_
private

Definition at line 73 of file EwkElecDQM.h.

Referenced by analyze().

unsigned int EwkElecDQM::nall
private

Definition at line 96 of file EwkElecDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkElecDQM::neid
private

Definition at line 98 of file EwkElecDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

MonitorElement* EwkElecDQM::nelectrons_after_
private

Definition at line 168 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::nelectrons_before_
private

Definition at line 167 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

unsigned int EwkElecDQM::nGoodElectrons
private

Definition at line 105 of file EwkElecDQM.h.

Referenced by analyze().

unsigned int EwkElecDQM::niso
private

Definition at line 99 of file EwkElecDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

int EwkElecDQM::nJetMax_
private

Definition at line 88 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::njets_after_
private

Definition at line 186 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::njets_before_
private

Definition at line 185 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::npvs_afterZ_
private

Definition at line 165 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::npvs_before_
private

Definition at line 163 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

unsigned int EwkElecDQM::nrec
private

Definition at line 97 of file EwkElecDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkElecDQM::nsel
private

Definition at line 102 of file EwkElecDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

MonitorElement* EwkElecDQM::pt_after_
private

Definition at line 108 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::pt_before_
private

Definition at line 107 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::ptCut_
private
unsigned int EwkElecDQM::PUBinCount_
private

Definition at line 91 of file EwkElecDQM.h.

Referenced by bookHistograms().

unsigned int EwkElecDQM::PUMax_
private

Definition at line 91 of file EwkElecDQM.h.

Referenced by bookHistograms().

MonitorElement* EwkElecDQM::sieiebarrel_after_
private

Definition at line 114 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::sieiebarrel_before_
private

Definition at line 113 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::sieieCutBarrel_
private

Definition at line 58 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::sieieCutEndcap_
private

Definition at line 59 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::sieieendcap_after_
private

Definition at line 117 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::sieieendcap_before_
private

Definition at line 116 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::trig_after_
private

Definition at line 156 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::trig_before_
private

Definition at line 155 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::TriggerResults> EwkElecDQM::trigTag_
private

Definition at line 45 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::trkisobarrel_after_
private

Definition at line 150 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::trkisobarrel_before_
private

Definition at line 149 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkElecDQM::trkIsoCutBarrel_
private

Definition at line 71 of file EwkElecDQM.h.

Referenced by analyze().

double EwkElecDQM::trkIsoCutEndcap_
private

Definition at line 72 of file EwkElecDQM.h.

Referenced by analyze().

MonitorElement* EwkElecDQM::trkisoendcap_after_
private

Definition at line 153 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkElecDQM::trkisoendcap_before_
private

Definition at line 152 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::View<reco::Vertex> > EwkElecDQM::vertexTag_
private

Definition at line 49 of file EwkElecDQM.h.

Referenced by analyze().