CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
EwkElecDQM Class Reference

#include <EwkElecDQM.h>

Inheritance diagram for EwkElecDQM:
DQMOneEDAnalyzer<> edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EwkElecDQM (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMOneEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
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 &) override
 
void dqmEndRun (const edm::Run &, const edm::EventSetup &) override
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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::TriggerResultstrigTag_
 
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 DQMOneEDAnalyzer<>
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMOneEDAnalyzer<>
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

DQM offline for EWK Electrons

Definition at line 27 of file EwkElecDQM.h.

Constructor & Destructor Documentation

◆ EwkElecDQM()

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

Definition at line 36 of file EwkElecDQM.cc.

References isValidHltConfig_.

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

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 347 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_, HPSPFTauProducerPuppi_cfi::electron, pdwgLeptonRecoSkim_cfi::electronCollection, reco::LeafCandidate::energy(), PVValHelper::eta, reco::LeafCandidate::eta(), eta_after_, eta_before_, etaCut_, makeMEIFBenchmarkPlots::ev, dqm::impl::MonitorElement::Fill(), hcalisobarrel_after_, hcalisobarrel_before_, hcalIsoCutBarrel_, hcalIsoCutEndcap_, hcalisoendcap_after_, hcalisoendcap_before_, hltPrescaleProvider_, mps_fire::i, invmass_after_, invmass_before_, invmassPU_afterZ_, invmassPU_before_, PixelPluginsPhase0_cfi::isBarrel, GeomDetEnumerators::isEndcap(), dqmiolumiharvest::j, metsig::jet, jet_et_after_, jet_et_before_, jet_eta_after_, jet_eta_before_, jetfilter_cfi::jetCollection, jetToken_, LogTrace, reco::LeafCandidate::massSqr(), BTaggingMonitor_cfi::met, met_after_, met_before_, susyDQM_cfi::metCollection, metMax_, metMin_, metToken_, mt_after_, mt_before_, mtMax_, mtMin_, nall, neid, nelectrons_after_, nelectrons_before_, nGoodElectrons, niso, nJetMax_, BTaggingMonitoring_cff::njets, njets_after_, njets_before_, npvs_afterZ_, npvs_before_, nrec, nsel, reco::LeafCandidate::phi(), HLTPrescaleProvider::prescaleSet(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), pt_after_, pt_before_, ptCut_, multPhiCorr_741_25nsDY_cfi::px, reco::LeafCandidate::px(), multPhiCorr_741_25nsDY_cfi::py, reco::LeafCandidate::py(), reco::LeafCandidate::pz(), electrons_cff::sieie, sieiebarrel_after_, sieiebarrel_before_, sieieCutBarrel_, sieieCutEndcap_, sieieendcap_after_, sieieendcap_before_, reco::GsfElectron::sigmaIetaIeta(), mathSSE::sqrt(), trkisobarrel_after_, trkisobarrel_before_, trkIsoCutBarrel_, trkIsoCutEndcap_, trkisoendcap_after_, trkisoendcap_before_, bphysicsOniaDQM_cfi::vertex, spclusmultinvestigator_cfi::vertexCollection, and vertexTag_.

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

◆ bookHistograms()

void EwkElecDQM::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

1.5); // elecTrig_ is now a vector of strings!

Implements DQMOneEDAnalyzer<>.

Definition at line 128 of file EwkElecDQM.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::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_, dqm::implementation::NavigatorBase::setCurrentFolder(), sieiebarrel_after_, sieiebarrel_before_, sieieendcap_after_, sieieendcap_before_, trkisobarrel_after_, trkisobarrel_before_, trkisoendcap_after_, and trkisoendcap_before_.

