CMS 3D CMS Logo

HcalHBHEMuonAnalyzer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <iostream>
3 #include <fstream>
4 #include <vector>
5 #include <TFile.h>
6 #include <TTree.h>
7 #include "TPRegexp.h"
8 
9 // user include files
19 
27 
29 
39 
42 
45 
49 
53 
57 
69 
70 //#define EDM_ML_DEBUG
71 
72 class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
73 public:
74  explicit HcalHBHEMuonAnalyzer(const edm::ParameterSet&);
75 
76  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
77 
78 private:
79  void beginJob() override;
80  void analyze(edm::Event const&, edm::EventSetup const&) override;
81  void beginRun(edm::Run const&, edm::EventSetup const&) override;
82  void endRun(edm::Run const&, edm::EventSetup const&) override {}
83  void clearVectors();
84  int matchId(const HcalDetId&, const HcalDetId&);
85  double activeLength(const DetId&);
86  bool isGoodVertex(const reco::Vertex& vtx);
87  double respCorr(const DetId& id);
88  double gainFactor(const HcalDbService* dbserv, const HcalDetId& id);
89  int depth16HE(int ieta, int iphi);
90  bool goodCell(const HcalDetId& hcid, const reco::Track* pTrack, const CaloGeometry* geo, const MagneticField* bField);
91 
92  // ----------member data ---------------------------
98  const std::vector<std::string> triggers_;
99  const int verbosity_, useRaw_;
105 
110 
117 
127 
129  static const int depthMax_ = 7;
130  TTree* tree_;
132  unsigned int goodVertex_;
134  std::vector<bool> muon_is_tight_, muon_is_medium_;
135  std::vector<double> ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_;
138  std::vector<bool> innerTrack_, outerTrack_, globalTrack_;
139  std::vector<double> chiTracker_, dxyTracker_, dzTracker_;
141  std::vector<double> tight_validFraction_, outerTrackChi_;
145  std::vector<int> globalMuonHits_, matchedStat_;
147  std::vector<double> isolationR04_, isolationR03_;
148  std::vector<double> ecalEnergy_, hcalEnergy_, hoEnergy_;
149  std::vector<bool> matchedId_, hcalHot_;
150  std::vector<double> ecal3x3Energy_, hcal1x1Energy_;
151  std::vector<unsigned int> ecalDetId_, hcalDetId_, ehcalDetId_;
152  std::vector<int> hcal_ieta_, hcal_iphi_;
153  std::vector<double> hcalDepthEnergy_[depthMax_];
154  std::vector<double> hcalDepthActiveLength_[depthMax_];
155  std::vector<double> hcalDepthEnergyHot_[depthMax_];
156  std::vector<double> hcalDepthActiveLengthHot_[depthMax_];
157  std::vector<double> hcalDepthChargeHot_[depthMax_];
158  std::vector<double> hcalDepthChargeHotBG_[depthMax_];
159  std::vector<double> hcalDepthEnergyCorr_[depthMax_];
160  std::vector<double> hcalDepthEnergyHotCorr_[depthMax_];
161  std::vector<bool> hcalDepthMatch_[depthMax_];
162  std::vector<bool> hcalDepthMatchHot_[depthMax_];
164  std::vector<std::string> all_triggers_;
165  std::vector<int> hltresults_;
166 
167  std::vector<HcalDDDRecConstants::HcalActiveLength> actHB, actHE;
168  std::map<DetId, double> corrValue_;
170 };
171 
173  : hlTriggerResults_(iConfig.getParameter<edm::InputTag>("hlTriggerResults")),
174  labelEBRecHit_(iConfig.getParameter<edm::InputTag>("labelEBRecHit")),
175  labelEERecHit_(iConfig.getParameter<edm::InputTag>("labelEERecHit")),
176  labelHBHERecHit_(iConfig.getParameter<edm::InputTag>("labelHBHERecHit")),
177  labelVtx_(iConfig.getParameter<std::string>("labelVertex")),
178  labelMuon_(iConfig.getParameter<std::string>("labelMuon")),
179  fileInCorr_(iConfig.getUntrackedParameter<std::string>("fileInCorr", "")),
180  triggers_(iConfig.getParameter<std::vector<std::string>>("triggers")),
181  verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)),
182  useRaw_(iConfig.getParameter<int>("useRaw")),
183  unCorrect_(iConfig.getParameter<bool>("unCorrect")),
184  collapseDepth_(iConfig.getParameter<bool>("collapseDepth")),
185  isItPlan1_(iConfig.getParameter<bool>("isItPlan1")),
186  ignoreHECorr_(iConfig.getUntrackedParameter<bool>("ignoreHECorr", false)),
187  isItPreRecHit_(iConfig.getUntrackedParameter<bool>("isItPreRecHit", false)),
188  getCharge_(iConfig.getParameter<bool>("getCharge")),
189  writeRespCorr_(iConfig.getUntrackedParameter<bool>("writeRespCorr", false)),
190  hdc_(nullptr),
191  theHBHETopology_(nullptr),
192  respCorrs_(nullptr) {
193  usesResource(TFileService::kSharedResource);
194  //now do what ever initialization is needed
195  kount_ = 0;
196  maxDepth_ = iConfig.getUntrackedParameter<int>("maxDepth", 4);
197  if (maxDepth_ > depthMax_)
199  else if (maxDepth_ < 1)
200  maxDepth_ = 4;
201  std::string modnam = iConfig.getUntrackedParameter<std::string>("moduleName", "");
202  std::string procnm = iConfig.getUntrackedParameter<std::string>("processName", "");
203 
205  tok_trigRes_ = consumes<edm::TriggerResults>(hlTriggerResults_);
206  tok_EB_ = consumes<EcalRecHitCollection>(labelEBRecHit_);
207  tok_EE_ = consumes<EcalRecHitCollection>(labelEERecHit_);
208  tok_HBHE_ = consumes<HBHERecHitCollection>(labelHBHERecHit_);
209  if (modnam.empty()) {
210  tok_Vtx_ = consumes<reco::VertexCollection>(labelVtx_);
211  tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_);
212  edm::LogVerbatim("HBHEMuon") << "Labels used: Trig " << hlTriggerResults_ << " Vtx " << labelVtx_ << " EB "
213  << labelEBRecHit_ << " EE " << labelEERecHit_ << " HBHE " << labelHBHERecHit_ << " MU "
214  << labelMuon_;
215  } else {
216  tok_Vtx_ = consumes<reco::VertexCollection>(edm::InputTag(modnam, labelVtx_, procnm));
217  tok_Muon_ = consumes<reco::MuonCollection>(edm::InputTag(modnam, labelMuon_, procnm));
218  edm::LogVerbatim("HBHEMuon") << "Labels used Trig " << hlTriggerResults_ << "\n Vtx "
219  << edm::InputTag(modnam, labelVtx_, procnm) << "\n EB " << labelEBRecHit_
220  << "\n EE " << labelEERecHit_ << "\n HBHE " << labelHBHERecHit_ << "\n MU "
221  << edm::InputTag(modnam, labelMuon_, procnm);
222  }
223 
224  tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
225  tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
226  tok_respcorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd, edm::Transition::BeginRun>();
227  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>();
228  tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
229  tok_chan_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
230  tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
231  tok_topo_ = esConsumes<CaloTopology, CaloTopologyRecord>();
232  tok_dbservice_ = esConsumes<HcalDbService, HcalDbRecord>();
233 
234  if (!fileInCorr_.empty()) {
235  std::ifstream infile(fileInCorr_.c_str());
236  if (infile.is_open()) {
237  while (true) {
238  unsigned int id;
239  double cfac;
240  infile >> id >> cfac;
241  if (!infile.good())
242  break;
243  corrValue_[DetId(id)] = cfac;
244  }
245  infile.close();
246  }
247  }
248  useMyCorr_ = (!corrValue_.empty());
249  edm::LogVerbatim("HBHEMuon") << "Flags used: UseRaw " << useRaw_ << " GetCharge " << getCharge_ << " UnCorrect "
250  << unCorrect_ << " IgnoreHECorr " << ignoreHECorr_ << " CollapseDepth " << collapseDepth_
251  << ":" << mergedDepth_ << " IsItPlan1 " << isItPlan1_ << " IsItPreRecHit "
252  << isItPreRecHit_ << " UseMyCorr " << useMyCorr_;
253 }
254 
255 //
256 // member functions
257 //
258 
259 // ------------ method called for each event ------------
261  ++kount_;
262  clearVectors();
263  runNumber_ = iEvent.id().run();
264  eventNumber_ = iEvent.id().event();
265  lumiNumber_ = iEvent.id().luminosityBlock();
266  bxNumber_ = iEvent.bunchCrossing();
267 #ifdef EDM_ML_DEBUG
268  edm::LogVerbatim("HBHEMuon") << "Run " << runNumber_ << " Event " << eventNumber_ << " Lumi " << lumiNumber_ << " BX "
269  << bxNumber_ << std::endl;
270 #endif
272  iEvent.getByToken(tok_trigRes_, _Triggers);
273 #ifdef EDM_ML_DEBUG
274  if ((verbosity_ / 10000) % 10 > 0)
275  edm::LogVerbatim("HBHEMuon") << "Size of all triggers " << all_triggers_.size() << std::endl;
276 #endif
277  int Ntriggers = all_triggers_.size();
278 #ifdef EDM_ML_DEBUG
279  if ((verbosity_ / 10000) % 10 > 0)
280  edm::LogVerbatim("HBHEMuon") << "Size of HLT MENU: " << _Triggers->size() << std::endl;
281 #endif
282  if (_Triggers.isValid()) {
283  const edm::TriggerNames& triggerNames_ = iEvent.triggerNames(*_Triggers);
284  std::vector<int> index;
285  for (int i = 0; i < Ntriggers; i++) {
286  index.push_back(triggerNames_.triggerIndex(all_triggers_[i]));
287  int triggerSize = int(_Triggers->size());
288 #ifdef EDM_ML_DEBUG
289  if ((verbosity_ / 10000) % 10 > 0)
290  edm::LogVerbatim("HBHEMuon") << "outside loop " << index[i] << "\ntriggerSize " << triggerSize << std::endl;
291 #endif
292  if (index[i] < triggerSize) {
293  hltresults_.push_back(_Triggers->accept(index[i]));
294 #ifdef EDM_ML_DEBUG
295  if ((verbosity_ / 10000) % 10 > 0)
296  edm::LogVerbatim("HBHEMuon") << "Trigger_info " << triggerSize << " triggerSize " << index[i]
297  << " trigger_index " << hltresults_.at(i) << " hltresult" << std::endl;
298 #endif
299  } else {
300  if ((verbosity_ / 10000) % 10 > 0)
301  edm::LogVerbatim("HBHEMuon") << "Requested HLT path \""
302  << "\" does not exist\n";
303  }
304  }
305  }
306 
307  // get handles to calogeometry and calotopology
308  const MagneticField* bField = &iSetup.getData(tok_magField_);
309  const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_chan_);
310  const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_);
311  const CaloTopology* caloTopology = &iSetup.getData(tok_topo_);
313 
314  // Relevant blocks from iEvent
316  iEvent.getByToken(tok_Vtx_, vtx);
317 
318  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
319  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
320  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
321  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
322 
324  iEvent.getByToken(tok_HBHE_, hbhe);
325 
327  iEvent.getByToken(tok_Muon_, _Muon);
328 
329  // require a good vertex
330  math::XYZPoint pvx;
331  goodVertex_ = 0;
332  if (!vtx.isValid()) {
333 #ifdef EDM_ML_DEBUG
334  edm::LogVerbatim("HBHEMuon") << "No Good Vertex found == Reject\n";
335 #endif
336  return;
337  }
338  reco::VertexCollection::const_iterator firstGoodVertex = vtx->end();
339  for (reco::VertexCollection::const_iterator it = vtx->begin(); it != vtx->end(); it++) {
340  if (isGoodVertex(*it)) {
341  if (firstGoodVertex == vtx->end())
342  firstGoodVertex = it;
343  ++goodVertex_;
344  }
345  }
346  if (firstGoodVertex != vtx->end())
347  pvx = firstGoodVertex->position();
348 
349  bool accept(false);
350  if (_Muon.isValid() && barrelRecHitsHandle.isValid() && endcapRecHitsHandle.isValid() && hbhe.isValid()) {
351  for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) {
352  muon_is_good_.push_back(RecMuon->isPFMuon());
353  muon_global_.push_back(RecMuon->isGlobalMuon());
354  muon_tracker_.push_back(RecMuon->isTrackerMuon());
355  ptGlob_.push_back((RecMuon)->pt());
356  etaGlob_.push_back(RecMuon->eta());
357  phiGlob_.push_back(RecMuon->phi());
358  energyMuon_.push_back(RecMuon->energy());
359  pMuon_.push_back(RecMuon->p());
360 #ifdef EDM_ML_DEBUG
361  edm::LogVerbatim("HBHEMuon") << "Energy:" << RecMuon->energy() << " P:" << RecMuon->p() << std::endl;
362 #endif
363  muon_is_tight_.push_back(muon::isTightMuon(*RecMuon, *firstGoodVertex));
364  muon_is_medium_.push_back(muon::isMediumMuon(*RecMuon));
365  muon_trkKink.push_back(RecMuon->combinedQuality().trkKink);
366  muon_chi2LocalPosition.push_back(RecMuon->combinedQuality().chi2LocalPosition);
367  muon_segComp.push_back(muon::segmentCompatibility(*RecMuon));
368  // acessing tracker hits info
369  if (RecMuon->track().isNonnull()) {
370  trackerLayer_.push_back(RecMuon->track()->hitPattern().trackerLayersWithMeasurement());
371  } else {
372  trackerLayer_.push_back(-1);
373  }
374  if (RecMuon->innerTrack().isNonnull()) {
375  innerTrack_.push_back(true);
376  numPixelLayers_.push_back(RecMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement());
377  chiTracker_.push_back(RecMuon->innerTrack()->normalizedChi2());
378  dxyTracker_.push_back(fabs(RecMuon->innerTrack()->dxy(pvx)));
379  dzTracker_.push_back(fabs(RecMuon->innerTrack()->dz(pvx)));
380  innerTrackpt_.push_back(RecMuon->innerTrack()->pt());
381  innerTracketa_.push_back(RecMuon->innerTrack()->eta());
382  innerTrackphi_.push_back(RecMuon->innerTrack()->phi());
383  tight_PixelHits_.push_back(RecMuon->innerTrack()->hitPattern().numberOfValidPixelHits());
384  tight_validFraction_.push_back(RecMuon->innerTrack()->validFraction());
385  } else {
386  innerTrack_.push_back(false);
387  numPixelLayers_.push_back(0);
388  chiTracker_.push_back(0);
389  dxyTracker_.push_back(0);
390  dzTracker_.push_back(0);
391  innerTrackpt_.push_back(0);
392  innerTracketa_.push_back(0);
393  innerTrackphi_.push_back(0);
394  tight_PixelHits_.push_back(0);
395  tight_validFraction_.push_back(-99);
396  }
397  // outer track info
398  if (RecMuon->outerTrack().isNonnull()) {
399  outerTrack_.push_back(true);
400  outerTrackPt_.push_back(RecMuon->outerTrack()->pt());
401  outerTrackEta_.push_back(RecMuon->outerTrack()->eta());
402  outerTrackPhi_.push_back(RecMuon->outerTrack()->phi());
403  outerTrackChi_.push_back(RecMuon->outerTrack()->normalizedChi2());
404  outerTrackHits_.push_back(RecMuon->outerTrack()->numberOfValidHits());
405  outerTrackRHits_.push_back(RecMuon->outerTrack()->recHitsSize());
406  } else {
407  outerTrack_.push_back(false);
408  outerTrackPt_.push_back(0);
409  outerTrackEta_.push_back(0);
410  outerTrackPhi_.push_back(0);
411  outerTrackChi_.push_back(0);
412  outerTrackHits_.push_back(0);
413  outerTrackRHits_.push_back(0);
414  }
415  // Tight Muon cuts
416  if (RecMuon->globalTrack().isNonnull()) {
417  globalTrack_.push_back(true);
418  chiGlobal_.push_back(RecMuon->globalTrack()->normalizedChi2());
419  globalMuonHits_.push_back(RecMuon->globalTrack()->hitPattern().numberOfValidMuonHits());
420  matchedStat_.push_back(RecMuon->numberOfMatchedStations());
421  globalTrckPt_.push_back(RecMuon->globalTrack()->pt());
422  globalTrckEta_.push_back(RecMuon->globalTrack()->eta());
423  globalTrckPhi_.push_back(RecMuon->globalTrack()->phi());
424  tight_TransImpara_.push_back(fabs(RecMuon->muonBestTrack()->dxy(pvx)));
425  tight_LongPara_.push_back(fabs(RecMuon->muonBestTrack()->dz(pvx)));
426  } else {
427  globalTrack_.push_back(false);
428  chiGlobal_.push_back(0);
429  globalMuonHits_.push_back(0);
430  matchedStat_.push_back(0);
431  globalTrckPt_.push_back(0);
432  globalTrckEta_.push_back(0);
433  globalTrckPhi_.push_back(0);
434  tight_TransImpara_.push_back(0);
435  tight_LongPara_.push_back(0);
436  }
437 
438  isolationR04_.push_back(
439  ((RecMuon->pfIsolationR04().sumChargedHadronPt +
440  std::max(0.,
441  RecMuon->pfIsolationR04().sumNeutralHadronEt + RecMuon->pfIsolationR04().sumPhotonEt -
442  (0.5 * RecMuon->pfIsolationR04().sumPUPt))) /
443  RecMuon->pt()));
444 
445  isolationR03_.push_back(
446  ((RecMuon->pfIsolationR03().sumChargedHadronPt +
447  std::max(0.,
448  RecMuon->pfIsolationR03().sumNeutralHadronEt + RecMuon->pfIsolationR03().sumPhotonEt -
449  (0.5 * RecMuon->pfIsolationR03().sumPUPt))) /
450  RecMuon->pt()));
451 
452  ecalEnergy_.push_back(RecMuon->calEnergy().emS9);
453  hcalEnergy_.push_back(RecMuon->calEnergy().hadS9);
454  hoEnergy_.push_back(RecMuon->calEnergy().hoS9);
455 
456  double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
457  double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_];
458  double eHcalDepthC[depthMax_], eHcalDepthHotC[depthMax_];
459  double cHcalDepthHot[depthMax_], cHcalDepthHotBG[depthMax_];
460  double activeL[depthMax_], activeHotL[depthMax_];
461  bool matchDepth[depthMax_], matchDepthHot[depthMax_];
462  HcalDetId eHcalDetId[depthMax_];
463  unsigned int isHot(0);
464  bool tmpmatch(false);
465  int ieta(-1000), iphi(-1000);
466  for (int i = 0; i < depthMax_; ++i) {
467  eHcalDepth[i] = eHcalDepthHot[i] = 0;
468  eHcalDepthC[i] = eHcalDepthHotC[i] = 0;
469  cHcalDepthHot[i] = cHcalDepthHotBG[i] = 0;
470  activeL[i] = activeHotL[i] = 0;
471  matchDepth[i] = matchDepthHot[i] = true;
472  }
473  if (RecMuon->innerTrack().isNonnull()) {
474  const reco::Track* pTrack = (RecMuon->innerTrack()).get();
475  spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0)));
476  if ((RecMuon->p() > 10.0) && (trackID.okHCAL))
477  accept = true;
478 
479  ecalDetId_.push_back((trackID.detIdECAL)());
480  hcalDetId_.push_back((trackID.detIdHCAL)());
481  ehcalDetId_.push_back((trackID.detIdEHCAL)());
482 
484  std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0)));
485  if (info.first) {
486  check = info.second;
487  }
488 
489  bool okE = trackID.okECAL;
490  if (okE) {
491  const DetId isoCell(trackID.detIdECAL);
492  std::pair<double, bool> e3x3 = spr::eECALmatrix(isoCell,
493  barrelRecHitsHandle,
494  endcapRecHitsHandle,
495  *theEcalChStatus,
496  geo_,
497  caloTopology,
498  sevlv,
499  1,
500  1,
501  -100.0,
502  -100.0,
503  -500.0,
504  500.0,
505  false);
506  eEcal = e3x3.first;
507  okE = e3x3.second;
508  }
509 #ifdef EDM_ML_DEBUG
510  edm::LogVerbatim("HBHEMuon") << "Propagate Track to ECAL: " << okE << ":" << trackID.okECAL << " E " << eEcal;
511 #endif
512 
513  if (trackID.okHCAL) {
514  DetId closestCell(trackID.detIdHCAL);
515  HcalDetId hcidt(closestCell.rawId());
516  if ((hcidt.ieta() == check.ieta()) && (hcidt.iphi() == check.iphi()))
517  tmpmatch = true;
518 #ifdef EDM_ML_DEBUG
519  edm::LogVerbatim("HBHEMuon") << "Front " << hcidt << " Back " << info.first << ":" << check << " Match "
520  << tmpmatch;
521 #endif
522 
523  HcalSubdetector subdet = hcidt.subdet();
524  ieta = hcidt.ieta();
525  iphi = hcidt.iphi();
526  bool hborhe = (std::abs(ieta) == 16);
527 
529  closestCell,
530  hbhe,
531  0,
532  0,
533  false,
534  true,
535  -100.0,
536  -100.0,
537  -100.0,
538  -100.0,
539  -500.,
540  500.,
541  useRaw_);
542  std::vector<std::pair<double, int>> ehdepth;
543  spr::energyHCALCell((HcalDetId)closestCell,
544  hbhe,
545  ehdepth,
546  maxDepth_,
547  -100.0,
548  -100.0,
549  -100.0,
550  -100.0,
551  -500.0,
552  500.0,
553  useRaw_,
554  depth16HE(ieta, iphi),
555  (((verbosity_ / 1000) % 10) > 0));
556  for (int i = 0; i < depthMax_; ++i)
557  eHcalDetId[i] = HcalDetId();
558  for (unsigned int i = 0; i < ehdepth.size(); ++i) {
559  HcalSubdetector subdet0 =
560  (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
561  HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second);
562  double actL = activeLength(DetId(hcid0));
563  double ene = ehdepth[i].first;
564  bool tmpC(false);
565  if (ene > 0.0) {
566  if (!(theHBHETopology_->validHcal(hcid0))) {
567  edm::LogWarning("HBHEMuon") << "(1) Invalid ID " << hcid0 << " with E = " << ene;
568  edm::LogWarning("HBHEMuon") << HcalDetId(closestCell) << " with " << ehdepth.size() << " depths:";
569  for (const auto& ehd : ehdepth)
570  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
571  } else {
572  tmpC = goodCell(hcid0, pTrack, geo_, bField);
573  double enec(ene);
574  if (unCorrect_) {
575  double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0));
576  if (corr != 0)
577  ene /= corr;
578 #ifdef EDM_ML_DEBUG
579  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
580  edm::LogVerbatim("HBHEMuon") << hcid0 << ":" << id << " Corr " << corr;
581 #endif
582  }
583  int depth = ehdepth[i].second - 1;
584  if (collapseDepth_) {
585  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
586  depth = id.depth() - 1;
587  }
588  eHcalDepth[depth] += ene;
589  eHcalDepthC[depth] += enec;
590  activeL[depth] += actL;
591  activeLengthTot += actL;
592  matchDepth[depth] = (matchDepth[depth] && tmpC);
593 #ifdef EDM_ML_DEBUG
594  if ((verbosity_ % 10) > 0)
595  edm::LogVerbatim("HBHEMuon")
596  << hcid0 << " E " << ene << ":" << enec << " L " << actL << " Match " << tmpC;
597 #endif
598  }
599  }
600  }
601 #ifdef EDM_ML_DEBUG
602  if ((verbosity_ % 10) > 0) {
603  edm::LogVerbatim("HBHEMuon") << hcidt << " Match " << tmpmatch << " Depths " << ehdepth.size();
604  for (unsigned int k = 0; k < ehdepth.size(); ++k)
605  edm::LogVerbatim("HBHEMuon") << " [" << k << ":" << ehdepth[k].second << "] " << matchDepth[k];
606  }
607 #endif
608  HcalDetId hotCell;
609  spr::eHCALmatrix(geo_, theHBHETopology_, closestCell, hbhe, 1, 1, hotCell, false, useRaw_, false);
610  isHot = matchId(closestCell, hotCell);
611  if (hotCell != HcalDetId()) {
612  subdet = HcalDetId(hotCell).subdet();
613  ieta = HcalDetId(hotCell).ieta();
614  iphi = HcalDetId(hotCell).iphi();
615  hborhe = (std::abs(ieta) == 16);
616  std::vector<std::pair<double, int>> ehdepth;
617  spr::energyHCALCell(hotCell,
618  hbhe,
619  ehdepth,
620  maxDepth_,
621  -100.0,
622  -100.0,
623  -100.0,
624  -100.0,
625  -500.0,
626  500.0,
627  useRaw_,
628  depth16HE(ieta, iphi),
629  false); //(((verbosity_/1000)%10)>0 ));
630  for (int i = 0; i < depthMax_; ++i)
631  eHcalDetId[i] = HcalDetId();
632  for (unsigned int i = 0; i < ehdepth.size(); ++i) {
633  HcalSubdetector subdet0 =
634  (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
635  HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second);
636  double actL = activeLength(DetId(hcid0));
637  double ene = ehdepth[i].first;
638  bool tmpC(false);
639  if (ene > 0.0) {
640  if (!(theHBHETopology_->validHcal(hcid0))) {
641  edm::LogWarning("HBHEMuon") << "(2) Invalid ID " << hcid0 << " with E = " << ene;
642  edm::LogWarning("HBHEMuon") << HcalDetId(hotCell) << " with " << ehdepth.size() << " depths:";
643  for (const auto& ehd : ehdepth)
644  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
645  } else {
646  tmpC = goodCell(hcid0, pTrack, geo_, bField);
647  double chg(ene), enec(ene);
648  if (unCorrect_) {
649  double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0));
650  if (corr != 0)
651  ene /= corr;
652 #ifdef EDM_ML_DEBUG
653  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
654  edm::LogVerbatim("HBHEMuon")
655  << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << enec;
656 #endif
657  }
658  if (getCharge_) {
659  double gain = gainFactor(conditions, hcid0);
660  if (gain != 0)
661  chg /= gain;
662 #ifdef EDM_ML_DEBUG
663  edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg;
664 #endif
665  }
666  int depth = ehdepth[i].second - 1;
667  if (collapseDepth_) {
668  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
669  depth = id.depth() - 1;
670  }
671  eHcalDepthHot[depth] += ene;
672  eHcalDepthHotC[depth] += enec;
673  cHcalDepthHot[depth] += chg;
674  activeHotL[depth] += actL;
675  activeLengthHotTot += actL;
676  matchDepthHot[depth] = (matchDepthHot[depth] && tmpC);
677 #ifdef EDM_ML_DEBUG
678  if ((verbosity_ % 10) > 0)
679  edm::LogVerbatim("HBHEMuon") << hcid0 << " depth " << depth << " E " << ene << ":" << enec << " C "
680  << chg << " L " << actL << " Match " << tmpC;
681 #endif
682  }
683  }
684  }
685 
686  HcalDetId oppCell(subdet, -ieta, iphi, HcalDetId(hotCell).depth());
687  std::vector<std::pair<double, int>> ehdeptho;
688  spr::energyHCALCell(oppCell,
689  hbhe,
690  ehdeptho,
691  maxDepth_,
692  -100.0,
693  -100.0,
694  -100.0,
695  -100.0,
696  -500.0,
697  500.0,
698  useRaw_,
699  depth16HE(-ieta, iphi),
700  false); //(((verbosity_/1000)%10)>0));
701  for (unsigned int i = 0; i < ehdeptho.size(); ++i) {
702  HcalSubdetector subdet0 =
703  (hborhe) ? ((ehdeptho[i].second >= depth16HE(-ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
704  HcalDetId hcid0(subdet0, -ieta, iphi, ehdeptho[i].second);
705  double ene = ehdeptho[i].first;
706  if (ene > 0.0) {
707  if (!(theHBHETopology_->validHcal(hcid0))) {
708  edm::LogWarning("HBHEMuon") << "(3) Invalid ID " << hcid0 << " with E = " << ene;
709  edm::LogWarning("HBHEMuon") << oppCell << " with " << ehdeptho.size() << " depths:";
710  for (const auto& ehd : ehdeptho)
711  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
712  } else {
713  double chg(ene);
714  if (unCorrect_) {
715  double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0));
716  if (corr != 0)
717  ene /= corr;
718 #ifdef EDM_ML_DEBUG
719  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
720  edm::LogVerbatim("HBHEMuon")
721  << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << ehdeptho[i].first;
722 #endif
723  }
724  if (getCharge_) {
725  double gain = gainFactor(conditions, hcid0);
726  if (gain != 0)
727  chg /= gain;
728 #ifdef EDM_ML_DEBUG
729  edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg;
730 #endif
731  }
732  int depth = ehdeptho[i].second - 1;
733  if (collapseDepth_) {
734  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
735  depth = id.depth() - 1;
736  }
737  cHcalDepthHotBG[depth] += chg;
738 #ifdef EDM_ML_DEBUG
739  if ((verbosity_ % 10) > 0)
740  edm::LogVerbatim("HBHEMuon") << hcid0 << " Depth " << depth << " E " << ene << " C " << chg;
741 #endif
742  }
743  }
744  }
745  }
746  }
747 #ifdef EDM_ML_DEBUG
748  edm::LogVerbatim("HBHEMuon") << "Propagate Track to HCAL: " << trackID.okHCAL << " Match " << tmpmatch
749  << " Hot " << isHot << " Energy " << eHcal << std::endl;
750 #endif
751 
752  } else {
753  ecalDetId_.push_back(0);
754  hcalDetId_.push_back(0);
755  ehcalDetId_.push_back(0);
756  }
757 
758  matchedId_.push_back(tmpmatch);
759  ecal3x3Energy_.push_back(eEcal);
760  hcal1x1Energy_.push_back(eHcal);
761  hcal_ieta_.push_back(ieta);
762  hcal_iphi_.push_back(iphi);
763  for (int i = 0; i < depthMax_; ++i) {
764  hcalDepthEnergy_[i].push_back(eHcalDepth[i]);
765  hcalDepthActiveLength_[i].push_back(activeL[i]);
766  hcalDepthEnergyHot_[i].push_back(eHcalDepthHot[i]);
767  hcalDepthActiveLengthHot_[i].push_back(activeHotL[i]);
768  hcalDepthEnergyCorr_[i].push_back(eHcalDepthC[i]);
769  hcalDepthEnergyHotCorr_[i].push_back(eHcalDepthHotC[i]);
770  hcalDepthChargeHot_[i].push_back(cHcalDepthHot[i]);
771  hcalDepthChargeHotBG_[i].push_back(cHcalDepthHotBG[i]);
772  hcalDepthMatch_[i].push_back(matchDepth[i]);
773  hcalDepthMatchHot_[i].push_back(matchDepthHot[i]);
774  }
775  hcalActiveLength_.push_back(activeLengthTot);
776  hcalHot_.push_back(isHot);
777  hcalActiveLengthHot_.push_back(activeLengthHotTot);
778  }
779  }
780  if (accept) {
781 #ifdef EDM_ML_DEBUG
782  for (unsigned int i = 0; i < hcal_ieta_.size(); ++i)
783  edm::LogVerbatim("HBHEMuon") << "[" << i << "] ieta/iphi for entry to "
784  << "HCAL has value of " << hcal_ieta_[i] << ":" << hcal_iphi_[i];
785 #endif
786  tree_->Fill();
787  }
788 }
789 
790 // ------------ method called once each job just before starting event loop ------------
792  tree_ = fs->make<TTree>("TREE", "TREE");
793  tree_->Branch("Event_No", &eventNumber_);
794  tree_->Branch("Run_No", &runNumber_);
795  tree_->Branch("LumiNumber", &lumiNumber_);
796  tree_->Branch("BXNumber", &bxNumber_);
797  tree_->Branch("GoodVertex", &goodVertex_);
798  tree_->Branch("PF_Muon", &muon_is_good_);
799  tree_->Branch("Global_Muon", &muon_global_);
800  tree_->Branch("Tracker_muon", &muon_tracker_);
801  tree_->Branch("MuonIsTight", &muon_is_tight_);
802  tree_->Branch("MuonIsMedium", &muon_is_medium_);
803  tree_->Branch("pt_of_muon", &ptGlob_);
804  tree_->Branch("eta_of_muon", &etaGlob_);
805  tree_->Branch("phi_of_muon", &phiGlob_);
806  tree_->Branch("energy_of_muon", &energyMuon_);
807  tree_->Branch("p_of_muon", &pMuon_);
808  tree_->Branch("muon_trkKink", &muon_trkKink);
809  tree_->Branch("muon_chi2LocalPosition", &muon_chi2LocalPosition);
810  tree_->Branch("muon_segComp", &muon_segComp);
811 
812  tree_->Branch("TrackerLayer", &trackerLayer_);
813  tree_->Branch("NumPixelLayers", &numPixelLayers_);
814  tree_->Branch("InnerTrackPixelHits", &tight_PixelHits_);
815  tree_->Branch("innerTrack", &innerTrack_);
816  tree_->Branch("chiTracker", &chiTracker_);
817  tree_->Branch("DxyTracker", &dxyTracker_);
818  tree_->Branch("DzTracker", &dzTracker_);
819  tree_->Branch("innerTrackpt", &innerTrackpt_);
820  tree_->Branch("innerTracketa", &innerTracketa_);
821  tree_->Branch("innerTrackphi", &innerTrackphi_);
822  tree_->Branch("tight_validFraction", &tight_validFraction_);
823 
824  tree_->Branch("OuterTrack", &outerTrack_);
825  tree_->Branch("OuterTrackChi", &outerTrackChi_);
826  tree_->Branch("OuterTrackPt", &outerTrackPt_);
827  tree_->Branch("OuterTrackEta", &outerTrackEta_);
828  tree_->Branch("OuterTrackPhi", &outerTrackPhi_);
829  tree_->Branch("OuterTrackHits", &outerTrackHits_);
830  tree_->Branch("OuterTrackRHits", &outerTrackRHits_);
831 
832  tree_->Branch("GlobalTrack", &globalTrack_);
833  tree_->Branch("GlobalTrckPt", &globalTrckPt_);
834  tree_->Branch("GlobalTrckEta", &globalTrckEta_);
835  tree_->Branch("GlobalTrckPhi", &globalTrckPhi_);
836  tree_->Branch("Global_Muon_Hits", &globalMuonHits_);
837  tree_->Branch("MatchedStations", &matchedStat_);
838  tree_->Branch("GlobTrack_Chi", &chiGlobal_);
839  tree_->Branch("Tight_LongitudinalImpactparameter", &tight_LongPara_);
840  tree_->Branch("Tight_TransImpactparameter", &tight_TransImpara_);
841 
842  tree_->Branch("IsolationR04", &isolationR04_);
843  tree_->Branch("IsolationR03", &isolationR03_);
844  tree_->Branch("ecal_3into3", &ecalEnergy_);
845  tree_->Branch("hcal_3into3", &hcalEnergy_);
846  tree_->Branch("tracker_3into3", &hoEnergy_);
847 
848  tree_->Branch("matchedId", &matchedId_);
849  tree_->Branch("hcal_cellHot", &hcalHot_);
850 
851  tree_->Branch("ecal_3x3", &ecal3x3Energy_);
852  tree_->Branch("hcal_1x1", &hcal1x1Energy_);
853  tree_->Branch("ecal_detID", &ecalDetId_);
854  tree_->Branch("hcal_detID", &hcalDetId_);
855  tree_->Branch("ehcal_detID", &ehcalDetId_);
856  tree_->Branch("hcal_ieta", &hcal_ieta_);
857  tree_->Branch("hcal_iphi", &hcal_iphi_);
858 
859  char name[100];
860  for (int k = 0; k < maxDepth_; ++k) {
861  sprintf(name, "hcal_edepth%d", (k + 1));
862  tree_->Branch(name, &hcalDepthEnergy_[k]);
863  sprintf(name, "hcal_activeL%d", (k + 1));
864  tree_->Branch(name, &hcalDepthActiveLength_[k]);
865  sprintf(name, "hcal_edepthHot%d", (k + 1));
866  tree_->Branch(name, &hcalDepthEnergyHot_[k]);
867  sprintf(name, "hcal_activeHotL%d", (k + 1));
869  sprintf(name, "hcal_cdepthHot%d", (k + 1));
870  tree_->Branch(name, &hcalDepthChargeHot_[k]);
871  sprintf(name, "hcal_cdepthHotBG%d", (k + 1));
872  tree_->Branch(name, &hcalDepthChargeHotBG_[k]);
873  sprintf(name, "hcal_edepthCorrect%d", (k + 1));
874  tree_->Branch(name, &hcalDepthEnergyCorr_[k]);
875  sprintf(name, "hcal_edepthHotCorrect%d", (k + 1));
876  tree_->Branch(name, &hcalDepthEnergyHotCorr_[k]);
877  sprintf(name, "hcal_depthMatch%d", (k + 1));
878  tree_->Branch(name, &hcalDepthMatch_[k]);
879  sprintf(name, "hcal_depthMatchHot%d", (k + 1));
880  tree_->Branch(name, &hcalDepthMatchHot_[k]);
881  }
882 
883  tree_->Branch("activeLength", &hcalActiveLength_);
884  tree_->Branch("activeLengthHot", &hcalActiveLengthHot_);
885 
886  tree_->Branch("hltresults", &hltresults_);
887  tree_->Branch("all_triggers", &all_triggers_);
888 }
889 
890 // ------------ method called when starting to processes a run ------------
891 void HcalHBHEMuonAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
892  hdc_ = &iSetup.getData(tok_ddrec_);
893  actHB.clear();
894  actHE.clear();
895  actHB = hdc_->getThickActive(0);
896  actHE = hdc_->getThickActive(1);
897 #ifdef EDM_ML_DEBUG
898  unsigned int k1(0), k2(0);
899  edm::LogVerbatim("HBHEMuon") << actHB.size() << " Active Length for HB";
900  for (const auto& act : actHB) {
901  edm::LogVerbatim("HBHEMuon") << "[" << k1 << "] ieta " << act.ieta << " depth " << act.depth << " zside "
902  << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":"
903  << act.iphis[0] << " L " << act.thick;
904  HcalDetId hcid1(HcalBarrel, (act.ieta) * (act.zside), act.iphis[0], act.depth);
905  HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1;
906  edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2));
907  ++k1;
908  }
909  edm::LogVerbatim("HBHEMuon") << actHE.size() << " Active Length for HE";
910  for (const auto& act : actHE) {
911  edm::LogVerbatim("HBHEMuon") << "[" << k2 << "] ieta " << act.ieta << " depth " << act.depth << " zside "
912  << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":"
913  << act.iphis[0] << " L " << act.thick;
914  HcalDetId hcid1(HcalEndcap, (act.ieta) * (act.zside), act.iphis[0], act.depth);
915  HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1;
916  edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2));
917  ++k2;
918  }
919 #endif
920 
921  bool changed = true;
922  all_triggers_.clear();
923  if (hltConfig_.init(iRun, iSetup, "HLT", changed)) {
924  // if init returns TRUE, initialisation has succeeded!
925 #ifdef EDM_ML_DEBUG
926  edm::LogVerbatim("HBHEMuon") << "HLT config with process name "
927  << "HLT"
928  << " successfully extracted" << std::endl;
929 #endif
930  unsigned int ntriggers = hltConfig_.size();
931  for (unsigned int t = 0; t < ntriggers; ++t) {
933  for (unsigned int ik = 0; ik < 6; ++ik) {
934  if (hltname.find(triggers_[ik]) != std::string::npos) {
935  all_triggers_.push_back(hltname);
936  break;
937  }
938  }
939  } //loop over ntriggers
940  edm::LogVerbatim("HBHEMuon") << "All triggers size in begin run " << all_triggers_.size() << std::endl;
941  } else {
942  edm::LogError("HBHEMuon") << "Error! HLT config extraction with process "
943  << "name HLT failed";
944  }
945 
947  const HcalRespCorrs* resp = &iSetup.getData(tok_respcorr_);
948  respCorrs_ = new HcalRespCorrs(*resp);
950  geo_ = &iSetup.getData(tok_geom_);
951 
952  // Write correction factors for all HB/HE events
953  if (writeRespCorr_) {
954  const HcalGeometry* gHcal = static_cast<const HcalGeometry*>(geo_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel));
955  const std::vector<DetId>& ids = gHcal->getValidDetIds(DetId::Hcal, 0);
956  edm::LogVerbatim("HBHEMuon") << "\nTable of Correction Factors for Run " << iRun.run() << "\n";
957  for (auto const& id : ids) {
958  if ((id.det() == DetId::Hcal) && ((id.subdetId() == HcalBarrel) || (id.subdetId() == HcalEndcap))) {
959  edm::LogVerbatim("HBHEMuon") << HcalDetId(id) << " " << id.rawId() << " "
960  << (respCorrs_->getValues(id))->getValue();
961  }
962  }
963  }
964 }
965 
966 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
969  desc.add<edm::InputTag>("hlTriggerResults", edm::InputTag("TriggerResults", "", "HLT"));
970  desc.add<edm::InputTag>("labelEBRecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
971  desc.add<edm::InputTag>("labelEERecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
972  desc.add<edm::InputTag>("labelHBHERecHit", edm::InputTag("hbhereco"));
973  desc.add<std::string>("labelVertex", "offlinePrimaryVertices");
974  desc.add<std::string>("labelMuon", "muons");
975  std::vector<std::string> trig = {"HLT_IsoMu17", "HLT_IsoMu20", "HLT_IsoMu24", "HLT_IsoMu27", "HLT_Mu45", "HLT_Mu50"};
976  desc.add<std::vector<std::string>>("triggers", trig);
977  desc.addUntracked<int>("verbosity", 0);
978  desc.add<int>("useRaw", 0);
979  desc.add<bool>("unCorrect", false);
980  desc.add<bool>("getCharge", false);
981  desc.add<bool>("collapseDepth", false);
982  desc.add<bool>("isItPlan1", false);
983  desc.addUntracked<bool>("ignoreHECorr", false);
984  desc.addUntracked<bool>("isItPreRecHit", false);
985  desc.addUntracked<std::string>("moduleName", "");
986  desc.addUntracked<std::string>("processName", "");
987  desc.addUntracked<int>("maxDepth", 4);
988  desc.addUntracked<std::string>("fileInCorr", "");
989  desc.addUntracked<bool>("writeRespCorr", false);
990  descriptions.add("hcalHBHEMuon", desc);
991 }
992 
995  eventNumber_ = -99999;
996  runNumber_ = -99999;
997  lumiNumber_ = -99999;
998  bxNumber_ = -99999;
999  goodVertex_ = -99999;
1000 
1001  muon_is_good_.clear();
1002  muon_global_.clear();
1003  muon_tracker_.clear();
1004  ptGlob_.clear();
1005  etaGlob_.clear();
1006  phiGlob_.clear();
1007  energyMuon_.clear();
1008  pMuon_.clear();
1009  muon_trkKink.clear();
1010  muon_chi2LocalPosition.clear();
1011  muon_segComp.clear();
1012  muon_is_tight_.clear();
1013  muon_is_medium_.clear();
1014 
1015  trackerLayer_.clear();
1016  numPixelLayers_.clear();
1017  tight_PixelHits_.clear();
1018  innerTrack_.clear();
1019  chiTracker_.clear();
1020  dxyTracker_.clear();
1021  dzTracker_.clear();
1022  innerTrackpt_.clear();
1023  innerTracketa_.clear();
1024  innerTrackphi_.clear();
1025  tight_validFraction_.clear();
1026 
1027  outerTrack_.clear();
1028  outerTrackPt_.clear();
1029  outerTrackEta_.clear();
1030  outerTrackPhi_.clear();
1031  outerTrackHits_.clear();
1032  outerTrackRHits_.clear();
1033  outerTrackChi_.clear();
1034 
1035  globalTrack_.clear();
1036  globalTrckPt_.clear();
1037  globalTrckEta_.clear();
1038  globalTrckPhi_.clear();
1039  globalMuonHits_.clear();
1040  matchedStat_.clear();
1041  chiGlobal_.clear();
1042  tight_LongPara_.clear();
1043  tight_TransImpara_.clear();
1044 
1045  isolationR04_.clear();
1046  isolationR03_.clear();
1047  ecalEnergy_.clear();
1048  hcalEnergy_.clear();
1049  hoEnergy_.clear();
1050  matchedId_.clear();
1051  hcalHot_.clear();
1052  ecal3x3Energy_.clear();
1053  hcal1x1Energy_.clear();
1054  ecalDetId_.clear();
1055  hcalDetId_.clear();
1056  ehcalDetId_.clear();
1057  hcal_ieta_.clear();
1058  hcal_iphi_.clear();
1059  for (int i = 0; i < maxDepth_; ++i) {
1060  hcalDepthEnergy_[i].clear();
1061  hcalDepthActiveLength_[i].clear();
1062  hcalDepthEnergyHot_[i].clear();
1063  hcalDepthActiveLengthHot_[i].clear();
1064  hcalDepthChargeHot_[i].clear();
1065  hcalDepthChargeHotBG_[i].clear();
1066  hcalDepthEnergyCorr_[i].clear();
1067  hcalDepthEnergyHotCorr_[i].clear();
1068  hcalDepthMatch_[i].clear();
1069  hcalDepthMatchHot_[i].clear();
1070  }
1071  hcalActiveLength_.clear();
1072  hcalActiveLengthHot_.clear();
1073  hltresults_.clear();
1074 }
1075 
1077  HcalDetId kd1(id1.subdet(), id1.ieta(), id1.iphi(), 1);
1078  HcalDetId kd2(id1.subdet(), id2.ieta(), id2.iphi(), 1);
1079  int match = ((kd1 == kd2) ? 1 : 0);
1080  return match;
1081 }
1082 
1084  HcalDetId id(id_);
1085  int ieta = id.ietaAbs();
1086  int zside = id.zside();
1087  int iphi = id.iphi();
1088  std::vector<int> dpths;
1089  if (mergedDepth_) {
1090  std::vector<HcalDetId> ids;
1091  hdc_->unmergeDepthDetId(id, ids);
1092  for (auto idh : ids)
1093  dpths.emplace_back(idh.depth());
1094  } else {
1095  dpths.emplace_back(id.depth());
1096  }
1097  double lx(0);
1098  if (id.subdet() == HcalBarrel) {
1099  for (unsigned int i = 0; i < actHB.size(); ++i) {
1100  if ((ieta == actHB[i].ieta) && (zside == actHB[i].zside) &&
1101  (std::find(dpths.begin(), dpths.end(), actHB[i].depth) != dpths.end()) &&
1102  (std::find(actHB[i].iphis.begin(), actHB[i].iphis.end(), iphi) != actHB[i].iphis.end())) {
1103  lx += actHB[i].thick;
1104  }
1105  }
1106  } else {
1107  for (unsigned int i = 0; i < actHE.size(); ++i) {
1108  if ((ieta == actHE[i].ieta) && (zside == actHE[i].zside) &&
1109  (std::find(dpths.begin(), dpths.end(), actHE[i].depth) != dpths.end()) &&
1110  (std::find(actHE[i].iphis.begin(), actHE[i].iphis.end(), iphi) != actHE[i].iphis.end())) {
1111  lx += actHE[i].thick;
1112  }
1113  }
1114  }
1115  return lx;
1116 }
1117 
1119  if (vtx.isFake())
1120  return false;
1121  if (vtx.ndof() < 4)
1122  return false;
1123  if (vtx.position().Rho() > 2.)
1124  return false;
1125  if (fabs(vtx.position().Z()) > 24.)
1126  return false;
1127  return true;
1128 }
1129 
1131  double cfac(1.0);
1132  if (useMyCorr_) {
1133  auto itr = corrValue_.find(id);
1134  if (itr != corrValue_.end())
1135  cfac = itr->second;
1136  } else if (respCorrs_ != nullptr) {
1137  cfac = (respCorrs_->getValues(id))->getValue();
1138  }
1139  return cfac;
1140 }
1141 
1143  double gain(0.0);
1144  const HcalCalibrations& calibs = conditions->getHcalCalibrations(id);
1145  for (int capid = 0; capid < 4; ++capid)
1146  gain += (0.25 * calibs.respcorrgain(capid));
1147  return gain;
1148 }
1149 
1151  // Transition between HB/HE is special
1152  // For Run 1 or for Plan1 standard reconstruction it is 3
1153  // For runs beyond 2018 or in Plan1 for HEP17 it is 4
1154  int zside = (ieta > 0) ? 1 : -1;
1156  if (isItPlan1_ && (!isItPreRecHit_))
1157  depth = 3;
1158 #ifdef EDM_ML_DEBUG
1159  edm::LogVerbatim("HBHEMuon") << "Plan1 " << isItPlan1_ << " PreRecHit " << isItPreRecHit_ << " phi " << iphi
1160  << " depth " << depth;
1161 #endif
1162  return depth;
1163 }
1164 
1166  const reco::Track* pTrack,
1167  const CaloGeometry* geo,
1168  const MagneticField* bField) {
1169  std::pair<double, double> rz = hdc_->getRZ(hcid);
1170  bool typeRZ = (hcid.subdet() == HcalEndcap) ? false : true;
1171  bool match = spr::propagateHCAL(pTrack, geo, bField, typeRZ, rz, (((verbosity_ / 10000) % 10) > 0));
1172  return match;
1173 }
1174 
1175 //define this as a plug-in
1177 
HcalHBHEMuonAnalyzer::innerTracketa_
std::vector< double > innerTracketa_
Definition: HcalHBHEMuonAnalyzer.cc:140
HcalHBHEMuonAnalyzer::muon_global_
std::vector< bool > muon_global_
Definition: HcalHBHEMuonAnalyzer.cc:133
ConfigurationDescriptions.h
HcalHBHEMuonAnalyzer::outerTrackPt_
std::vector< double > outerTrackPt_
Definition: HcalHBHEMuonAnalyzer.cc:142
HcalHBHEMuonAnalyzer::dxyTracker_
std::vector< double > dxyTracker_
Definition: HcalHBHEMuonAnalyzer.cc:139
HcalDDDRecConstants::mergedDepthDetId
HcalDetId mergedDepthDetId(const HcalDetId &id) const
Definition: HcalDDDRecConstants.cc:647
HcalHBHEMuonAnalyzer::ignoreHECorr_
const bool ignoreHECorr_
Definition: HcalHBHEMuonAnalyzer.cc:101
HcalHBHEMuonAnalyzer::pMuon_
std::vector< double > pMuon_
Definition: HcalHBHEMuonAnalyzer.cc:135
HcalHBHEMuonAnalyzer::hcalDepthActiveLengthHot_
std::vector< double > hcalDepthActiveLengthHot_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:156
EcalSeverityLevelAlgo
Definition: EcalSeverityLevelAlgo.h:33
HcalHBHEMuonAnalyzer::hcalDepthEnergyHot_
std::vector< double > hcalDepthEnergyHot_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:155
HcalHBHEMuonAnalyzer::isGoodVertex
bool isGoodVertex(const reco::Vertex &vtx)
Definition: HcalHBHEMuonAnalyzer.cc:1118
HcalHBHEMuonAnalyzer::matchedStat_
std::vector< int > matchedStat_
Definition: HcalHBHEMuonAnalyzer.cc:145
HcalRespCorrsRcd.h
electrons_cff.bool
bool
Definition: electrons_cff.py:393
EDAnalyzer.h
HcalRespCorrs
Definition: HcalRespCorrs.h:17
HcalCalibrations.h
mps_fire.i
i
Definition: mps_fire.py:428
HcalHBHEMuonAnalyzer::tight_PixelHits_
std::vector< int > tight_PixelHits_
Definition: HcalHBHEMuonAnalyzer.cc:137
HcalHBHEMuonAnalyzer::tok_htopo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
Definition: HcalHBHEMuonAnalyzer.cc:119
HcalHBHEMuonAnalyzer::hcalDepthChargeHot_
std::vector< double > hcalDepthChargeHot_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:157
Muon.h
MessageLogger.h
HcalTopology::validHcal
bool validHcal(const HcalDetId &id) const
Definition: HcalTopology.cc:230
HcalHBHEMuonAnalyzer::tight_validFraction_
std::vector< double > tight_validFraction_
Definition: HcalHBHEMuonAnalyzer.cc:141
HcalHBHEMuonAnalyzer::muon_is_good_
std::vector< bool > muon_is_good_
Definition: HcalHBHEMuonAnalyzer.cc:133
funct::false
false
Definition: Factorize.h:29
HcalCondObjectContainerBase::setTopo
void setTopo(const HcalTopology *topo)
Definition: HcalCondObjectContainerBase.cc:17
HcalHBHEMuonAnalyzer::getCharge_
const bool getCharge_
Definition: HcalHBHEMuonAnalyzer.cc:102
spr::propagatedTrackID::detIdEHCAL
DetId detIdEHCAL
Definition: CaloPropagateTrack.h:47
HcalHBHEMuonAnalyzer::collapseDepth_
const bool collapseDepth_
Definition: HcalHBHEMuonAnalyzer.cc:100
TriggerResults.h
HcalHBHEMuonAnalyzer::isolationR03_
std::vector< double > isolationR03_
Definition: HcalHBHEMuonAnalyzer.cc:147
HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer
HcalHBHEMuonAnalyzer(const edm::ParameterSet &)
Definition: HcalHBHEMuonAnalyzer.cc:172
HcalHBHEMuonAnalyzer::isItPlan1_
const bool isItPlan1_
Definition: HcalHBHEMuonAnalyzer.cc:100
HcalDetId::iphi
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
HcalHBHEMuonAnalyzer::tok_sevlv_
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_sevlv_
Definition: HcalHBHEMuonAnalyzer.cc:124
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
EcalSeverityLevelAlgoRcd.h
HcalDDDRecConstants::getThickActive
std::vector< HcalActiveLength > getThickActive(const int &type) const
Definition: HcalDDDRecConstants.cc:465
HcalHBHEMuonAnalyzer::tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: HcalHBHEMuonAnalyzer.cc:114
edm::Run
Definition: Run.h:45
HcalHBHEMuonAnalyzer::tok_magField_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
Definition: HcalHBHEMuonAnalyzer.cc:122
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
TriggerEvent.h
edm::EDGetTokenT< edm::TriggerResults >
HcalHBHEMuonAnalyzer::hcalDepthEnergy_
std::vector< double > hcalDepthEnergy_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:153
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalHBHEMuonAnalyzer::tok_trigRes_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
Definition: HcalHBHEMuonAnalyzer.cc:111
HcalHBHEMuonAnalyzer::respCorr
double respCorr(const DetId &id)
Definition: HcalHBHEMuonAnalyzer.cc:1130
globals_cff.id1
id1
Definition: globals_cff.py:33
HcalHBHEMuonAnalyzer::outerTrackPhi_
std::vector< double > outerTrackPhi_
Definition: HcalHBHEMuonAnalyzer.cc:142
HcalTopology
Definition: HcalTopology.h:26
HcalHBHEMuonAnalyzer::muon_trkKink
std::vector< float > muon_trkKink
Definition: HcalHBHEMuonAnalyzer.cc:136
EBDetId.h
EEDetId.h
DetId::Hcal
Definition: DetId.h:28
HcalHBHEMuonAnalyzer::labelHBHERecHit_
const edm::InputTag labelHBHERecHit_
Definition: HcalHBHEMuonAnalyzer.cc:96
HcalHBHEMuonAnalyzer::maxDepth_
int maxDepth_
Definition: HcalHBHEMuonAnalyzer.cc:104
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
HcalHBHEMuonAnalyzer::energyMuon_
std::vector< double > energyMuon_
Definition: HcalHBHEMuonAnalyzer.cc:135
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
HcalHBHEMuonAnalyzer::hcalDepthChargeHotBG_
std::vector< double > hcalDepthChargeHotBG_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:158
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
HcalHBHEMuonAnalyzer
Definition: HcalHBHEMuonAnalyzer.cc:72
HcalHBHEMuonAnalyzer::actHB
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB
Definition: HcalHBHEMuonAnalyzer.cc:167
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
HcalHBHEMuonAnalyzer::tok_HBHE_
edm::EDGetTokenT< HBHERecHitCollection > tok_HBHE_
Definition: HcalHBHEMuonAnalyzer.cc:115
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HcalHBHEMuonAnalyzer::verbosity_
const int verbosity_
Definition: HcalHBHEMuonAnalyzer.cc:99
HcalHBHEMuonAnalyzer::innerTrackphi_
std::vector< double > innerTrackphi_
Definition: HcalHBHEMuonAnalyzer.cc:140
HcalHBHEMuonAnalyzer::isItPreRecHit_
const bool isItPreRecHit_
Definition: HcalHBHEMuonAnalyzer.cc:101
HcalHBHEMuonAnalyzer::all_triggers_
std::vector< std::string > all_triggers_
Definition: HcalHBHEMuonAnalyzer.cc:164
HcalHBHEMuonAnalyzer::writeRespCorr_
const bool writeRespCorr_
Definition: HcalHBHEMuonAnalyzer.cc:102
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
HcalBarrel
Definition: HcalAssistant.h:33
HcalHBHEMuonAnalyzer::mergedDepth_
bool mergedDepth_
Definition: HcalHBHEMuonAnalyzer.cc:103
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
edm::Handle< edm::TriggerResults >
HcalHBHEMuonAnalyzer::eventNumber_
unsigned int eventNumber_
Definition: HcalHBHEMuonAnalyzer.cc:131
HcalHBHEMuonAnalyzer::hcalActiveLength_
std::vector< double > hcalActiveLength_
Definition: HcalHBHEMuonAnalyzer.cc:163
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
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
EcalRecHitCollections.h
chg
const float chg[109]
Definition: CoreSimTrack.cc:5
HcalHBHEMuonAnalyzer::hcalDepthEnergyHotCorr_
std::vector< double > hcalDepthEnergyHotCorr_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:160
HcalGeometry.h
HcalGeometry::getValidDetIds
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
HcalHBHEMuonAnalyzer::actHE
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE
Definition: HcalHBHEMuonAnalyzer.cc:167
HcalHBHEMuonAnalyzer::matchId
int matchId(const HcalDetId &, const HcalDetId &)
Definition: HcalHBHEMuonAnalyzer.cc:1076
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
MakerMacros.h
CaloGeometry
Definition: CaloGeometry.h:21
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
HcalHBHEMuonAnalyzer::useRaw_
const int useRaw_
Definition: HcalHBHEMuonAnalyzer.cc:99
HcalHBHEMuonAnalyzer::tok_ddrec_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_ddrec_
Definition: HcalHBHEMuonAnalyzer.cc:118
spr::energyHCALCell
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, int depthHE=3, bool debug=false)
Track.h
HcalHBHEMuonAnalyzer::muon_tracker_
std::vector< bool > muon_tracker_
Definition: HcalHBHEMuonAnalyzer.cc:133
HcalHBHEMuonAnalyzer::tok_Muon_
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
Definition: HcalHBHEMuonAnalyzer.cc:116
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HcalHBHEMuonAnalyzer::numPixelLayers_
std::vector< int > numPixelLayers_
Definition: HcalHBHEMuonAnalyzer.cc:137
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
HcalHBHEMuonAnalyzer::isolationR04_
std::vector< double > isolationR04_
Definition: HcalHBHEMuonAnalyzer.cc:147
HcalHBHEMuonAnalyzer::fs
edm::Service< TFileService > fs
Definition: HcalHBHEMuonAnalyzer.cc:94
HcalHBHEMuonAnalyzer::runNumber_
unsigned int runNumber_
Definition: HcalHBHEMuonAnalyzer.cc:131
HcalHBHEMuonAnalyzer::muon_is_tight_
std::vector< bool > muon_is_tight_
Definition: HcalHBHEMuonAnalyzer.cc:134
edm::HLTGlobalStatus::size
unsigned int size() const
Get number of paths stored.
Definition: HLTGlobalStatus.h:35
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
MuonSelectors.h
Service.h
HcalHBHEMuonAnalyzer::ecalDetId_
std::vector< unsigned int > ecalDetId_
Definition: HcalHBHEMuonAnalyzer.cc:151
spr::propagatedTrackID::okECAL
bool okECAL
Definition: CaloPropagateTrack.h:46
MuonFwd.h
eHCALMatrix.h
HcalHBHEMuonAnalyzer::trackerLayer_
std::vector< int > trackerLayer_
Definition: HcalHBHEMuonAnalyzer.cc:137
HcalHBHEMuonAnalyzer::ehcalDetId_
std::vector< unsigned int > ehcalDetId_
Definition: HcalHBHEMuonAnalyzer.cc:151
reco::Track
Definition: Track.h:27
IdealMagneticFieldRecord.h
HcalHBHEMuonAnalyzer::phiGlob_
std::vector< double > phiGlob_
Definition: HcalHBHEMuonAnalyzer.cc:135
HcalHBHEMuonAnalyzer::labelEBRecHit_
const edm::InputTag labelEBRecHit_
Definition: HcalHBHEMuonAnalyzer.cc:96
HcalHBHEMuonAnalyzer::dzTracker_
std::vector< double > dzTracker_
Definition: HcalHBHEMuonAnalyzer.cc:139
HcalHBHEMuonAnalyzer::hlTriggerResults_
const edm::InputTag hlTriggerResults_
Definition: HcalHBHEMuonAnalyzer.cc:95
HcalHBHEMuonAnalyzer::respCorrs_
HcalRespCorrs * respCorrs_
Definition: HcalHBHEMuonAnalyzer.cc:109
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HcalDbRecord.h
HcalCalibrations
Definition: HcalCalibrations.h:9
eECALMatrix.h
EcalSeverityLevelAlgo.h
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalDDDRecConstants::getMinDepth
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
Definition: HcalDDDRecConstants.cc:353
HcalCalibrations::respcorrgain
constexpr double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
Definition: HcalCalibrations.h:42
CaloGeometryRecord.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
EcalSubdetector.h
HLTConfigProvider::size
unsigned int size() const
number of trigger paths in trigger table
Definition: HLTConfigProvider.h:63
HcalHBHEMuonAnalyzer::globalMuonHits_
std::vector< int > globalMuonHits_
Definition: HcalHBHEMuonAnalyzer.cc:145
TFileService.h
HcalHBHEMuonAnalyzer::hcalDepthEnergyCorr_
std::vector< double > hcalDepthEnergyCorr_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:159
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
CaloSubdetectorGeometry.h
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
spr::propagatedTrackID::detIdHCAL
DetId detIdHCAL
Definition: CaloPropagateTrack.h:47
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
HcalHBHEMuonAnalyzer::hcal1x1Energy_
std::vector< double > hcal1x1Energy_
Definition: HcalHBHEMuonAnalyzer.cc:150
spr::propagatedTrackID::detIdECAL
DetId detIdECAL
Definition: CaloPropagateTrack.h:47
HcalHBHEMuonAnalyzer::outerTrackRHits_
std::vector< int > outerTrackRHits_
Definition: HcalHBHEMuonAnalyzer.cc:143
Event.h
HcalHBHEMuonAnalyzer::hltresults_
std::vector< int > hltresults_
Definition: HcalHBHEMuonAnalyzer.cc:165
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HcalHBHEMuonAnalyzer::hcalHot_
std::vector< bool > hcalHot_
Definition: HcalHBHEMuonAnalyzer.cc:149
HcalHBHEMuonAnalyzer::globalTrckPt_
std::vector< double > globalTrckPt_
Definition: HcalHBHEMuonAnalyzer.cc:144
HcalHBHEMuonAnalyzer::labelEERecHit_
const edm::InputTag labelEERecHit_
Definition: HcalHBHEMuonAnalyzer.cc:96
muon::isTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:880
HcalDetId.h
HcalTopology::dddConstants
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
HcalHBHEMuonAnalyzer::lumiNumber_
unsigned int lumiNumber_
Definition: HcalHBHEMuonAnalyzer.cc:131
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
CaloTopologyRecord.h
reco::JetExtendedAssociation::getValue
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
Definition: JetExtendedAssociation.cc:50
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalHBHEMuonAnalyzer::geo_
const CaloGeometry * geo_
Definition: HcalHBHEMuonAnalyzer.cc:108
HcalDetId
Definition: HcalDetId.h:12
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
HcalHBHEMuonAnalyzer::useMyCorr_
bool useMyCorr_
Definition: HcalHBHEMuonAnalyzer.cc:103
TriggerNames.h
HcalHBHEMuonAnalyzer::chiTracker_
std::vector< double > chiTracker_
Definition: HcalHBHEMuonAnalyzer.cc:139
iEvent
int iEvent
Definition: GenABIO.cc:224
HcalHBHEMuonAnalyzer::labelVtx_
const std::string labelVtx_
Definition: HcalHBHEMuonAnalyzer.cc:97
HcalHBHEMuonAnalyzer::tok_chan_
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_chan_
Definition: HcalHBHEMuonAnalyzer.cc:123
HcalHBHEMuonAnalyzer::innerTrack_
std::vector< bool > innerTrack_
Definition: HcalHBHEMuonAnalyzer.cc:138
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HcalHBHEMuonAnalyzer::outerTrackHits_
std::vector< int > outerTrackHits_
Definition: HcalHBHEMuonAnalyzer.cc:143
HcalHBHEMuonAnalyzer::globalTrack_
std::vector< bool > globalTrack_
Definition: HcalHBHEMuonAnalyzer.cc:138
HcalHBHEMuonAnalyzer::depthMax_
static const int depthMax_
Definition: HcalHBHEMuonAnalyzer.cc:129
HcalHBHEMuonAnalyzer::outerTrackEta_
std::vector< double > outerTrackEta_
Definition: HcalHBHEMuonAnalyzer.cc:142
HcalHBHEMuonAnalyzer::tok_respcorr_
edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_respcorr_
Definition: HcalHBHEMuonAnalyzer.cc:120
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
HcalRespCorrs.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalHBHEMuonAnalyzer::globalTrckEta_
std::vector< double > globalTrckEta_
Definition: HcalHBHEMuonAnalyzer.cc:144
HLTConfigProvider.h
HcalHBHEMuonAnalyzer::clearVectors
void clearVectors()
Definition: HcalHBHEMuonAnalyzer.cc:993
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
muon::isMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:899
get
#define get
ClusterTask_cfi.trig
trig
Definition: ClusterTask_cfi.py:398
HcalHBHEMuonAnalyzer::tok_geom_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Definition: HcalHBHEMuonAnalyzer.cc:121
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord >
spr::propagatedTrackID::okHCAL
bool okHCAL
Definition: CaloPropagateTrack.h:46
TriggerObject.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
CaloTopology.h
HcalHBHEMuonAnalyzer::kount_
int kount_
Definition: HcalHBHEMuonAnalyzer.cc:104
HcalHBHEMuonAnalyzer::hcalDepthActiveLength_
std::vector< double > hcalDepthActiveLength_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:154
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
HcalHBHEMuonAnalyzer::hcalEnergy_
std::vector< double > hcalEnergy_
Definition: HcalHBHEMuonAnalyzer.cc:148
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
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
VertexFwd.h
CaloSubdetectorTopology.h
HcalHBHEMuonAnalyzer::muon_segComp
std::vector< float > muon_segComp
Definition: HcalHBHEMuonAnalyzer.cc:136
HcalHBHEMuonAnalyzer::hcalDetId_
std::vector< unsigned int > hcalDetId_
Definition: HcalHBHEMuonAnalyzer.cc:151
HcalHBHEMuonAnalyzer::corrValue_
std::map< DetId, double > corrValue_
Definition: HcalHBHEMuonAnalyzer.cc:168
HcalTopology.h
HcalHBHEMuonAnalyzer::ecal3x3Energy_
std::vector< double > ecal3x3Energy_
Definition: HcalHBHEMuonAnalyzer.cc:150
HcalDbService
Definition: HcalDbService.h:26
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTConfigProvider
Definition: HLTConfigProvider.h:29
HcalHBHEMuonAnalyzer::globalTrckPhi_
std::vector< double > globalTrckPhi_
Definition: HcalHBHEMuonAnalyzer.cc:144
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalDDDRecConstants::getRZ
double getRZ(const int &subdet, const int &ieta, const int &depth) const
Definition: HcalDDDRecConstants.cc:416
HcalHBHEMuonAnalyzer::tok_EB_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: HcalHBHEMuonAnalyzer.cc:113
spr::propagateHCALBack
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
Definition: CaloPropagateTrack.cc:619
HLTConfigProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Definition: HLTConfigProvider.cc:36
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
HcalEndcap
Definition: HcalAssistant.h:34
HcalHBHEMuonAnalyzer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: HcalHBHEMuonAnalyzer.cc:82
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CaloPropagateTrack.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HLTConfigData.h
HcalHBHEMuonAnalyzer::hcalActiveLengthHot_
std::vector< double > hcalActiveLengthHot_
Definition: HcalHBHEMuonAnalyzer.cc:163
HcalHBHEMuonAnalyzer::unCorrect_
const bool unCorrect_
Definition: HcalHBHEMuonAnalyzer.cc:100
HcalHBHEMuonAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HcalHBHEMuonAnalyzer.cc:967
CaloGeometry.h
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
HcalHBHEMuonAnalyzer::beginJob
void beginJob() override
Definition: HcalHBHEMuonAnalyzer.cc:791
edm::TriggerNames
Definition: TriggerNames.h:55
HcalDDDRecConstants.h
spr::propagatedTrackID
Definition: CaloPropagateTrack.h:40
HcalHBHEMuonAnalyzer::hcalDepthMatch_
std::vector< bool > hcalDepthMatch_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:161
HcalHBHEMuonAnalyzer::tok_topo_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_topo_
Definition: HcalHBHEMuonAnalyzer.cc:125
HcalHBHEMuonAnalyzer::tok_dbservice_
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbservice_
Definition: HcalHBHEMuonAnalyzer.cc:126
HcalHBHEMuonAnalyzer::hcal_ieta_
std::vector< int > hcal_ieta_
Definition: HcalHBHEMuonAnalyzer.cc:152
HcalHBHEMuonAnalyzer::tok_Vtx_
edm::EDGetTokenT< reco::VertexCollection > tok_Vtx_
Definition: HcalHBHEMuonAnalyzer.cc:112
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HcalHBHEMuonAnalyzer::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: HcalHBHEMuonAnalyzer.cc:891
HcalHBHEMuonAnalyzer::hoEnergy_
std::vector< double > hoEnergy_
Definition: HcalHBHEMuonAnalyzer.cc:148
spr::propagateHCAL
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:759
HcalRecHitCollections.h
HcalHBHEMuonAnalyzer::goodVertex_
unsigned int goodVertex_
Definition: HcalHBHEMuonAnalyzer.cc:132
HcalHBHEMuonAnalyzer::hdc_
const HcalDDDRecConstants * hdc_
Definition: HcalHBHEMuonAnalyzer.cc:106
HcalHBHEMuonAnalyzer::depth16HE
int depth16HE(int ieta, int iphi)
Definition: HcalHBHEMuonAnalyzer.cc:1150
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)
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
HcalDbService.h
HcalDDDRecConstants
Definition: HcalDDDRecConstants.h:23
HLTConfigProvider::triggerName
const std::string & triggerName(unsigned int triggerIndex) const
Definition: HLTConfigProvider.h:70
HcalHBHEMuonAnalyzer::bxNumber_
unsigned int bxNumber_
Definition: HcalHBHEMuonAnalyzer.cc:131
HcalHBHEMuonAnalyzer::matchedId_
std::vector< bool > matchedId_
Definition: HcalHBHEMuonAnalyzer.cc:149
HcalHBHEMuonAnalyzer::hcal_iphi_
std::vector< int > hcal_iphi_
Definition: HcalHBHEMuonAnalyzer.cc:152
HcalHBHEMuonAnalyzer::theHBHETopology_
const HcalTopology * theHBHETopology_
Definition: HcalHBHEMuonAnalyzer.cc:107
HcalHBHEMuonAnalyzer::hltConfig_
HLTConfigProvider hltConfig_
Definition: HcalHBHEMuonAnalyzer.cc:93
HcalHBHEMuonAnalyzer::ecalEnergy_
std::vector< double > ecalEnergy_
Definition: HcalHBHEMuonAnalyzer.cc:148
HcalHBHEMuonAnalyzer::muon_is_medium_
std::vector< bool > muon_is_medium_
Definition: HcalHBHEMuonAnalyzer.cc:134
HcalHBHEMuonAnalyzer::chiGlobal_
std::vector< double > chiGlobal_
Definition: HcalHBHEMuonAnalyzer.cc:146
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalHBHEMuonAnalyzer::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: HcalHBHEMuonAnalyzer.cc:260
ParameterSet.h
HcalHBHEMuonAnalyzer::hcalDepthMatchHot_
std::vector< bool > hcalDepthMatchHot_[depthMax_]
Definition: HcalHBHEMuonAnalyzer.cc:162
globals_cff.id2
id2
Definition: globals_cff.py:34
HcalHBHEMuonAnalyzer::innerTrackpt_
std::vector< double > innerTrackpt_
Definition: HcalHBHEMuonAnalyzer.cc:140
HcalHBHEMuonAnalyzer::etaGlob_
std::vector< double > etaGlob_
Definition: HcalHBHEMuonAnalyzer.cc:135
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HcalHBHEMuonAnalyzer::muon_chi2LocalPosition
std::vector< float > muon_chi2LocalPosition
Definition: HcalHBHEMuonAnalyzer.cc:136
HcalHBHEMuonAnalyzer::triggers_
const std::vector< std::string > triggers_
Definition: HcalHBHEMuonAnalyzer.cc:98
edm::Event
Definition: Event.h:73
edm::TriggerNames::triggerIndex
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
HcalHBHEMuonAnalyzer::outerTrack_
std::vector< bool > outerTrack_
Definition: HcalHBHEMuonAnalyzer.cc:138
MagneticField
Definition: MagneticField.h:19
HcalHBHEMuonAnalyzer::gainFactor
double gainFactor(const HcalDbService *dbserv, const HcalDetId &id)
Definition: HcalHBHEMuonAnalyzer.cc:1142
edm::Log
Definition: MessageLogger.h:70
HcalHBHEMuonAnalyzer::activeLength
double activeLength(const DetId &)
Definition: HcalHBHEMuonAnalyzer.cc:1083
HcalHBHEMuonAnalyzer::ptGlob_
std::vector< double > ptGlob_
Definition: HcalHBHEMuonAnalyzer.cc:135
HcalGeometry
Definition: HcalGeometry.h:17
HcalHBHEMuonAnalyzer::goodCell
bool goodCell(const HcalDetId &hcid, const reco::Track *pTrack, const CaloGeometry *geo, const MagneticField *bField)
Definition: HcalHBHEMuonAnalyzer.cc:1165
HcalHBHEMuonAnalyzer::outerTrackChi_
std::vector< double > outerTrackChi_
Definition: HcalHBHEMuonAnalyzer.cc:141
HcalHBHEMuonAnalyzer::labelMuon_
const std::string labelMuon_
Definition: HcalHBHEMuonAnalyzer.cc:97
edm::InputTag
Definition: InputTag.h:15
HcalDDDRecConstants::unmergeDepthDetId
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
Definition: HcalDDDRecConstants.cc:671
reco::Vertex
Definition: Vertex.h:35
EcalChannelStatusRcd.h
HcalHBHEMuonAnalyzer::fileInCorr_
const std::string fileInCorr_
Definition: HcalHBHEMuonAnalyzer.cc:97
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
HcalHBHEMuonAnalyzer::tight_LongPara_
std::vector< double > tight_LongPara_
Definition: HcalHBHEMuonAnalyzer.cc:146
HcalHBHEMuonAnalyzer::tight_TransImpara_
std::vector< double > tight_TransImpara_
Definition: HcalHBHEMuonAnalyzer.cc:146
HcalHBHEMuonAnalyzer::tree_
TTree * tree_
Definition: HcalHBHEMuonAnalyzer.cc:130