CMS 3D CMS Logo

ZCounting.cc
Go to the documentation of this file.
10 
14 
15 #include <TLorentzVector.h>
16 
17 #include <memory>
18 
20 
21 using namespace ZCountingTrigger;
22 
23 //
24 // -------------------------------------- Constructor --------------------------------------------
25 //
27  : fHLTObjTag(iConfig.getParameter<edm::InputTag>("TriggerEvent")),
28  fHLTTag(iConfig.getParameter<edm::InputTag>("TriggerResults")),
29  fPVName(iConfig.getUntrackedParameter<std::string>("edmPVName", "offlinePrimaryVertices")),
30  fMuonName(iConfig.getUntrackedParameter<std::string>("edmName", "muons")),
31  fTrackName(iConfig.getUntrackedParameter<std::string>("edmTrackName", "generalTracks")),
32 
33  // Electron-specific Parameters
34  fElectronName(iConfig.getUntrackedParameter<std::string>("edmGsfEleName", "gedGsfElectrons")),
35  fSCName(iConfig.getUntrackedParameter<std::string>("edmSCName", "particleFlowEGamma")),
36 
37  // Electron-specific Tags
38  fRhoTag(iConfig.getParameter<edm::InputTag>("rhoname")),
39  fBeamspotTag(iConfig.getParameter<edm::InputTag>("beamspotName")),
40  fConversionTag(iConfig.getParameter<edm::InputTag>("conversionsName")),
41 
42  // Electron-specific Cuts
43  ELE_PT_CUT_TAG(iConfig.getUntrackedParameter<double>("PtCutEleTag")),
44  ELE_PT_CUT_PROBE(iConfig.getUntrackedParameter<double>("PtCutEleProbe")),
45  ELE_ETA_CUT_TAG(iConfig.getUntrackedParameter<double>("EtaCutEleTag")),
46  ELE_ETA_CUT_PROBE(iConfig.getUntrackedParameter<double>("EtaCutEleProbe")),
47 
48  ELE_MASS_CUT_LOW(iConfig.getUntrackedParameter<double>("MassCutEleLow")),
49  ELE_MASS_CUT_HIGH(iConfig.getUntrackedParameter<double>("MassCutEleHigh")),
50 
51  ELE_ID_WP(iConfig.getUntrackedParameter<std::string>("ElectronIDType", "TIGHT")),
52  EleID_(ElectronIdentifier(iConfig)) {
53  edm::LogInfo("ZCounting") << "Constructor ZCounting::ZCounting " << std::endl;
54 
55  //Get parameters from configuration file
56  fHLTTag_token = consumes<edm::TriggerResults>(fHLTTag);
57  fHLTObjTag_token = consumes<trigger::TriggerEvent>(fHLTObjTag);
58  fPVName_token = consumes<reco::VertexCollection>(fPVName);
59  fMuonName_token = consumes<reco::MuonCollection>(fMuonName);
60  fTrackName_token = consumes<reco::TrackCollection>(fTrackName);
61 
62  // Trigger-specific Parameters
63  fMuonHLTNames = iConfig.getParameter<std::vector<std::string>>("MuonTriggerNames");
64  fMuonHLTObjectNames = iConfig.getParameter<std::vector<std::string>>("MuonTriggerObjectNames");
65  if (fMuonHLTNames.size() != fMuonHLTObjectNames.size()) {
66  edm::LogError("ZCounting") << "List of MuonTriggerNames and MuonTriggerObjectNames has to be the same length"
67  << std::endl;
68  }
69 
70  // Electron-specific parameters
71  fGsfElectronName_token = consumes<edm::View<reco::GsfElectron>>(fElectronName);
72  fSCName_token = consumes<edm::View<reco::SuperCluster>>(fSCName);
73  fRhoToken = consumes<double>(fRhoTag);
74  fBeamspotToken = consumes<reco::BeamSpot>(fBeamspotTag);
75  fConversionToken = consumes<reco::ConversionCollection>(fConversionTag);
76 
77  // Muon-specific Cuts
78  IDTypestr_ = iConfig.getUntrackedParameter<std::string>("IDType");
79  IsoTypestr_ = iConfig.getUntrackedParameter<std::string>("IsoType");
80  IsoCut_ = iConfig.getUntrackedParameter<double>("IsoCut");
81 
82  if (IDTypestr_ == "Loose")
83  IDType_ = LooseID;
84  else if (IDTypestr_ == "Medium")
85  IDType_ = MediumID;
86  else if (IDTypestr_ == "Tight")
87  IDType_ = TightID;
88  else
89  IDType_ = NoneID;
90 
91  if (IsoTypestr_ == "Tracker-based")
93  else if (IsoTypestr_ == "PF-based")
94  IsoType_ = PFIso;
95  else
96  IsoType_ = NoneIso;
97 
98  PtCutL1_ = iConfig.getUntrackedParameter<double>("PtCutL1");
99  PtCutL2_ = iConfig.getUntrackedParameter<double>("PtCutL2");
100  EtaCutL1_ = iConfig.getUntrackedParameter<double>("EtaCutL1");
101  EtaCutL2_ = iConfig.getUntrackedParameter<double>("EtaCutL2");
102 
103  MassBin_ = iConfig.getUntrackedParameter<int>("MassBin");
104  MassMin_ = iConfig.getUntrackedParameter<double>("MassMin");
105  MassMax_ = iConfig.getUntrackedParameter<double>("MassMax");
106 
107  LumiBin_ = iConfig.getUntrackedParameter<int>("LumiBin");
108  LumiMin_ = iConfig.getUntrackedParameter<double>("LumiMin");
109  LumiMax_ = iConfig.getUntrackedParameter<double>("LumiMax");
110 
111  PVBin_ = iConfig.getUntrackedParameter<int>("PVBin");
112  PVMin_ = iConfig.getUntrackedParameter<double>("PVMin");
113  PVMax_ = iConfig.getUntrackedParameter<double>("PVMax");
114 
115  VtxNTracksFitCut_ = iConfig.getUntrackedParameter<double>("VtxNTracksFitMin");
116  VtxNdofCut_ = iConfig.getUntrackedParameter<double>("VtxNdofMin");
117  VtxAbsZCut_ = iConfig.getUntrackedParameter<double>("VtxAbsZMax");
118  VtxRhoCut_ = iConfig.getUntrackedParameter<double>("VtxRhoMax");
119 
121 }
122 
123 //
124 // -------------------------------------- Destructor --------------------------------------------
125 //
126 ZCounting::~ZCounting() { edm::LogInfo("ZCounting") << "Destructor ZCounting::~ZCounting " << std::endl; }
127 
128 //
129 // -------------------------------------- beginRun --------------------------------------------
130 //
132  edm::LogInfo("ZCounting") << "ZCounting::beginRun" << std::endl;
133 
134  // Triggers
135  fTrigger = std::make_unique<ZCountingTrigger::TTrigger>(fMuonHLTNames, fMuonHLTObjectNames);
136 }
137 //
138 // -------------------------------------- bookHistos --------------------------------------------
139 //
141  edm::LogInfo("ZCounting") << "ZCounting::bookHistograms" << std::endl;
142  ibooker_.cd();
143  ibooker_.setCurrentFolder("ZCounting/Histograms");
144 
145  // Muon histograms
146  h_mass_HLT_pass_central = ibooker_.book2D("h_mass_HLT_pass_central",
147  "Muon HLT passing probes central",
148  LumiBin_,
149  LumiMin_,
150  LumiMax_,
151  MassBin_,
152  MassMin_,
153  MassMax_);
154  h_mass_HLT_pass_forward = ibooker_.book2D("h_mass_HLT_pass_forward",
155  "Muon HLT passing probes forward",
156  LumiBin_,
157  LumiMin_,
158  LumiMax_,
159  MassBin_,
160  MassMin_,
161  MassMax_);
162  h_mass_HLT_fail_central = ibooker_.book2D("h_mass_HLT_fail_central",
163  "Muon HLT failing probes central",
164  LumiBin_,
165  LumiMin_,
166  LumiMax_,
167  MassBin_,
168  MassMin_,
169  MassMax_);
170  h_mass_HLT_fail_forward = ibooker_.book2D("h_mass_HLT_fail_forward",
171  "Muon HLT failing probes forward",
172  LumiBin_,
173  LumiMin_,
174  LumiMax_,
175  MassBin_,
176  MassMin_,
177  MassMax_);
178 
179  h_mass_SIT_pass_central = ibooker_.book2D("h_mass_SIT_pass_central",
180  "Muon SIT passing probes central",
181  LumiBin_,
182  LumiMin_,
183  LumiMax_,
184  MassBin_,
185  MassMin_,
186  MassMax_);
187  h_mass_SIT_pass_forward = ibooker_.book2D("h_mass_SIT_pass_forward",
188  "Muon SIT passing probes forward",
189  LumiBin_,
190  LumiMin_,
191  LumiMax_,
192  MassBin_,
193  MassMin_,
194  MassMax_);
195  h_mass_SIT_fail_central = ibooker_.book2D("h_mass_SIT_fail_central",
196  "Muon SIT_failing probes central",
197  LumiBin_,
198  LumiMin_,
199  LumiMax_,
200  MassBin_,
201  MassMin_,
202  MassMax_);
203  h_mass_SIT_fail_forward = ibooker_.book2D("h_mass_SIT_fail_forward",
204  "Muon SIT failing probes forward",
205  LumiBin_,
206  LumiMin_,
207  LumiMax_,
208  MassBin_,
209  MassMin_,
210  MassMax_);
211 
212  h_mass_Glo_pass_central = ibooker_.book2D("h_mass_Glo_pass_central",
213  "Muon Glo passing probes central",
214  LumiBin_,
215  LumiMin_,
216  LumiMax_,
217  MassBin_,
218  MassMin_,
219  MassMax_);
220  h_mass_Glo_pass_forward = ibooker_.book2D("h_mass_Glo_pass_forward",
221  "Muon Glo passing probes forward",
222  LumiBin_,
223  LumiMin_,
224  LumiMax_,
225  MassBin_,
226  MassMin_,
227  MassMax_);
228  h_mass_Glo_fail_central = ibooker_.book2D("h_mass_Glo_fail_central",
229  "Muon Glo failing probes central",
230  LumiBin_,
231  LumiMin_,
232  LumiMax_,
233  MassBin_,
234  MassMin_,
235  MassMax_);
236  h_mass_Glo_fail_forward = ibooker_.book2D("h_mass_Glo_fail_forward",
237  "Muon Glo failing probes forward",
238  LumiBin_,
239  LumiMin_,
240  LumiMax_,
241  MassBin_,
242  MassMin_,
243  MassMax_);
244 
245  h_npv = ibooker_.book2D(
246  "h_npv", "Events with valid primary vertex", LumiBin_, LumiMin_, LumiMax_, PVBin_, PVMin_, PVMax_);
247  h_mass_yield_Z = ibooker_.book2D(
248  "h_mass_yield_Z", "reconstructed Z bosons", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
249  h_npv_yield_Z =
250  ibooker_.book2D("h_npv_yield_Z", "reconstructed Z bosons", LumiBin_, LumiMin_, LumiMax_, PVBin_, PVMin_, PVMax_);
251  h_yieldBB_Z = ibooker_.book1D("h_yieldBB_Z", "reconstructed Z bosons in barrel", LumiBin_, LumiMin_, LumiMax_);
252  h_yieldEE_Z = ibooker_.book1D("h_yieldEE_Z", "reconstructed Z bosons in endcap", LumiBin_, LumiMin_, LumiMax_);
253 
254  // Axis titles
255  h_mass_HLT_pass_central->setAxisTitle("luminosiry section", 1);
256  h_mass_HLT_pass_forward->setAxisTitle("luminosiry section", 1);
257  h_mass_HLT_fail_central->setAxisTitle("luminosiry section", 1);
258  h_mass_HLT_fail_forward->setAxisTitle("luminosiry section", 1);
259  h_mass_SIT_pass_central->setAxisTitle("luminosiry section", 1);
260  h_mass_SIT_pass_forward->setAxisTitle("luminosiry section", 1);
261  h_mass_SIT_fail_central->setAxisTitle("luminosiry section", 1);
262  h_mass_SIT_fail_forward->setAxisTitle("luminosiry section", 1);
263  h_mass_Glo_pass_central->setAxisTitle("luminosiry section", 1);
264  h_mass_Glo_pass_forward->setAxisTitle("luminosiry section", 1);
265  h_mass_Glo_fail_central->setAxisTitle("luminosiry section", 1);
266  h_mass_Glo_fail_forward->setAxisTitle("luminosiry section", 1);
267  h_mass_HLT_pass_central->setAxisTitle("tag and probe mass", 2);
268  h_mass_HLT_pass_forward->setAxisTitle("tag and probe mass", 2);
269  h_mass_HLT_fail_central->setAxisTitle("tag and probe mass", 2);
270  h_mass_HLT_fail_forward->setAxisTitle("tag and probe mass", 2);
271  h_mass_SIT_pass_central->setAxisTitle("tag and probe mass", 2);
272  h_mass_SIT_pass_forward->setAxisTitle("tag and probe mass", 2);
273  h_mass_SIT_fail_central->setAxisTitle("tag and probe mass", 2);
274  h_mass_SIT_fail_forward->setAxisTitle("tag and probe mass", 2);
275  h_mass_Glo_pass_central->setAxisTitle("tag and probe mass", 2);
276  h_mass_Glo_pass_forward->setAxisTitle("tag and probe mass", 2);
277  h_mass_Glo_fail_central->setAxisTitle("tag and probe mass", 2);
278  h_mass_Glo_fail_forward->setAxisTitle("tag and probe mass", 2);
279  h_npv->setAxisTitle("luminosity section", 1);
280  h_npv->setAxisTitle("number of primary vertices", 2);
281  h_npv_yield_Z->setAxisTitle("luminosiry section", 1);
282  h_npv_yield_Z->setAxisTitle("number of primary vertices", 2);
283  h_mass_yield_Z->setAxisTitle("luminosiry section", 1);
284  h_mass_yield_Z->setAxisTitle("tag and probe mass", 2);
285 
286  h_yieldBB_Z->setAxisTitle("luminosiry section", 1);
287  h_yieldEE_Z->setAxisTitle("luminosiry section", 1);
288 
289  /*
290  // Electron histograms
291  h_ee_mass_id_pass_central = ibooker_.book2D("h_ee_mass_id_pass_central", "h_ee_mass_id_pass_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
292  h_ee_mass_id_fail_central = ibooker_.book2D("h_ee_mass_id_fail_central", "h_ee_mass_id_fail_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
293  h_ee_mass_id_pass_forward = ibooker_.book2D("h_ee_mass_id_pass_forward", "h_ee_mass_id_pass_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
294  h_ee_mass_id_fail_forward = ibooker_.book2D("h_ee_mass_id_fail_forward", "h_ee_mass_id_fail_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
295 
296  h_ee_mass_HLT_pass_central = ibooker_.book2D("h_ee_mass_HLT_pass_central", "h_ee_mass_HLT_pass_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
297  h_ee_mass_HLT_fail_central = ibooker_.book2D("h_ee_mass_HLT_fail_central", "h_ee_mass_HLT_fail_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
298  h_ee_mass_HLT_pass_forward = ibooker_.book2D("h_ee_mass_HLT_pass_forward", "h_ee_mass_HLT_pass_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
299  h_ee_mass_HLT_fail_forward = ibooker_.book2D("h_ee_mass_HLT_fail_forward", "h_ee_mass_HLT_fail_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
300 
301  h_ee_yield_Z_ebeb = ibooker_.book1D("h_ee_yield_Z_ebeb", "h_ee_yield_Z_ebeb", LumiBin_, LumiMin_, LumiMax_);
302  h_ee_yield_Z_ebee = ibooker_.book1D("h_ee_yield_Z_ebee", "h_ee_yield_Z_ebee", LumiBin_, LumiMin_, LumiMax_);
303  h_ee_yield_Z_eeee = ibooker_.book1D("h_ee_yield_Z_eeee", "h_ee_yield_Z_eeee", LumiBin_, LumiMin_, LumiMax_);*/
304 }
305 
306 //
307 // -------------------------------------- Analyze --------------------------------------------
308 //
309 //--------------------------------------------------------------------------------------------------
310 void ZCounting::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { // Fill event tree on the fly
311  edm::LogInfo("ZCounting") << "ZCounting::analyze" << std::endl;
312  analyzeMuons(iEvent, iSetup);
313  //analyzeElectrons(iEvent, iSetup);
314 }
315 
317  edm::LogInfo("ZCounting") << "ZCounting::analyzeMuons" << std::endl;
318  //-------------------------------
319  //--- Vertex
320  //-------------------------------
322  iEvent.getByToken(fPVName_token, hVertexProduct);
323  if (!hVertexProduct.isValid()) {
324  edm::LogWarning("ZCounting") << "ZCounting::analyzeMuons - no valid primary vertex product found" << std::endl;
325  return;
326  }
327  const reco::VertexCollection* pvCol = hVertexProduct.product();
328  const reco::Vertex* pv = &(*pvCol->begin());
329  int nvtx = 0;
330 
331  for (auto const& itVtx : *hVertexProduct) {
332  if (itVtx.isFake())
333  continue;
334  if (itVtx.tracksSize() < VtxNTracksFitCut_)
335  continue;
336  if (itVtx.ndof() < VtxNdofCut_)
337  continue;
338  if (fabs(itVtx.z()) > VtxAbsZCut_)
339  continue;
340  if (itVtx.position().Rho() > VtxRhoCut_)
341  continue;
342 
343  if (nvtx == 0) {
344  pv = &itVtx;
345  }
346  nvtx++;
347  }
348 
349  h_npv->Fill(iEvent.luminosityBlock(), nvtx);
350 
351  //-------------------------------
352  //--- Trigger
353  //-------------------------------
355  iEvent.getByToken(fHLTTag_token, hTrgRes);
356  if (!hTrgRes.isValid())
357  return;
358 
360  iEvent.getByToken(fHLTObjTag_token, hTrgEvt);
361 
362  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*hTrgRes);
363  bool config_changed = false;
364  if (fTriggerNamesID != triggerNames.parameterSetID()) {
365  fTriggerNamesID = triggerNames.parameterSetID();
366  config_changed = true;
367  }
368  if (config_changed) {
369  initHLT(*hTrgRes, triggerNames);
370  }
371 
372  TriggerBits triggerBits;
373  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
374  if (fTrigger->fRecords[irec].hltPathIndex == (unsigned int)-1)
375  continue;
376  if (hTrgRes->accept(fTrigger->fRecords[irec].hltPathIndex)) {
377  triggerBits[fTrigger->fRecords[irec].baconTrigBit] = true;
378  }
379  }
380  //if(fSkipOnHLTFail && triggerBits == 0) return;
381 
382  // Trigger requirement
383  if (!isMuonTrigger(*fTrigger, triggerBits))
384  return;
385 
386  //-------------------------------
387  //--- Muons and Tracks
388  //-------------------------------
390  iEvent.getByToken(fMuonName_token, hMuonProduct);
391  if (!hMuonProduct.isValid())
392  return;
393 
395  iEvent.getByToken(fTrackName_token, hTrackProduct);
396  if (!hTrackProduct.isValid())
397  return;
398 
399  TLorentzVector vTag(0., 0., 0., 0.);
400  TLorentzVector vProbe(0., 0., 0., 0.);
401  TLorentzVector vTrack(0., 0., 0., 0.);
402 
403  // Tag loop
404  for (auto const& itMu1 : *hMuonProduct) {
405  float pt1 = itMu1.muonBestTrack()->pt();
406  float eta1 = itMu1.muonBestTrack()->eta();
407  float phi1 = itMu1.muonBestTrack()->phi();
408  float q1 = itMu1.muonBestTrack()->charge();
409 
410  // Tag selection: kinematic cuts, lepton selection and trigger matching
411  if (pt1 < PtCutL1_)
412  continue;
413  if (fabs(eta1) > EtaCutL1_)
414  continue;
415  if (!(passMuonID(itMu1, *pv, IDType_) && passMuonIso(itMu1, IsoType_, IsoCut_)))
416  continue;
417  if (!isMuonTriggerObj(*fTrigger, TriggerTools::matchHLT(eta1, phi1, fTrigger->fRecords, *hTrgEvt)))
418  continue;
419 
420  vTag.SetPtEtaPhiM(pt1, eta1, phi1, MUON_MASS);
421 
422  // Probe loop over muons
423  for (auto const& itMu2 : *hMuonProduct) {
424  if (&itMu2 == &itMu1)
425  continue;
426 
427  float pt2 = itMu2.muonBestTrack()->pt();
428  float eta2 = itMu2.muonBestTrack()->eta();
429  float phi2 = itMu2.muonBestTrack()->phi();
430  float q2 = itMu2.muonBestTrack()->charge();
431 
432  // Probe selection: kinematic cuts and opposite charge requirement
433  if (pt2 < PtCutL2_)
434  continue;
435  if (fabs(eta2) > EtaCutL2_)
436  continue;
437  if (q1 == q2)
438  continue;
439 
440  vProbe.SetPtEtaPhiM(pt2, eta2, phi2, MUON_MASS);
441 
442  // Mass window
443  TLorentzVector vDilep = vTag + vProbe;
444  float dilepMass = vDilep.M();
445  if ((dilepMass < MassMin_) || (dilepMass > MassMax_))
446  continue;
447 
448  bool isTagCentral = false;
449  bool isProbeCentral = false;
450  if (fabs(eta1) < MUON_BOUND)
451  isTagCentral = true;
452  if (fabs(eta2) < MUON_BOUND)
453  isProbeCentral = true;
454 
455  // Determine event category for efficiency calculation
456  if (passMuonID(itMu2, *pv, IDType_) && passMuonIso(itMu2, IsoType_, IsoCut_)) {
457  if (isMuonTriggerObj(*fTrigger, TriggerTools::matchHLT(eta2, phi2, fTrigger->fRecords, *hTrgEvt))) {
458  // category 2HLT: both muons passing trigger requirements
459  if (&itMu1 > &itMu2)
460  continue; // make sure we don't double count MuMu2HLT category
461 
462  // Fill twice for each event, since both muons pass trigger
463  if (isTagCentral) {
464  h_mass_HLT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
465  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
466  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
467  } else {
468  h_mass_HLT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
469  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
470  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
471  }
472 
473  if (isProbeCentral) {
474  h_mass_HLT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
475  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
476  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
477  } else {
478  h_mass_HLT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
479  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
480  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
481  }
482 
483  } else {
484  // category 1HLT: probe passing selection but not trigger
485  if (isProbeCentral) {
486  h_mass_HLT_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
487  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
488  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
489  } else {
490  h_mass_HLT_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
491  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
492  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
493  }
494  }
495  // category 2HLT + 1HLT: Fill once for Z yield
496  h_npv_yield_Z->Fill(iEvent.luminosityBlock(), nvtx);
497  h_mass_yield_Z->Fill(iEvent.luminosityBlock(), dilepMass);
498  if (isTagCentral && isProbeCentral)
499  h_yieldBB_Z->Fill(iEvent.luminosityBlock());
500  else if (!isTagCentral && !isProbeCentral)
501  h_yieldEE_Z->Fill(iEvent.luminosityBlock());
502  } else if (itMu2.isGlobalMuon()) {
503  // category Glo: probe is a Global muon but failing selection
504  if (isProbeCentral) {
505  h_mass_SIT_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
506  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
507  } else {
508  h_mass_SIT_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
509  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
510  }
511  } else if (itMu2.isStandAloneMuon()) {
512  // category Sta: probe is a Standalone muon
513  if (isProbeCentral) {
514  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
515  } else {
516  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
517  }
518  } else if (itMu2.innerTrack()->hitPattern().trackerLayersWithMeasurement() >= 6 &&
519  itMu2.innerTrack()->hitPattern().numberOfValidPixelHits() >= 1) {
520  // cateogry Trk: probe is a tracker track
521  if (isProbeCentral) {
522  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
523  } else {
524  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
525  }
526  }
527 
528  } // End of probe loop over muons
529 
530  // Probe loop over tracks, only for standalone efficiency calculation
531  for (auto const& itTrk : *hTrackProduct) {
532  // Check track is not a muon
533  bool isMuon = false;
534  for (auto const& itMu : *hMuonProduct) {
535  if (itMu.innerTrack().isNonnull() && itMu.innerTrack().get() == &itTrk) {
536  isMuon = true;
537  break;
538  }
539  }
540  if (isMuon)
541  continue;
542 
543  float pt2 = itTrk.pt();
544  float eta2 = itTrk.eta();
545  float phi2 = itTrk.phi();
546  float q2 = itTrk.charge();
547 
548  // Probe selection: kinematic cuts and opposite charge requirement
549  if (pt2 < PtCutL2_)
550  continue;
551  if (fabs(eta2) > EtaCutL2_)
552  continue;
553  if (q1 == q2)
554  continue;
555 
556  vTrack.SetPtEtaPhiM(pt2, eta2, phi2, MUON_MASS);
557 
558  TLorentzVector vDilep = vTag + vTrack;
559  float dilepMass = vDilep.M();
560  if ((dilepMass < MassMin_) || (dilepMass > MassMax_))
561  continue;
562 
563  bool isTrackCentral = false;
564  if (fabs(eta2) < MUON_BOUND)
565  isTrackCentral = true;
566 
567  if (itTrk.hitPattern().trackerLayersWithMeasurement() >= 6 && itTrk.hitPattern().numberOfValidPixelHits() >= 1) {
568  if (isTrackCentral)
569  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
570  else
571  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
572  }
573 
574  } //End of probe loop over tracks
575 
576  } //End of tag loop
577 }
579  edm::LogInfo("ZCounting") << "ZCounting::analyzeElectrons" << std::endl;
580 
581  //-------------------------------
582  //--- Vertex
583  //-------------------------------
585  iEvent.getByToken(fPVName_token, hVertexProduct);
586  if (!hVertexProduct.isValid())
587  return;
588 
589  const reco::VertexCollection* pvCol = hVertexProduct.product();
590  int nvtx = 0;
591 
592  for (auto const& vtx : *pvCol) {
593  if (vtx.isFake())
594  continue;
595  if (vtx.tracksSize() < VtxNTracksFitCut_)
596  continue;
597  if (vtx.ndof() < VtxNdofCut_)
598  continue;
599  if (fabs(vtx.z()) > VtxAbsZCut_)
600  continue;
601  if (vtx.position().Rho() > VtxRhoCut_)
602  continue;
603 
604  nvtx++;
605  }
606 
607  // Good vertex requirement
608  if (nvtx == 0)
609  return;
610 
611  //-------------------------------
612  //--- Trigger
613  //-------------------------------
615  iEvent.getByToken(fHLTTag_token, hTrgRes);
616  if (!hTrgRes.isValid())
617  return;
618 
620  iEvent.getByToken(fHLTObjTag_token, hTrgEvt);
621 
622  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*hTrgRes);
623  Bool_t config_changed = false;
624  if (fTriggerNamesID != triggerNames.parameterSetID()) {
625  fTriggerNamesID = triggerNames.parameterSetID();
626  config_changed = true;
627  }
628  if (config_changed) {
629  initHLT(*hTrgRes, triggerNames);
630  }
631 
632  TriggerBits triggerBits;
633  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
634  if (fTrigger->fRecords[irec].hltPathIndex == (unsigned int)-1)
635  continue;
636  if (hTrgRes->accept(fTrigger->fRecords[irec].hltPathIndex)) {
637  triggerBits[fTrigger->fRecords[irec].baconTrigBit] = true;
638  }
639  }
640 
641  // Trigger requirement
642  if (!isElectronTrigger(*fTrigger, triggerBits))
643  return;
644 
645  // Get Electrons
648 
649  // Get SuperClusters
651  iEvent.getByToken(fSCName_token, superclusters);
652 
653  // Get Rho
654  edm::Handle<double> rhoHandle;
655  iEvent.getByToken(fRhoToken, rhoHandle);
656  EleID_.setRho(*rhoHandle);
657 
658  // Get beamspot
659  edm::Handle<reco::BeamSpot> beamspotHandle;
660  iEvent.getByToken(fBeamspotToken, beamspotHandle);
661 
662  // Conversions
663  edm::Handle<reco::ConversionCollection> conversionsHandle;
664  iEvent.getByToken(fConversionToken, conversionsHandle);
665 
667  enum { eEleEle2HLT = 1, eEleEle1HLT1L1, eEleEle1HLT, eEleEleNoSel, eEleSC }; // event category enum
668 
669  // Loop over Tags
670  for (size_t itag = 0; itag < electrons->size(); ++itag) {
671  const auto el1 = electrons->ptrAt(itag);
672  if (not EleID_.passID(el1, beamspotHandle, conversionsHandle))
673  continue;
674 
675  float pt1 = el1->pt();
676  float eta1 = el1->eta();
677  float phi1 = el1->phi();
678 
679  if (!isElectronTriggerObj(*fTrigger, TriggerTools::matchHLT(eta1, phi1, fTrigger->fRecords, *hTrgEvt)))
680  continue;
681  TLorentzVector vTag(0., 0., 0., 0.);
682  vTag.SetPtEtaPhiM(pt1, eta1, phi1, ELECTRON_MASS);
683 
684  // Tag selection: kinematic cuts, lepton selection and trigger matching
685  double tag_pt = vTag.Pt();
686  double tag_abseta = fabs(vTag.Eta());
687 
688  bool tag_is_valid_tag = ele_tag_selection(tag_pt, tag_abseta);
689  bool tag_is_valid_probe = ele_probe_selection(tag_pt, tag_abseta);
690 
691  if (not(tag_is_valid_tag or tag_is_valid_probe))
692  continue;
693 
694  // Loop over probes
695  for (size_t iprobe = 0; iprobe < superclusters->size(); ++iprobe) {
696  // Initialize probe
697  const auto sc = superclusters->ptrAt(iprobe);
698  if (*sc == *(el1->superCluster())) {
699  continue;
700  }
701 
702  // Find matching electron
703  for (size_t iele = 0; iele < electrons->size(); ++iele) {
704  if (iele == itag)
705  continue;
706  const auto ele = electrons->ptrAt(iele);
707  if (*sc == *(ele->superCluster())) {
708  eleProbe = ele;
709  break;
710  }
711  }
712 
713  // Assign final probe 4-vector
714  TLorentzVector vProbe(0., 0., 0., 0.);
715  if (eleProbe.isNonnull()) {
716  vProbe.SetPtEtaPhiM(eleProbe->pt(), eleProbe->eta(), eleProbe->phi(), ELECTRON_MASS);
717  } else {
718  double pt = sc->energy() * sqrt(1 - pow(tanh(sc->eta()), 2));
719  vProbe.SetPtEtaPhiM(pt, sc->eta(), sc->phi(), ELECTRON_MASS);
720  }
721 
722  // Probe Selection
723  double probe_pt = vProbe.Pt();
724  double probe_abseta = fabs(sc->eta());
725  bool probe_is_valid_probe = ele_probe_selection(probe_pt, probe_abseta);
726  if (!probe_is_valid_probe)
727  continue;
728 
729  // Good Probe found!
730 
731  // Require good Z
732  TLorentzVector vDilep = vTag + vProbe;
733 
734  if ((vDilep.M() < ELE_MASS_CUT_LOW) || (vDilep.M() > ELE_MASS_CUT_HIGH))
735  continue;
736  if (eleProbe.isNonnull() and (eleProbe->charge() != -el1->charge()))
737  continue;
738 
739  // Good Z found!
740 
741  long ls = iEvent.luminosityBlock();
742  bool probe_pass_trigger = isElectronTriggerObj(
743  *fTrigger, TriggerTools::matchHLT(vProbe.Eta(), vProbe.Phi(), fTrigger->fRecords, *hTrgEvt));
744  bool probe_pass_id = eleProbe.isNonnull() and EleID_.passID(eleProbe, beamspotHandle, conversionsHandle);
745 
747  bool probe_is_forward = probe_abseta > ELE_ETA_CRACK_LOW;
748  bool tag_is_forward = tag_abseta > ELE_ETA_CRACK_LOW;
749 
750  if (probe_pass_id) {
751  if (probe_is_forward and tag_is_forward) {
753  } else if (!probe_is_forward and !tag_is_forward) {
755  } else {
757  }
758  }
759 
760  if (!tag_is_valid_tag)
761  continue;
762 
764  if (probe_pass_id) {
765  if (probe_is_forward) {
766  h_ee_mass_id_pass_forward->Fill(ls, vDilep.M());
767  } else {
768  h_ee_mass_id_pass_central->Fill(ls, vDilep.M());
769  }
770  } else {
771  if (probe_is_forward) {
772  h_ee_mass_id_fail_forward->Fill(ls, vDilep.M());
773  } else {
774  h_ee_mass_id_fail_central->Fill(ls, vDilep.M());
775  }
776  }
777 
779  if (probe_pass_id and probe_pass_trigger) {
780  if (probe_is_forward) {
781  h_ee_mass_HLT_pass_forward->Fill(ls, vDilep.M());
782  } else {
783  h_ee_mass_HLT_pass_central->Fill(ls, vDilep.M());
784  }
785  } else if (probe_pass_id) {
786  if (probe_is_forward) {
787  h_ee_mass_HLT_fail_forward->Fill(ls, vDilep.M());
788  } else {
789  h_ee_mass_HLT_fail_central->Fill(ls, vDilep.M());
790  }
791  }
792  } // End of probe loop
793  } //End of tag loop
794 }
795 
796 bool ZCounting::ele_probe_selection(double pt, double abseta) {
797  if (pt < ELE_PT_CUT_PROBE)
798  return false;
799  if (abseta > ELE_ETA_CUT_PROBE)
800  return false;
801  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
802  return false;
803  return true;
804 }
805 bool ZCounting::ele_tag_selection(double pt, double abseta) {
806  if (pt < ELE_PT_CUT_TAG)
807  return false;
808  if (abseta > ELE_ETA_CUT_TAG)
809  return false;
810  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
811  return false;
812  return true;
813 }
814 //
815 // -------------------------------------- functions --------------------------------------------
816 //
817 
819  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
820  fTrigger->fRecords[irec].hltPathName = "";
821  fTrigger->fRecords[irec].hltPathIndex = (unsigned int)-1;
822  const std::string pattern = fTrigger->fRecords[irec].hltPattern;
823  if (edm::is_glob(pattern)) { // handle pattern with wildcards (*,?)
824  std::vector<std::vector<std::string>::const_iterator> matches =
825  edm::regexMatch(triggerNames.triggerNames(), pattern);
826  if (matches.empty()) {
827  edm::LogWarning("ZCounting") << "requested pattern [" << pattern << "] does not match any HLT paths"
828  << std::endl;
829  } else {
830  for (auto const& match : matches) {
831  fTrigger->fRecords[irec].hltPathName = *match;
832  }
833  }
834  } else { // take full HLT path name given
835  fTrigger->fRecords[irec].hltPathName = pattern;
836  }
837  // Retrieve index in trigger menu corresponding to HLT path
838  unsigned int index = triggerNames.triggerIndex(fTrigger->fRecords[irec].hltPathName);
839  if (index < result.size()) { // check for valid index
840  fTrigger->fRecords[irec].hltPathIndex = index;
841  }
842  }
843 }
844 
845 //--------------------------------------------------------------------------------------------------
846 bool ZCounting::isMuonTrigger(const ZCountingTrigger::TTrigger& triggerMenu, const TriggerBits& hltBits) {
847  for (unsigned int i = 0; i < fMuonHLTNames.size(); ++i) {
848  if (triggerMenu.pass(fMuonHLTNames.at(i), hltBits))
849  return true;
850  }
851  return false;
852 }
853 
854 //--------------------------------------------------------------------------------------------------
855 bool ZCounting::isMuonTriggerObj(const ZCountingTrigger::TTrigger& triggerMenu, const TriggerObjects& hltMatchBits) {
856  for (unsigned int i = 0; i < fMuonHLTNames.size(); ++i) {
857  if (triggerMenu.passObj(fMuonHLTNames.at(i), fMuonHLTObjectNames.at(i), hltMatchBits))
858  return true;
859  }
860  return false;
861 }
862 
863 //--------------------------------------------------------------------------------------------------
864 // Definition of the CustomTightID function
866  if (!muon.isPFMuon() || !muon.isGlobalMuon())
867  return false;
868 
869  bool muID = isGoodMuon(muon, muon::GlobalMuonPromptTight) && (muon.numberOfMatchedStations() > 1);
870 
871  bool muIdAndHits = muID && muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
872  muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
873 
874  return muIdAndHits;
875 }
876 
877 //--------------------------------------------------------------------------------------------------
879  const reco::Muon& muon,
880  const reco::Vertex& vtx,
881  const MuonIDTypes& idType) { //Muon ID selection, using internal function "DataFormats/MuonReco/src/MuonSelectors.cc
882 
883  if (idType == LooseID && muon::isLooseMuon(muon))
884  return true;
885  else if (idType == MediumID && muon::isMediumMuon(muon))
886  return true;
887  else if (idType == TightID && muon::isTightMuon(muon, vtx))
888  return true;
889  else if (idType == CustomTightID && isCustomTightMuon(muon))
890  return true;
891  else if (idType == NoneID)
892  return true;
893  else
894  return false;
895 }
896 //--------------------------------------------------------------------------------------------------
898  const MuonIsoTypes& isoType,
899  const float isoCut) { //Muon isolation selection, up-to-date with MUO POG recommendation
900 
901  if (isoType == TrackerIso && muon.isolationR03().sumPt < isoCut)
902  return true;
903  else if (isoType == PFIso &&
904  muon.pfIsolationR04().sumChargedHadronPt +
905  std::max(0.,
906  muon.pfIsolationR04().sumNeutralHadronEt + muon.pfIsolationR04().sumPhotonEt -
907  0.5 * muon.pfIsolationR04().sumPUPt) <
908  isoCut)
909  return true;
910  else if (isoType == NoneIso)
911  return true;
912  else
913  return false;
914 }
915 
916 //--------------------------------------------------------------------------------------------------
918  return triggerMenu.pass("HLT_Ele35_WPTight_Gsf_v*", hltBits);
919 }
920 //--------------------------------------------------------------------------------------------------
922  return triggerMenu.passObj("HLT_Ele35_WPTight_Gsf_v*", "hltEle35noerWPTightGsfTrackIsoFilter", hltMatchBits);
923 }
ZCounting(const edm::ParameterSet &ps)
Definition: ZCounting.cc:26
bool accept() const
Has at least one path accepted the event?
MonitorElement * h_mass_Glo_pass_forward
Definition: ZCounting.h:168
MonitorElement * h_mass_Glo_fail_forward
Definition: ZCounting.h:170
bool isElectronTrigger(ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits)
Definition: ZCounting.cc:917
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
double IsoCut_
Definition: ZCounting.h:114
edm::InputTag fRhoTag
Definition: ZCounting.h:98
edm::InputTag fBeamspotTag
Definition: ZCounting.h:101
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:164
double PtCutL1_
Definition: ZCounting.h:116
double pt() const final
transverse momentum
std::string fPVName
Definition: ZCounting.h:79
bool isMuon(const Candidate &part)
Definition: pdgIdUtils.h:9
double LumiMax_
Definition: ZCounting.h:127
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
std::string fSCName
Definition: ZCounting.h:95
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string fTrackName
Definition: ZCounting.h:89
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:163
T const * product() const
Definition: Handle.h:70
bool is_glob(std::string const &pattern)
Definition: RegexMatch.cc:17
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:85
edm::InputTag fHLTObjTag
Definition: ZCounting.h:75
MuonIsoTypes IsoType_
Definition: ZCounting.h:113
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool passMuonID(const reco::Muon &muon, const reco::Vertex &vtx, const MuonIDTypes &idType)
Definition: ZCounting.cc:878
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:94
bool isElectronTriggerObj(ZCountingTrigger::TTrigger triggerMenu, TriggerObjects hltMatchBits)
Definition: ZCounting.cc:921
std::string fMuonName
Definition: ZCounting.h:83
edm::InputTag fConversionTag
Definition: ZCounting.h:104
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:158
Log< level::Error, false > LogError
ElectronIdentifier EleID_
Definition: ZCounting.h:154
const float ELE_ETA_CRACK_HIGH
Definition: ZCounting.h:152
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:145
MonitorElement * h_ee_mass_HLT_fail_central
Definition: ZCounting.h:185
MonitorElement * h_mass_yield_Z
Definition: ZCounting.h:174
MonitorElement * h_mass_Glo_pass_central
Definition: ZCounting.h:167
double LumiMin_
Definition: ZCounting.h:126
std::bitset< kNTrigObjectBit > TriggerObjects
Definition: TriggerDefs.h:9
edm::InputTag fHLTTag
Definition: ZCounting.h:76
MonitorElement * h_ee_mass_HLT_pass_forward
Definition: ZCounting.h:186
bool isLooseMuon(const reco::Muon &)
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:90
void Fill(long long x)
std::string IDTypestr_
Definition: ZCounting.h:110
bool isCustomTightMuon(const reco::Muon &muon)
Definition: ZCounting.cc:865
const double MUON_MASS
Definition: ZCounting.h:138
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:84
void analyzeMuons(edm::Event const &e, edm::EventSetup const &eSetup)
Definition: ZCounting.cc:316
double VtxRhoCut_
Definition: ZCounting.h:136
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:74
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:148
const std::string ELE_ID_WP
Definition: ZCounting.h:150
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:80
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:176
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
int PVBin_
Definition: ZCounting.h:129
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:144
double VtxNTracksFitCut_
Definition: ZCounting.h:133
MonitorElement * h_npv_yield_Z
Definition: ZCounting.h:173
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
bool passID(const reco::GsfElectronPtr &ele, edm::Handle< reco::BeamSpot > beamspot, edm::Handle< reco::ConversionCollection > conversions)
bool isMuonTrigger(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits)
Definition: ZCounting.cc:846
void initHLT(const edm::TriggerResults &, const edm::TriggerNames &)
Definition: ZCounting.cc:818
def pv(vc)
Definition: MetAnalyzer.py:7
MonitorElement * h_ee_yield_Z_eeee
Definition: ZCounting.h:191
MonitorElement * h_ee_yield_Z_ebee
Definition: ZCounting.h:190
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ZCounting.cc:140
double VtxNdofCut_
Definition: ZCounting.h:134
MonitorElement * h_ee_mass_HLT_fail_forward
Definition: ZCounting.h:187
MuonIDTypes IDType_
Definition: ZCounting.h:112
bool ele_tag_selection(double pt, double abseta)
Definition: ZCounting.cc:805
MonitorElement * h_npv
Definition: ZCounting.h:172
double PtCutL2_
Definition: ZCounting.h:117
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: ZCounting.cc:310
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:147
const double MUON_BOUND
Definition: ZCounting.h:139
const float ELE_ETA_CRACK_LOW
Definition: ZCounting.h:151
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:77
MonitorElement * h_ee_mass_id_pass_forward
Definition: ZCounting.h:181
Log< level::Info, false > LogInfo
MonitorElement * h_ee_mass_HLT_pass_central
Definition: ZCounting.h:184
def ls(path, rec=False)
Definition: eostools.py:349
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:165
void setRho(double rho)
MonitorElement * h_ee_yield_Z_ebeb
Definition: ZCounting.h:189
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:157
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:146
int MassBin_
Definition: ZCounting.h:121
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
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:105
int LumiBin_
Definition: ZCounting.h:125
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:78
~ZCounting() override
Definition: ZCounting.cc:126
bool ele_probe_selection(double pt, double abseta)
Definition: ZCounting.cc:796
MonitorElement * h_ee_mass_id_pass_central
Definition: ZCounting.h:179
std::string fElectronName
Definition: ZCounting.h:93
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:160
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const &regexp)
Definition: RegexMatch.cc:26
bool passObj(const std::string &iName, const std::string &iObjName, const TriggerObjects &iTrigObj) const
Definition: TTrigger.cc:74
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: ZCounting.cc:131
HLT enums.
double EtaCutL1_
Definition: ZCounting.h:118
bool passMuonIso(const reco::Muon &muon, const MuonIsoTypes &isoType, const float isoCut)
Definition: ZCounting.cc:897
void setID(std::string ID)
MonitorElement * h_ee_mass_id_fail_forward
Definition: ZCounting.h:182
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:99
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:175
std::vector< std::string > fMuonHLTObjectNames
Definition: ZCounting.h:86
MonitorElement * h_ee_mass_id_fail_central
Definition: ZCounting.h:180
double MassMax_
Definition: ZCounting.h:123
void analyzeElectrons(edm::Event const &e, edm::EventSetup const &eSetup)
Definition: ZCounting.cc:578
const float ELECTRON_MASS
Definition: ZCounting.h:141
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
double PVMax_
Definition: ZCounting.h:131
MonitorElement * h_mass_Glo_fail_central
Definition: ZCounting.h:169
Log< level::Warning, false > LogWarning
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
double MassMin_
Definition: ZCounting.h:122
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:102
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:162
double phi() const final
momentum azimuthal angle
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:143
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:108
std::string IsoTypestr_
Definition: ZCounting.h:111
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:96
double EtaCutL2_
Definition: ZCounting.h:119
double PVMin_
Definition: ZCounting.h:130
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:159
bool isMuonTriggerObj(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits)
Definition: ZCounting.cc:855
Definition: Run.h:45
bool pass(const std::string &iName, const TriggerBits &iTrig) const
Definition: TTrigger.cc:65
int charge() const final
electric charge
double VtxAbsZCut_
Definition: ZCounting.h:135
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
double eta() const final
momentum pseudorapidity