128  {
129  ibooker.setCurrentFolder("Physics/EwkElecDQM");
130 
131  char chtitle[256] = "";
132 
133  pt_before_ = ibooker.book1D("PT_BEFORECUTS", "Electron transverse momentum [GeV]", 100, 0., 100.);
134  pt_after_ = ibooker.book1D("PT_LASTCUT", "Electron transverse momentum [GeV]", 100, 0., 100.);
135 
136  eta_before_ = ibooker.book1D("ETA_BEFORECUTS", "Electron pseudo-rapidity", 50, -2.5, 2.5);
137  eta_after_ = ibooker.book1D("ETA_LASTCUT", "Electron pseudo-rapidity", 50, -2.5, 2.5);
138 
139  sieiebarrel_before_ = ibooker.book1D("SIEIEBARREL_BEFORECUTS", "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
140  sieiebarrel_after_ = ibooker.book1D("SIEIEBARREL_LASTCUT", "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
141 
142  sieieendcap_before_ = ibooker.book1D("SIEIEENDCAP_BEFORECUTS", "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
143  sieieendcap_after_ = ibooker.book1D("SIEIEENDCAP_LASTCUT", "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
144 
146  ibooker.book1D("DETAINBARREL_BEFORECUTS", "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
147  detainbarrel_after_ = ibooker.book1D("DETAINBARREL_LASTCUT", "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
148 
150  ibooker.book1D("DETAINENDCAP_BEFORECUTS", "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
151  detainendcap_after_ = ibooker.book1D("DETAINENDCAP_LASTCUT", "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
152 
153  ecalisobarrel_before_ = ibooker.book1D(
154  "ECALISOBARREL_BEFORECUTS", "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
156  ibooker.book1D("ECALISOBARREL_LASTCUT", "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
157 
158  ecalisoendcap_before_ = ibooker.book1D(
159  "ECALISOENDCAP_BEFORECUTS", "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
161  ibooker.book1D("ECALISOENDCAP_LASTCUT", "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
162 
163  hcalisobarrel_before_ = ibooker.book1D(
164  "HCALISOBARREL_BEFORECUTS", "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
166  ibooker.book1D("HCALISOBARREL_LASTCUT", "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
167 
168  hcalisoendcap_before_ = ibooker.book1D(
169  "HCALISOENDCAP_BEFORECUTS", "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
171  ibooker.book1D("HCALISOENDCAP_LASTCUT", "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
172 
173  trkisobarrel_before_ = ibooker.book1D(
174  "TRKISOBARREL_BEFORECUTS", "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
176  ibooker.book1D("TRKISOBARREL_LASTCUT", "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
177 
178  trkisoendcap_before_ = ibooker.book1D(
179  "TRKISOENDCAP_BEFORECUTS", "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
181  ibooker.book1D("TRKISOENDCAP_LASTCUT", "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
182 
183  // trig_before_ = ibooker.book1D("TRIG_BEFORECUTS", "Trigger response", 2, -0.5,
185  // trig_after_ = ibooker.book1D("TRIG_LASTCUT", "Trigger response", 2, -0.5, 1.5);
186 
187  invmass_before_ = ibooker.book1D("INVMASS_BEFORECUTS", "Di-electron invariant mass [GeV]", 100, 0., 200.);
188  invmass_after_ = ibooker.book1D("INVMASS_AFTERCUTS", "Di-electron invariant mass [GeV]", 100, 0., 200.);
189 
190  invmassPU_before_ = ibooker.book2D("INVMASS_PU_BEFORECUTS",
191  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count",
192  100,
193  0.,
194  200.,
195  PUBinCount_,
196  -0.5,
197  PUMax_ + 0.5);
198  invmassPU_afterZ_ = ibooker.book2D("INVMASS_PU_AFTERZCUTS",
199  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count",
200  100,
201  0.,
202  200.,
203  PUBinCount_,
204  -0.5,
205  PUMax_ + 0.5);
206 
207  npvs_before_ =
208  ibooker.book1D("NPVs_BEFORECUTS", "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
209 
210  npvs_afterZ_ =
211  ibooker.book1D("NPVs_AFTERZCUTS", "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
212 
213  nelectrons_before_ = ibooker.book1D("NELECTRONS_BEFORECUTS", "Number of electrons in event", 10, -0.5, 9.5);
214  nelectrons_after_ = ibooker.book1D("NELECTRONS_AFTERCUTS", "Number of electrons in event", 10, -0.5, 9.5);
215 
216  snprintf(chtitle, 255, "Transverse mass (%s) [GeV]", metTag_.label().data());
217  mt_before_ = ibooker.book1D("MT_BEFORECUTS", chtitle, 150, 0., 300.);
218  mt_after_ = ibooker.book1D("MT_LASTCUT", chtitle, 150, 0., 300.);
219 
220  snprintf(chtitle, 255, "Missing transverse energy (%s) [GeV]", metTag_.label().data());
221  met_before_ = ibooker.book1D("MET_BEFORECUTS", chtitle, 100, 0., 200.);
222  met_after_ = ibooker.book1D("MET_LASTCUT", chtitle, 100, 0., 200.);
223 
224  snprintf(chtitle, 255, "Number of jets (%s) above %.2f GeV", jetTag_.label().data(), eJetMin_);
225  njets_before_ = ibooker.book1D("NJETS_BEFORECUTS", chtitle, 10, -0.5, 9.5);
226  njets_after_ = ibooker.book1D("NJETS_LASTCUT", chtitle, 10, -0.5, 9.5);
227 
228  snprintf(chtitle, 255, "Jet with highest E_{T} (%s)", jetTag_.label().data());
229  jet_et_before_ = ibooker.book1D("JETET1_BEFORECUTS", chtitle, 20, 0., 200.0);
230  jet_et_after_ = ibooker.book1D("JETET1_AFTERCUTS", chtitle, 20, 0., 200.0);
231 
232  snprintf(chtitle, 255, "Eta of Jet with highest E_{T} (%s)", jetTag_.label().data());
233  jet_eta_before_ = ibooker.book1D("JETETA1_BEFORECUTS", chtitle, 20, -5, 5);
234  jet_eta_after_ = ibooker.book1D("JETETA1_AFTERCUTS", chtitle, 20, -5, 5);
235 }
MonitorElement * ecalisoendcap_after_
Definition: EwkElecDQM.h:140
MonitorElement * jet_et_after_
Definition: EwkElecDQM.h:187
MonitorElement * invmass_after_
Definition: EwkElecDQM.h:158
MonitorElement * hcalisobarrel_after_
Definition: EwkElecDQM.h:143
MonitorElement * nelectrons_before_
Definition: EwkElecDQM.h:166
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * sieieendcap_before_
Definition: EwkElecDQM.h:115
MonitorElement * sieieendcap_after_
Definition: EwkElecDQM.h:116
MonitorElement * ecalisobarrel_before_
Definition: EwkElecDQM.h:136
edm::InputTag jetTag_
Definition: EwkElecDQM.h:43
MonitorElement * sieiebarrel_before_
Definition: EwkElecDQM.h:112
MonitorElement * hcalisobarrel_before_
Definition: EwkElecDQM.h:142
MonitorElement * detainbarrel_after_
Definition: EwkElecDQM.h:119
MonitorElement * ecalisobarrel_after_
Definition: EwkElecDQM.h:137
MonitorElement * detainendcap_before_
Definition: EwkElecDQM.h:121
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * sieiebarrel_after_
Definition: EwkElecDQM.h:113
MonitorElement * detainbarrel_before_
Definition: EwkElecDQM.h:118
MonitorElement * mt_before_
Definition: EwkElecDQM.h:169
MonitorElement * nelectrons_after_
Definition: EwkElecDQM.h:167
MonitorElement * hcalisoendcap_before_
Definition: EwkElecDQM.h:145
MonitorElement * npvs_afterZ_
Definition: EwkElecDQM.h:164
MonitorElement * mt_after_
Definition: EwkElecDQM.h:170
MonitorElement * jet_et_before_
Definition: EwkElecDQM.h:186
MonitorElement * njets_after_
Definition: EwkElecDQM.h:185
MonitorElement * pt_before_
Definition: EwkElecDQM.h:106
MonitorElement * pt_after_
Definition: EwkElecDQM.h:107
unsigned int PUBinCount_
Definition: EwkElecDQM.h:90
MonitorElement * hcalisoendcap_after_
Definition: EwkElecDQM.h:146
edm::InputTag metTag_
Definition: EwkElecDQM.h:42
MonitorElement * invmass_before_
Definition: EwkElecDQM.h:157
MonitorElement * ecalisoendcap_before_
Definition: EwkElecDQM.h:139
unsigned int PUMax_
Definition: EwkElecDQM.h:90
MonitorElement * jet_eta_after_
Definition: EwkElecDQM.h:189
MonitorElement * jet_eta_before_
Definition: EwkElecDQM.h:188
MonitorElement * detainendcap_after_
Definition: EwkElecDQM.h:122
MonitorElement * njets_before_
Definition: EwkElecDQM.h:184
MonitorElement * invmassPU_afterZ_
Definition: EwkElecDQM.h:160
MonitorElement * trkisobarrel_before_
Definition: EwkElecDQM.h:148
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
MonitorElement * met_before_
Definition: EwkElecDQM.h:172
MonitorElement * trkisoendcap_before_
Definition: EwkElecDQM.h:151
MonitorElement * met_after_
Definition: EwkElecDQM.h:173
double eJetMin_
Definition: EwkElecDQM.h:86
MonitorElement * trkisobarrel_after_
Definition: EwkElecDQM.h:149
MonitorElement * eta_after_
Definition: EwkElecDQM.h:110
MonitorElement * npvs_before_
Definition: EwkElecDQM.h:162
MonitorElement * trkisoendcap_after_
Definition: EwkElecDQM.h:152
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * eta_before_
Definition: EwkElecDQM.h:109
MonitorElement * invmassPU_before_
Definition: EwkElecDQM.h:159

◆ calcDeltaPhi()

double EwkElecDQM::calcDeltaPhi ( double  phi1,
double  phi2 
)
protected

Definition at line 994 of file EwkElecDQM.cc.

References srCondWrite_cfg::deltaPhi.

Referenced by analyze().

994  {
995  double deltaPhi = phi1 - phi2;
996 
997  if (deltaPhi < 0)
998  deltaPhi = -deltaPhi;
999 
1000  if (deltaPhi > 3.1415926) {
1001  deltaPhi = 2 * 3.1415926 - deltaPhi;
1002  }
1003 
1004  return deltaPhi;
1005 }

◆ dqmBeginRun()

void EwkElecDQM::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSet 
)
overrideprotectedvirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 109 of file EwkElecDQM.cc.

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

109  {
110  nall = 0;
111  nsel = 0;
112 
113  nrec = 0;
114  neid = 0;
115  niso = 0;
116  // nhlt = 0;
117  // nmet = 0;
118 
119  // passed as parameter to HLTConfigProvider::init(), not yet used
120  bool isConfigChanged = false;
121  // isValidHltConfig_ could be used to short-circuit analyze() in case of
122  // problems
123  isValidHltConfig_ = hltPrescaleProvider_.init(iRun, iSet, "HLT", isConfigChanged);
124 
125  LogTrace("") << "isValidHltConfig_=" << isValidHltConfig_ << "\n";
126 }
unsigned int nall
Definition: EwkElecDQM.h:95
unsigned int nsel
Definition: EwkElecDQM.h:101
#define LogTrace(id)
unsigned int niso
Definition: EwkElecDQM.h:98
unsigned int nrec
Definition: EwkElecDQM.h:96
unsigned int neid
Definition: EwkElecDQM.h:97
bool isValidHltConfig_
Definition: EwkElecDQM.h:92
HLTPrescaleProvider hltPrescaleProvider_
Definition: EwkElecDQM.h:93
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)

◆ dqmEndRun()

void EwkElecDQM::dqmEndRun ( const edm::Run r,
const edm::EventSetup  
)
overrideprotectedvirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 237 of file EwkElecDQM.cc.

References python.cmstools::all(), submitPVResolutionJobs::err, nall, neid, niso, nrec, nsel, EgammaValidation_cff::num, and mathSSE::sqrt().

237  {
238  // overall
239  double all = nall;
240  double esel = nsel / all;
241  LogVerbatim("") << "\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
242  LogVerbatim("") << "Total number of events analyzed: " << nall << " [events]";
243  LogVerbatim("") << "Total number of events selected: " << nsel << " [events]";
244  LogVerbatim("") << "Overall efficiency: "
245  << "(" << setprecision(4) << esel * 100. << " +/- " << setprecision(2)
246  << sqrt(esel * (1 - esel) / all) * 100. << ")%";
247 
248  double erec = nrec / all;
249  double eeid = neid / all;
250  double eiso = niso / all;
251  // double ehlt = nhlt/all;
252  // double emet = nmet/all;
253 
254  // general reconstruction step??
255  double num = nrec;
256  double eff = erec;
257  double err = sqrt(eff * (1 - eff) / all);
258  LogVerbatim("") << "Passing Pt/Eta/Quality cuts: " << num << " [events], (" << setprecision(4) << eff * 100.
259  << " +/- " << setprecision(2) << err * 100. << ")%";
260 
261  // electron ID step
262  num = neid;
263  eff = eeid;
264  err = sqrt(eff * (1 - eff) / all);
265  double effstep = 0.;
266  double errstep = 0.;
267  if (nrec > 0)
268  effstep = eeid / erec;
269  if (nrec > 0)
270  errstep = sqrt(effstep * (1 - effstep) / nrec);
271  LogVerbatim("") << "Passing eID cuts: " << num << " [events], (" << setprecision(4) << eff * 100. << " +/- "
272  << setprecision(2) << err * 100. << ")%, to previous step: (" << setprecision(4) << effstep * 100.
273  << " +/- " << setprecision(2) << errstep * 100. << ")%";
274 
275  // isolation step
276  num = niso;
277  eff = eiso;
278  err = sqrt(eff * (1 - eff) / all);
279  effstep = 0.;
280  errstep = 0.;
281  if (neid > 0)
282  effstep = eiso / eeid;
283  if (neid > 0)
284  errstep = sqrt(effstep * (1 - effstep) / neid);
285  LogVerbatim("") << "Passing isolation cuts: " << num << " [events], (" << setprecision(4) << eff * 100.
286  << " +/- " << setprecision(2) << err * 100. << ")%, to previous step: (" << setprecision(4)
287  << effstep * 100. << " +/- " << setprecision(2) << errstep * 100. << ")%";
288 
289  // // trigger step
290  // num = nhlt;
291  // eff = ehlt;
292  // err = sqrt(eff*(1-eff)/all);
293  // effstep = 0.;
294  // errstep = 0.;
295  // if (niso>0) effstep = ehlt/eiso;
296  // if (niso>0) errstep = sqrt(effstep*(1-effstep)/niso);
297  // LogVerbatim("") << "Passing HLT criteria: " << num << "
298  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
299  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
300  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
301 
302  // trigger step
303  num = nsel;
304  eff = esel;
305  err = sqrt(eff * (1 - eff) / all);
306  effstep = 0.;
307  errstep = 0.;
308  if (niso > 0)
309  effstep = esel / eiso;
310  if (niso > 0)
311  errstep = sqrt(effstep * (1 - effstep) / niso);
312  LogVerbatim("") << "Passing HLT criteria: " << num << " [events], (" << setprecision(4) << eff * 100.
313  << " +/- " << setprecision(2) << err * 100. << ")%, to previous step: (" << setprecision(4)
314  << effstep * 100. << " +/- " << setprecision(2) << errstep * 100. << ")%";
315 
316  // // met/acoplanarity cuts
317  // num = nmet;
318  // eff = emet;
319  // err = sqrt(eff*(1-eff)/all);
320  // effstep = 0.;
321  // errstep = 0.;
322  // if (nhlt>0) effstep = emet/ehlt;
323  // if (nhlt>0) errstep = sqrt(effstep*(1-effstep)/nhlt);
324  // LogVerbatim("") << "Passing MET/acoplanarity cuts: " << num << "
325  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
326  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
327  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
328 
329  // // Z/top selection cuts ALSO LAST STEP so "sel" for "selection"
330  // num = nsel;
331  // eff = esel;
332  // err = sqrt(eff*(1-eff)/all);
333  // effstep = 0.;
334  // errstep = 0.;
335  // if (nmet>0) effstep = esel/emet;
336  // if (nmet>0) errstep = sqrt(effstep*(1-effstep)/nmet);
337  // LogVerbatim("") << "Passing Z/top rejection cuts: " << num << "
338  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
339  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
340  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
341 
342  LogVerbatim("") << ">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
343 }
Log< level::Info, true > LogVerbatim
unsigned int nall
Definition: EwkElecDQM.h:95
unsigned int nsel
Definition: EwkElecDQM.h:101
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
unsigned int niso
Definition: EwkElecDQM.h:98
T sqrt(T t)
Definition: SSEVec.h:23
unsigned int nrec
Definition: EwkElecDQM.h:96
unsigned int neid
Definition: EwkElecDQM.h:97

Member Data Documentation

◆ beamSpotTag_

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

Definition at line 49 of file EwkElecDQM.h.

Referenced by analyze().

◆ detainbarrel_after_

MonitorElement* EwkElecDQM::detainbarrel_after_
private

Definition at line 119 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ detainbarrel_before_

MonitorElement* EwkElecDQM::detainbarrel_before_
private

Definition at line 118 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ detainCutBarrel_

double EwkElecDQM::detainCutBarrel_
private

Definition at line 59 of file EwkElecDQM.h.

Referenced by analyze().

◆ detainCutEndcap_

double EwkElecDQM::detainCutEndcap_
private

Definition at line 60 of file EwkElecDQM.h.

Referenced by analyze().

◆ detainendcap_after_

MonitorElement* EwkElecDQM::detainendcap_after_
private

Definition at line 122 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ detainendcap_before_

MonitorElement* EwkElecDQM::detainendcap_before_
private

Definition at line 121 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ ecalisobarrel_after_

MonitorElement* EwkElecDQM::ecalisobarrel_after_
private

Definition at line 137 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ ecalisobarrel_before_

MonitorElement* EwkElecDQM::ecalisobarrel_before_
private

Definition at line 136 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ ecalIsoCutBarrel_

double EwkElecDQM::ecalIsoCutBarrel_
private

Definition at line 66 of file EwkElecDQM.h.

Referenced by analyze().

◆ ecalIsoCutEndcap_

double EwkElecDQM::ecalIsoCutEndcap_
private

Definition at line 67 of file EwkElecDQM.h.

Referenced by analyze().

◆ ecalisoendcap_after_

MonitorElement* EwkElecDQM::ecalisoendcap_after_
private

Definition at line 140 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ ecalisoendcap_before_

MonitorElement* EwkElecDQM::ecalisoendcap_before_
private

Definition at line 139 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ eJetMin_

double EwkElecDQM::eJetMin_
private

Definition at line 86 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ elecTag_

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

Definition at line 45 of file EwkElecDQM.h.

Referenced by analyze().

◆ elecTrig_

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

Definition at line 53 of file EwkElecDQM.h.

◆ eta_after_

MonitorElement* EwkElecDQM::eta_after_
private

Definition at line 110 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ eta_before_

MonitorElement* EwkElecDQM::eta_before_
private

Definition at line 109 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ etaCut_

double EwkElecDQM::etaCut_
private

Definition at line 55 of file EwkElecDQM.h.

Referenced by analyze().

◆ hcalisobarrel_after_

MonitorElement* EwkElecDQM::hcalisobarrel_after_
private

Definition at line 143 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ hcalisobarrel_before_

MonitorElement* EwkElecDQM::hcalisobarrel_before_
private

Definition at line 142 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ hcalIsoCutBarrel_

double EwkElecDQM::hcalIsoCutBarrel_
private

Definition at line 68 of file EwkElecDQM.h.

Referenced by analyze().

◆ hcalIsoCutEndcap_

double EwkElecDQM::hcalIsoCutEndcap_
private

Definition at line 69 of file EwkElecDQM.h.

Referenced by analyze().

◆ hcalisoendcap_after_

MonitorElement* EwkElecDQM::hcalisoendcap_after_
private

Definition at line 146 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ hcalisoendcap_before_

MonitorElement* EwkElecDQM::hcalisoendcap_before_
private

Definition at line 145 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ hltPrescaleProvider_

HLTPrescaleProvider EwkElecDQM::hltPrescaleProvider_
private

Definition at line 93 of file EwkElecDQM.h.

Referenced by analyze(), and dqmBeginRun().

◆ invmass_after_

MonitorElement* EwkElecDQM::invmass_after_
private

Definition at line 158 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ invmass_before_

MonitorElement* EwkElecDQM::invmass_before_
private

Definition at line 157 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ invmassPU_afterZ_

MonitorElement* EwkElecDQM::invmassPU_afterZ_
private

Definition at line 160 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ invmassPU_before_

MonitorElement* EwkElecDQM::invmassPU_before_
private

Definition at line 159 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ isValidHltConfig_

bool EwkElecDQM::isValidHltConfig_
private

Definition at line 92 of file EwkElecDQM.h.

Referenced by dqmBeginRun(), and EwkElecDQM().

◆ jet_et_after_

MonitorElement* EwkElecDQM::jet_et_after_
private

Definition at line 187 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ jet_et_before_

MonitorElement* EwkElecDQM::jet_et_before_
private

Definition at line 186 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ jet_eta_after_

MonitorElement* EwkElecDQM::jet_eta_after_
private

Definition at line 189 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ jet_eta_before_

MonitorElement* EwkElecDQM::jet_eta_before_
private

Definition at line 188 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ jetTag_

edm::InputTag EwkElecDQM::jetTag_
private

Definition at line 43 of file EwkElecDQM.h.

Referenced by bookHistograms().

◆ jetToken_

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

Definition at line 47 of file EwkElecDQM.h.

Referenced by analyze().

◆ met_after_

MonitorElement* EwkElecDQM::met_after_
private

Definition at line 173 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ met_before_

MonitorElement* EwkElecDQM::met_before_
private

Definition at line 172 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ metIncludesMuons_

bool EwkElecDQM::metIncludesMuons_
private

Definition at line 50 of file EwkElecDQM.h.

◆ metMax_

double EwkElecDQM::metMax_
private

Definition at line 75 of file EwkElecDQM.h.

Referenced by analyze().

◆ metMin_

double EwkElecDQM::metMin_
private

Definition at line 74 of file EwkElecDQM.h.

Referenced by analyze().

◆ metTag_

edm::InputTag EwkElecDQM::metTag_
private

Definition at line 42 of file EwkElecDQM.h.

Referenced by bookHistograms().

◆ metToken_

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

Definition at line 46 of file EwkElecDQM.h.

Referenced by analyze().

◆ mt_after_

MonitorElement* EwkElecDQM::mt_after_
private

Definition at line 170 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ mt_before_

MonitorElement* EwkElecDQM::mt_before_
private

Definition at line 169 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ mtMax_

double EwkElecDQM::mtMax_
private

Definition at line 73 of file EwkElecDQM.h.

Referenced by analyze().

◆ mtMin_

double EwkElecDQM::mtMin_
private

Definition at line 72 of file EwkElecDQM.h.

Referenced by analyze().

◆ nall

unsigned int EwkElecDQM::nall
private

Definition at line 95 of file EwkElecDQM.h.

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

◆ neid

unsigned int EwkElecDQM::neid
private

Definition at line 97 of file EwkElecDQM.h.

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

◆ nelectrons_after_

MonitorElement* EwkElecDQM::nelectrons_after_
private

Definition at line 167 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ nelectrons_before_

MonitorElement* EwkElecDQM::nelectrons_before_
private

Definition at line 166 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ nGoodElectrons

unsigned int EwkElecDQM::nGoodElectrons
private

Definition at line 104 of file EwkElecDQM.h.

Referenced by analyze().

◆ niso

unsigned int EwkElecDQM::niso
private

Definition at line 98 of file EwkElecDQM.h.

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

◆ nJetMax_

int EwkElecDQM::nJetMax_
private

Definition at line 87 of file EwkElecDQM.h.

Referenced by analyze().

◆ njets_after_

MonitorElement* EwkElecDQM::njets_after_
private

Definition at line 185 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ njets_before_

MonitorElement* EwkElecDQM::njets_before_
private

Definition at line 184 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ npvs_afterZ_

MonitorElement* EwkElecDQM::npvs_afterZ_
private

Definition at line 164 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ npvs_before_

MonitorElement* EwkElecDQM::npvs_before_
private

Definition at line 162 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ nrec

unsigned int EwkElecDQM::nrec
private

Definition at line 96 of file EwkElecDQM.h.

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

◆ nsel

unsigned int EwkElecDQM::nsel
private

Definition at line 101 of file EwkElecDQM.h.

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

◆ pt_after_

MonitorElement* EwkElecDQM::pt_after_
private

Definition at line 107 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ pt_before_

MonitorElement* EwkElecDQM::pt_before_
private

Definition at line 106 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ ptCut_

double EwkElecDQM::ptCut_
private

◆ PUBinCount_

unsigned int EwkElecDQM::PUBinCount_
private

Definition at line 90 of file EwkElecDQM.h.

Referenced by bookHistograms().

◆ PUMax_

unsigned int EwkElecDQM::PUMax_
private

Definition at line 90 of file EwkElecDQM.h.

Referenced by bookHistograms().

◆ sieiebarrel_after_

MonitorElement* EwkElecDQM::sieiebarrel_after_
private

Definition at line 113 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ sieiebarrel_before_

MonitorElement* EwkElecDQM::sieiebarrel_before_
private

Definition at line 112 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ sieieCutBarrel_

double EwkElecDQM::sieieCutBarrel_
private

Definition at line 57 of file EwkElecDQM.h.

Referenced by analyze().

◆ sieieCutEndcap_

double EwkElecDQM::sieieCutEndcap_
private

Definition at line 58 of file EwkElecDQM.h.

Referenced by analyze().

◆ sieieendcap_after_

MonitorElement* EwkElecDQM::sieieendcap_after_
private

Definition at line 116 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ sieieendcap_before_

MonitorElement* EwkElecDQM::sieieendcap_before_
private

Definition at line 115 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ trig_after_

MonitorElement* EwkElecDQM::trig_after_
private

Definition at line 155 of file EwkElecDQM.h.

◆ trig_before_

MonitorElement* EwkElecDQM::trig_before_
private

Definition at line 154 of file EwkElecDQM.h.

◆ trigTag_

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

Definition at line 44 of file EwkElecDQM.h.

◆ trkisobarrel_after_

MonitorElement* EwkElecDQM::trkisobarrel_after_
private

Definition at line 149 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ trkisobarrel_before_

MonitorElement* EwkElecDQM::trkisobarrel_before_
private

Definition at line 148 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ trkIsoCutBarrel_

double EwkElecDQM::trkIsoCutBarrel_
private

Definition at line 70 of file EwkElecDQM.h.

Referenced by analyze().

◆ trkIsoCutEndcap_

double EwkElecDQM::trkIsoCutEndcap_
private

Definition at line 71 of file EwkElecDQM.h.

Referenced by analyze().

◆ trkisoendcap_after_

MonitorElement* EwkElecDQM::trkisoendcap_after_
private

Definition at line 152 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ trkisoendcap_before_

MonitorElement* EwkElecDQM::trkisoendcap_before_
private

Definition at line 151 of file EwkElecDQM.h.

Referenced by analyze(), and bookHistograms().

◆ vertexTag_

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

Definition at line 48 of file EwkElecDQM.h.

Referenced by analyze().