CMS 3D CMS Logo

HcalIsoTrkSimAnalyzer.cc
Go to the documentation of this file.
1 // system include files
2 #include <cmath>
3 #include <string>
4 #include <vector>
5 
6 // Root objects
7 #include "TTree.h"
8 #include "TLorentzVector.h"
9 
12 
16 
17 // Vertices
21 
22 //Triggers
29 
34 
38 
39 //Generator information
44 
47 
55 
61 
74 
75 //#define EDM_ML_DEBUG
76 
77 class HcalIsoTrkSimAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
78 public:
80  ~HcalIsoTrkSimAnalyzer() override = default;
81 
82  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
83 
84 private:
85  void analyze(edm::Event const&, edm::EventSetup const&) override;
86  void beginJob() override;
87  void beginRun(edm::Run const&, edm::EventSetup const&) override;
88  void endRun(edm::Run const&, edm::EventSetup const&) override;
89 
90  std::array<int, 3> fillTree(std::vector<math::XYZTLorentzVector>& vecL1,
91  std::vector<math::XYZTLorentzVector>& vecL3,
92  math::XYZPoint& leadPV,
93  std::vector<spr::propagatedGenParticleID>& trackIDs,
94  const CaloGeometry* geo,
95  const CaloTopology* topo,
96  const HcalTopology* theHBHETopology,
97  const EcalChannelStatus* theEcalChStatus,
98  const EcalSeverityLevelAlgo* theEcalSevlv,
99  edm::Handle<EcalRecHitCollection>& barrelRecHitsHandle,
100  edm::Handle<EcalRecHitCollection>& endcapRecHitsHandle,
102  const edm::Handle<CaloTowerCollection>& towerHandle,
104  const HcalRespCorrs* respCorrs);
106  double rhoh(const edm::Handle<CaloTowerCollection>&);
107  double eThreshold(const DetId& id, const CaloGeometry* geo) const;
108  DetId newId(const DetId&);
109  void storeEnergy(int indx,
110  const HcalRespCorrs* respCorrs,
111  const std::vector<DetId>& ids,
112  std::vector<double>& edet,
113  double& eHcal,
114  std::vector<unsigned int>* detIds,
115  std::vector<double>* hitEnergies);
116  bool notaMuon(const reco::GenParticle* pTrack);
117 
120  const std::vector<std::string> trigNames_;
123  const double ptMin_, etaMax_;
128  const double pTrackLow_, pTrackHigh_;
130  const int useRaw_, dataType_, mode_;
134  const double hitEthrEE2_, hitEthrEE3_;
135  const double hitEthrEELo_, hitEthrEEHi_;
139  const std::vector<int> oldID_, newDepth_;
140  const bool hep17_;
141  const bool usePFThresh_;
144 
156 
167 
168  unsigned int nRun_, nLow_, nHigh_;
172 
173  std::vector<double> etabins_, phibins_;
174  std::vector<int> oldDet_, oldEta_, oldDepth_;
176 
177  TTree *tree, *tree2;
178  unsigned int t_RunNo, t_EventNo;
191  std::vector<unsigned int>*t_DetIds, *t_DetIds1, *t_DetIds3;
192  std::vector<double>*t_HitEnergies, *t_HitEnergies1, *t_HitEnergies3;
193  std::vector<bool>*t_trgbits, *t_hltbits;
194  bool t_L1Bit;
197  std::vector<int>*t_ietaAll, *t_ietaGood, *t_trackType;
198 };
199 
201  : trigNames_(iConfig.getParameter<std::vector<std::string> >("triggers")),
202  processName_(iConfig.getParameter<std::string>("processName")),
203  l1Filter_(iConfig.getParameter<std::string>("l1Filter")),
204  l2Filter_(iConfig.getParameter<std::string>("l2Filter")),
205  l3Filter_(iConfig.getParameter<std::string>("l3Filter")),
206  ptMin_(iConfig.getParameter<double>("pTMin")),
207  etaMax_(iConfig.getParameter<double>("maxChargedHadronEta")),
208  a_coneR_(iConfig.getParameter<double>("coneRadius")),
209  a_mipR_(iConfig.getParameter<double>("coneRadiusMIP")),
210  a_mipR2_(iConfig.getParameter<double>("coneRadiusMIP2")),
211  a_mipR3_(iConfig.getParameter<double>("coneRadiusMIP3")),
212  a_mipR4_(iConfig.getParameter<double>("coneRadiusMIP4")),
213  a_mipR5_(iConfig.getParameter<double>("coneRadiusMIP5")),
214  pTrackMin_(iConfig.getParameter<double>("minimumTrackP")),
215  eEcalMax_(iConfig.getParameter<double>("maximumEcalEnergy")),
216  maxRestrictionP_(iConfig.getParameter<double>("maxTrackP")),
217  slopeRestrictionP_(iConfig.getParameter<double>("slopeTrackP")),
218  hcalScale_(iConfig.getUntrackedParameter<double>("hHcalScale", 1.0)),
219  eIsolate1_(iConfig.getParameter<double>("isolationEnergyTight")),
220  eIsolate2_(iConfig.getParameter<double>("isolationEnergyLoose")),
221  pTrackLow_(iConfig.getParameter<double>("momentumLow")),
222  pTrackHigh_(iConfig.getParameter<double>("momentumHigh")),
223  prescaleLow_(iConfig.getParameter<int>("prescaleLow")),
224  prescaleHigh_(iConfig.getParameter<int>("prescaleHigh")),
225  useRaw_(iConfig.getUntrackedParameter<int>("useRaw", 0)),
226  dataType_(iConfig.getUntrackedParameter<int>("dataType", 0)),
227  mode_(iConfig.getUntrackedParameter<int>("outMode", 11)),
228  ignoreTrigger_(iConfig.getUntrackedParameter<bool>("ignoreTriggers", false)),
229  useL1Trigger_(iConfig.getUntrackedParameter<bool>("useL1Trigger", false)),
230  unCorrect_(iConfig.getUntrackedParameter<bool>("unCorrect", false)),
231  collapseDepth_(iConfig.getUntrackedParameter<bool>("collapseDepth", false)),
232  hitEthrEB_(iConfig.getParameter<double>("EBHitEnergyThreshold")),
233  hitEthrEE0_(iConfig.getParameter<double>("EEHitEnergyThreshold0")),
234  hitEthrEE1_(iConfig.getParameter<double>("EEHitEnergyThreshold1")),
235  hitEthrEE2_(iConfig.getParameter<double>("EEHitEnergyThreshold2")),
236  hitEthrEE3_(iConfig.getParameter<double>("EEHitEnergyThreshold3")),
237  hitEthrEELo_(iConfig.getParameter<double>("EEHitEnergyThresholdLow")),
238  hitEthrEEHi_(iConfig.getParameter<double>("EEHitEnergyThresholdHigh")),
239  triggerEvent_(iConfig.getParameter<edm::InputTag>("labelTriggerEvent")),
240  theTriggerResultsLabel_(iConfig.getParameter<edm::InputTag>("labelTriggerResult")),
241  labelGenTrack_(iConfig.getParameter<std::string>("labelTrack")),
242  labelRecVtx_(iConfig.getParameter<std::string>("labelVertex")),
243  labelEB_(iConfig.getParameter<std::string>("labelEBRecHit")),
244  labelEE_(iConfig.getParameter<std::string>("labelEERecHit")),
245  labelHBHE_(iConfig.getParameter<std::string>("labelHBHERecHit")),
246  labelTower_(iConfig.getParameter<std::string>("labelCaloTower")),
247  l1TrigName_(iConfig.getUntrackedParameter<std::string>("l1TrigName", "L1_SingleJet60")),
248  oldID_(iConfig.getUntrackedParameter<std::vector<int> >("oldID")),
249  newDepth_(iConfig.getUntrackedParameter<std::vector<int> >("newDepth")),
250  hep17_(iConfig.getUntrackedParameter<bool>("hep17")),
251  usePFThresh_(iConfig.getParameter<bool>("usePFThreshold")),
252  labelBS_(iConfig.getParameter<std::string>("labelBeamSpot")),
253  modnam_(iConfig.getUntrackedParameter<std::string>("moduleName", "")),
254  prdnam_(iConfig.getUntrackedParameter<std::string>("producerName", "")),
255  algTag_(iConfig.getParameter<edm::InputTag>("algInputTag")),
256  extTag_(iConfig.getParameter<edm::InputTag>("extInputTag")),
257  tok_trigEvt_(consumes<trigger::TriggerEvent>(triggerEvent_)),
258  tok_trigRes_(consumes<edm::TriggerResults>(theTriggerResultsLabel_)),
259  tok_bs_(consumes<reco::BeamSpot>(labelBS_)),
260  tok_recVtx_((modnam_.empty()) ? consumes<reco::VertexCollection>(labelRecVtx_)
261  : consumes<reco::VertexCollection>(edm::InputTag(modnam_, labelRecVtx_, prdnam_))),
262  tok_EB_((modnam_.empty()) ? consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", labelEB_))
263  : consumes<EcalRecHitCollection>(edm::InputTag(modnam_, labelEB_, prdnam_))),
264  tok_EE_((modnam_.empty()) ? consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", labelEE_))
265  : consumes<EcalRecHitCollection>(edm::InputTag(modnam_, labelEE_, prdnam_))),
266  tok_hbhe_((modnam_.empty()) ? consumes<HBHERecHitCollection>(labelHBHE_)
267  : consumes<HBHERecHitCollection>(edm::InputTag(modnam_, labelHBHE_, prdnam_))),
268  tok_ew_(consumes<GenEventInfoProduct>(edm::InputTag("generator"))),
269  tok_parts_(consumes<reco::GenParticleCollection>(edm::InputTag("genParticles"))),
270  tok_cala_(consumes<CaloTowerCollection>(labelTower_)),
271  tok_alg_(consumes<BXVector<GlobalAlgBlk> >(algTag_)),
274  tok_ecalChStatus_(esConsumes<EcalChannelStatus, EcalChannelStatusRcd>()),
277  tok_caloTopology_(esConsumes<CaloTopology, CaloTopologyRecord>()),
281  tok_ecalPFRecHitThresholds_(esConsumes<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd>()),
282  nRun_(0),
283  nLow_(0),
284  nHigh_(0),
285  hdc_(nullptr) {
286  usesResource(TFileService::kSharedResource);
287 
288  //now do whatever initialization is needed
289  const double isolationRadius(28.9), innerR(10.0), outerR(30.0);
290  a_charIsoR_ = a_coneR_ + isolationRadius;
291  a_coneR1_ = a_coneR_ + innerR;
292  a_coneR2_ = a_coneR_ + outerR;
293  // Different isolation cuts are described in DN-2016/029
294  // Tight cut uses 2 GeV; Loose cut uses 10 GeV
295  // Eta dependent cut uses (maxRestrictionP_ * exp(|ieta|*log(2.5)/18))
296  // with the factor for exponential slopeRestrictionP_ = log(2.5)/18
297  // maxRestrictionP_ = 8 GeV as came from a study
298 
299  for (unsigned int k = 0; k < oldID_.size(); ++k) {
300  oldDet_.emplace_back((oldID_[k] / 10000) % 10);
301  oldEta_.emplace_back((oldID_[k] / 100) % 100);
302  oldDepth_.emplace_back(oldID_[k] % 100);
303  }
304 
305  l1GtUtils_ =
307 
308  if (modnam_.empty()) {
309  edm::LogVerbatim("HcalIsoTrack") << "Labels used " << triggerEvent_ << " " << theTriggerResultsLabel_ << " "
310  << labelBS_ << " " << labelRecVtx_ << " " << labelGenTrack_ << " "
311  << edm::InputTag("ecalRecHit", labelEB_) << " "
312  << edm::InputTag("ecalRecHit", labelEE_) << " " << labelHBHE_ << " "
313  << labelTower_;
314  } else {
315  edm::LogVerbatim("HcalIsoTrack") << "Labels used " << triggerEvent_ << " " << theTriggerResultsLabel_ << " "
316  << labelBS_ << " " << edm::InputTag(modnam_, labelRecVtx_, prdnam_) << " "
317  << labelGenTrack_ << " " << edm::InputTag(modnam_, labelEB_, prdnam_) << " "
320  }
321 
322  edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n"
323  << "\t minPt " << ptMin_ << "\t etaMax " << etaMax_ << "\t a_coneR " << a_coneR_
324  << ":" << a_coneR1_ << ":" << a_coneR2_ << "\t a_charIsoR " << a_charIsoR_
325  << "\t a_mipR " << a_mipR_ << "\t a_mipR2 " << a_mipR2_ << "\t a_mipR3 " << a_mipR3_
326  << "\t a_mipR4 " << a_mipR4_ << "\t a_mipR5 " << a_mipR5_ << "\n pTrackMin_ "
327  << pTrackMin_ << "\t eEcalMax_ " << eEcalMax_ << "\t maxRestrictionP_ "
328  << maxRestrictionP_ << "\t slopeRestrictionP_ " << slopeRestrictionP_
329  << "\t eIsolateStrong_ " << eIsolate1_ << "\t eIsolateSoft_ " << eIsolate2_
330  << "\t hcalScale_ " << hcalScale_ << "\n\t momentumLow_ " << pTrackLow_
331  << "\t prescaleLow_ " << prescaleLow_ << "\t momentumHigh_ " << pTrackHigh_
332  << "\t prescaleHigh_ " << prescaleHigh_ << "\n\t useRaw_ " << useRaw_
333  << "\t ignoreTrigger_ " << ignoreTrigger_ << "\n\t useL1Trigegr_ " << useL1Trigger_
334  << "\t dataType_ " << dataType_ << "\t mode_ " << mode_
335  << "\t unCorrect_ " << unCorrect_ << "\t collapseDepth_ " << collapseDepth_
336  << "\t L1TrigName_ " << l1TrigName_ << "\nThreshold flag used " << usePFThresh_
337  << " value for EB " << hitEthrEB_ << " EE " << hitEthrEE0_ << ":" << hitEthrEE1_
338  << ":" << hitEthrEE2_ << ":" << hitEthrEE3_ << ":" << hitEthrEELo_ << ":"
339  << hitEthrEEHi_;
340  edm::LogVerbatim("HcalIsoTrack") << "Process " << processName_ << " L1Filter:" << l1Filter_
341  << " L2Filter:" << l2Filter_ << " L3Filter:" << l3Filter_;
342  for (unsigned int k = 0; k < trigNames_.size(); ++k) {
343  edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k];
344  }
345  edm::LogVerbatim("HcalIsoTrack") << oldID_.size() << " DetIDs to be corrected with HEP17 flag:" << hep17_;
346  for (unsigned int k = 0; k < oldID_.size(); ++k)
347  edm::LogVerbatim("HcalIsoTrack") << "[" << k << "] Det " << oldDet_[k] << " EtaAbs " << oldEta_[k] << " Depth "
348  << oldDepth_[k] << ":" << newDepth_[k];
349 
350  for (int i = 0; i < 10; i++)
351  phibins_.push_back(-M_PI + 0.1 * (2 * i + 1) * M_PI);
352  for (int i = 0; i < 8; ++i)
353  etabins_.push_back(-2.1 + 0.6 * i);
354  etadist_ = etabins_[1] - etabins_[0];
355  phidist_ = phibins_[1] - phibins_[0];
356  etahalfdist_ = 0.5 * etadist_;
357  phihalfdist_ = 0.5 * phidist_;
358  edm::LogVerbatim("HcalIsoTrack") << "EtaDist " << etadist_ << " " << etahalfdist_ << " PhiDist " << phidist_ << " "
359  << phihalfdist_;
360  unsigned int k1(0), k2(0);
361  for (auto phi : phibins_) {
362  edm::LogVerbatim("HcalIsoTrack") << "phibin_[" << k1 << "] " << phi;
363  ++k1;
364  }
365  for (auto eta : etabins_) {
366  edm::LogVerbatim("HcalIsoTrack") << "etabin_[" << k2 << "] " << eta;
367  ++k2;
368  }
369 }
370 
372  t_Run = iEvent.id().run();
373  t_Event = iEvent.id().event();
375 #ifdef EDM_ML_DEBUG
376  edm::LogVerbatim("HcalIsoTrack") << "Run " << t_Run << " Event " << t_Event << " type " << t_DataType
377  << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing();
378 #endif
379  //Get magnetic field and ECAL channel status
380  const MagneticField* bField = &iSetup.getData(tok_bFieldH_);
381  const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_ecalChStatus_);
382  const EcalSeverityLevelAlgo* theEcalSevlv = &iSetup.getData(tok_sevlv_);
383 
384  // get calogeometry and calotopology
385  const CaloGeometry* geo = &iSetup.getData(tok_geom_);
386  const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_);
387  const HcalTopology* theHBHETopology = &iSetup.getData(tok_htopo_);
388 
389  // get response correction
390  const HcalRespCorrs* resp = &iSetup.getData(tok_resp_);
391  HcalRespCorrs* respCorrs = new HcalRespCorrs(*resp);
392  respCorrs->setTopo(theHBHETopology);
393 
394  // get ECAL thresholds
396 
397  // get particle data table
398  const HepPDT::ParticleDataTable* pdt = &iSetup.getData(tok_pdt_);
399 
400  //=== genParticle information
401  bool okC(true);
403  if (!genParticles.isValid()) {
404  edm::LogWarning("HcalIsoTrack") << "Cannot access the genParticles collection";
405  okC = false;
406  }
407 
408  //event weight for FLAT sample
409  t_EventWeight = 1.0;
411  if (genEventInfo.isValid())
412  t_EventWeight = genEventInfo->weight();
413 
414  //Define the best vertex and the beamspot
415  const edm::Handle<reco::VertexCollection> recVtxs = iEvent.getHandle(tok_recVtx_);
416  const edm::Handle<reco::BeamSpot> beamSpotH = iEvent.getHandle(tok_bs_);
417  math::XYZPoint leadPV(0, 0, 0);
418  t_goodPV = t_nVtx = 0;
419  if (recVtxs.isValid() && !(recVtxs->empty())) {
420  t_nVtx = recVtxs->size();
421  for (unsigned int k = 0; k < recVtxs->size(); ++k) {
422  if (!((*recVtxs)[k].isFake()) && ((*recVtxs)[k].ndof() > 4)) {
423  if (t_goodPV == 0)
424  leadPV = math::XYZPoint((*recVtxs)[k].x(), (*recVtxs)[k].y(), (*recVtxs)[k].z());
425  t_goodPV++;
426  }
427  }
428  }
429  if (t_goodPV == 0 && beamSpotH.isValid()) {
430  leadPV = beamSpotH->position();
431  }
433 #ifdef EDM_ML_DEBUG
434  edm::LogVerbatim("HcalIsoTrack") << "Primary Vertex " << leadPV << " out of " << t_goodPV << " vertex";
435  if (beamSpotH.isValid()) {
436  edm::LogVerbatim("HcalIsoTrack") << " Beam Spot " << beamSpotH->position();
437  }
438 #endif
439  // RecHits
440  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle = iEvent.getHandle(tok_EB_);
441  if (!barrelRecHitsHandle.isValid()) {
442  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
443  okC = false;
444  }
445  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle = iEvent.getHandle(tok_EE_);
446  if (!endcapRecHitsHandle.isValid()) {
447  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
448  okC = false;
449  }
451  if (!hbhe.isValid()) {
452  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
453  okC = false;
454  }
455  const edm::Handle<CaloTowerCollection> caloTower = iEvent.getHandle(tok_cala_);
456 
457  //Propagate tracks to calorimeter surface)
458  std::vector<spr::propagatedGenParticleID> trackIDs =
459  spr::propagateCALO(genParticles, pdt, geo, bField, etaMax_, false);
460  std::vector<math::XYZTLorentzVector> vecL1, vecL3;
461  t_RunNo = iEvent.id().run();
462  t_EventNo = iEvent.id().event();
463  t_Tracks = (genParticles.product())->size();
464  t_TracksProp = trackIDs.size();
465  t_ietaAll->clear();
466  t_ietaGood->clear();
467  t_trackType->clear();
468  t_trgbits->clear();
469  t_hltbits->clear();
470 #ifdef EDM_ML_DEBUG
471  edm::LogVerbatim("HcalIsoTrack") << "# of propagated tracks " << t_TracksProp << " out of " << t_Tracks
472  << " with Trigger " << ignoreTrigger_;
473 #endif
474 
475  //Trigger
476  t_trgbits->assign(trigNames_.size(), false);
477  t_hltbits->assign(trigNames_.size(), false);
479  t_L1Bit = true;
480  t_TrigPass = false;
481 
482  if (!ignoreTrigger_) {
483  //L1
485  const std::vector<std::pair<std::string, bool> >& finalDecisions = l1GtUtils_->decisionsFinal();
486  for (const auto& decision : finalDecisions) {
487  if (decision.first.find(l1TrigName_) != std::string::npos) {
488  t_L1Bit = decision.second;
489  break;
490  }
491  }
492 #ifdef EDM_ML_DEBUG
493  edm::LogVerbatim("HcalIsoTrack") << "Trigger Information for " << l1TrigName_ << " is " << t_L1Bit
494  << " from a list of " << finalDecisions.size() << " decisions";
495 #endif
496 
497  //HLT
499  if (triggerResults.isValid()) {
500  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
501  const std::vector<std::string>& names = triggerNames.triggerNames();
502  if (!trigNames_.empty()) {
503  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
504  int hlt = triggerResults->accept(iHLT);
505  for (unsigned int i = 0; i < trigNames_.size(); ++i) {
506  if (names[iHLT].find(trigNames_[i]) != std::string::npos) {
507  t_trgbits->at(i) = (hlt > 0);
508  t_hltbits->at(i) = (hlt > 0);
509  if (hlt > 0)
510  t_TrigPass = true;
511 #ifdef EDM_ML_DEBUG
512  edm::LogVerbatim("HcalIsoTrack")
513  << "This trigger " << names[iHLT] << " Flag " << hlt << ":" << t_trgbits->at(i);
514 #endif
515  }
516  }
517  }
518  }
519  }
520 #ifdef EDM_ML_DEBUG
521  edm::LogVerbatim("HcalIsoTrack") << "HLT Information shows " << t_TrigPass << ":" << trigNames_.empty() << ":"
522  << okC;
523 #endif
524  }
525 
526  std::array<int, 3> ntksave{{0, 0, 0}};
527  if (ignoreTrigger_ || useL1Trigger_) {
528  t_l1pt = t_l1eta = t_l1phi = 0;
529  t_l3pt = t_l3eta = t_l3phi = 0;
530  if (ignoreTrigger_ || t_L1Bit)
531  ntksave = fillTree(vecL1,
532  vecL3,
533  leadPV,
534  trackIDs,
535  geo,
536  caloTopology,
537  theHBHETopology,
538  theEcalChStatus,
539  theEcalSevlv,
540  barrelRecHitsHandle,
541  endcapRecHitsHandle,
542  hbhe,
543  caloTower,
544  genParticles,
545  respCorrs);
546  t_TracksSaved = ntksave[0];
547  t_TracksLoose = ntksave[1];
548  t_TracksTight = ntksave[2];
549  } else {
551  edm::Handle<trigger::TriggerEvent> triggerEventHandle = iEvent.getHandle(tok_trigEvt_);
552  if (!triggerEventHandle.isValid()) {
553  edm::LogWarning("HcalIsoTrack") << "Error! Can't get the product " << triggerEvent_.label();
554  } else if (okC) {
555  triggerEvent = *(triggerEventHandle.product());
557  const trigger::TriggerObjectCollection& TOC(triggerEvent.getObjects());
558  bool done(false);
559  if (triggerResults.isValid()) {
560  std::vector<std::string> modules;
561  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
562  const std::vector<std::string>& names = triggerNames.triggerNames();
563  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
564  bool ok = (t_TrigPass) || (trigNames_.empty());
565  if (ok) {
566  unsigned int triggerindx = hltConfig_.triggerIndex(names[iHLT]);
567  const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
568  std::vector<math::XYZTLorentzVector> vecL2;
569  vecL1.clear();
570  vecL3.clear();
571  //loop over all trigger filters in event (i.e. filters passed)
572  for (unsigned int ifilter = 0; ifilter < triggerEvent.sizeFilters(); ++ifilter) {
573  std::vector<int> Keys;
574  std::string label = triggerEvent.filterTag(ifilter).label();
575  //loop over keys to objects passing this filter
576  for (unsigned int imodule = 0; imodule < moduleLabels.size(); imodule++) {
577  if (label.find(moduleLabels[imodule]) != std::string::npos) {
578 #ifdef EDM_ML_DEBUG
579  edm::LogVerbatim("HcalIsoTrack") << "FilterName " << label;
580 #endif
581  for (unsigned int ifiltrKey = 0; ifiltrKey < triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) {
582  Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]);
583  const trigger::TriggerObject& TO(TOC[Keys[ifiltrKey]]);
584  math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy());
585  if (label.find(l2Filter_) != std::string::npos) {
586  vecL2.push_back(v4);
587  } else if (label.find(l3Filter_) != std::string::npos) {
588  vecL3.push_back(v4);
589  } else if ((label.find(l1Filter_) != std::string::npos) || (l1Filter_.empty())) {
590  vecL1.push_back(v4);
591  }
592 #ifdef EDM_ML_DEBUG
593  edm::LogVerbatim("HcalIsoTrack")
594  << "key " << ifiltrKey << " : pt " << TO.pt() << " eta " << TO.eta() << " phi " << TO.phi()
595  << " mass " << TO.mass() << " Id " << TO.id();
596 #endif
597  }
598 #ifdef EDM_ML_DEBUG
599  edm::LogVerbatim("HcalIsoTrack")
600  << "sizes " << vecL1.size() << ":" << vecL2.size() << ":" << vecL3.size();
601 #endif
602  }
603  }
604  }
606  math::XYZTLorentzVector mindRvec1;
607  double mindR1(999);
608  for (unsigned int i = 0; i < vecL2.size(); i++) {
609  double dr = dR(vecL1[0], vecL2[i]);
610 #ifdef EDM_ML_DEBUG
611  edm::LogVerbatim("HcalIsoTrack") << "lvl2[" << i << "] dR " << dr;
612 #endif
613  if (dr < mindR1) {
614  mindR1 = dr;
615  mindRvec1 = vecL2[i];
616  }
617  }
618 #ifdef EDM_ML_DEBUG
619  edm::LogVerbatim("HcalIsoTrack") << "L2 object closest to L1 " << mindRvec1 << " at Dr " << mindR1;
620 #endif
621 
622  if (!vecL1.empty()) {
623  t_l1pt = vecL1[0].pt();
624  t_l1eta = vecL1[0].eta();
625  t_l1phi = vecL1[0].phi();
626  } else {
627  t_l1pt = t_l1eta = t_l1phi = 0;
628  }
629  if (!vecL3.empty()) {
630  t_l3pt = vecL3[0].pt();
631  t_l3eta = vecL3[0].eta();
632  t_l3phi = vecL3[0].phi();
633  } else {
634  t_l3pt = t_l3eta = t_l3phi = 0;
635  }
636  // Now fill in the tree for each selected track
637  if (!done) {
638  ntksave = fillTree(vecL1,
639  vecL3,
640  leadPV,
641  trackIDs,
642  geo,
643  caloTopology,
644  theHBHETopology,
645  theEcalChStatus,
646  theEcalSevlv,
647  barrelRecHitsHandle,
648  endcapRecHitsHandle,
649  hbhe,
650  caloTower,
651  genParticles,
652  respCorrs);
653  t_TracksSaved += ntksave[0];
654  t_TracksLoose += ntksave[1];
655  t_TracksTight += ntksave[2];
656  done = true;
657  }
658  }
659  }
660  }
661  }
662  }
663 #ifdef EDM_ML_DEBUG
664  edm::LogVerbatim("HcalIsoTrack") << "Final results on selected tracks " << t_TracksSaved << ":" << t_TracksLoose
665  << ":" << t_TracksTight;
666 #endif
668  tree2->Fill();
669 }
670 
673  tree = fs->make<TTree>("CalibTree", "CalibTree");
674 
675  tree->Branch("t_Run", &t_Run, "t_Run/I");
676  tree->Branch("t_Event", &t_Event, "t_Event/I");
677  tree->Branch("t_DataType", &t_DataType, "t_DataType/I");
678  tree->Branch("t_ieta", &t_ieta, "t_ieta/I");
679  tree->Branch("t_iphi", &t_iphi, "t_iphi/I");
680  tree->Branch("t_EventWeight", &t_EventWeight, "t_EventWeight/D");
681  tree->Branch("t_nVtx", &t_nVtx, "t_nVtx/I");
682  tree->Branch("t_nTrk", &t_nTrk, "t_nTrk/I");
683  tree->Branch("t_goodPV", &t_goodPV, "t_goodPV/I");
684  tree->Branch("t_l1pt", &t_l1pt, "t_l1pt/D");
685  tree->Branch("t_l1eta", &t_l1eta, "t_l1eta/D");
686  tree->Branch("t_l1phi", &t_l1phi, "t_l1phi/D");
687  tree->Branch("t_l3pt", &t_l3pt, "t_l3pt/D");
688  tree->Branch("t_l3eta", &t_l3eta, "t_l3eta/D");
689  tree->Branch("t_l3phi", &t_l3phi, "t_l3phi/D");
690  tree->Branch("t_p", &t_p, "t_p/D");
691  tree->Branch("t_pt", &t_pt, "t_pt/D");
692  tree->Branch("t_phi", &t_phi, "t_phi/D");
693  tree->Branch("t_mindR1", &t_mindR1, "t_mindR1/D");
694  tree->Branch("t_mindR2", &t_mindR2, "t_mindR2/D");
695  tree->Branch("t_eMipDR", &t_eMipDR, "t_eMipDR/D");
696  tree->Branch("t_eMipDR2", &t_eMipDR2, "t_eMipDR2/D");
697  tree->Branch("t_eMipDR3", &t_eMipDR3, "t_eMipDR3/D");
698  tree->Branch("t_eMipDR4", &t_eMipDR4, "t_eMipDR4/D");
699  tree->Branch("t_eMipDR5", &t_eMipDR5, "t_eMipDR5/D");
700  tree->Branch("t_eHcal", &t_eHcal, "t_eHcal/D");
701  tree->Branch("t_eHcal10", &t_eHcal10, "t_eHcal10/D");
702  tree->Branch("t_eHcal30", &t_eHcal30, "t_eHcal30/D");
703  tree->Branch("t_hmaxNearP", &t_hmaxNearP, "t_hmaxNearP/D");
704  tree->Branch("t_emaxNearP", &t_emaxNearP, "t_emaxNearP/D");
705  tree->Branch("t_eAnnular", &t_eAnnular, "t_eAnnular/D");
706  tree->Branch("t_hAnnular", &t_hAnnular, "t_hAnnular/D");
707  tree->Branch("t_rhoh", &t_rhoh, "t_rhoh/D");
708  tree->Branch("t_selectTk", &t_selectTk, "t_selectTk/O");
709  tree->Branch("t_qltyFlag", &t_qltyFlag, "t_qltyFlag/O");
710  tree->Branch("t_qltyMissFlag", &t_qltyMissFlag, "t_qltyMissFlag/O");
711  tree->Branch("t_qltyPVFlag", &t_qltyPVFlag, "t_qltyPVFlag/O");
712  tree->Branch("t_gentrackP", &t_gentrackP, "t_gentrackP/D");
713 
714  t_DetIds = new std::vector<unsigned int>();
715  t_DetIds1 = new std::vector<unsigned int>();
716  t_DetIds3 = new std::vector<unsigned int>();
717  t_HitEnergies = new std::vector<double>();
718  t_HitEnergies1 = new std::vector<double>();
719  t_HitEnergies3 = new std::vector<double>();
720  t_trgbits = new std::vector<bool>();
721  tree->Branch("t_DetIds", "std::vector<unsigned int>", &t_DetIds);
722  tree->Branch("t_HitEnergies", "std::vector<double>", &t_HitEnergies);
723  tree->Branch("t_trgbits", "std::vector<bool>", &t_trgbits);
724  tree->Branch("t_DetIds1", "std::vector<unsigned int>", &t_DetIds1);
725  tree->Branch("t_DetIds3", "std::vector<unsigned int>", &t_DetIds3);
726  tree->Branch("t_HitEnergies1", "std::vector<double>", &t_HitEnergies1);
727  tree->Branch("t_HitEnergies3", "std::vector<double>", &t_HitEnergies3);
728 
729  tree2 = fs->make<TTree>("EventInfo", "Event Information");
730 
731  tree2->Branch("t_RunNo", &t_RunNo, "t_RunNo/i");
732  tree2->Branch("t_EventNo", &t_EventNo, "t_EventNo/i");
733  tree2->Branch("t_Tracks", &t_Tracks, "t_Tracks/I");
734  tree2->Branch("t_TracksProp", &t_TracksProp, "t_TracksProp/I");
735  tree2->Branch("t_TracksSaved", &t_TracksSaved, "t_TracksSaved/I");
736  tree2->Branch("t_TracksLoose", &t_TracksLoose, "t_TracksLoose/I");
737  tree2->Branch("t_TracksTight", &t_TracksTight, "t_TracksTight/I");
738  tree2->Branch("t_TrigPass", &t_TrigPass, "t_TrigPass/O");
739  tree2->Branch("t_TrigPassSel", &t_TrigPassSel, "t_TrigPassSel/O");
740  tree2->Branch("t_L1Bit", &t_L1Bit, "t_L1Bit/O");
741  tree2->Branch("t_allvertex", &t_allvertex, "t_allvertex/I");
742  t_hltbits = new std::vector<bool>();
743  t_ietaAll = new std::vector<int>();
744  t_ietaGood = new std::vector<int>();
745  t_trackType = new std::vector<int>();
746  tree2->Branch("t_ietaAll", "std::vector<int>", &t_ietaAll);
747  tree2->Branch("t_ietaGood", "std::vector<int>", &t_ietaGood);
748  tree2->Branch("t_trackType", "std::vector<int>", &t_trackType);
749  tree2->Branch("t_hltbits", "std::vector<bool>", &t_hltbits);
750 }
751 
752 // ------------ method called when starting to processes a run ------------
753 void HcalIsoTrkSimAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
754  hdc_ = &iSetup.getData(tok_ddrec_);
755 
756  bool changed_(true);
757  bool flag = hltConfig_.init(iRun, iSetup, processName_, changed_);
758  edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " process " << processName_
759  << " init flag " << flag << " change flag " << changed_;
760  // check if trigger names in (new) config
761  if (changed_) {
762 #ifdef EDM_ML_DEBUG
763  edm::LogVerbatim("HcalIsoTrack") << "New trigger menu found !!!";
764 #endif
765  const unsigned int n(hltConfig_.size());
766  for (unsigned itrig = 0; itrig < trigNames_.size(); itrig++) {
767  unsigned int triggerindx = hltConfig_.triggerIndex(trigNames_[itrig]);
768  if (triggerindx >= n) {
769  edm::LogWarning("HcalIsoTrack") << trigNames_[itrig] << " " << triggerindx << " does not exist in "
770  << "the current menu";
771 #ifdef EDM_ML_DEBUG
772  } else {
773  edm::LogVerbatim("HcalIsoTrack") << trigNames_[itrig] << " " << triggerindx << " exists";
774 #endif
775  }
776  }
777  }
778 }
779 
780 // ------------ method called when ending the processing of a run ------------
782  nRun_++;
783  edm::LogVerbatim("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run();
784 }
785 
788  std::vector<std::string> trig = {"HLT_PFJet40",
789  "HLT_PFJet60",
790  "HLT_PFJet80",
791  "HLT_PFJet140",
792  "HLT_PFJet200",
793  "HLT_PFJet260",
794  "HLT_PFJet320",
795  "HLT_PFJet400",
796  "HLT_PFJet450",
797  "HLT_PFJet500"};
798  desc.add<std::vector<std::string> >("triggers", trig);
799  desc.add<std::string>("processName", "HLT");
800  desc.add<std::string>("l1Filter", "");
801  desc.add<std::string>("l2Filter", "L2Filter");
802  desc.add<std::string>("l3Filter", "Filter");
803  desc.add<double>("pTMin", 1.0), desc.add<double>("maxChargedHadronEta", 3.0);
804  // Minimum momentum of selected isolated track and signal zone
805  desc.add<double>("minimumTrackP", 10.0);
806  desc.add<double>("coneRadius", 34.98);
807  // signal zone in ECAL and MIP energy cutoff
808  desc.add<double>("coneRadiusMIP", 14.0);
809  desc.add<double>("coneRadiusMIP2", 18.0);
810  desc.add<double>("coneRadiusMIP3", 20.0);
811  desc.add<double>("coneRadiusMIP4", 22.0);
812  desc.add<double>("coneRadiusMIP5", 24.0);
813  desc.add<double>("maximumEcalEnergy", 2.0);
814  // following 4 parameters are for isolation cuts and described in the code
815  desc.add<double>("maxTrackP", 8.0);
816  desc.add<double>("slopeTrackP", 0.05090504066);
817  desc.add<double>("isolationEnergyTight", 2.0);
818  desc.add<double>("isolationEnergyLoose", 10.0);
819  // energy thershold for ECAL (from Egamma group)
820  desc.add<double>("EBHitEnergyThreshold", 0.08);
821  desc.add<double>("EEHitEnergyThreshold0", 0.30);
822  desc.add<double>("EEHitEnergyThreshold1", 0.00);
823  desc.add<double>("EEHitEnergyThreshold2", 0.00);
824  desc.add<double>("EEHitEnergyThreshold3", 0.00);
825  desc.add<double>("EEHitEnergyThresholdLow", 0.30);
826  desc.add<double>("EEHitEnergyThresholdHigh", 0.30);
827  // prescale factors
828  desc.add<double>("momentumLow", 40.0);
829  desc.add<double>("momentumHigh", 60.0);
830  desc.add<int>("prescaleLow", 1);
831  desc.add<int>("prescaleHigh", 1);
832  // various labels for collections used in the code
833  desc.add<edm::InputTag>("labelTriggerEvent", edm::InputTag("hltTriggerSummaryAOD", "", "HLT"));
834  desc.add<edm::InputTag>("labelTriggerResult", edm::InputTag("TriggerResults", "", "HLT"));
835  desc.add<std::string>("labelTrack", "generalTracks");
836  desc.add<std::string>("labelVertex", "offlinePrimaryVertices");
837  desc.add<std::string>("labelEBRecHit", "EcalRecHitsEB");
838  desc.add<std::string>("labelEERecHit", "EcalRecHitsEE");
839  desc.add<std::string>("labelHBHERecHit", "hbhereco");
840  desc.add<std::string>("labelBeamSpot", "offlineBeamSpot");
841  desc.add<std::string>("labelCaloTower", "towerMaker");
842  desc.add<edm::InputTag>("algInputTag", edm::InputTag("gtStage2Digis"));
843  desc.add<edm::InputTag>("extInputTag", edm::InputTag("gtStage2Digis"));
844  desc.addUntracked<std::string>("moduleName", "");
845  desc.addUntracked<std::string>("producerName", "");
846  // Various flags used for selecting tracks, choice of energy Method2/0
847  // Data type 0/1 for single jet trigger or others
848  desc.addUntracked<int>("useRaw", 0);
849  desc.addUntracked<bool>("ignoreTriggers", false);
850  desc.addUntracked<bool>("useL1Trigger", false);
851  desc.addUntracked<double>("hcalScale", 1.0);
852  desc.addUntracked<int>("dataType", 0);
853  desc.addUntracked<bool>("unCorrect", false);
854  desc.addUntracked<bool>("collapseDepth", false);
855  desc.addUntracked<std::string>("l1TrigName", "L1_SingleJet60");
856  desc.addUntracked<int>("outMode", 11);
857  std::vector<int> dummy;
858  desc.addUntracked<std::vector<int> >("oldID", dummy);
859  desc.addUntracked<std::vector<int> >("newDepth", dummy);
860  desc.addUntracked<bool>("hep17", false);
861  desc.add<bool>("usePFThreshold", true);
862  descriptions.add("hcalIsoTrkSimAnalyzer", desc);
863 }
864 
865 std::array<int, 3> HcalIsoTrkSimAnalyzer::fillTree(std::vector<math::XYZTLorentzVector>& vecL1,
866  std::vector<math::XYZTLorentzVector>& vecL3,
867  math::XYZPoint& leadPV,
868  std::vector<spr::propagatedGenParticleID>& trackIDs,
869  const CaloGeometry* geo,
870  const CaloTopology* caloTopology,
871  const HcalTopology* theHBHETopology,
872  const EcalChannelStatus* theEcalChStatus,
873  const EcalSeverityLevelAlgo* theEcalSevlv,
874  edm::Handle<EcalRecHitCollection>& barrelRecHitsHandle,
875  edm::Handle<EcalRecHitCollection>& endcapRecHitsHandle,
879  const HcalRespCorrs* respCorrs) {
880  int nSave(0), nLoose(0), nTight(0);
881  //Loop over tracks
882  unsigned int nTracks(0);
883  t_nTrk = trackIDs.size();
884  t_rhoh = (tower.isValid()) ? rhoh(tower) : 0;
885  for (auto const& trkDetItr : trackIDs) {
886  const reco::GenParticle* pTrack = &(*(trkDetItr.trkItr));
887  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
888 #ifdef EDM_ML_DEBUG
889  edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|"
890  << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p();
891 #endif
892  t_mindR2 = 999;
893  for (unsigned int k = 0; k < vecL3.size(); ++k) {
894  double dr = dR(vecL3[k], v4);
895  if (dr < t_mindR2) {
896  t_mindR2 = dr;
897  }
898  }
899  t_mindR1 = (!vecL1.empty()) ? dR(vecL1[0], v4) : 999;
900 #ifdef EDM_ML_DEBUG
901  edm::LogVerbatim("HcalIsoTrack") << "Closest L3 object at dr :" << t_mindR2 << " and from L1 " << t_mindR1;
902 #endif
903  t_ieta = t_iphi = 0;
904  if (trkDetItr.okHCAL) {
905  HcalDetId detId = (HcalDetId)(trkDetItr.detIdHCAL);
906  t_ieta = detId.ieta();
907  t_iphi = detId.iphi();
908  if (t_p > 40.0 && t_p <= 60.0)
909  t_ietaAll->emplace_back(t_ieta);
910  }
911  //Selection of good track
913  double eIsolation = maxRestrictionP_ * exp(slopeRestrictionP_ * std::abs((double)t_ieta));
914  if (eIsolation < eIsolate1_)
915  eIsolation = eIsolate1_;
916  if (eIsolation < eIsolate2_)
917  eIsolation = eIsolate2_;
918 #ifdef EDM_ML_DEBUG
919  edm::LogVerbatim("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << t_qltyFlag << "|" << trkDetItr.okECAL << "|"
920  << trkDetItr.okHCAL << " eIsolation " << eIsolation;
921 #endif
922  t_qltyFlag = (t_selectTk && trkDetItr.okECAL && trkDetItr.okHCAL);
923  bool notMuon = notaMuon(pTrack);
924  if (t_qltyFlag && notMuon) {
925  int nNearTRKs(0);
927  std::vector<DetId> eIds;
928  std::vector<double> eHit;
930  barrelRecHitsHandle,
931  endcapRecHitsHandle,
932  trkDetItr.pointHCAL,
933  trkDetItr.pointECAL,
934  a_mipR_,
935  trkDetItr.directionECAL,
936  eIds,
937  eHit);
938  double eEcal(0);
939  for (unsigned int k = 0; k < eIds.size(); ++k) {
940  if (eHit[k] > eThreshold(eIds[k], geo))
941  eEcal += eHit[k];
942  }
943 #ifdef EDM_ML_DEBUG
944  edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << t_eMipDR << ":" << eEcal;
945 #endif
946  t_eMipDR = eEcal;
949  std::vector<DetId> eIds2;
950  std::vector<double> eHit2;
952  barrelRecHitsHandle,
953  endcapRecHitsHandle,
954  trkDetItr.pointHCAL,
955  trkDetItr.pointECAL,
956  a_mipR2_,
957  trkDetItr.directionECAL,
958  eIds2,
959  eHit2);
960  double eEcal2(0);
961  for (unsigned int k = 0; k < eIds2.size(); ++k) {
962  if (eHit2[k] > eThreshold(eIds2[k], geo))
963  eEcal2 += eHit2[k];
964  }
965 #ifdef EDM_ML_DEBUG
966  edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << t_eMipDR2 << ":" << eEcal2;
967 #endif
968  t_eMipDR2 = eEcal2;
971  std::vector<DetId> eIds3;
972  std::vector<double> eHit3;
974  barrelRecHitsHandle,
975  endcapRecHitsHandle,
976  trkDetItr.pointHCAL,
977  trkDetItr.pointECAL,
978  a_mipR3_,
979  trkDetItr.directionECAL,
980  eIds3,
981  eHit3);
982  double eEcal3(0);
983  for (unsigned int k = 0; k < eIds3.size(); ++k) {
984  if (eHit3[k] > eThreshold(eIds3[k], geo))
985  eEcal3 += eHit3[k];
986  }
987 #ifdef EDM_ML_DEBUG
988  edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << t_eMipDR3 << ":" << eEcal3;
989 #endif
990  t_eMipDR3 = eEcal3;
993  std::vector<DetId> eIds4;
994  std::vector<double> eHit4;
996  barrelRecHitsHandle,
997  endcapRecHitsHandle,
998  trkDetItr.pointHCAL,
999  trkDetItr.pointECAL,
1000  a_mipR4_,
1001  trkDetItr.directionECAL,
1002  eIds4,
1003  eHit4);
1004  double eEcal4(0);
1005  for (unsigned int k = 0; k < eIds4.size(); ++k) {
1006  if (eHit4[k] > eThreshold(eIds4[k], geo))
1007  eEcal4 += eHit4[k];
1008  }
1009 #ifdef EDM_ML_DEBUG
1010  edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << t_eMipDR4 << ":" << eEcal4;
1011 #endif
1012  t_eMipDR4 = eEcal4;
1015  std::vector<DetId> eIds5;
1016  std::vector<double> eHit5;
1017  t_eMipDR5 = spr::eCone_ecal(geo,
1018  barrelRecHitsHandle,
1019  endcapRecHitsHandle,
1020  trkDetItr.pointHCAL,
1021  trkDetItr.pointECAL,
1022  a_mipR5_,
1023  trkDetItr.directionECAL,
1024  eIds5,
1025  eHit5);
1026  double eEcal5(0);
1027  for (unsigned int k = 0; k < eIds5.size(); ++k) {
1028  if (eHit5[k] > eThreshold(eIds5[k], geo))
1029  eEcal5 += eHit5[k];
1030  }
1031 #ifdef EDM_ML_DEBUG
1032  edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << t_eMipDR5 << ":" << eEcal5;
1033 #endif
1034  t_eMipDR5 = eEcal5;
1036 
1037  t_emaxNearP = spr::chargeIsolationGenEcal(nTracks, trackIDs, geo, caloTopology, 15, 15);
1038  const DetId cellE(trkDetItr.detIdECAL);
1039  std::pair<double, bool> e11x11P = spr::eECALmatrix(cellE,
1040  barrelRecHitsHandle,
1041  endcapRecHitsHandle,
1042  *theEcalChStatus,
1043  geo,
1044  caloTopology,
1045  theEcalSevlv,
1046  5,
1047  5,
1048  -100.0,
1049  -100.0,
1050  -100.0,
1051  100.0);
1052  std::pair<double, bool> e15x15P = spr::eECALmatrix(cellE,
1053  barrelRecHitsHandle,
1054  endcapRecHitsHandle,
1055  *theEcalChStatus,
1056  geo,
1057  caloTopology,
1058  theEcalSevlv,
1059  7,
1060  7,
1061  -100.0,
1062  -100.0,
1063  -100.0,
1064  100.0);
1065  if (e11x11P.second && e15x15P.second) {
1066  t_eAnnular = (e15x15P.first - e11x11P.first);
1067  } else {
1068  t_eAnnular = -(e15x15P.first - e11x11P.first);
1069  }
1070  t_hmaxNearP = spr::chargeIsolationGenCone(nTracks, trackIDs, a_charIsoR_, nNearTRKs, false);
1071  const DetId cellH(trkDetItr.detIdHCAL);
1072  double h5x5 = spr::eHCALmatrix(
1073  theHBHETopology, cellH, hbhe, 2, 2, false, true, -100.0, -100.0, -100.0, -100.0, -100.0, 100.0);
1074  double h7x7 = spr::eHCALmatrix(
1075  theHBHETopology, cellH, hbhe, 3, 3, false, true, -100.0, -100.0, -100.0, -100.0, -100.0, 100.0);
1076  t_hAnnular = h7x7 - h5x5;
1077 #ifdef EDM_ML_DEBUG
1078  edm::LogVerbatim("HcalIsoTrack") << "max p Near (Ecal) " << t_emaxNearP << " (Hcal) " << t_hmaxNearP
1079  << " Annular E (Ecal) " << e11x11P.first << ":" << e15x15P.first << ":"
1080  << t_eAnnular << " (Hcal) " << h5x5 << ":" << h7x7 << ":" << t_hAnnular;
1081 #endif
1082  t_gentrackP = pTrack->p();
1083  if (t_eMipDR < eEcalMax_ && t_hmaxNearP < eIsolation) {
1084  t_DetIds->clear();
1085  t_HitEnergies->clear();
1086  t_DetIds1->clear();
1087  t_HitEnergies1->clear();
1088  t_DetIds3->clear();
1089  t_HitEnergies3->clear();
1090  int nRecHits(-999), nRecHits1(-999), nRecHits3(-999);
1091  std::vector<DetId> ids, ids1, ids3;
1092  std::vector<double> edet0, edet1, edet3;
1093  t_eHcal = spr::eCone_hcal(geo,
1094  hbhe,
1095  trkDetItr.pointHCAL,
1096  trkDetItr.pointECAL,
1097  a_coneR_,
1098  trkDetItr.directionHCAL,
1099  nRecHits,
1100  ids,
1101  edet0,
1102  useRaw_);
1103  if (!oldID_.empty()) {
1104  for (unsigned k = 0; k < ids.size(); ++k)
1105  ids[k] = newId(ids[k]);
1106  }
1107  storeEnergy(0, respCorrs, ids, edet0, t_eHcal, t_DetIds, t_HitEnergies);
1108 
1109  //----- hcal energy in the extended cone 1 (a_coneR+10) --------------
1110  t_eHcal10 = spr::eCone_hcal(geo,
1111  hbhe,
1112  trkDetItr.pointHCAL,
1113  trkDetItr.pointECAL,
1114  a_coneR1_,
1115  trkDetItr.directionHCAL,
1116  nRecHits1,
1117  ids1,
1118  edet1,
1119  useRaw_);
1120  if (!oldID_.empty()) {
1121  for (unsigned k = 0; k < ids1.size(); ++k)
1122  ids1[k] = newId(ids1[k]);
1123  }
1124  storeEnergy(1, respCorrs, ids1, edet1, t_eHcal10, t_DetIds1, t_HitEnergies1);
1125 
1126  //----- hcal energy in the extended cone 3 (a_coneR+30) --------------
1127  t_eHcal30 = spr::eCone_hcal(geo,
1128  hbhe,
1129  trkDetItr.pointHCAL,
1130  trkDetItr.pointECAL,
1131  a_coneR2_,
1132  trkDetItr.directionHCAL,
1133  nRecHits3,
1134  ids3,
1135  edet3,
1136  useRaw_);
1137  if (!oldID_.empty()) {
1138  for (unsigned k = 0; k < ids3.size(); ++k)
1139  ids3[k] = newId(ids3[k]);
1140  }
1141  storeEnergy(3, respCorrs, ids3, edet3, t_eHcal30, t_DetIds3, t_HitEnergies3);
1142 
1143  t_p = pTrack->p();
1144  t_pt = pTrack->pt();
1145  t_phi = pTrack->phi();
1146 
1147 #ifdef EDM_ML_DEBUG
1148  edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << t_pt << "|"
1149  << pTrack->eta() << "|" << t_phi << "|" << t_p << " Generator Level p "
1150  << t_gentrackP;
1151  edm::LogVerbatim("HcalIsoTrack") << "e_MIP " << t_eMipDR << " Chg Isolation " << t_hmaxNearP << " eHcal"
1152  << t_eHcal << " ieta " << t_ieta << " Quality " << t_qltyMissFlag << ":"
1153  << t_qltyPVFlag << ":" << t_selectTk;
1154  for (unsigned int ll = 0; ll < t_DetIds->size(); ll++) {
1155  edm::LogVerbatim("HcalIsoTrack")
1156  << "det id is = " << t_DetIds->at(ll) << " hit enery is = " << t_HitEnergies->at(ll);
1157  }
1158  for (unsigned int ll = 0; ll < t_DetIds1->size(); ll++) {
1159  edm::LogVerbatim("HcalIsoTrack")
1160  << "det id is = " << t_DetIds1->at(ll) << " hit enery is = " << t_HitEnergies1->at(ll);
1161  }
1162  for (unsigned int ll = 0; ll < t_DetIds3->size(); ll++) {
1163  edm::LogVerbatim("HcalIsoTrack")
1164  << "det id is = " << t_DetIds3->at(ll) << " hit enery is = " << t_HitEnergies3->at(ll);
1165  }
1166 #endif
1167  bool accept(false);
1168  if (t_p > pTrackMin_) {
1169  if (t_p < pTrackLow_) {
1170  ++nLow_;
1171  if (prescaleLow_ <= 1)
1172  accept = true;
1173  else if (nLow_ % prescaleLow_ == 1)
1174  accept = true;
1175  } else if (t_p > pTrackHigh_) {
1176  ++nHigh_;
1177  if (prescaleHigh_ <= 1)
1178  accept = true;
1179  else if (nHigh_ % prescaleHigh_ == 1)
1180  accept = true;
1181  } else {
1182  accept = true;
1183  }
1184  }
1185  if (accept) {
1186  tree->Fill();
1187  nSave++;
1188  int type(0);
1189  if (t_eMipDR < 1.0) {
1190  if (t_hmaxNearP < eIsolate2_) {
1191  ++nLoose;
1192  type = 1;
1193  }
1194  if (t_hmaxNearP < eIsolate1_) {
1195  ++nTight;
1196  type = 2;
1197  }
1198  }
1199  if (t_p > 40.0 && t_p <= 60.0 && t_selectTk) {
1200  t_ietaGood->emplace_back(t_ieta);
1201  t_trackType->emplace_back(type);
1202  }
1203 #ifdef EDM_ML_DEBUG
1204  for (unsigned int k = 0; k < t_trgbits->size(); k++) {
1205  edm::LogVerbatim("HcalIsoTrack") << "trigger bit is = " << t_trgbits->at(k);
1206  }
1207 #endif
1208  }
1209  }
1210  }
1211  ++nTracks;
1212  }
1213  std::array<int, 3> i3{{nSave, nLoose, nTight}};
1214  return i3;
1215 }
1216 
1218  return reco::deltaR(vec1.eta(), vec1.phi(), vec2.eta(), vec2.phi());
1219 }
1220 
1222  std::vector<double> sumPFNallSMDQH2;
1223  sumPFNallSMDQH2.reserve(phibins_.size() * etabins_.size());
1224 
1225  for (auto eta : etabins_) {
1226  for (auto phi : phibins_) {
1227  double hadder = 0;
1228  for (const auto& pf_it : (*tower)) {
1229  if (fabs(eta - pf_it.eta()) > etahalfdist_)
1230  continue;
1231  if (fabs(reco::deltaPhi(phi, pf_it.phi())) > phihalfdist_)
1232  continue;
1233  hadder += pf_it.hadEt();
1234  }
1235  sumPFNallSMDQH2.emplace_back(hadder);
1236  }
1237  }
1238 
1239  double evt_smdq(0);
1240  std::sort(sumPFNallSMDQH2.begin(), sumPFNallSMDQH2.end());
1241  if (sumPFNallSMDQH2.size() % 2)
1242  evt_smdq = sumPFNallSMDQH2[(sumPFNallSMDQH2.size() - 1) / 2];
1243  else
1244  evt_smdq = (sumPFNallSMDQH2[sumPFNallSMDQH2.size() / 2] + sumPFNallSMDQH2[(sumPFNallSMDQH2.size() - 2) / 2]) / 2.;
1245  double rhoh = evt_smdq / (etadist_ * phidist_);
1246 #ifdef EDM_ML_DEBUG
1247  edm::LogVerbatim("HcalIsoTrack") << "Rho " << evt_smdq << ":" << rhoh;
1248 #endif
1249  return rhoh;
1250 }
1251 
1252 double HcalIsoTrkSimAnalyzer::eThreshold(const DetId& id, const CaloGeometry* geo) const {
1253  double eThr(hitEthrEB_);
1254  if (usePFThresh_) {
1255  eThr = static_cast<double>((*eThresholds_)[id]);
1256  } else {
1257  const GlobalPoint& pos = geo->getPosition(id);
1258  double eta = std::abs(pos.eta());
1259  if (id.subdetId() != EcalBarrel) {
1260  eThr = (((eta * hitEthrEE3_ + hitEthrEE2_) * eta + hitEthrEE1_) * eta + hitEthrEE0_);
1261  if (eThr < hitEthrEELo_)
1262  eThr = hitEthrEELo_;
1263  else if (eThr > hitEthrEEHi_)
1264  eThr = hitEthrEEHi_;
1265  }
1266  }
1267  return eThr;
1268 }
1269 
1271  HcalDetId hid(id);
1272  if (hep17_ && ((hid.iphi() < 63) || (hid.iphi() > 66) || (hid.zside() < 0)))
1273  return id;
1274  for (unsigned int k = 0; k < oldID_.size(); ++k) {
1275  if ((hid.subdetId() == oldDet_[k]) && (hid.ietaAbs() == oldEta_[k]) && (hid.depth() == oldDepth_[k])) {
1276  return static_cast<DetId>(HcalDetId(hid.subdet(), hid.ieta(), hid.iphi(), newDepth_[k]));
1277  }
1278  }
1279  return id;
1280 }
1281 
1283  const HcalRespCorrs* respCorrs,
1284  const std::vector<DetId>& ids,
1285  std::vector<double>& edet,
1286  double& eHcal,
1287  std::vector<unsigned int>* detIds,
1288  std::vector<double>* hitEnergies) {
1289  double ehcal(0);
1290  if (unCorrect_) {
1291  for (unsigned int k = 0; k < ids.size(); ++k) {
1292  double corr = (respCorrs->getValues(ids[k]))->getValue();
1293  if (corr != 0)
1294  edet[k] /= corr;
1295  ehcal += edet[k];
1296  }
1297  } else {
1298  for (const auto& en : edet)
1299  ehcal += en;
1300  }
1301  if ((std::abs(ehcal - eHcal) > 0.001) && (!unCorrect_))
1302  edm::LogWarning("HcalIsoTrack") << "Check inconsistent energies: " << indx << " " << eHcal << ":" << ehcal
1303  << " from " << ids.size() << " cells";
1304  eHcal = hcalScale_ * ehcal;
1305 
1306  if (collapseDepth_) {
1307  std::map<HcalDetId, double> hitMap;
1308  for (unsigned int k = 0; k < ids.size(); ++k) {
1309  HcalDetId id = hdc_->mergedDepthDetId(HcalDetId(ids[k]));
1310  auto itr = hitMap.find(id);
1311  if (itr == hitMap.end()) {
1312  hitMap[id] = edet[k];
1313  } else {
1314  (itr->second) += edet[k];
1315  }
1316  }
1317  detIds->reserve(hitMap.size());
1318  hitEnergies->reserve(hitMap.size());
1319  for (const auto& hit : hitMap) {
1320  detIds->emplace_back(hit.first.rawId());
1321  hitEnergies->emplace_back(hit.second);
1322  }
1323  } else {
1324  detIds->reserve(ids.size());
1325  hitEnergies->reserve(ids.size());
1326  for (unsigned int k = 0; k < ids.size(); ++k) {
1327  detIds->emplace_back(ids[k].rawId());
1328  hitEnergies->emplace_back(edet[k]);
1329  }
1330  }
1331 #ifdef EDM_ML_DEBUG
1332  edm::LogVerbatim("HcalIsoTrack") << "Input to storeEnergy with " << ids.size() << " cells";
1333  for (unsigned int k = 0; k < ids.size(); ++k)
1334  edm::LogVerbatim("HcalIsoTrack") << "Hit [" << k << "] " << HcalDetId(ids[k]) << " E " << edet[k];
1335  edm::LogVerbatim("HcalIsoTrack") << "Output of storeEnergy with " << detIds->size() << " cells and Etot " << eHcal;
1336  for (unsigned int k = 0; k < detIds->size(); ++k)
1337  edm::LogVerbatim("HcalIsoTrack") << "Hit [" << k << "] " << HcalDetId((*detIds)[k]) << " E " << (*hitEnergies)[k];
1338 #endif
1339 }
1340 
1342  int id = pTrack->pdgId();
1343  bool flag = ((id != 13) && (id != -13) && (pTrack->charge() != 0));
1344 #ifdef EDM_ML_DEBUG
1345  edm::LogVerbatim("HcalIsoTrack") << "notaMuon: ID " << id << " charge " << pTrack->charge() << " Flag " << flag;
1346 #endif
1347  return flag;
1348 }
1349 
1350 //define this as a plug-in
size
Write out results.
static const std::string kSharedResource
Definition: TFileService.h:76
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, int useRaw=0, bool debug=false)
Log< level::Info, true > LogVerbatim
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
const std::vector< int > newDepth_
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
HcalIsoTrkSimAnalyzer(edm::ParameterSet const &)
std::vector< double > * t_HitEnergies3
double pz() const final
z coordinate of momentum vector
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
double pt() const final
transverse momentum
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:26
HcalDetId mergedDepthDetId(const HcalDetId &id) const
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
const Point & position() const
position
Definition: BeamSpot.h:59
HepPDT::ParticleDataTable ParticleDataTable
std::vector< double > * t_HitEnergies
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
T const * product() const
Definition: Handle.h:70
const std::string labelRecVtx_
const std::vector< std::string > trigNames_
l1t::L1TGlobalUtil * l1GtUtils_
double chargeIsolationGenCone(unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, double dR, int &nNearTRKs, bool debug=false)
const edm::InputTag algTag_
std::vector< int > * t_ietaGood
std::vector< double > etabins_
std::vector< double > phibins_
std::string const & label() const
Definition: InputTag.h:36
const edm::InputTag triggerEvent_
std::vector< bool > * t_hltbits
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
double chargeIsolationGenEcal(unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
float energy() const
Definition: TriggerObject.h:61
std::vector< unsigned int > * t_DetIds1
const std::string names[nVars_]
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_sevlv_
const Item * getValues(DetId fId, bool throwOnFail=true) const
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_caloTopology_
DetId newId(const DetId &)
int pdgId() const final
PDG identifier.
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double rhoh(const edm::Handle< CaloTowerCollection > &)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
char const * label
const std::vector< int > oldID_
bool notaMuon(const reco::GenParticle *pTrack)
double px() const final
x coordinate of momentum vector
std::vector< int > oldDepth_
int iEvent
Definition: GenABIO.cc:224
RunNumber_t run() const
Definition: RunBase.h:40
double p() const final
magnitude of momentum vector
dictionary corr
const EcalPFRecHitThresholds * eThresholds_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
unsigned int size() const
number of trigger paths in trigger table
std::vector< double > vec1
Definition: HCALResponse.h:15
edm::EDGetTokenT< BXVector< GlobalAlgBlk > > tok_alg_
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
const HcalDDDRecConstants * hdc_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< int > * t_ietaAll
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Transition
Definition: Transition.h:12
void storeEnergy(int indx, const HcalRespCorrs *respCorrs, const std::vector< DetId > &ids, std::vector< double > &edet, double &eHcal, std::vector< unsigned int > *detIds, std::vector< double > *hitEnergies)
int id() const
getters
Definition: TriggerObject.h:51
std::vector< int > * t_trackType
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::array< int, 3 > fillTree(std::vector< math::XYZTLorentzVector > &vecL1, std::vector< math::XYZTLorentzVector > &vecL3, math::XYZPoint &leadPV, std::vector< spr::propagatedGenParticleID > &trackIDs, const CaloGeometry *geo, const CaloTopology *topo, const HcalTopology *theHBHETopology, const EcalChannelStatus *theEcalChStatus, const EcalSeverityLevelAlgo *theEcalSevlv, edm::Handle< EcalRecHitCollection > &barrelRecHitsHandle, edm::Handle< EcalRecHitCollection > &endcapRecHitsHandle, edm::Handle< HBHERecHitCollection > &hbhe, const edm::Handle< CaloTowerCollection > &towerHandle, edm::Handle< reco::GenParticleCollection > &genParticles, const HcalRespCorrs *respCorrs)
static std::string const triggerResults
Definition: EdmProvDump.cc:47
const edm::InputTag extTag_
double py() const final
y coordinate of momentum vector
std::vector< unsigned int > * t_DetIds3
~HcalIsoTrkSimAnalyzer() override=default
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
#define M_PI
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::EDGetTokenT< CaloTowerCollection > tok_cala_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
void endRun(edm::Run const &, edm::EventSetup const &) override
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_ecalChStatus_
Definition: DetId.h:17
std::vector< unsigned int > * t_DetIds
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > tok_ecalPFRecHitThresholds_
void analyze(edm::Event const &, edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< double > * t_HitEnergies1
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
bool isValid() const
Definition: HandleBase.h:70
const std::string processName_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_ddrec_
fixed size matrix
HLT enums.
std::vector< bool > * t_trgbits
edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_resp_
const std::vector< std::pair< std::string, bool > > & decisionsFinal()
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > tok_pdt_
const std::string labelGenTrack_
Definition: tree.py:1
Log< level::Warning, false > LogWarning
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
double eThreshold(const DetId &id, const CaloGeometry *geo) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_bFieldH_
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double phi() const final
momentum azimuthal angle
const edm::InputTag theTriggerResultsLabel_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
void setTopo(const HcalTopology *topo)
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup)
initialize the class (mainly reserve)
Definition: Run.h:45
int charge() const final
electric charge
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)
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)
double eta() const final
momentum pseudorapidity
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164