CMS 3D CMS Logo

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

#include <ZCountingElectrons.h>

Inheritance diagram for ZCountingElectrons:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 ZCountingElectrons (const edm::ParameterSet &ps)
 
 ~ZCountingElectrons () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

bool ele_probe_selection (double pt, double abseta)
 
bool ele_tag_selection (double pt, double abseta)
 

Private Attributes

const double DRMAX = 0.1
 
const float ELE_ETA_CRACK_HIGH = 1.56
 
const float ELE_ETA_CRACK_LOW = 1.4442
 
const std::string ELE_ID_WP
 
const float ELECTRON_MASS = 0.000511
 
ElectronIdentifier EleID_
 
double EtaCutL1_
 
double EtaCutL2_
 
edm::EDGetTokenT< reco::BeamSpotfBeamspotToken
 
edm::EDGetTokenT< reco::ConversionCollectionfConversionToken
 
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
 
edm::EDGetTokenT< reco::VertexCollectionfPVName_token
 
edm::EDGetTokenT< double > fRhoToken
 
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
 
MonitorElementh_ee_mass_HLT_fail_central
 
MonitorElementh_ee_mass_HLT_fail_forward
 
MonitorElementh_ee_mass_HLT_pass_central
 
MonitorElementh_ee_mass_HLT_pass_forward
 
MonitorElementh_ee_mass_id_fail_central
 
MonitorElementh_ee_mass_id_fail_forward
 
MonitorElementh_ee_mass_id_pass_central
 
MonitorElementh_ee_mass_id_pass_forward
 
MonitorElementh_ee_yield_Z_ebeb
 
MonitorElementh_ee_yield_Z_ebee
 
MonitorElementh_ee_yield_Z_eeee
 
MonitorElementh_npv
 
HLTConfigProvider hltConfigProvider_
 
int LumiBin_
 
double LumiMax_
 
double LumiMin_
 
int MassBin_
 
double MassMax_
 
double MassMin_
 
double PtCutL1_
 
double PtCutL2_
 
int PVBin_
 
double PVMax_
 
double PVMin_
 
const edm::InputTag triggerResultsInputTag_
 
TriggerToolstriggers
 
double VtxAbsZCut_
 
double VtxNdofCut_
 
double VtxNTracksFitCut_
 
double VtxRhoCut_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 24 of file ZCountingElectrons.h.

Constructor & Destructor Documentation

◆ ZCountingElectrons()

ZCountingElectrons::ZCountingElectrons ( const edm::ParameterSet ps)

Definition at line 18 of file ZCountingElectrons.cc.

References TriggerTools::addTriggerRecord(), DRMAX, ELE_ID_WP, EleID_, edm::ParameterSet::getParameter(), TriggerTools::setDRMAX(), ElectronIdentifier::setID(), TriggerTools::setTriggerEventToken(), TriggerTools::setTriggerResultsToken(), AlCaHLTBitMon_QueryRunRegistry::string, triggerResultsInputTag_, and triggers.

