CMS 3D CMS Logo

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