CMS 3D CMS Logo

StudyHLT.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: IsolatedParticles
4 // Class: StudyHLT
5 //
13 //
14 // Original Author: Sunanda Banerjee
15 // Created: Thu Mar 4 18:52:02 CST 2011
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <string>
22 
23 // Root objects
24 #include "TH1.h"
25 #include "TH2.h"
26 #include "TTree.h"
27 
28 // user include files
35 
38 
57 
66 
74 
81 
82 class StudyHLT : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
83 public:
84  explicit StudyHLT(const edm::ParameterSet&);
85  ~StudyHLT() override {}
86 
87  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
88 
89 private:
90  void analyze(edm::Event const&, edm::EventSetup const&) override;
91  void beginJob() override;
92  void beginRun(edm::Run const&, edm::EventSetup const&) override;
93  void endRun(edm::Run const&, edm::EventSetup const&) override;
96 
97  void clear();
98  void fillTrack(int, double, double, double, double);
99  void fillIsolation(int, double, double, double);
100  void fillEnergy(int, int, double, double, double, double, double);
103 
104  // ----------member data ---------------------------
105  static const int nPBin_ = 15, nEtaBin_ = 4, nPVBin_ = 4;
106  static const int nGen_ = (nPVBin_ + 12);
109  const int verbosity_;
110  const std::vector<std::string> trigNames_, newNames_;
112  const double minTrackP_, maxTrackEta_;
113  const double tMinE_, tMaxE_, tMinH_, tMaxH_;
115  const std::vector<double> puWeights_;
118  std::vector<std::string> HLTNames_;
120 
131 
134  TH2I* h_nHLTvsRN;
135  std::vector<TH1I*> h_HLTAccepts;
136  TH1D *h_p[nGen_ + 2], *h_pt[nGen_ + 2], *h_counter[8];
137  TH1D *h_eta[nGen_ + 2], *h_phi[nGen_ + 2], *h_h_pNew[8];
138  TH1I* h_ntrk[2];
139  TH1D *h_maxNearP[2], *h_ene1[2], *h_ene2[2], *h_ediff[2];
140  TH1D* h_energy[nPVBin_ + 8][nPBin_][nEtaBin_][6];
141  TTree* tree_;
143  double pBin_[nPBin_ + 1];
146  std::vector<std::string> tr_TrigName;
147  std::vector<double> tr_TrkPt, tr_TrkP, tr_TrkEta, tr_TrkPhi;
148  std::vector<double> tr_MaxNearP31X31, tr_MaxNearHcalP7x7;
149  std::vector<double> tr_H3x3, tr_H5x5, tr_H7x7;
150  std::vector<double> tr_FE7x7P, tr_FE11x11P, tr_FE15x15P;
151  std::vector<bool> tr_SE7x7P, tr_SE11x11P, tr_SE15x15P;
152  std::vector<int> tr_iEta, tr_TrkID;
153 };
154 
156  : verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)),
157  trigNames_(iConfig.getUntrackedParameter<std::vector<std::string> >("triggers")),
158  newNames_(iConfig.getUntrackedParameter<std::vector<std::string> >("newNames")),
159  theTrackQuality_(iConfig.getUntrackedParameter<std::string>("trackQuality", "highPurity")),
160  minTrackP_(iConfig.getUntrackedParameter<double>("minTrackP", 1.0)),
161  maxTrackEta_(iConfig.getUntrackedParameter<double>("maxTrackEta", 2.5)),
162  tMinE_(iConfig.getUntrackedParameter<double>("timeMinCutECAL", -500.)),
163  tMaxE_(iConfig.getUntrackedParameter<double>("timeMaxCutECAL", 500.)),
164  tMinH_(iConfig.getUntrackedParameter<double>("timeMinCutHCAL", -500.)),
165  tMaxH_(iConfig.getUntrackedParameter<double>("timeMaxCutHCAL", 500.)),
166  isItAOD_(iConfig.getUntrackedParameter<bool>("isItAOD", false)),
167  vetoTrigger_(iConfig.getUntrackedParameter<bool>("vetoTrigger", false)),
168  doTree_(iConfig.getUntrackedParameter<bool>("doTree", false)),
169  puWeights_(iConfig.getUntrackedParameter<std::vector<double> >("puWeights")),
170  triggerEvent_(edm::InputTag("hltTriggerSummaryAOD", "", "HLT")),
171  theTriggerResultsLabel_(edm::InputTag("TriggerResults", "", "HLT")),
172  nRun_(0) {
173  usesResource(TFileService::kSharedResource);
174 
176  selectionParameters_.minPt = iConfig.getUntrackedParameter<double>("minTrackPt", 10.0);
178  selectionParameters_.maxDxyPV = iConfig.getUntrackedParameter<double>("maxDxyPV", 0.2);
179  selectionParameters_.maxDzPV = iConfig.getUntrackedParameter<double>("maxDzPV", 5.0);
180  selectionParameters_.maxChi2 = iConfig.getUntrackedParameter<double>("maxChi2", 5.0);
181  selectionParameters_.maxDpOverP = iConfig.getUntrackedParameter<double>("maxDpOverP", 0.1);
182  selectionParameters_.minOuterHit = iConfig.getUntrackedParameter<int>("minOuterHit", 4);
183  selectionParameters_.minLayerCrossed = iConfig.getUntrackedParameter<int>("minLayerCrossed", 8);
184  selectionParameters_.maxInMiss = iConfig.getUntrackedParameter<int>("maxInMiss", 0);
185  selectionParameters_.maxOutMiss = iConfig.getUntrackedParameter<int>("maxOutMiss", 0);
186 
187  // define tokens for access
188  tok_lumi = consumes<LumiDetails, edm::InLumi>(edm::InputTag("lumiProducer"));
189  tok_trigEvt = consumes<trigger::TriggerEvent>(triggerEvent_);
190  tok_trigRes = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
191  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
192  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
193  tok_parts_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("particleSource"));
194 
195  if (isItAOD_) {
196  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
197  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
198  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
199  } else {
200  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
201  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
202  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
203  }
204  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
205 
206  edm::LogInfo("IsoTrack") << "Verbosity " << verbosity_ << " with " << trigNames_.size() << " triggers:";
207  for (unsigned int k = 0; k < trigNames_.size(); ++k)
208  edm::LogInfo("IsoTrack") << " [" << k << "] " << trigNames_[k];
209  edm::LogInfo("IsoTrack") << "TrackQuality " << theTrackQuality_ << " Minpt " << selectionParameters_.minPt
210  << " maxDxy " << selectionParameters_.maxDxyPV << " maxDz " << selectionParameters_.maxDzPV
211  << " maxChi2 " << selectionParameters_.maxChi2 << " maxDp/p "
213  << " minLayerCrossed " << selectionParameters_.minLayerCrossed << " maxInMiss "
215  << " minTrackP " << minTrackP_ << " maxTrackEta " << maxTrackEta_ << " tMinE_ " << tMinE_
216  << " tMaxE " << tMaxE_ << " tMinH_ " << tMinH_ << " tMaxH_ " << tMaxH_ << " isItAOD "
217  << isItAOD_ << " doTree " << doTree_ << " vetoTrigger " << vetoTrigger_;
218 
219  double pBins[nPBin_ + 1] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 20.0, 25.0, 30.0, 40.0, 60.0, 100.0};
220  int etaBins[nEtaBin_ + 1] = {1, 7, 13, 17, 23};
221  int pvBins[nPVBin_ + 1] = {1, 2, 3, 5, 100};
222  for (int i = 0; i <= nPBin_; ++i)
223  pBin_[i] = pBins[i];
224  for (int i = 0; i <= nEtaBin_; ++i)
225  etaBin_[i] = etaBins[i];
226  for (int i = 0; i <= nPVBin_; ++i)
227  pvBin_[i] = pvBins[i];
228 
229  firstEvent_ = true;
230  changed_ = false;
231 }
232 
234  std::vector<std::string> trig;
235  std::vector<double> weights;
236  std::vector<std::string> newNames = {"HLT", "PixelTracks_Multiplicity", "HLT_Physics_", "HLT_JetE", "HLT_ZeroBias"};
238  desc.add<edm::InputTag>("particleSource", edm::InputTag("genParticles"));
239  desc.addUntracked<int>("verbosity", 0);
240  desc.addUntracked<std::vector<std::string> >("triggers", trig);
241  desc.addUntracked<std::vector<std::string> >("newNames", newNames);
242  desc.addUntracked<std::string>("trackQuality", "highPurity");
243  desc.addUntracked<double>("minTrackPt", 1.0);
244  desc.addUntracked<double>("maxDxyPV", 0.02);
245  desc.addUntracked<double>("maxDzPV", 0.02);
246  desc.addUntracked<double>("maxChi2", 5.0);
247  desc.addUntracked<double>("maxDpOverP", 0.1);
248  desc.addUntracked<int>("minOuterHit", 4);
249  desc.addUntracked<int>("minLayerCrossed", 8);
250  desc.addUntracked<int>("maxInMiss", 0);
251  desc.addUntracked<int>("maxOutMiss", 0);
252  desc.addUntracked<double>("minTrackP", 1.0);
253  desc.addUntracked<double>("maxTrackEta", 2.6);
254  desc.addUntracked<double>("timeMinCutECAL", -500.0);
255  desc.addUntracked<double>("timeMaxCutECAL", 500.0);
256  desc.addUntracked<double>("timeMinCutHCAL", -500.0);
257  desc.addUntracked<double>("timeMaxCutHCAL", 500.0);
258  desc.addUntracked<bool>("isItAOD", false);
259  desc.addUntracked<bool>("vetoTrigger", false);
260  desc.addUntracked<bool>("doTree", false);
261  desc.addUntracked<std::vector<double> >("puWeights", weights);
262  descriptions.add("studyHLT", desc);
263 }
264 
265 void StudyHLT::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) {
266  clear();
267  int counter0[1000] = {0};
268  int counter1[1000] = {0};
269  int counter2[1000] = {0};
270  int counter3[1000] = {0};
271  int counter4[1000] = {0};
272  int counter5[1000] = {0};
273  int counter6[1000] = {0};
274  int counter7[1000] = {0};
275  if (verbosity_ > 0)
276  edm::LogInfo("IsoTrack") << "Event starts====================================";
277  int RunNo = iEvent.id().run();
278  int EvtNo = iEvent.id().event();
279  int Lumi = iEvent.luminosityBlock();
280  int Bunch = iEvent.bunchCrossing();
281 
282  std::vector<int> newAccept(newNames_.size() + 1, 0);
283  float mybxlumi = -1;
284  /*
285  edm::Handle<LumiDetails> Lumid;
286  iEvent.getLuminosityBlock().getByToken(tok_lumi,Lumid);
287  if (Lumid.isValid()) mybxlumi=Lumid->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
288  */
289  if (verbosity_ > 0)
290  edm::LogInfo("IsoTrack") << "RunNo " << RunNo << " EvtNo " << EvtNo << " Lumi " << Lumi << " Bunch " << Bunch
291  << " mybxlumi " << mybxlumi;
292 
294  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
295  iEvent.getByToken(tok_trigEvt, triggerEventHandle);
296 
297  bool ok(false);
298  if (!triggerEventHandle.isValid()) {
299  edm::LogWarning("IsoTrack") << "Error! Can't get the product " << triggerEvent_.label();
300  } else {
301  triggerEvent = *(triggerEventHandle.product());
302 
305  iEvent.getByToken(tok_trigRes, triggerResults);
306 
307  if (triggerResults.isValid()) {
308  h_nHLT->Fill(triggerResults->size());
309  h_nHLTvsRN->Fill(RunNo, triggerResults->size());
310 
311  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
312  const std::vector<std::string>& triggerNames_ = triggerNames.triggerNames();
313  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
314  int ipos = -1;
315  std::string newtriggerName = truncate_str(triggerNames_[iHLT]);
316  for (unsigned int i = 0; i < HLTNames_.size(); ++i) {
317  if (newtriggerName == HLTNames_[i]) {
318  ipos = i + 1;
319  break;
320  }
321  }
322  if (ipos < 0) {
323  HLTNames_.push_back(newtriggerName);
324  ipos = (int)(HLTNames_.size());
325  if (ipos <= h_HLTAccept->GetNbinsX())
326  h_HLTAccept->GetXaxis()->SetBinLabel(ipos, newtriggerName.c_str());
327  }
328  if ((int)(iHLT + 1) > h_HLTAccepts[nRun_]->GetNbinsX()) {
329  edm::LogInfo("IsoTrack") << "Wrong trigger " << RunNo << " Event " << EvtNo << " Hlt " << iHLT;
330  } else {
331  if (firstEvent_)
332  h_HLTAccepts[nRun_]->GetXaxis()->SetBinLabel(iHLT + 1, newtriggerName.c_str());
333  }
334  int hlt = triggerResults->accept(iHLT);
335  if (hlt) {
336  h_HLTAccepts[nRun_]->Fill(iHLT + 1);
337  h_HLTAccept->Fill(ipos);
338  }
339  if (trigNames_.empty()) {
340  ok = true;
341  } else {
342  for (unsigned int i = 0; i < trigNames_.size(); ++i) {
343  if (newtriggerName.find(trigNames_[i]) != std::string::npos) {
344  if (verbosity_ % 10 > 0)
345  edm::LogInfo("IsoTrack") << newtriggerName;
346  if (hlt > 0) {
347  ok = true;
348  tr_TrigName.push_back(newtriggerName);
349  }
350  }
351  }
352  if (vetoTrigger_)
353  ok = !ok;
354  for (unsigned int i = 0; i < newNames_.size(); ++i) {
355  if (newtriggerName.find(newNames_[i]) != std::string::npos) {
356  if (verbosity_ % 10 > 0)
357  edm::LogInfo("IsoTrack") << "[" << i << "] " << newNames_[i] << " : " << newtriggerName;
358  if (hlt > 0)
359  newAccept[i] = 1;
360  }
361  }
362  }
363  }
364  int iflg(0), indx(1);
365  for (unsigned int i = 0; i < newNames_.size(); ++i) {
366  iflg += (indx * newAccept[i]);
367  indx *= 2;
368  }
369  h_HLTCorr->Fill(iflg);
370  }
371  }
372 
373  //Look at the tracks
374  if (ok) {
375  h_goodRun->Fill(RunNo);
376  tr_goodRun = RunNo;
377  // get handles to calogeometry and calotopology
379  iSetup.get<CaloGeometryRecord>().get(pG);
380  const CaloGeometry* geo = pG.product();
381 
382  edm::ESHandle<CaloTopology> theCaloTopology;
383  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
384  const CaloTopology* caloTopology = theCaloTopology.product();
385 
387  iSetup.get<HcalRecNumberingRecord>().get(htopo);
388  const HcalTopology* theHBHETopology = htopo.product();
389 
391  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
392  const MagneticField* bField = bFieldH.product();
393 
395  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
396  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
397 
399  iEvent.getByToken(tok_recVtx_, recVtxs);
400  int ntrk(0), ngoodPV(0), nPV(-1);
401  int nvtxs = (int)(recVtxs->size());
402  for (int ind = 0; ind < nvtxs; ind++) {
403  if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > 4)
404  ngoodPV++;
405  }
406  for (int i = 0; i < nPVBin_; ++i) {
407  if (ngoodPV >= pvBin_[i] && ngoodPV < pvBin_[i + 1]) {
408  nPV = i;
409  break;
410  }
411  }
412 
413  tr_eventWeight = 1.0;
415  iEvent.getByToken(tok_ew_, genEventInfo);
416  if (genEventInfo.isValid())
417  tr_eventWeight = genEventInfo->weight();
418 
419  if ((verbosity_ / 10) % 10 > 0)
420  edm::LogInfo("IsoTrack") << "Number of vertices: " << nvtxs << " Good " << ngoodPV << " Bin " << nPV
421  << " Event weight " << tr_eventWeight;
422  h_numberPV->Fill(nvtxs, tr_eventWeight);
423  h_goodPV->Fill(ngoodPV, tr_eventWeight);
424  tr_goodPV = ngoodPV;
425 
426  if (!puWeights_.empty()) {
427  int npbin = h_goodPV->FindBin(ngoodPV);
428  if (npbin > 0 && npbin <= (int)(puWeights_.size()))
429  tr_eventWeight *= puWeights_[npbin - 1];
430  else
431  tr_eventWeight = 0;
432  }
433 
435  iEvent.getByToken(tok_genTrack_, trkCollection);
436 
437  //=== genParticle information
439  iEvent.getByToken(tok_parts_, genParticles);
440  if (genParticles.isValid()) {
441  for (const auto& p : (reco::GenParticleCollection)(*genParticles)) {
442  double pt1 = p.momentum().Rho();
443  double p1 = p.momentum().R();
444  double eta1 = p.momentum().Eta();
445  double phi1 = p.momentum().Phi();
446  fillTrack(nGen_, pt1, p1, eta1, phi1);
447  bool match(false);
448  double phi2(phi1);
449  if (phi2 < 0)
450  phi2 += 2.0 * M_PI;
451  for (const auto& trk : (reco::TrackCollection)(*trkCollection)) {
452  bool quality = trk.quality(selectionParameters_.minQuality);
453  if (quality) {
454  double dEta = trk.eta() - eta1;
455  double phi0 = trk.phi();
456  if (phi0 < 0)
457  phi0 += 2.0 * M_PI;
458  double dPhi = phi0 - phi2;
459  if (dPhi > M_PI)
460  dPhi -= 2. * M_PI;
461  else if (dPhi < -M_PI)
462  dPhi += 2. * M_PI;
463  double dR = sqrt(dEta * dEta + dPhi * dPhi);
464  if (dR < 0.01) {
465  match = true;
466  break;
467  }
468  }
469  }
470  if (match)
471  fillTrack(nGen_ + 1, pt1, p1, eta1, phi1);
472  }
473  }
474 
475  reco::TrackCollection::const_iterator trkItr;
476  for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr, ++ntrk) {
477  const reco::Track* pTrack = &(*trkItr);
478  double pt1 = pTrack->pt();
479  double p1 = pTrack->p();
480  double eta1 = pTrack->momentum().eta();
481  double phi1 = pTrack->momentum().phi();
483  fillTrack(0, pt1, p1, eta1, phi1);
484  if (quality)
485  fillTrack(1, pt1, p1, eta1, phi1);
486  if (p1 < 1000) {
487  h_h_pNew[0]->Fill(p1);
488  ++counter0[(int)(p1)];
489  }
490  }
491  h_ntrk[0]->Fill(ntrk, tr_eventWeight);
492 
493  std::vector<spr::propagatedTrackID> trkCaloDets;
494  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDets, ((verbosity_ / 100) % 10 > 0));
495  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
496  for (trkDetItr = trkCaloDets.begin(), ntrk = 0; trkDetItr != trkCaloDets.end(); trkDetItr++, ntrk++) {
497  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
498  double pt1 = pTrack->pt();
499  double p1 = pTrack->p();
500  double eta1 = pTrack->momentum().eta();
501  double phi1 = pTrack->momentum().phi();
502  if ((verbosity_ / 10) % 10 > 0)
503  edm::LogInfo("IsoTrack") << "track: p " << p1 << " pt " << pt1 << " eta " << eta1 << " phi " << phi1
504  << " okEcal " << trkDetItr->okECAL;
505  fillTrack(2, pt1, p1, eta1, phi1);
506  if (pt1 > minTrackP_ && std::abs(eta1) < maxTrackEta_ && trkDetItr->okECAL) {
507  fillTrack(3, pt1, p1, eta1, phi1);
508  double maxNearP31x31 =
509  spr::chargeIsolationEcal(ntrk, trkCaloDets, geo, caloTopology, 15, 15, ((verbosity_ / 1000) % 10 > 0));
510 
512  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
513 
514  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
515  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
516  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
517  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
518  // get ECal Tranverse Profile
519  std::pair<double, bool> e7x7P, e11x11P, e15x15P;
520  const DetId isoCell = trkDetItr->detIdECAL;
521  e7x7P = spr::eECALmatrix(isoCell,
522  barrelRecHitsHandle,
523  endcapRecHitsHandle,
524  *theEcalChStatus,
525  geo,
526  caloTopology,
527  sevlv.product(),
528  3,
529  3,
530  0.030,
531  0.150,
532  tMinE_,
533  tMaxE_,
534  ((verbosity_ / 10000) % 10 > 0));
535  e11x11P = spr::eECALmatrix(isoCell,
536  barrelRecHitsHandle,
537  endcapRecHitsHandle,
538  *theEcalChStatus,
539  geo,
540  caloTopology,
541  sevlv.product(),
542  5,
543  5,
544  0.030,
545  0.150,
546  tMinE_,
547  tMaxE_,
548  ((verbosity_ / 10000) % 10 > 0));
549  e15x15P = spr::eECALmatrix(isoCell,
550  barrelRecHitsHandle,
551  endcapRecHitsHandle,
552  *theEcalChStatus,
553  geo,
554  caloTopology,
555  sevlv.product(),
556  7,
557  7,
558  0.030,
559  0.150,
560  tMinE_,
561  tMaxE_,
562  ((verbosity_ / 10000) % 10 > 0));
563 
564  double maxNearHcalP7x7 =
565  spr::chargeIsolationHcal(ntrk, trkCaloDets, theHBHETopology, 3, 3, ((verbosity_ / 1000) % 10 > 0));
566  int ieta(0);
567  double h3x3(0), h5x5(0), h7x7(0);
568  fillIsolation(0, maxNearP31x31, e11x11P.first, e15x15P.first);
569  if ((verbosity_ / 10) % 10 > 0)
570  edm::LogInfo("IsoTrack") << "Accepted Tracks reaching Ecal maxNearP31x31 " << maxNearP31x31 << " e11x11P "
571  << e11x11P.first << " e15x15P " << e15x15P.first << " okHCAL " << trkDetItr->okHCAL;
572 
573  int trackID = trackPID(pTrack, genParticles);
574  if (trkDetItr->okHCAL) {
576  iEvent.getByToken(tok_hbhe_, hbhe);
577  const DetId ClosestCell(trkDetItr->detIdHCAL);
578  ieta = ((HcalDetId)(ClosestCell)).ietaAbs();
579  h3x3 = spr::eHCALmatrix(theHBHETopology,
580  ClosestCell,
581  hbhe,
582  1,
583  1,
584  false,
585  true,
586  0.7,
587  0.8,
588  -100.0,
589  -100.0,
590  tMinH_,
591  tMaxH_,
592  ((verbosity_ / 10000) % 10 > 0));
593  h5x5 = spr::eHCALmatrix(theHBHETopology,
594  ClosestCell,
595  hbhe,
596  2,
597  2,
598  false,
599  true,
600  0.7,
601  0.8,
602  -100.0,
603  -100.0,
604  tMinH_,
605  tMaxH_,
606  ((verbosity_ / 10000) % 10 > 0));
607  h7x7 = spr::eHCALmatrix(theHBHETopology,
608  ClosestCell,
609  hbhe,
610  3,
611  3,
612  false,
613  true,
614  0.7,
615  0.8,
616  -100.0,
617  -100.0,
618  tMinH_,
619  tMaxH_,
620  ((verbosity_ / 10000) % 10 > 0));
621  fillIsolation(1, maxNearHcalP7x7, h5x5, h7x7);
622  if ((verbosity_ / 10) % 10 > 0)
623  edm::LogInfo("IsoTrack") << "Tracks Reaching Hcal maxNearHcalP7x7/h5x5/h7x7 " << maxNearHcalP7x7 << "/"
624  << h5x5 << "/" << h7x7;
625  tr_TrkPt.push_back(pt1);
626  tr_TrkP.push_back(p1);
627  tr_TrkEta.push_back(eta1);
628  tr_TrkPhi.push_back(phi1);
629  tr_TrkID.push_back(trackID);
630  tr_MaxNearP31X31.push_back(maxNearP31x31);
631  tr_MaxNearHcalP7x7.push_back(maxNearHcalP7x7);
632  tr_FE7x7P.push_back(e7x7P.first);
633  tr_FE11x11P.push_back(e11x11P.first);
634  tr_FE15x15P.push_back(e15x15P.first);
635  tr_SE7x7P.push_back(e7x7P.second);
636  tr_SE11x11P.push_back(e11x11P.second);
637  tr_SE15x15P.push_back(e15x15P.second);
638  tr_iEta.push_back(ieta);
639  tr_H3x3.push_back(h3x3);
640  tr_H5x5.push_back(h5x5);
641  tr_H7x7.push_back(h7x7);
642 
643  if (maxNearP31x31 < 0) {
644  fillTrack(4, pt1, p1, eta1, phi1);
645  fillEnergy(0, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
646  if (maxNearHcalP7x7 < 0) {
647  fillTrack(5, pt1, p1, eta1, phi1);
648  fillEnergy(1, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
649  if ((e11x11P.second) && (e15x15P.second) && (e15x15P.first - e11x11P.first) < 2.0) {
650  fillTrack(6, pt1, p1, eta1, phi1);
651  fillEnergy(2, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
652  if (h7x7 - h5x5 < 2.0) {
653  fillTrack(7, pt1, p1, eta1, phi1);
654  fillEnergy(3, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
655  if (nPV >= 0) {
656  fillTrack(nPV + 8, pt1, p1, eta1, phi1);
657  fillEnergy(nPV + 4, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
658  }
659  if (trackID > 0) {
660  fillTrack(nPVBin_ + trackID + 7, pt1, p1, eta1, phi1);
661  fillEnergy(nPVBin_ + trackID + 3, ieta, p1, e7x7P.first, h3x3, e11x11P.first, h5x5);
662  }
663  if (p1 < 1000) {
664  h_h_pNew[7]->Fill(p1);
665  ++counter7[(int)(p1)];
666  }
667  }
668  if (p1 < 1000) {
669  h_h_pNew[6]->Fill(p1);
670  ++counter6[(int)(p1)];
671  }
672  }
673  if (p1 < 1000) {
674  h_h_pNew[5]->Fill(p1);
675  ++counter5[(int)(p1)];
676  }
677  }
678  if (p1 < 1000) {
679  h_h_pNew[4]->Fill(p1);
680  ++counter4[(int)(p1)];
681  }
682  }
683  if (p1 < 1000) {
684  h_h_pNew[3]->Fill(p1);
685  ++counter3[(int)(p1)];
686  }
687  }
688  if (p1 < 1000) {
689  h_h_pNew[2]->Fill(p1);
690  ++counter2[(int)(p1)];
691  }
692  }
693  if (p1 < 1000) {
694  h_h_pNew[1]->Fill(p1);
695  ++counter1[(int)(p1)];
696  }
697  }
698  h_ntrk[1]->Fill(ntrk, tr_eventWeight);
699  if ((!tr_TrkPt.empty()) && doTree_)
700  tree_->Fill();
701  for (int i = 0; i < 1000; ++i) {
702  if (counter0[i])
703  h_counter[0]->Fill(i, counter0[i]);
704  if (counter1[i])
705  h_counter[1]->Fill(i, counter1[i]);
706  if (counter2[i])
707  h_counter[2]->Fill(i, counter2[i]);
708  if (counter3[i])
709  h_counter[3]->Fill(i, counter3[i]);
710  if (counter4[i])
711  h_counter[4]->Fill(i, counter4[i]);
712  if (counter5[i])
713  h_counter[5]->Fill(i, counter5[i]);
714  if (counter6[i])
715  h_counter[6]->Fill(i, counter6[i]);
716  if (counter7[i])
717  h_counter[7]->Fill(i, counter7[i]);
718  }
719  }
720  firstEvent_ = false;
721 }
722 
724  // Book histograms
725  h_nHLT = fs_->make<TH1I>("h_nHLT", "size of trigger Names", 1000, 0, 1000);
726  h_HLTAccept = fs_->make<TH1I>("h_HLTAccept", "HLT Accepts for all runs", 500, 0, 500);
727  for (int i = 1; i <= 500; ++i)
728  h_HLTAccept->GetXaxis()->SetBinLabel(i, " ");
729  h_nHLTvsRN = fs_->make<TH2I>("h_nHLTvsRN", "size of trigger Names vs RunNo", 2168, 190949, 193116, 100, 400, 500);
730  h_HLTCorr = fs_->make<TH1I>("h_HLTCorr", "Correlation among different paths", 100, 0, 100);
731  h_numberPV = fs_->make<TH1I>("h_numberPV", "Number of Primary Vertex", 100, 0, 100);
732  h_goodPV = fs_->make<TH1I>("h_goodPV", "Number of good Primary Vertex", 100, 0, 100);
733  h_goodRun = fs_->make<TH1I>("h_goodRun", "Number of accepted events for Run", 4000, 190000, 1940000);
734  char hname[60], htit[200];
735  std::string CollectionNames[2] = {"Reco", "Propagated"};
736  for (unsigned int i = 0; i < 2; i++) {
737  sprintf(hname, "h_nTrk_%s", CollectionNames[i].c_str());
738  sprintf(htit, "Number of %s tracks", CollectionNames[i].c_str());
739  h_ntrk[i] = fs_->make<TH1I>(hname, htit, 500, 0, 500);
740  }
741  std::string TrkNames[8] = {
742  "All", "Quality", "NoIso", "okEcal", "EcalCharIso", "HcalCharIso", "EcalNeutIso", "HcalNeutIso"};
743  std::string particle[4] = {"Electron", "Pion", "Kaon", "Proton"};
744  for (unsigned int i = 0; i <= nGen_ + 1; i++) {
745  if (i < 8) {
746  sprintf(hname, "h_pt_%s", TrkNames[i].c_str());
747  sprintf(htit, "p_{T} of %s tracks", TrkNames[i].c_str());
748  } else if (i < 8 + nPVBin_) {
749  sprintf(hname, "h_pt_%s_%d", TrkNames[7].c_str(), i - 8);
750  sprintf(htit, "p_{T} of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i - 8], pvBin_[i - 7] - 1);
751  } else if (i >= nGen_) {
752  sprintf(hname, "h_pt_%s_%d", TrkNames[0].c_str(), i - nGen_);
753  sprintf(htit, "p_{T} of %s Generator tracks", TrkNames[0].c_str());
754  } else {
755  sprintf(hname, "h_pt_%s_%s", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
756  sprintf(htit, "p_{T} of %s tracks (%s)", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
757  }
758  h_pt[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
759  h_pt[i]->Sumw2();
760 
761  if (i < 8) {
762  sprintf(hname, "h_p_%s", TrkNames[i].c_str());
763  sprintf(htit, "Momentum of %s tracks", TrkNames[i].c_str());
764  } else if (i < 8 + nPVBin_) {
765  sprintf(hname, "h_p_%s_%d", TrkNames[7].c_str(), i - 8);
766  sprintf(htit, "Momentum of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i - 8], pvBin_[i - 7] - 1);
767  } else if (i >= nGen_) {
768  sprintf(hname, "h_p_%s_%d", TrkNames[0].c_str(), i - nGen_);
769  sprintf(htit, "Momentum of %s Generator tracks", TrkNames[0].c_str());
770  } else {
771  sprintf(hname, "h_p_%s_%s", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
772  sprintf(htit, "Momentum of %s tracks (%s)", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
773  }
774  h_p[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
775  h_p[i]->Sumw2();
776 
777  if (i < 8) {
778  sprintf(hname, "h_eta_%s", TrkNames[i].c_str());
779  sprintf(htit, "Eta of %s tracks", TrkNames[i].c_str());
780  } else if (i < 8 + nPVBin_) {
781  sprintf(hname, "h_eta_%s_%d", TrkNames[7].c_str(), i - 8);
782  sprintf(htit, "Eta of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i - 8], pvBin_[i - 7] - 1);
783  } else if (i >= nGen_) {
784  sprintf(hname, "h_eta_%s_%d", TrkNames[0].c_str(), i - nGen_);
785  sprintf(htit, "Eta of %s Generator tracks", TrkNames[0].c_str());
786  } else {
787  sprintf(hname, "h_eta_%s_%s", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
788  sprintf(htit, "Eta of %s tracks (%s)", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
789  }
790  h_eta[i] = fs_->make<TH1D>(hname, htit, 60, -3.0, 3.0);
791  h_eta[i]->Sumw2();
792 
793  if (i < 8) {
794  sprintf(hname, "h_phi_%s", TrkNames[i].c_str());
795  sprintf(htit, "Phi of %s tracks", TrkNames[i].c_str());
796  } else if (i < 8 + nPVBin_) {
797  sprintf(hname, "h_phi_%s_%d", TrkNames[7].c_str(), i - 8);
798  sprintf(htit, "Phi of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i - 8], pvBin_[i - 7] - 1);
799  } else if (i >= nGen_) {
800  sprintf(hname, "h_phi_%s_%d", TrkNames[0].c_str(), i - nGen_);
801  sprintf(htit, "Phi of %s Generator tracks", TrkNames[0].c_str());
802  } else {
803  sprintf(hname, "h_phi_%s_%s", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
804  sprintf(htit, "Phi of %s tracks (%s)", TrkNames[7].c_str(), particle[i - 8 - nPVBin_].c_str());
805  }
806  h_phi[i] = fs_->make<TH1D>(hname, htit, 100, -3.15, 3.15);
807  h_phi[i]->Sumw2();
808  }
809  std::string IsolationNames[2] = {"Ecal", "Hcal"};
810  for (unsigned int i = 0; i < 2; i++) {
811  sprintf(hname, "h_maxNearP_%s", IsolationNames[i].c_str());
812  sprintf(htit, "Energy in ChargeIso region for %s", IsolationNames[i].c_str());
813  h_maxNearP[i] = fs_->make<TH1D>(hname, htit, 120, -1.5, 10.5);
814  h_maxNearP[i]->Sumw2();
815 
816  sprintf(hname, "h_ene1_%s", IsolationNames[i].c_str());
817  sprintf(htit, "Energy in smaller cone for %s", IsolationNames[i].c_str());
818  h_ene1[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
819  h_ene1[i]->Sumw2();
820 
821  sprintf(hname, "h_ene2_%s", IsolationNames[i].c_str());
822  sprintf(htit, "Energy in bigger cone for %s", IsolationNames[i].c_str());
823  h_ene2[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
824  h_ene2[i]->Sumw2();
825 
826  sprintf(hname, "h_ediff_%s", IsolationNames[i].c_str());
827  sprintf(htit, "Energy in NeutralIso region for %s", IsolationNames[i].c_str());
828  h_ediff[i] = fs_->make<TH1D>(hname, htit, 100, -0.5, 19.5);
829  h_ediff[i]->Sumw2();
830  }
831  std::string energyNames[6] = {
832  "E_{7x7}", "H_{3x3}", "(E_{7x7}+H_{3x3})", "E_{11x11}", "H_{5x5}", "{E_{11x11}+H_{5x5})"};
833  for (int i = 0; i < 4 + nPVBin_ + 4; ++i) {
834  for (int ip = 0; ip < nPBin_; ++ip) {
835  for (int ie = 0; ie < nEtaBin_; ++ie) {
836  for (int j = 0; j < 6; ++j) {
837  sprintf(hname, "h_energy_%d_%d_%d_%d", i, ip, ie, j);
838  if (i < 4) {
839  sprintf(htit,
840  "%s/p (p=%4.1f:%4.1f; i#eta=%d:%d) for tracks with %s",
841  energyNames[j].c_str(),
842  pBin_[ip],
843  pBin_[ip + 1],
844  etaBin_[ie],
845  (etaBin_[ie + 1] - 1),
846  TrkNames[i + 4].c_str());
847  } else if (i < 4 + nPVBin_) {
848  sprintf(htit,
849  "%s/p (p=%4.1f:%4.1f, i#eta=%d:%d, PV=%d:%d) for tracks with %s",
850  energyNames[j].c_str(),
851  pBin_[ip],
852  pBin_[ip + 1],
853  etaBin_[ie],
854  (etaBin_[ie + 1] - 1),
855  pvBin_[i - 4],
856  pvBin_[i - 3],
857  TrkNames[7].c_str());
858  } else {
859  sprintf(htit,
860  "%s/p (p=%4.1f:%4.1f, i#eta=%d:%d %s) for tracks with %s",
861  energyNames[j].c_str(),
862  pBin_[ip],
863  pBin_[ip + 1],
864  etaBin_[ie],
865  (etaBin_[ie + 1] - 1),
866  particle[i - 4 - nPVBin_].c_str(),
867  TrkNames[7].c_str());
868  }
869  h_energy[i][ip][ie][j] = fs_->make<TH1D>(hname, htit, 5000, -0.1, 49.9);
870  h_energy[i][ip][ie][j]->Sumw2();
871  }
872  }
873  }
874  }
875 
876  for (int i = 0; i < 8; ++i) {
877  sprintf(hname, "counter%d", i);
878  sprintf(htit, "Counter with cut %d", i);
879  h_counter[i] = fs_->make<TH1D>(hname, htit, 1000, 0, 1000);
880  sprintf(hname, "h_pTNew%d", i);
881  sprintf(htit, "Track momentum with cut %d", i);
882  h_h_pNew[i] = fs_->make<TH1D>(hname, htit, 1000, 0, 1000);
883  }
884 
885  // Now the tree
886  if (doTree_) {
887  tree_ = fs_->make<TTree>("testTree", "new HLT Tree");
888  tree_->Branch("tr_goodRun", &tr_goodRun, "tr_goodRun/I");
889  tree_->Branch("tr_goodPV", &tr_goodPV, "tr_goodPV/I");
890  tree_->Branch("tr_eventWeight", &tr_eventWeight, "tr_eventWeight/D");
891  tree_->Branch("tr_tr_TrigName", &tr_TrigName);
892  tree_->Branch("tr_TrkPt", &tr_TrkPt);
893  tree_->Branch("tr_TrkP", &tr_TrkP);
894  tree_->Branch("tr_TrkEta", &tr_TrkEta);
895  tree_->Branch("tr_TrkPhi", &tr_TrkPhi);
896  tree_->Branch("tr_TrkID", &tr_TrkID);
897  tree_->Branch("tr_MaxNearP31X31", &tr_MaxNearP31X31);
898  tree_->Branch("tr_MaxNearHcalP7x7", &tr_MaxNearHcalP7x7);
899  tree_->Branch("tr_FE7x7P", &tr_FE7x7P);
900  tree_->Branch("tr_FE11x11P", &tr_FE11x11P);
901  tree_->Branch("tr_FE15x15P", &tr_FE15x15P);
902  tree_->Branch("tr_SE7x7P", &tr_SE7x7P);
903  tree_->Branch("tr_SE11x11P", &tr_SE11x11P);
904  tree_->Branch("tr_SE15x15P", &tr_SE15x15P);
905  tree_->Branch("tr_H3x3", &tr_H3x3);
906  tree_->Branch("tr_H5x5", &tr_H5x5);
907  tree_->Branch("tr_H7x7", &tr_H7x7);
908  tree_->Branch("tr_iEta", &tr_iEta);
909  }
910 }
911 
912 // ------------ method called when starting to processes a run ------------
913 void StudyHLT::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
914  char hname[100], htit[400];
915  edm::LogInfo("IsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init "
916  << hltConfig_.init(iRun, iSetup, "HLT", changed_);
917  sprintf(hname, "h_HLTAccepts_%i", iRun.run());
918  sprintf(htit, "HLT Accepts for Run No %i", iRun.run());
919  TH1I* hnew = fs_->make<TH1I>(hname, htit, 500, 0, 500);
920  for (int i = 1; i <= 500; ++i)
921  hnew->GetXaxis()->SetBinLabel(i, " ");
922  h_HLTAccepts.push_back(hnew);
923  edm::LogInfo("IsoTrack") << "beginrun " << iRun.run();
924  firstEvent_ = true;
925  changed_ = false;
926 }
927 
928 // ------------ method called when ending the processing of a run ------------
929 void StudyHLT::endRun(edm::Run const& iRun, edm::EventSetup const&) {
930  ++nRun_;
931  edm::LogInfo("IsoTrack") << "endrun[" << nRun_ << "] " << iRun.run();
932 }
933 
935  tr_TrigName.clear();
936  tr_TrkPt.clear();
937  tr_TrkP.clear();
938  tr_TrkEta.clear();
939  tr_TrkPhi.clear();
940  tr_TrkID.clear();
941  tr_MaxNearP31X31.clear();
942  tr_MaxNearHcalP7x7.clear();
943  tr_FE7x7P.clear();
944  tr_FE11x11P.clear();
945  tr_FE15x15P.clear();
946  tr_SE7x7P.clear();
947  tr_SE11x11P.clear();
948  tr_SE15x15P.clear();
949  tr_H3x3.clear();
950  tr_H5x5.clear();
951  tr_H7x7.clear();
952  tr_iEta.clear();
953 }
954 
955 void StudyHLT::fillTrack(int i, double pt, double p, double eta, double phi) {
956  h_pt[i]->Fill(pt, tr_eventWeight);
957  h_p[i]->Fill(p, tr_eventWeight);
958  h_eta[i]->Fill(eta, tr_eventWeight);
959  h_phi[i]->Fill(phi, tr_eventWeight);
960 }
961 
962 void StudyHLT::fillIsolation(int i, double emaxnearP, double eneutIso1, double eneutIso2) {
963  h_maxNearP[i]->Fill(emaxnearP, tr_eventWeight);
964  h_ene1[i]->Fill(eneutIso1, tr_eventWeight);
965  h_ene2[i]->Fill(eneutIso2, tr_eventWeight);
966  h_ediff[i]->Fill(eneutIso2 - eneutIso1, tr_eventWeight);
967 }
968 
969 void StudyHLT::fillEnergy(int flag, int ieta, double p, double enEcal1, double enHcal1, double enEcal2, double enHcal2) {
970  int ip(-1), ie(-1);
971  for (int i = 0; i < nPBin_; ++i) {
972  if (p >= pBin_[i] && p < pBin_[i + 1]) {
973  ip = i;
974  break;
975  }
976  }
977  for (int i = 0; i < nEtaBin_; ++i) {
978  if (ieta >= etaBin_[i] && ieta < etaBin_[i + 1]) {
979  ie = i;
980  break;
981  }
982  }
983  if (ip >= 0 && ie >= 0 && enEcal1 > 0.02 && enHcal1 > 0.1) {
984  h_energy[flag][ip][ie][0]->Fill(enEcal1 / p, tr_eventWeight);
985  h_energy[flag][ip][ie][1]->Fill(enHcal1 / p, tr_eventWeight);
986  h_energy[flag][ip][ie][2]->Fill((enEcal1 + enHcal1) / p, tr_eventWeight);
987  h_energy[flag][ip][ie][3]->Fill(enEcal2 / p, tr_eventWeight);
988  h_energy[flag][ip][ie][4]->Fill(enHcal2 / p, tr_eventWeight);
989  h_energy[flag][ip][ie][5]->Fill((enEcal2 + enHcal2) / p, tr_eventWeight);
990  }
991 }
992 
994  std::string truncated_str(str);
995  int length = str.length();
996  for (int i = 0; i < length - 2; i++) {
997  if (str[i] == '_' && str[i + 1] == 'v' && isdigit(str.at(i + 2))) {
998  int z = i + 1;
999  truncated_str = str.substr(0, z);
1000  }
1001  }
1002  return (truncated_str);
1003 }
1004 
1006  int id(0);
1007  if (genParticles.isValid()) {
1008  unsigned int indx;
1009  reco::GenParticleCollection::const_iterator p;
1010  double mindR(999.9);
1011  for (p = genParticles->begin(), indx = 0; p != genParticles->end(); ++p, ++indx) {
1012  int pdgId = std::abs(p->pdgId());
1013  int idx = (pdgId == 11) ? 1 : ((pdgId == 211) ? 2 : ((pdgId == 321) ? 3 : ((pdgId == 2212) ? 4 : 0)));
1014  if (idx > 0) {
1015  double dEta = pTrack->eta() - p->momentum().Eta();
1016  double phi1 = pTrack->phi();
1017  double phi2 = p->momentum().Phi();
1018  if (phi1 < 0)
1019  phi1 += 2.0 * M_PI;
1020  if (phi2 < 0)
1021  phi2 += 2.0 * M_PI;
1022  double dPhi = phi1 - phi2;
1023  if (dPhi > M_PI)
1024  dPhi -= 2. * M_PI;
1025  else if (dPhi < -M_PI)
1026  dPhi += 2. * M_PI;
1027  double dR = sqrt(dEta * dEta + dPhi * dPhi);
1028  if (dR < mindR) {
1029  mindR = dR;
1030  id = idx;
1031  }
1032  }
1033  }
1034  }
1035  return id;
1036 }
1037 
RunNumber_t run() const
Definition: EventID.h:38
const edm::InputTag theTriggerResultsLabel_
Definition: StudyHLT.cc:116
static const std::string kSharedResource
Definition: TFileService.h:76
void fillEnergy(int, int, double, double, double, double, double)
Definition: StudyHLT.cc:969
const double tMinH_
Definition: StudyHLT.cc:113
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:40
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: StudyHLT.cc:128
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > tr_TrkPt
Definition: StudyHLT.cc:147
std::vector< double > tr_H3x3
Definition: StudyHLT.cc:149
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
const std::string theTrackQuality_
Definition: StudyHLT.cc:111
TH1I * h_HLTCorr
Definition: StudyHLT.cc:132
bool firstEvent_
Definition: StudyHLT.cc:119
TH1I * h_numberPV
Definition: StudyHLT.cc:132
TH1I * h_nHLT
Definition: StudyHLT.cc:132
const edm::InputTag triggerEvent_
Definition: StudyHLT.cc:116
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:265
const double tMinE_
Definition: StudyHLT.cc:113
RunNumber_t run() const
Definition: RunBase.h:40
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::vector< double > tr_MaxNearP31X31
Definition: StudyHLT.cc:148
TH1I * h_ntrk[2]
Definition: StudyHLT.cc:138
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
TrackQuality
track quality
Definition: TrackBase.h:150
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.cc:135
std::vector< std::string > tr_TrigName
Definition: StudyHLT.cc:146
static const int nGen_
Definition: StudyHLT.cc:106
std::vector< bool > tr_SE7x7P
Definition: StudyHLT.cc:151
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
Definition: StudyHLT.cc:130
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
Definition: StudyHLT.cc:124
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
static const int nPBin_
Definition: StudyHLT.cc:105
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:614
TH1D * h_phi[nGen_+2]
Definition: StudyHLT.cc:137
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1I * h_HLTAccept
Definition: StudyHLT.cc:132
double weight() const
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:629
std::vector< std::string > HLTNames_
Definition: StudyHLT.cc:118
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: StudyHLT.cc:94
const double tMaxH_
Definition: StudyHLT.cc:113
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
static const int nPVBin_
Definition: StudyHLT.cc:105
std::vector< double > tr_TrkEta
Definition: StudyHLT.cc:147
const int verbosity_
Definition: StudyHLT.cc:109
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: StudyHLT.cc:125
TH1I * h_goodRun
Definition: StudyHLT.cc:133
void beginJob() override
Definition: StudyHLT.cc:723
TH1D * h_ene2[2]
Definition: StudyHLT.cc:139
void fillIsolation(int, double, double, double)
Definition: StudyHLT.cc:962
TH1D * h_pt[nGen_+2]
Definition: StudyHLT.cc:136
bool changed_
Definition: StudyHLT.cc:119
const double tMaxE_
Definition: StudyHLT.cc:113
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: StudyHLT.cc:129
TH1D * h_energy[nPVBin_+8][nPBin_][nEtaBin_][6]
Definition: StudyHLT.cc:140
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
~StudyHLT() override
Definition: StudyHLT.cc:85
int etaBin_[nEtaBin_+1]
Definition: StudyHLT.cc:142
std::vector< int > tr_iEta
Definition: StudyHLT.cc:152
spr::trackSelectionParameters selectionParameters_
Definition: StudyHLT.cc:117
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: StudyHLT.cc:126
void fillTrack(int, double, double, double, double)
Definition: StudyHLT.cc:955
std::vector< double > tr_MaxNearHcalP7x7
Definition: StudyHLT.cc:148
std::string truncate_str(const std::string &)
Definition: StudyHLT.cc:993
TH1D * h_h_pNew[8]
Definition: StudyHLT.cc:137
const std::vector< double > puWeights_
Definition: StudyHLT.cc:115
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int size() const
Get number of paths stored.
TH1D * h_ene1[2]
Definition: StudyHLT.cc:139
double pt() const
track transverse momentum
Definition: TrackBase.h:602
static const int nEtaBin_
Definition: StudyHLT.cc:105
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int tr_goodRun
Definition: StudyHLT.cc:144
HLTConfigProvider hltConfig_
Definition: StudyHLT.cc:107
std::vector< bool > tr_SE11x11P
Definition: StudyHLT.cc:151
int pvBin_[nPVBin_+1]
Definition: StudyHLT.cc:142
static std::string const triggerResults
Definition: EdmProvDump.cc:45
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:70
TH1D * h_ediff[2]
Definition: StudyHLT.cc:139
int tr_goodPV
Definition: StudyHLT.cc:144
std::vector< double > tr_FE11x11P
Definition: StudyHLT.cc:150
#define M_PI
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
edm::Service< TFileService > fs_
Definition: StudyHLT.cc:108
TH1D * h_maxNearP[2]
Definition: StudyHLT.cc:139
T const * product() const
Definition: Handle.h:69
void clear()
Definition: StudyHLT.cc:934
TH2I * h_nHLTvsRN
Definition: StudyHLT.cc:134
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: StudyHLT.cc:127
std::vector< int > tr_TrkID
Definition: StudyHLT.cc:152
int trackPID(const reco::Track *, const edm::Handle< reco::GenParticleCollection > &)
Definition: StudyHLT.cc:1005
const double maxTrackEta_
Definition: StudyHLT.cc:112
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
TTree * tree_
Definition: StudyHLT.cc:141
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TH1I * h_goodPV
Definition: StudyHLT.cc:133
edm::EDGetTokenT< LumiDetails > tok_lumi
Definition: StudyHLT.cc:121
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:531
std::vector< double > tr_H7x7
Definition: StudyHLT.cc:149
std::string const & label() const
Definition: InputTag.h:36
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:913
std::vector< double > tr_FE15x15P
Definition: StudyHLT.cc:150
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
double p1[4]
Definition: TauolaWrapper.h:89
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: StudyHLT.cc:123
double pBin_[nPBin_+1]
Definition: StudyHLT.cc:143
T get() const
Definition: EventSetup.h:73
double tr_eventWeight
Definition: StudyHLT.cc:145
reco::TrackBase::TrackQuality minQuality
const bool vetoTrigger_
Definition: StudyHLT.cc:114
const bool doTree_
Definition: StudyHLT.cc:114
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: StudyHLT.cc:233
TH1D * h_eta[nGen_+2]
Definition: StudyHLT.cc:137
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
const double minTrackP_
Definition: StudyHLT.cc:112
StudyHLT(const edm::ParameterSet &)
Definition: StudyHLT.cc:155
TH1D * h_counter[8]
Definition: StudyHLT.cc:136
std::vector< double > tr_FE7x7P
Definition: StudyHLT.cc:150
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: StudyHLT.cc:95
std::vector< double > tr_TrkPhi
Definition: StudyHLT.cc:147
const bool isItAOD_
Definition: StudyHLT.cc:114
#define str(s)
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
std::vector< double > tr_TrkP
Definition: StudyHLT.cc:147
T const * product() const
Definition: ESHandle.h:86
std::vector< bool > tr_SE15x15P
Definition: StudyHLT.cc:151
const std::vector< std::string > trigNames_
Definition: StudyHLT.cc:110
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265
TH1D * h_p[nGen_+2]
Definition: StudyHLT.cc:136
std::vector< double > tr_H5x5
Definition: StudyHLT.cc:149
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:929
Definition: Run.h:45
int nRun_
Definition: StudyHLT.cc:142
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: StudyHLT.cc:122
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
const std::vector< std::string > newNames_
Definition: StudyHLT.cc:110
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)