19  : triggerResultsInputTag_(iConfig.getParameter<edm::InputTag>("TriggerResults")),
20  fPVName_token(consumes<reco::VertexCollection>(
21  iConfig.getUntrackedParameter<std::string>("edmPVName", "offlinePrimaryVertices"))),
22 
23  // Electron-specific Parameters
25  iConfig.getUntrackedParameter<std::string>("edmGsfEleName", "gedGsfElectrons"))),
27  iConfig.getUntrackedParameter<std::string>("edmSCName", "particleFlowEGamma"))),
28 
29  // Electron-specific Tags
30  fRhoToken(consumes<double>(iConfig.getParameter<edm::InputTag>("rhoname"))),
31  fBeamspotToken(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamspotName"))),
32  fConversionToken(consumes<reco::ConversionCollection>(iConfig.getParameter<edm::InputTag>("conversionsName"))),
33 
34  // Electron-specific Cuts
35  PtCutL1_(iConfig.getUntrackedParameter<double>("PtCutL1")),
36  PtCutL2_(iConfig.getUntrackedParameter<double>("PtCutL2")),
37  EtaCutL1_(iConfig.getUntrackedParameter<double>("EtaCutL1")),
38  EtaCutL2_(iConfig.getUntrackedParameter<double>("EtaCutL2")),
39 
40  MassBin_(iConfig.getUntrackedParameter<double>("MassBin")),
41  MassMin_(iConfig.getUntrackedParameter<double>("MassMin")),
42  MassMax_(iConfig.getUntrackedParameter<double>("MassMax")),
43 
44  LumiBin_(iConfig.getUntrackedParameter<double>("LumiBin")),
45  LumiMin_(iConfig.getUntrackedParameter<double>("LumiMin")),
46  LumiMax_(iConfig.getUntrackedParameter<double>("LumiMax")),
47 
48  PVBin_(iConfig.getUntrackedParameter<int>("PVBin")),
49  PVMin_(iConfig.getUntrackedParameter<double>("PVMin")),
50  PVMax_(iConfig.getUntrackedParameter<double>("PVMax")),
51 
52  VtxNTracksFitCut_(iConfig.getUntrackedParameter<double>("VtxNTracksFitMin")),
53  VtxNdofCut_(iConfig.getUntrackedParameter<double>("VtxNdofMin")),
54  VtxAbsZCut_(iConfig.getUntrackedParameter<double>("VtxAbsZMax")),
55  VtxRhoCut_(iConfig.getUntrackedParameter<double>("VtxRhoMax")),
56 
57  ELE_ID_WP(iConfig.getUntrackedParameter<std::string>("ElectronIDType", "TIGHT")),
58  EleID_(ElectronIdentifier(iConfig)) {
59  edm::LogInfo("ZCounting") << "Constructor ZCountingElectrons::ZCounting " << std::endl;
60 
61  // Trigger settings
62  triggers = new TriggerTools();
63  triggers->setTriggerResultsToken(consumes<edm::TriggerResults>(triggerResultsInputTag_));
64  triggers->setTriggerEventToken(consumes<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("TriggerEvent")));
66 
67  edm::LogVerbatim("ZCounting") << "ZCounting::ZCounting set trigger names";
68  const std::vector<std::string> patterns_ = iConfig.getParameter<std::vector<std::string>>("ElectronTriggerNames");
69  for (const std::string& pattern_ : patterns_) {
70  triggers->addTriggerRecord(pattern_);
71  }
72 
74 }
Log< level::Info, true > LogVerbatim
void setDRMAX(const double _drMax)
Definition: TriggerTools.h:28
const edm::InputTag triggerResultsInputTag_
const std::string ELE_ID_WP
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
void setTriggerEventToken(edm::EDGetTokenT< trigger::TriggerEvent > token)
Definition: TriggerTools.h:27
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
edm::EDGetTokenT< double > fRhoToken
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
void setTriggerResultsToken(edm::EDGetTokenT< edm::TriggerResults > token)
Definition: TriggerTools.h:26
Log< level::Info, false > LogInfo
TriggerTools * triggers
void addTriggerRecord(const std::string &name)
Definition: TriggerTools.h:30
void setID(std::string ID)
ElectronIdentifier EleID_
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token

◆ ~ZCountingElectrons()

ZCountingElectrons::~ZCountingElectrons ( )
override

Definition at line 79 of file ZCountingElectrons.cc.

79  {
80  edm::LogInfo("ZCountingElectrons") << "Destructor ZCountingElectrons::~ZCountingElectrons " << std::endl;
81 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

void ZCountingElectrons::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Fill for ID efficiency

Fill for HLT efficiency

Reimplemented from DQMEDAnalyzer.

Definition at line 199 of file ZCountingElectrons.cc.

References reco::LeafCandidate::charge(), ELE_ETA_CRACK_LOW, ele_probe_selection(), ele_tag_selection(), ELECTRON_MASS, pwdgSkimBPark_cfi::electrons, EleID_, reco::LeafCandidate::eta(), HLT_2022v14_cff::eta1, fBeamspotToken, fConversionToken, fGsfElectronName_token, dqm::impl::MonitorElement::Fill(), fPVName_token, fRhoToken, fSCName_token, h_ee_mass_HLT_fail_central, h_ee_mass_HLT_fail_forward, h_ee_mass_HLT_pass_central, h_ee_mass_HLT_pass_forward, h_ee_mass_id_fail_central, h_ee_mass_id_fail_forward, h_ee_mass_id_pass_central, h_ee_mass_id_pass_forward, h_ee_yield_Z_ebeb, h_ee_yield_Z_ebee, h_ee_yield_Z_eeee, h_npv, iEvent, edm::Ptr< T >::isNonnull(), edm::HandleBase::isValid(), eostools::ls(), MassMax_, MassMin_, or, TriggerTools::pass(), ElectronIdentifier::passID(), TriggerTools::passObj(), reco::LeafCandidate::phi(), funct::pow(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), HLT_2022v14_cff::pt1, TriggerTools::readEvent(), ElectronIdentifier::setRho(), mathSSE::sqrt(), nnet::tanh(), triggers, VtxAbsZCut_, VtxNdofCut_, VtxNTracksFitCut_, and VtxRhoCut_.

200  { // Fill event tree on the fly
201  edm::LogInfo("ZCountingElectrons") << "ZCountingElectrons::analyze" << std::endl;
202 
203  //-------------------------------
204  //--- Vertex
205  //-------------------------------
207  iEvent.getByToken(fPVName_token, hVertexProduct);
208  if (!hVertexProduct.isValid()) {
209  edm::LogWarning("ZCounting") << "ZCountingElectrons::analyze - no valid primary vertex product found" << std::endl;
210  return;
211  }
212  // const reco::VertexCollection* pvCol = hVertexProduct.product();
213  // const reco::Vertex* pv = &(*pvCol->begin());
214  int nvtx = 0;
215 
216  for (auto const& itVtx : *hVertexProduct) {
217  if (itVtx.isFake())
218  continue;
219  if (itVtx.tracksSize() < VtxNTracksFitCut_)
220  continue;
221  if (itVtx.ndof() < VtxNdofCut_)
222  continue;
223  if (fabs(itVtx.z()) > VtxAbsZCut_)
224  continue;
225  if (itVtx.position().Rho() > VtxRhoCut_)
226  continue;
227 
228  // if (nvtx == 0) {
229  // pv = &itVtx;
230  // }
231  nvtx++;
232  }
233 
234  h_npv->Fill(iEvent.luminosityBlock(), nvtx);
235 
236  //-------------------------------
237  //--- Trigger
238  //-------------------------------
240 
241  // Trigger requirement
242  if (!triggers->pass())
243  return;
244 
245  // Get Electrons
248 
249  // Get SuperClusters
251  iEvent.getByToken(fSCName_token, superclusters);
252 
253  // Get Rho
254  edm::Handle<double> rhoHandle;
255  iEvent.getByToken(fRhoToken, rhoHandle);
256  EleID_.setRho(*rhoHandle);
257 
258  // Get beamspot
259  edm::Handle<reco::BeamSpot> beamspotHandle;
260  iEvent.getByToken(fBeamspotToken, beamspotHandle);
261 
262  // Conversions
263  edm::Handle<reco::ConversionCollection> conversionsHandle;
264  iEvent.getByToken(fConversionToken, conversionsHandle);
265 
267  enum { eEleEle2HLT = 1, eEleEle1HLT1L1, eEleEle1HLT, eEleEleNoSel, eEleSC }; // event category enum
268 
269  // Loop over Tags
270  for (size_t itag = 0; itag < electrons->size(); ++itag) {
271  const auto el1 = electrons->ptrAt(itag);
272  if (not EleID_.passID(el1, beamspotHandle, conversionsHandle))
273  continue;
274 
275  float pt1 = el1->pt();
276  float eta1 = el1->eta();
277  float phi1 = el1->phi();
278 
279  if (!triggers->passObj(eta1, phi1))
280  continue;
281  TLorentzVector vTag(0., 0., 0., 0.);
282  vTag.SetPtEtaPhiM(pt1, eta1, phi1, ELECTRON_MASS);
283 
284  // Tag selection: kinematic cuts, lepton selection and trigger matching
285  double tag_pt = vTag.Pt();
286  double tag_abseta = fabs(vTag.Eta());
287 
288  bool tag_is_valid_tag = ele_tag_selection(tag_pt, tag_abseta);
289  bool tag_is_valid_probe = ele_probe_selection(tag_pt, tag_abseta);
290 
291  if (not(tag_is_valid_tag or tag_is_valid_probe))
292  continue;
293 
294  // Loop over probes
295  for (size_t iprobe = 0; iprobe < superclusters->size(); ++iprobe) {
296  // Initialize probe
297  const auto sc = superclusters->ptrAt(iprobe);
298  if (*sc == *(el1->superCluster())) {
299  continue;
300  }
301 
302  // Find matching electron
303  for (size_t iele = 0; iele < electrons->size(); ++iele) {
304  if (iele == itag)
305  continue;
306  const auto ele = electrons->ptrAt(iele);
307  if (*sc == *(ele->superCluster())) {
308  eleProbe = ele;
309  break;
310  }
311  }
312 
313  // Assign final probe 4-vector
314  TLorentzVector vProbe(0., 0., 0., 0.);
315  if (eleProbe.isNonnull()) {
316  vProbe.SetPtEtaPhiM(eleProbe->pt(), eleProbe->eta(), eleProbe->phi(), ELECTRON_MASS);
317  } else {
318  double pt = sc->energy() * sqrt(1 - pow(tanh(sc->eta()), 2));
319  vProbe.SetPtEtaPhiM(pt, sc->eta(), sc->phi(), ELECTRON_MASS);
320  }
321 
322  // Probe Selection
323  double probe_pt = vProbe.Pt();
324  double probe_abseta = fabs(sc->eta());
325  bool probe_is_valid_probe = ele_probe_selection(probe_pt, probe_abseta);
326  if (!probe_is_valid_probe)
327  continue;
328 
329  // Good Probe found!
330 
331  // Require good Z
332  TLorentzVector vDilep = vTag + vProbe;
333 
334  if ((vDilep.M() < MassMin_) || (vDilep.M() > MassMax_))
335  continue;
336  if (eleProbe.isNonnull() and (eleProbe->charge() != -el1->charge()))
337  continue;
338 
339  // Good Z found!
340  long ls = iEvent.luminosityBlock();
341  bool probe_pass_trigger = triggers->passObj(vProbe.Eta(), vProbe.Phi());
342  bool probe_pass_id = eleProbe.isNonnull() and EleID_.passID(eleProbe, beamspotHandle, conversionsHandle);
343 
345  bool probe_is_forward = probe_abseta > ELE_ETA_CRACK_LOW;
346  bool tag_is_forward = tag_abseta > ELE_ETA_CRACK_LOW;
347 
348  if (probe_pass_id) {
349  if (probe_is_forward and tag_is_forward) {
351  } else if (!probe_is_forward and !tag_is_forward) {
353  } else {
355  }
356  }
357 
358  if (!tag_is_valid_tag)
359  continue;
360 
362  if (probe_pass_id) {
363  if (probe_is_forward) {
364  h_ee_mass_id_pass_forward->Fill(ls, vDilep.M());
365  } else {
366  h_ee_mass_id_pass_central->Fill(ls, vDilep.M());
367  }
368  } else {
369  if (probe_is_forward) {
370  h_ee_mass_id_fail_forward->Fill(ls, vDilep.M());
371  } else {
372  h_ee_mass_id_fail_central->Fill(ls, vDilep.M());
373  }
374  }
375 
377  if (probe_pass_id and probe_pass_trigger) {
378  if (probe_is_forward) {
379  h_ee_mass_HLT_pass_forward->Fill(ls, vDilep.M());
380  } else {
381  h_ee_mass_HLT_pass_central->Fill(ls, vDilep.M());
382  }
383  } else if (probe_pass_id) {
384  if (probe_is_forward) {
385  h_ee_mass_HLT_fail_forward->Fill(ls, vDilep.M());
386  } else {
387  h_ee_mass_HLT_fail_central->Fill(ls, vDilep.M());
388  }
389  }
390  } // End of probe loop
391  } //End of tag loop
392 }
MonitorElement * h_ee_yield_Z_ebeb
MonitorElement * h_ee_mass_id_pass_forward
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
MonitorElement * h_ee_mass_HLT_pass_forward
double pt() const final
transverse momentum
MonitorElement * h_ee_yield_Z_ebee
const float ELE_ETA_CRACK_LOW
MonitorElement * h_ee_yield_Z_eeee
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
bool ele_probe_selection(double pt, double abseta)
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
void Fill(long long x)
edm::EDGetTokenT< double > fRhoToken
MonitorElement * h_ee_mass_HLT_fail_central
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
bool ele_tag_selection(double pt, double abseta)
T sqrt(T t)
Definition: SSEVec.h:19
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
bool passID(const reco::GsfElectronPtr &ele, edm::Handle< reco::BeamSpot > beamspot, edm::Handle< reco::ConversionCollection > conversions)
bool pass() const
MonitorElement * h_ee_mass_HLT_fail_forward
MonitorElement * h_ee_mass_HLT_pass_central
bool passObj(const double eta, const double phi) const
MonitorElement * h_ee_mass_id_pass_central
MonitorElement * h_ee_mass_id_fail_central
Log< level::Info, false > LogInfo
TriggerTools * triggers
def ls(path, rec=False)
Definition: eostools.py:349
void setRho(double rho)
MonitorElement * h_npv
bool isValid() const
Definition: HandleBase.h:70
void readEvent(const edm::Event &iEvent)
Definition: TriggerTools.cc:90
ElectronIdentifier EleID_
Log< level::Warning, false > LogWarning
double phi() const final
momentum azimuthal angle
MonitorElement * h_ee_mass_id_fail_forward
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
int charge() const final
electric charge
double eta() const final
momentum pseudorapidity

◆ bookHistograms()

void ZCountingElectrons::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 112 of file ZCountingElectrons.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), h_ee_mass_HLT_fail_central, h_ee_mass_HLT_fail_forward, h_ee_mass_HLT_pass_central, h_ee_mass_HLT_pass_forward, h_ee_mass_id_fail_central, h_ee_mass_id_fail_forward, h_ee_mass_id_pass_central, h_ee_mass_id_pass_forward, h_ee_yield_Z_ebeb, h_ee_yield_Z_ebee, h_ee_yield_Z_eeee, h_npv, LumiBin_, LumiMax_, LumiMin_, MassBin_, MassMax_, MassMin_, PVBin_, PVMax_, PVMin_, dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

112  {
113  edm::LogInfo("ZCountingElectrons") << "ZCountingElectrons::bookHistograms" << std::endl;
114  ibooker_.cd();
115  ibooker_.setCurrentFolder("ZCounting/Histograms");
116 
117  h_npv = ibooker_.book2D(
118  "h_npv", "Events with valid primary vertex", LumiBin_, LumiMin_, LumiMax_, PVBin_, PVMin_, PVMax_);
119 
120  h_npv->setAxisTitle("luminosity section", 1);
121  h_npv->setAxisTitle("number of primary vertices", 2);
122 
123  // Electron histograms
124  h_ee_mass_id_pass_central = ibooker_.book2D("h_ee_mass_id_pass_central",
125  "h_ee_mass_id_pass_central",
126  LumiBin_,
127  LumiMin_,
128  LumiMax_,
129  MassBin_,
130  MassMin_,
131  MassMax_);
132  h_ee_mass_id_fail_central = ibooker_.book2D("h_ee_mass_id_fail_central",
133  "h_ee_mass_id_fail_central",
134  LumiBin_,
135  LumiMin_,
136  LumiMax_,
137  MassBin_,
138  MassMin_,
139  MassMax_);
140  h_ee_mass_id_pass_forward = ibooker_.book2D("h_ee_mass_id_pass_forward",
141  "h_ee_mass_id_pass_forward",
142  LumiBin_,
143  LumiMin_,
144  LumiMax_,
145  MassBin_,
146  MassMin_,
147  MassMax_);
148  h_ee_mass_id_fail_forward = ibooker_.book2D("h_ee_mass_id_fail_forward",
149  "h_ee_mass_id_fail_forward",
150  LumiBin_,
151  LumiMin_,
152  LumiMax_,
153  MassBin_,
154  MassMin_,
155  MassMax_);
156 
157  h_ee_mass_HLT_pass_central = ibooker_.book2D("h_ee_mass_HLT_pass_central",
158  "h_ee_mass_HLT_pass_central",
159  LumiBin_,
160  LumiMin_,
161  LumiMax_,
162  MassBin_,
163  MassMin_,
164  MassMax_);
165  h_ee_mass_HLT_fail_central = ibooker_.book2D("h_ee_mass_HLT_fail_central",
166  "h_ee_mass_HLT_fail_central",
167  LumiBin_,
168  LumiMin_,
169  LumiMax_,
170  MassBin_,
171  MassMin_,
172  MassMax_);
173  h_ee_mass_HLT_pass_forward = ibooker_.book2D("h_ee_mass_HLT_pass_forward",
174  "h_ee_mass_HLT_pass_forward",
175  LumiBin_,
176  LumiMin_,
177  LumiMax_,
178  MassBin_,
179  MassMin_,
180  MassMax_);
181  h_ee_mass_HLT_fail_forward = ibooker_.book2D("h_ee_mass_HLT_fail_forward",
182  "h_ee_mass_HLT_fail_forward",
183  LumiBin_,
184  LumiMin_,
185  LumiMax_,
186  MassBin_,
187  MassMin_,
188  MassMax_);
189 
190  h_ee_yield_Z_ebeb = ibooker_.book1D("h_ee_yield_Z_ebeb", "h_ee_yield_Z_ebeb", LumiBin_, LumiMin_, LumiMax_);
191  h_ee_yield_Z_ebee = ibooker_.book1D("h_ee_yield_Z_ebee", "h_ee_yield_Z_ebee", LumiBin_, LumiMin_, LumiMax_);
192  h_ee_yield_Z_eeee = ibooker_.book1D("h_ee_yield_Z_eeee", "h_ee_yield_Z_eeee", LumiBin_, LumiMin_, LumiMax_);
193 }
MonitorElement * h_ee_yield_Z_ebeb
MonitorElement * h_ee_mass_id_pass_forward
MonitorElement * h_ee_mass_HLT_pass_forward
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * h_ee_yield_Z_ebee
MonitorElement * h_ee_yield_Z_eeee
MonitorElement * h_ee_mass_HLT_fail_central
MonitorElement * h_ee_mass_HLT_fail_forward
MonitorElement * h_ee_mass_HLT_pass_central
MonitorElement * h_ee_mass_id_pass_central
MonitorElement * h_ee_mass_id_fail_central
Log< level::Info, false > LogInfo
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:212
MonitorElement * h_npv
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 * h_ee_mass_id_fail_forward
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ dqmBeginRun()

void ZCountingElectrons::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 86 of file ZCountingElectrons.cc.

References hltConfigProvider_, edm::RunBase::id(), HLTConfigProvider::init(), TriggerTools::initHLTObjects(), edm::InputTag::process(), HLTConfigProvider::processName(), HLTConfigProvider::size(), HLTConfigProvider::tableName(), triggerResultsInputTag_, and triggers.

86  {
87  edm::LogInfo("ZCountingElectrons") << "ZCountingElectrons::beginRun" << std::endl;
88 
89  // initialize triggers
90 
91  edm::LogVerbatim("ZCountingElectrons") << "ZCountingElectrons::dqmBeginRun now at " << iRun.id();
92 
93  bool hltChanged_ = true;
94  if (hltConfigProvider_.init(iRun, iSetup, triggerResultsInputTag_.process(), hltChanged_)) {
95  edm::LogVerbatim("ZCountingElectrons")
96  << "ZCountingElectrons::dqmBeginRun [TriggerObjMatchValueMapsProducer::beginRun] "
97  "HLTConfigProvider initialized [processName() = \""
98  << hltConfigProvider_.processName() << "\", tableName() = \"" << hltConfigProvider_.tableName()
99  << "\", size() = " << hltConfigProvider_.size() << "]";
100  } else {
101  edm::LogError("ZCountingElectrons")
102  << "ZCountingElectrons::dqmBeginRun Initialization of HLTConfigProvider failed for Run=" << iRun.id()
103  << " (process=\"" << triggerResultsInputTag_.process() << "\") -> plugin will not produce outputs for this Run";
104  return;
105  }
106 
108 }
Log< level::Info, true > LogVerbatim
const edm::InputTag triggerResultsInputTag_
void initHLTObjects(const HLTConfigProvider &hltConfigProvider_)
Definition: TriggerTools.cc:35
Log< level::Error, false > LogError
unsigned int size() const
number of trigger paths in trigger table
HLTConfigProvider hltConfigProvider_
Log< level::Info, false > LogInfo
TriggerTools * triggers
const std::string & processName() const
process name
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::string & tableName() const
HLT ConfDB table name.
std::string const & process() const
Definition: InputTag.h:40

◆ ele_probe_selection()

bool ZCountingElectrons::ele_probe_selection ( double  pt,
double  abseta 
)
private

Definition at line 398 of file ZCountingElectrons.cc.

References ELE_ETA_CRACK_HIGH, ELE_ETA_CRACK_LOW, EtaCutL2_, DiDispStaMuonMonitor_cfi::pt, and PtCutL2_.

Referenced by analyze().

398  {
399  if (pt < PtCutL2_)
400  return false;
401  if (abseta > EtaCutL2_)
402  return false;
403  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
404  return false;
405  return true;
406 }
const float ELE_ETA_CRACK_LOW
const float ELE_ETA_CRACK_HIGH

◆ ele_tag_selection()

bool ZCountingElectrons::ele_tag_selection ( double  pt,
double  abseta 
)
private

Definition at line 408 of file ZCountingElectrons.cc.

References ELE_ETA_CRACK_HIGH, ELE_ETA_CRACK_LOW, EtaCutL1_, DiDispStaMuonMonitor_cfi::pt, and PtCutL1_.

Referenced by analyze().

408  {
409  if (pt < PtCutL1_)
410  return false;
411  if (abseta > EtaCutL1_)
412  return false;
413  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
414  return false;
415  return true;
416 }
const float ELE_ETA_CRACK_LOW
const float ELE_ETA_CRACK_HIGH

Member Data Documentation

◆ DRMAX

const double ZCountingElectrons::DRMAX = 0.1
private

Definition at line 79 of file ZCountingElectrons.h.

Referenced by ZCountingElectrons().

◆ ELE_ETA_CRACK_HIGH

const float ZCountingElectrons::ELE_ETA_CRACK_HIGH = 1.56
private

Definition at line 82 of file ZCountingElectrons.h.

Referenced by ele_probe_selection(), and ele_tag_selection().

◆ ELE_ETA_CRACK_LOW

const float ZCountingElectrons::ELE_ETA_CRACK_LOW = 1.4442
private

Definition at line 81 of file ZCountingElectrons.h.

Referenced by analyze(), ele_probe_selection(), and ele_tag_selection().

◆ ELE_ID_WP

const std::string ZCountingElectrons::ELE_ID_WP
private

Definition at line 72 of file ZCountingElectrons.h.

Referenced by ZCountingElectrons().

◆ ELECTRON_MASS

const float ZCountingElectrons::ELECTRON_MASS = 0.000511
private

Definition at line 80 of file ZCountingElectrons.h.

Referenced by analyze().

◆ EleID_

ElectronIdentifier ZCountingElectrons::EleID_
private

Definition at line 85 of file ZCountingElectrons.h.

Referenced by analyze(), and ZCountingElectrons().

◆ EtaCutL1_

double ZCountingElectrons::EtaCutL1_
private

Definition at line 52 of file ZCountingElectrons.h.

Referenced by ele_tag_selection().

◆ EtaCutL2_

double ZCountingElectrons::EtaCutL2_
private

Definition at line 53 of file ZCountingElectrons.h.

Referenced by ele_probe_selection().

◆ fBeamspotToken

edm::EDGetTokenT<reco::BeamSpot> ZCountingElectrons::fBeamspotToken
private

Definition at line 47 of file ZCountingElectrons.h.

Referenced by analyze().

◆ fConversionToken

edm::EDGetTokenT<reco::ConversionCollection> ZCountingElectrons::fConversionToken
private

Definition at line 48 of file ZCountingElectrons.h.

Referenced by analyze().

◆ fGsfElectronName_token

edm::EDGetTokenT<edm::View<reco::GsfElectron> > ZCountingElectrons::fGsfElectronName_token
private

Definition at line 44 of file ZCountingElectrons.h.

Referenced by analyze().

◆ fPVName_token

edm::EDGetTokenT<reco::VertexCollection> ZCountingElectrons::fPVName_token
private

Definition at line 41 of file ZCountingElectrons.h.

Referenced by analyze().

◆ fRhoToken

edm::EDGetTokenT<double> ZCountingElectrons::fRhoToken
private

Definition at line 46 of file ZCountingElectrons.h.

Referenced by analyze().

◆ fSCName_token

edm::EDGetTokenT<edm::View<reco::SuperCluster> > ZCountingElectrons::fSCName_token
private

Definition at line 45 of file ZCountingElectrons.h.

Referenced by analyze().

◆ h_ee_mass_HLT_fail_central

MonitorElement* ZCountingElectrons::h_ee_mass_HLT_fail_central
private

Definition at line 97 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_HLT_fail_forward

MonitorElement* ZCountingElectrons::h_ee_mass_HLT_fail_forward
private

Definition at line 99 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_HLT_pass_central

MonitorElement* ZCountingElectrons::h_ee_mass_HLT_pass_central
private

Definition at line 96 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_HLT_pass_forward

MonitorElement* ZCountingElectrons::h_ee_mass_HLT_pass_forward
private

Definition at line 98 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_id_fail_central

MonitorElement* ZCountingElectrons::h_ee_mass_id_fail_central
private

Definition at line 92 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_id_fail_forward

MonitorElement* ZCountingElectrons::h_ee_mass_id_fail_forward
private

Definition at line 94 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_id_pass_central

MonitorElement* ZCountingElectrons::h_ee_mass_id_pass_central
private

Definition at line 91 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_mass_id_pass_forward

MonitorElement* ZCountingElectrons::h_ee_mass_id_pass_forward
private

Definition at line 93 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_yield_Z_ebeb

MonitorElement* ZCountingElectrons::h_ee_yield_Z_ebeb
private

Definition at line 101 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_yield_Z_ebee

MonitorElement* ZCountingElectrons::h_ee_yield_Z_ebee
private

Definition at line 102 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_ee_yield_Z_eeee

MonitorElement* ZCountingElectrons::h_ee_yield_Z_eeee
private

Definition at line 103 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ h_npv

MonitorElement* ZCountingElectrons::h_npv
private

Definition at line 88 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ hltConfigProvider_

HLTConfigProvider ZCountingElectrons::hltConfigProvider_
private

Definition at line 75 of file ZCountingElectrons.h.

Referenced by dqmBeginRun().

◆ LumiBin_

int ZCountingElectrons::LumiBin_
private

Definition at line 59 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ LumiMax_

double ZCountingElectrons::LumiMax_
private

Definition at line 61 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ LumiMin_

double ZCountingElectrons::LumiMin_
private

Definition at line 60 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ MassBin_

int ZCountingElectrons::MassBin_
private

Definition at line 55 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ MassMax_

double ZCountingElectrons::MassMax_
private

Definition at line 57 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ MassMin_

double ZCountingElectrons::MassMin_
private

Definition at line 56 of file ZCountingElectrons.h.

Referenced by analyze(), and bookHistograms().

◆ PtCutL1_

double ZCountingElectrons::PtCutL1_
private

Definition at line 50 of file ZCountingElectrons.h.

Referenced by ele_tag_selection().

◆ PtCutL2_

double ZCountingElectrons::PtCutL2_
private

Definition at line 51 of file ZCountingElectrons.h.

Referenced by ele_probe_selection().

◆ PVBin_

int ZCountingElectrons::PVBin_
private

Definition at line 63 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ PVMax_

double ZCountingElectrons::PVMax_
private

Definition at line 65 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ PVMin_

double ZCountingElectrons::PVMin_
private

Definition at line 64 of file ZCountingElectrons.h.

Referenced by bookHistograms().

◆ triggerResultsInputTag_

const edm::InputTag ZCountingElectrons::triggerResultsInputTag_
private

Definition at line 40 of file ZCountingElectrons.h.

Referenced by dqmBeginRun(), and ZCountingElectrons().

◆ triggers

TriggerTools* ZCountingElectrons::triggers
private

Definition at line 76 of file ZCountingElectrons.h.

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

◆ VtxAbsZCut_

double ZCountingElectrons::VtxAbsZCut_
private

Definition at line 69 of file ZCountingElectrons.h.

Referenced by analyze().

◆ VtxNdofCut_

double ZCountingElectrons::VtxNdofCut_
private

Definition at line 68 of file ZCountingElectrons.h.

Referenced by analyze().

◆ VtxNTracksFitCut_

double ZCountingElectrons::VtxNTracksFitCut_
private

Definition at line 67 of file ZCountingElectrons.h.

Referenced by analyze().

◆ VtxRhoCut_

double ZCountingElectrons::VtxRhoCut_
private

Definition at line 70 of file ZCountingElectrons.h.

Referenced by analyze().