CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
reco::helper::JetIDHelper Class Reference

#include <JetIDHelper.h>

Classes

struct  subtower
 

Public Member Functions

double approximatefHPD () const
 
double approximatefRBX () const
 
void calculate (const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
 
double fEB () const
 
double fEE () const
 
double fHB () const
 
double fHE () const
 
double fHFOOT () const
 
double fHO () const
 
double fHPD () const
 
void fillDescription (edm::ParameterSetDescription &iDesc)
 
double fLong () const
 
double fLSbad () const
 
double fRBX () const
 
double fShort () const
 
double fSubDetector1 () const
 
double fSubDetector2 () const
 
double fSubDetector3 () const
 
double fSubDetector4 () const
 
int hitsInN90 () const
 
void initValues ()
 
 JetIDHelper ()
 
 JetIDHelper (edm::ParameterSet const &pset, edm::ConsumesCollector &&iC)
 
int n90Hits () const
 
int nECALTowers () const
 
int nHCALTowers () const
 
double restrictedEMF () const
 
 ~JetIDHelper ()
 

Private Types

enum  Region {
  unknown_region = -1, HFneg, HEneg, HBneg,
  HBpos, HEpos, HFpos
}
 

Private Member Functions

void classifyJetComponents (const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, std::vector< double > &energies, std::vector< double > &subdet_energies, std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies, std::vector< double > &HO_energies, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, double &LS_bad_energy, double &HF_OOT_energy, const int iDbg=0)
 
void classifyJetTowers (const edm::Event &event, const reco::CaloJet &jet, std::vector< subtower > &subtowers, std::vector< subtower > &Ecal_subtowers, std::vector< subtower > &Hcal_subtowers, std::vector< subtower > &HO_subtowers, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, const int iDbg=0)
 
int HBHE_oddness (int iEta)
 
int HBHE_oddness (int iEta, int depth)
 
Region HBHE_region (uint32_t)
 
unsigned int hitsInNCarrying (double fraction, const std::vector< subtower > &descending_towers)
 
unsigned int nCarrying (double fraction, const std::vector< double > &descending_energies)
 
Region region (int iEta)
 

Private Attributes

double approximatefHPD_
 
double approximatefRBX_
 
double approximatefSubDetector1_
 
double approximatefSubDetector2_
 
double approximatefSubDetector3_
 
double approximatefSubDetector4_
 
edm::InputTag ebRecHitsColl_
 
edm::InputTag eeRecHitsColl_
 
double fEB_
 
double fEE_
 
double fHB_
 
double fHE_
 
double fHFOOT_
 
double fHO_
 
double fHPD_
 
double fLong_
 
double fLS_
 
double fRBX_
 
double fShort_
 
double fSubDetector1_
 
double fSubDetector2_
 
double fSubDetector3_
 
double fSubDetector4_
 
edm::InputTag hbheRecHitsColl_
 
edm::InputTag hfRecHitsColl_
 
int hitsInN90_
 
edm::InputTag hoRecHitsColl_
 
edm::EDGetTokenT< EBRecHitCollectioninput_EBRecHits_token_
 
edm::EDGetTokenT< EERecHitCollectioninput_EERecHits_token_
 
edm::EDGetTokenT< HBHERecHitCollectioninput_HBHERecHits_token_
 
edm::EDGetTokenT< HFRecHitCollectioninput_HFRecHits_token_
 
edm::EDGetTokenT< HORecHitCollectioninput_HORecHits_token_
 
int n90Hits_
 
int nECALTowers_
 
int nHCALTowers_
 
double restrictedEMF_
 
bool useRecHits_
 

Static Private Attributes

static std::atomic< int > sanity_checks_left_ {100}
 

Detailed Description

Definition at line 23 of file JetIDHelper.h.

Member Enumeration Documentation

◆ Region

Enumerator
unknown_region 
HFneg 
HEneg 
HBneg 
HBpos 
HEpos 
HFpos 

Definition at line 107 of file JetIDHelper.h.

Constructor & Destructor Documentation

◆ JetIDHelper() [1/2]

reco::helper::JetIDHelper::JetIDHelper ( )
inline

Definition at line 26 of file JetIDHelper.h.

26 {}

◆ JetIDHelper() [2/2]

reco::helper::JetIDHelper::JetIDHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector &&  iC 
)

Definition at line 44 of file JetIDHelper.cc.

44  {
45  useRecHits_ = pset.getParameter<bool>("useRecHits");
46  if (useRecHits_) {
47  hbheRecHitsColl_ = pset.getParameter<edm::InputTag>("hbheRecHitsColl");
48  hoRecHitsColl_ = pset.getParameter<edm::InputTag>("hoRecHitsColl");
49  hfRecHitsColl_ = pset.getParameter<edm::InputTag>("hfRecHitsColl");
50  ebRecHitsColl_ = pset.getParameter<edm::InputTag>("ebRecHitsColl");
51  eeRecHitsColl_ = pset.getParameter<edm::InputTag>("eeRecHitsColl");
52  }
53  initValues();
54 
60 }

References muonDTDigis_cfi::pset.

◆ ~JetIDHelper()

reco::helper::JetIDHelper::~JetIDHelper ( )
inline

Definition at line 28 of file JetIDHelper.h.

28 {}

Member Function Documentation

◆ approximatefHPD()

double reco::helper::JetIDHelper::approximatefHPD ( ) const
inline

Definition at line 64 of file JetIDHelper.h.

64 { return approximatefHPD_; }

References approximatefHPD_.

Referenced by JetIDProducer::produce().

◆ approximatefRBX()

double reco::helper::JetIDHelper::approximatefRBX ( ) const
inline

Definition at line 65 of file JetIDHelper.h.

65 { return approximatefRBX_; }

References approximatefRBX_.

Referenced by JetIDProducer::produce().

◆ calculate()

void reco::helper::JetIDHelper::calculate ( const edm::Event event,
const edm::EventSetup setup,
const reco::CaloJet jet,
const int  iDbg = 0 
)

Definition at line 93 of file JetIDHelper.cc.

96  {
97  initValues();
98 
99  // --------------------------------------------------
100  // 1) jet ID variable derived from existing fractions
101  // --------------------------------------------------
102 
103  double E_EM = TMath::Max(float(0.), jet.emEnergyInHF()) + TMath::Max(float(0.), jet.emEnergyInEB()) +
104  TMath::Max(float(0.), jet.emEnergyInEE());
105  double E_Had = TMath::Max(float(0.), jet.hadEnergyInHB()) + TMath::Max(float(0.), jet.hadEnergyInHE()) +
106  TMath::Max(float(0.), jet.hadEnergyInHO()) + TMath::Max(float(0.), jet.hadEnergyInHF());
107  if (E_Had + E_EM > 0)
108  restrictedEMF_ = E_EM / (E_EM + E_Had);
109  if (iDbg > 1)
110  cout << "jet pT: " << jet.pt() << ", eT: " << jet.et() << ", E: " << jet.energy() << " rEMF: " << restrictedEMF_
111  << endl;
112 
113  // ------------------------
114  // 2) tower based variables
115  // ------------------------
116  vector<subtower> subtowers, Ecal_subtowers, Hcal_subtowers, HO_subtowers;
117  vector<double> HPD_energies, RBX_energies;
118 
120  event, jet, subtowers, Ecal_subtowers, Hcal_subtowers, HO_subtowers, HPD_energies, RBX_energies, iDbg);
121  if (iDbg > 1) {
122  cout << "E:";
123  for (unsigned int i = 0; i < subtowers.size(); ++i)
124  cout << " " << subtowers[i].E << "," << subtowers[i].Nhit;
125  cout << "\nECal_E:";
126  for (unsigned int i = 0; i < Ecal_subtowers.size(); ++i)
127  cout << " " << Ecal_subtowers[i].E << "," << Ecal_subtowers[i].Nhit;
128  cout << "\nHCal_E:";
129  for (unsigned int i = 0; i < Hcal_subtowers.size(); ++i)
130  cout << " " << Hcal_subtowers[i].E << "," << Hcal_subtowers[i].Nhit;
131  cout << "\nHO_E:";
132  for (unsigned int i = 0; i < HO_subtowers.size(); ++i)
133  cout << " " << HO_subtowers[i].E << "," << HO_subtowers[i].Nhit;
134  cout << "\nHPD_E:";
135  for (unsigned int i = 0; i < HPD_energies.size(); ++i)
136  cout << " " << HPD_energies[i];
137  cout << "\nRBX_E:";
138  for (unsigned int i = 0; i < RBX_energies.size(); ++i)
139  cout << " " << RBX_energies[i];
140  cout << endl;
141  }
142 
143  // counts
144  hitsInN90_ = hitsInNCarrying(0.9, subtowers);
145  nHCALTowers_ = Hcal_subtowers.size();
146  vector<subtower>::const_iterator it;
147  it = find_if(Ecal_subtowers.begin(), Ecal_subtowers.end(), hasNonPositiveE);
148  nECALTowers_ = it - Ecal_subtowers.begin(); // ignores negative energies from HF!
149 
150  // energy fractions
151  double max_HPD_energy = 0., max_RBX_energy = 0.;
152  std::vector<double>::const_iterator it_max_HPD_energy = std::max_element(HPD_energies.begin(), HPD_energies.end());
153  std::vector<double>::const_iterator it_max_RBX_energy = std::max_element(RBX_energies.begin(), RBX_energies.end());
154  if (it_max_HPD_energy != HPD_energies.end()) {
155  max_HPD_energy = *it_max_HPD_energy;
156  }
157  if (it_max_RBX_energy != RBX_energies.end()) {
158  max_RBX_energy = *it_max_RBX_energy;
159  }
160  if (jet.energy() > 0) {
161  if (!HPD_energies.empty())
162  approximatefHPD_ = max_HPD_energy / jet.energy();
163  if (!RBX_energies.empty())
164  approximatefRBX_ = max_HPD_energy / jet.energy();
165  }
166 
167  // -----------------------
168  // 3) cell based variables
169  // -----------------------
170  if (useRecHits_) {
171  vector<double> energies, subdet_energies, Ecal_energies, Hcal_energies, HO_energies;
172  double LS_bad_energy, HF_OOT_energy;
174  setup,
175  jet,
176  energies,
177  subdet_energies,
178  Ecal_energies,
179  Hcal_energies,
180  HO_energies,
181  HPD_energies,
182  RBX_energies,
183  LS_bad_energy,
184  HF_OOT_energy,
185  iDbg);
186 
187  // counts
188  n90Hits_ = nCarrying(0.9, energies);
189 
190  // energy fractions
191  if (jet.energy() > 0) {
192  if (!HPD_energies.empty())
193  fHPD_ = max_HPD_energy / jet.energy();
194  if (!RBX_energies.empty())
195  fRBX_ = max_RBX_energy / jet.energy();
196  if (!subdet_energies.empty())
197  fSubDetector1_ = subdet_energies.at(0) / jet.energy();
198  if (subdet_energies.size() > 1)
199  fSubDetector2_ = subdet_energies.at(1) / jet.energy();
200  if (subdet_energies.size() > 2)
201  fSubDetector3_ = subdet_energies.at(2) / jet.energy();
202  if (subdet_energies.size() > 3)
203  fSubDetector4_ = subdet_energies.at(3) / jet.energy();
204  fLS_ = LS_bad_energy / jet.energy();
205  fHFOOT_ = HF_OOT_energy / jet.energy();
206 
207  if (iDbg > 0 && sanity_checks_left_.load(std::memory_order_acquire) > 0) {
209  double EH_sum = accumulate(Ecal_energies.begin(), Ecal_energies.end(), 0.);
210  EH_sum = accumulate(Hcal_energies.begin(), Hcal_energies.end(), EH_sum);
211  double EHO_sum = accumulate(HO_energies.begin(), HO_energies.end(), EH_sum);
212  if (jet.energy() > 0.001 && abs(EH_sum / jet.energy() - 1) > 0.01 && abs(EHO_sum / jet.energy() - 1) > 0.01)
213  edm::LogWarning("BadInput") << "Jet energy (" << jet.energy()
214  << ") does not match the total energy in the recHits (" << EHO_sum
215  << ", or without HO: " << EH_sum << ") . Are these the right recHits? "
216  << "Were jet energy corrections mistakenly applied before jet ID? A bug?";
217  if (iDbg > 1)
218  cout << "Sanity check - E: " << jet.energy() << " =? EH_sum: " << EH_sum << " / EHO_sum: " << EHO_sum << endl;
219  }
220  }
221 
222  if (iDbg > 1) {
223  cout << "DBG - fHPD: " << fHPD_ << ", fRBX: " << fRBX_ << ", nh90: " << n90Hits_ << ", fLS: " << fLS_
224  << ", fHFOOT: " << fHFOOT_ << endl;
225  cout << " -~fHPD: " << approximatefHPD_ << ", ~fRBX: " << approximatefRBX_ << ", hits in n90: " << hitsInN90_
226  << endl;
227  cout << " - nHCALTowers: " << nHCALTowers_ << ", nECALTowers: " << nECALTowers_
228  << "; subdet fractions: " << fSubDetector1_ << ", " << fSubDetector2_ << ", " << fSubDetector3_ << ", "
229  << fSubDetector4_ << endl;
230  }
231  }
232 }

References funct::abs(), gather_cfg::cout, reco::helper::hasNonPositiveE(), mps_fire::i, metsig::jet, Max(), and singleTopDQM_cfi::setup.

Referenced by JetMETHLTOfflineSource::analyze(), HLTCaloJetIDProducer::produce(), and JetIDProducer::produce().

◆ classifyJetComponents()

void reco::helper::JetIDHelper::classifyJetComponents ( const edm::Event event,
const edm::EventSetup setup,
const reco::CaloJet jet,
std::vector< double > &  energies,
std::vector< double > &  subdet_energies,
std::vector< double > &  Ecal_energies,
std::vector< double > &  Hcal_energies,
std::vector< double > &  HO_energies,
std::vector< double > &  HPD_energies,
std::vector< double > &  RBX_energies,
double &  LS_bad_energy,
double &  HF_OOT_energy,
const int  iDbg = 0 
)
private

Definition at line 269 of file JetIDHelper.cc.

281  {
282  energies.clear();
283  subdet_energies.clear();
284  Ecal_energies.clear();
285  Hcal_energies.clear();
286  HO_energies.clear();
287  HPD_energies.clear();
288  RBX_energies.clear();
289  LS_bad_energy = HF_OOT_energy = 0.;
290 
291  edm::ESHandle<HcalTopology> theHcalTopology;
292  setup.get<HcalRecNumberingRecord>().get(theHcalTopology);
293 
294  std::map<int, double> HPD_energy_map, RBX_energy_map;
295  vector<double> EB_energies, EE_energies, HB_energies, HE_energies, short_energies, long_energies;
301  // the jet only contains DetIds, so first read recHit collection
302  event.getByToken(input_HBHERecHits_token_, HBHERecHits);
303  event.getByToken(input_HORecHits_token_, HORecHits);
304  event.getByToken(input_HFRecHits_token_, HFRecHits);
305  event.getByToken(input_EBRecHits_token_, EBRecHits);
306  event.getByToken(input_EERecHits_token_, EERecHits);
307  if (iDbg > 2)
308  cout << "# of rechits found - HBHE: " << HBHERecHits->size() << ", HO: " << HORecHits->size()
309  << ", HF: " << HFRecHits->size() << ", EB: " << EBRecHits->size() << ", EE: " << EERecHits->size() << endl;
310 
311  vector<CaloTowerPtr> towers = jet.getCaloConstituents();
312  int nTowers = towers.size();
313  if (iDbg > 9)
314  cout << "In classifyJetComponents. # of towers found: " << nTowers << endl;
315 
316  for (int iTower = 0; iTower < nTowers; iTower++) {
317  CaloTowerPtr &tower = towers[iTower];
318 
319  int nCells = tower->constituentsSize();
320  if (iDbg)
321  cout << "tower #" << iTower << " has " << nCells << " cells. "
322  << "It's at iEta: " << tower->ieta() << ", iPhi: " << tower->iphi() << endl;
323 
324  const vector<DetId> &cellIDs = tower->constituents(); // cell == recHit
325 
326  for (int iCell = 0; iCell < nCells; ++iCell) {
327  DetId::Detector detNum = cellIDs[iCell].det();
328  if (detNum == DetId::Hcal) {
329  HcalDetId HcalID = cellIDs[iCell];
330  HcalSubdetector HcalNum = HcalID.subdet();
331  double hitE = 0;
332  if (HcalNum == HcalOuter) {
333  HORecHitCollection::const_iterator theRecHit = HORecHits->find(HcalID);
334  if (theRecHit == HORecHits->end()) {
335  edm::LogWarning("UnexpectedEventContents") << "Can't find the HO recHit with ID: " << HcalID;
336  continue;
337  }
338  hitE = theRecHit->energy();
339  HO_energies.push_back(hitE);
340 
341  } else if (HcalNum == HcalForward) {
342  HFRecHitCollection::const_iterator theRecHit = HFRecHits->find(HcalID);
343  if (theRecHit == HFRecHits->end()) {
344  edm::LogWarning("UnexpectedEventContents") << "Can't find the HF recHit with ID: " << HcalID;
345  continue;
346  }
347  hitE = theRecHit->energy();
348  if (iDbg > 4)
349  cout << "hit #" << iCell << " is HF , E: " << hitE << " iEta: " << theRecHit->id().ieta()
350  << ", depth: " << theRecHit->id().depth() << ", iPhi: " << theRecHit->id().iphi();
351 
352  if (HcalID.depth() == 1)
353  long_energies.push_back(hitE);
354  else
355  short_energies.push_back(hitE);
356 
357  uint32_t flags = theRecHit->flags();
359  LS_bad_energy += hitE;
363  HF_OOT_energy += hitE;
364  if (iDbg > 4 && flags)
365  cout << "flags: " << flags << " -> LS_bad_energy: " << LS_bad_energy << ", HF_OOT_energy: " << HF_OOT_energy
366  << endl;
367 
368  } else { // HBHE
369 
370  HBHERecHitCollection::const_iterator theRecHit = HBHERecHits->find(HcalID);
371  if (theRecHit == HBHERecHits->end()) {
372  edm::LogWarning("UnexpectedEventContents") << "Can't find the HBHE recHit with ID: " << HcalID;
373  continue;
374  }
375  hitE = theRecHit->energy();
376  int iEta = theRecHit->id().ieta();
377  int depth = theRecHit->id().depth();
378  Region region = HBHE_region(theRecHit->id().rawId());
379  int hitIPhi = theRecHit->id().iphi();
380  if (iDbg > 3)
381  cout << "hit #" << iCell << " is HBHE, E: " << hitE << " iEta: " << iEta << ", depth: " << depth
382  << ", iPhi: " << theRecHit->id().iphi() << " -> " << region;
383 
384  if (theHcalTopology->mergedDepth29(theRecHit->id()))
385  hitE /= 2; // Depth 3 at the HE forward edge is split over tower 28 & 29, and jet reco. assigns half each
386 
387  int iHPD = 100 * region;
388  int iRBX = 100 * region + ((hitIPhi + 1) % 72) / 4; // 71,72,1,2 are in the same RBX module
389 
390  if (std::abs(iEta) >= 21) {
391  if ((0x1 & hitIPhi) == 0) {
392  edm::LogError("CodeAssumptionsViolated") << "Bug?! Jet ID code assumes no even iPhi recHits at HE edges";
393  return;
394  }
395  bool oddnessIEta = HBHE_oddness(iEta, depth);
396  bool upperIPhi = ((hitIPhi % 4) == 1 || (hitIPhi % 4) == 2); // the upper iPhi indices in the HE wedge
397  // remap the iPhi so it fits the one in the inner HE regions, change in needed in two cases:
398  // 1) in the upper iPhis of the module, the even iEtas belong to the higher iPhi
399  // 2) in the loewr iPhis of the module, the odd iEtas belong to the higher iPhi
400  if (upperIPhi != oddnessIEta)
401  ++hitIPhi;
402  // note that hitIPhi could not be 72 before, so it's still in the legal range [1,72]
403  }
404  iHPD += hitIPhi;
405 
406  // book the energies
407  HPD_energy_map[iHPD] += hitE;
408  RBX_energy_map[iRBX] += hitE;
409  if (iDbg > 5)
410  cout << " --> H[" << iHPD << "]=" << HPD_energy_map[iHPD] << ", R[" << iRBX << "]=" << RBX_energy_map[iRBX];
411  if (iDbg > 1)
412  cout << endl;
413 
414  if (region == HBneg || region == HBpos)
415  HB_energies.push_back(hitE);
416  else
417  HE_energies.push_back(hitE);
418 
419  } // if HBHE
420  if (hitE == 0)
421  edm::LogWarning("UnexpectedEventContents") << "HCal hitE==0? (or unknown subdetector?)";
422 
423  } // if HCAL
424 
425  else if (detNum == DetId::Ecal) {
426  int EcalNum = cellIDs[iCell].subdetId();
427  double hitE = 0;
428  if (EcalNum == 1) {
429  EBDetId EcalID = cellIDs[iCell];
430  EBRecHitCollection::const_iterator theRecHit = EBRecHits->find(EcalID);
431  if (theRecHit == EBRecHits->end()) {
432  edm::LogWarning("UnexpectedEventContents") << "Can't find the EB recHit with ID: " << EcalID;
433  continue;
434  }
435  hitE = theRecHit->energy();
436  EB_energies.push_back(hitE);
437  } else if (EcalNum == 2) {
438  EEDetId EcalID = cellIDs[iCell];
439  EERecHitCollection::const_iterator theRecHit = EERecHits->find(EcalID);
440  if (theRecHit == EERecHits->end()) {
441  edm::LogWarning("UnexpectedEventContents") << "Can't find the EE recHit with ID: " << EcalID;
442  continue;
443  }
444  hitE = theRecHit->energy();
445  EE_energies.push_back(hitE);
446  }
447  if (hitE == 0)
448  edm::LogWarning("UnexpectedEventContents") << "ECal hitE==0? (or unknown subdetector?)";
449  if (iDbg > 6)
450  cout << "EcalNum: " << EcalNum << " hitE: " << hitE << endl;
451  } //
452  } // loop on cells
453  } // loop on towers
454 
455  /* Disabling check until HO is accounted for in EMF. Check was used in CMSSW_2, where HE was excluded.
456  double expHcalE = jet.energy() * (1-jet.emEnergyFraction());
457  if( totHcalE + expHcalE > 0 &&
458  TMath::Abs( totHcalE - expHcalE ) > 0.01 &&
459  ( totHcalE - expHcalE ) / ( totHcalE + expHcalE ) > 0.0001 ) {
460  edm::LogWarning("CodeAssumptionsViolated")<<"failed to account for all Hcal energies"
461  <<totHcalE<<"!="<<expHcalE;
462  } */
463  // concatenate Hcal and Ecal lists
464  Hcal_energies.insert(Hcal_energies.end(), HB_energies.begin(), HB_energies.end());
465  Hcal_energies.insert(Hcal_energies.end(), HE_energies.begin(), HE_energies.end());
466  Hcal_energies.insert(Hcal_energies.end(), short_energies.begin(), short_energies.end());
467  Hcal_energies.insert(Hcal_energies.end(), long_energies.begin(), long_energies.end());
468  Ecal_energies.insert(Ecal_energies.end(), EB_energies.begin(), EB_energies.end());
469  Ecal_energies.insert(Ecal_energies.end(), EE_energies.begin(), EE_energies.end());
470 
471  // sort the energies
472  // std::sort( Hcal_energies.begin(), Hcal_energies.end(), greater<double>() );
473  // std::sort( Ecal_energies.begin(), Ecal_energies.end(), greater<double>() );
474 
475  // put the energy sums (the 2nd entry in each pair of the maps) into the output vectors and sort them
477  HPD_energy_map.begin(), HPD_energy_map.end(), std::inserter(HPD_energies, HPD_energies.end()), select2nd);
478  // std::select2nd<std::map<int,double>::value_type>());
479  // std::sort( HPD_energies.begin(), HPD_energies.end(), greater<double>() );
481  RBX_energy_map.begin(), RBX_energy_map.end(), std::inserter(RBX_energies, RBX_energies.end()), select2nd);
482  // std::select2nd<std::map<int,double>::value_type>());
483  // std::sort( RBX_energies.begin(), RBX_energies.end(), greater<double>() );
484 
485  energies.insert(energies.end(), Hcal_energies.begin(), Hcal_energies.end());
486  energies.insert(energies.end(), Ecal_energies.begin(), Ecal_energies.end());
487  energies.insert(energies.end(), HO_energies.begin(), HO_energies.end());
488  std::sort(energies.begin(), energies.end(), greater<double>());
489 
490  // prepare sub detector energies, then turn them into fractions
491  fEB_ = std::accumulate(EB_energies.begin(), EB_energies.end(), 0.);
492  fEE_ = std::accumulate(EE_energies.begin(), EE_energies.end(), 0.);
493  fHB_ = std::accumulate(HB_energies.begin(), HB_energies.end(), 0.);
494  fHE_ = std::accumulate(HE_energies.begin(), HE_energies.end(), 0.);
495  fHO_ = std::accumulate(HO_energies.begin(), HO_energies.end(), 0.);
496  fShort_ = std::accumulate(short_energies.begin(), short_energies.end(), 0.);
497  fLong_ = std::accumulate(long_energies.begin(), long_energies.end(), 0.);
498  subdet_energies.push_back(fEB_);
499  subdet_energies.push_back(fEE_);
500  subdet_energies.push_back(fHB_);
501  subdet_energies.push_back(fHE_);
502  subdet_energies.push_back(fHO_);
503  subdet_energies.push_back(fShort_);
504  subdet_energies.push_back(fLong_);
505  std::sort(subdet_energies.begin(), subdet_energies.end(), greater<double>());
506  if (jet.energy() > 0) {
507  fEB_ /= jet.energy();
508  fEE_ /= jet.energy();
509  fHB_ /= jet.energy();
510  fHE_ /= jet.energy();
511  fHO_ /= jet.energy();
512  fShort_ /= jet.energy();
513  fLong_ /= jet.energy();
514  } else {
515  if (fEB_ > 0 || fEE_ > 0 || fHB_ > 0 || fHE_ > 0 || fHO_ > 0 || fShort_ > 0 || fLong_ > 0)
516  edm::LogError("UnexpectedEventContents") << "Jet ID Helper found energy in subdetectors and jet E <= 0";
517  }
518 }

References funct::abs(), gather_cfg::cout, LEDCalibrationChannels::depth, HcalDetId::depth(), filterRecHits_cfi::EBRecHits, DetId::Ecal, filterRecHits_cfi::EERecHits, edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), HLT_FULL_cff::flags, get, egHLT::errCodes::HBHERecHits, DetId::Hcal, HcalForward, HcalOuter, HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFLongShort, egHLT::errCodes::HFRecHits, HcalCaloFlagLabels::HFTimingTrustBits, L1TowerCalibrationProducer_cfi::iEta, metsig::jet, HcalTopology::mergedDepth29(), nCells, ecaldqm::nTowers, HLT_FULL_cff::region, reco::helper::select2nd(), singleTopDQM_cfi::setup, edm::SortedCollection< T, SORT >::size(), jetUpdater_cfi::sort, HcalDetId::subdet(), HcalCaloFlagLabels::TimingAddedBit, HcalCaloFlagLabels::TimingErrorBit, HcalCaloFlagLabels::TimingSubtractedBit, hgcalTowerProducer_cfi::tower, HLT_FULL_cff::towers, HcalDetIdTransform::transform(), and testProducerWithPsetDescEmpty_cfi::x1.

◆ classifyJetTowers()

void reco::helper::JetIDHelper::classifyJetTowers ( const edm::Event event,
const reco::CaloJet jet,
std::vector< subtower > &  subtowers,
std::vector< subtower > &  Ecal_subtowers,
std::vector< subtower > &  Hcal_subtowers,
std::vector< subtower > &  HO_subtowers,
std::vector< double > &  HPD_energies,
std::vector< double > &  RBX_energies,
const int  iDbg = 0 
)
private

Definition at line 520 of file JetIDHelper.cc.

528  {
529  subtowers.clear();
530  Ecal_subtowers.clear();
531  Hcal_subtowers.clear();
532  HO_subtowers.clear();
533  HPD_energies.clear();
534  RBX_energies.clear();
535 
536  std::map<int, double> HPD_energy_map, RBX_energy_map;
537 
538  vector<CaloTowerPtr> towers = jet.getCaloConstituents();
539  int nTowers = towers.size();
540  if (iDbg > 9)
541  cout << "classifyJetTowers started. # of towers found: " << nTowers << endl;
542 
543  for (int iTower = 0; iTower < nTowers; iTower++) {
544  CaloTowerPtr &tower = towers[iTower];
545 
546  int nEM = 0, nHad = 0, nHO = 0;
547  const vector<DetId> &cellIDs = tower->constituents(); // cell == recHit
548  int nCells = cellIDs.size();
549  if (iDbg)
550  cout << "tower #" << iTower << " has " << nCells << " cells. "
551  << "It's at iEta: " << tower->ieta() << ", iPhi: " << tower->iphi() << endl;
552 
553  for (int iCell = 0; iCell < nCells; ++iCell) {
554  DetId::Detector detNum = cellIDs[iCell].det();
555  if (detNum == DetId::Hcal) {
556  HcalDetId HcalID = cellIDs[iCell];
557  HcalSubdetector HcalNum = HcalID.subdet();
558  if (HcalNum == HcalOuter) {
559  ++nHO;
560  } else {
561  ++nHad;
562  }
563  } else if (detNum == DetId::Ecal) {
564  ++nEM;
565  }
566  }
567 
568  double E_em = tower->emEnergy();
569  if (E_em != 0)
570  Ecal_subtowers.push_back(subtower(E_em, nEM));
571 
572  double E_HO = tower->outerEnergy();
573  if (E_HO != 0)
574  HO_subtowers.push_back(subtower(E_HO, nHO));
575 
576  double E_had = tower->hadEnergy();
577  if (E_had != 0) {
578  Hcal_subtowers.push_back(subtower(E_had, nHad));
579  // totHcalE += E_had;
580 
581  int iEta = tower->ieta();
582  Region reg = region(iEta);
583  int iPhi = tower->iphi();
584  if (iDbg > 3)
585  cout << "tower has E_had: " << E_had << " iEta: " << iEta << ", iPhi: " << iPhi << " -> " << reg;
586 
587  if (reg == HEneg || reg == HBneg || reg == HBpos || reg == HEpos) {
588  int oddnessIEta = HBHE_oddness(iEta);
589  if (oddnessIEta < 0)
590  break; // can't assign this tower to a single readout component
591 
592  int iHPD = 100 * reg;
593  int iRBX = 100 * reg + ((iPhi + 1) % 72) / 4; // 71,72,1,2 are in the same RBX module
594 
595  if ((reg == HEneg || reg == HEpos) && std::abs(iEta) >= 21) { // at low-granularity edge of HE
596  if ((0x1 & iPhi) == 0) {
597  edm::LogError("CodeAssumptionsViolated") << "Bug?! Jet ID code assumes no even iPhi recHits at HE edges";
598  return;
599  }
600  bool boolOddnessIEta = oddnessIEta;
601  bool upperIPhi = ((iPhi % 4) == 1 || (iPhi % 4) == 2); // the upper iPhi indices in the HE wedge
602  // remap the iPhi so it fits the one in the inner HE regions, change in needed in two cases:
603  // 1) in the upper iPhis of the module, the even IEtas belong to the higher iPhi
604  // 2) in the loewr iPhis of the module, the odd IEtas belong to the higher iPhi
605  if (upperIPhi != boolOddnessIEta)
606  ++iPhi;
607  // note that iPhi could not be 72 before, so it's still in the legal range [1,72]
608  } // if at low-granularity edge of HE
609  iHPD += iPhi;
610 
611  // book the energies
612  HPD_energy_map[iHPD] += E_had;
613  RBX_energy_map[iRBX] += E_had;
614  if (iDbg > 5)
615  cout << " --> H[" << iHPD << "]=" << HPD_energy_map[iHPD] << ", R[" << iRBX << "]=" << RBX_energy_map[iRBX];
616  } // HBHE
617  } // E_had > 0
618  } // loop on towers
619 
620  // sort the subtowers
621  // std::sort( Hcal_subtowers.begin(), Hcal_subtowers.end(), subtower_has_greater_E );
622  // std::sort( Ecal_subtowers.begin(), Ecal_subtowers.end(), subtower_has_greater_E );
623 
624  // put the energy sums (the 2nd entry in each pair of the maps) into the output vectors and sort them
626  HPD_energy_map.begin(), HPD_energy_map.end(), std::inserter(HPD_energies, HPD_energies.end()), select2nd);
627  // std::select2nd<std::map<int,double>::value_type>());
628  // std::sort( HPD_energies.begin(), HPD_energies.end(), greater<double>() );
630  RBX_energy_map.begin(), RBX_energy_map.end(), std::inserter(RBX_energies, RBX_energies.end()), select2nd);
631  // std::select2nd<std::map<int,double>::value_type>());
632  // std::sort( RBX_energies.begin(), RBX_energies.end(), greater<double>() );
633 
634  subtowers.insert(subtowers.end(), Hcal_subtowers.begin(), Hcal_subtowers.end());
635  subtowers.insert(subtowers.end(), Ecal_subtowers.begin(), Ecal_subtowers.end());
636  subtowers.insert(subtowers.end(), HO_subtowers.begin(), HO_subtowers.end());
637  std::sort(subtowers.begin(), subtowers.end(), subtower_has_greater_E);
638 }

References funct::abs(), gather_cfg::cout, DetId::Ecal, DetId::Hcal, HcalOuter, L1TowerCalibrationProducer_cfi::iEta, metsig::jet, nCells, ecaldqm::nTowers, HLT_FULL_cff::region, reco::helper::select2nd(), jetUpdater_cfi::sort, HcalDetId::subdet(), reco::helper::subtower_has_greater_E(), hgcalTowerProducer_cfi::tower, HLT_FULL_cff::towers, HcalDetIdTransform::transform(), and testProducerWithPsetDescEmpty_cfi::x1.

◆ fEB()

double reco::helper::JetIDHelper::fEB ( ) const
inline

Definition at line 50 of file JetIDHelper.h.

50 { return fEB_; }

References fEB_.

Referenced by JetIDProducer::produce().

◆ fEE()

double reco::helper::JetIDHelper::fEE ( ) const
inline

Definition at line 51 of file JetIDHelper.h.

51 { return fEE_; }

References fEE_.

Referenced by JetIDProducer::produce().

◆ fHB()

double reco::helper::JetIDHelper::fHB ( ) const
inline

Definition at line 52 of file JetIDHelper.h.

52 { return fHB_; }

References fHB_.

Referenced by JetIDProducer::produce().

◆ fHE()

double reco::helper::JetIDHelper::fHE ( ) const
inline

Definition at line 53 of file JetIDHelper.h.

53 { return fHE_; }

References fHE_.

Referenced by JetIDProducer::produce().

◆ fHFOOT()

double reco::helper::JetIDHelper::fHFOOT ( ) const
inline

Definition at line 58 of file JetIDHelper.h.

58 { return fHFOOT_; }

References fHFOOT_.

Referenced by JetIDProducer::produce().

◆ fHO()

double reco::helper::JetIDHelper::fHO ( ) const
inline

Definition at line 54 of file JetIDHelper.h.

54 { return fHO_; }

References fHO_.

Referenced by JetIDProducer::produce().

◆ fHPD()

double reco::helper::JetIDHelper::fHPD ( ) const
inline

Definition at line 43 of file JetIDHelper.h.

43 { return fHPD_; }

References fHPD_.

Referenced by JetMETHLTOfflineSource::analyze(), and JetIDProducer::produce().

◆ fillDescription()

void reco::helper::JetIDHelper::fillDescription ( edm::ParameterSetDescription iDesc)

Definition at line 80 of file JetIDHelper.cc.

80  {
81  iDesc
82  .ifValue(edm::ParameterDescription<bool>("useRecHits", true, true),
83  true >> (edm::ParameterDescription<edm::InputTag>("hbheRecHitsColl", edm::InputTag(), true) and
84  edm::ParameterDescription<edm::InputTag>("hoRecHitsColl", edm::InputTag(), true) and
85  edm::ParameterDescription<edm::InputTag>("hfRecHitsColl", edm::InputTag(), true) and
86  edm::ParameterDescription<edm::InputTag>("ebRecHitsColl", edm::InputTag(), true) and
88  ->setComment(
89  "If using RecHits to calculate the precise jet ID variables that need them, "
90  "their sources need to be specified");
91 }

References edm::ParameterSetDescription::ifValue(), and edm::ParameterDescriptionNode::setComment().

◆ fLong()

double reco::helper::JetIDHelper::fLong ( ) const
inline

Definition at line 55 of file JetIDHelper.h.

55 { return fLong_; }

References fLong_.

Referenced by JetIDProducer::produce().

◆ fLSbad()

double reco::helper::JetIDHelper::fLSbad ( ) const
inline

Definition at line 57 of file JetIDHelper.h.

57 { return fLS_; }

References fLS_.

Referenced by JetIDProducer::produce().

◆ fRBX()

double reco::helper::JetIDHelper::fRBX ( ) const
inline

Definition at line 44 of file JetIDHelper.h.

44 { return fRBX_; }

References fRBX_.

Referenced by JetIDProducer::produce().

◆ fShort()

double reco::helper::JetIDHelper::fShort ( ) const
inline

Definition at line 56 of file JetIDHelper.h.

56 { return fShort_; }

References fShort_.

Referenced by JetIDProducer::produce().

◆ fSubDetector1()

double reco::helper::JetIDHelper::fSubDetector1 ( ) const
inline

Definition at line 46 of file JetIDHelper.h.

46 { return fSubDetector1_; }

References fSubDetector1_.

Referenced by JetIDProducer::produce().

◆ fSubDetector2()

double reco::helper::JetIDHelper::fSubDetector2 ( ) const
inline

Definition at line 47 of file JetIDHelper.h.

47 { return fSubDetector2_; }

References fSubDetector2_.

Referenced by JetIDProducer::produce().

◆ fSubDetector3()

double reco::helper::JetIDHelper::fSubDetector3 ( ) const
inline

Definition at line 48 of file JetIDHelper.h.

48 { return fSubDetector3_; }

References fSubDetector3_.

Referenced by JetIDProducer::produce().

◆ fSubDetector4()

double reco::helper::JetIDHelper::fSubDetector4 ( ) const
inline

Definition at line 49 of file JetIDHelper.h.

49 { return fSubDetector4_; }

References fSubDetector4_.

Referenced by JetIDProducer::produce().

◆ HBHE_oddness() [1/2]

int reco::helper::JetIDHelper::HBHE_oddness ( int  iEta)
private

Definition at line 663 of file JetIDHelper.cc.

663  {
664  int ae = TMath::Abs(iEta);
665  if (ae == 29)
666  return -1; // can't figure it out without RecHits
667  return ae & 0x1;
668 }

References Abs(), and L1TowerCalibrationProducer_cfi::iEta.

◆ HBHE_oddness() [2/2]

int reco::helper::JetIDHelper::HBHE_oddness ( int  iEta,
int  depth 
)
private

Definition at line 643 of file JetIDHelper.cc.

643  {
644  int ae = TMath::Abs(iEta);
645  if (ae == 29 && depth == 1)
646  ae += 1; // observed that: hits are at depths 1 & 2; 1 goes with the even pattern
647  return ae & 0x1;
648 }

References Abs(), LEDCalibrationChannels::depth, and L1TowerCalibrationProducer_cfi::iEta.

◆ HBHE_region()

reco::helper::JetIDHelper::Region reco::helper::JetIDHelper::HBHE_region ( uint32_t  rawid)
private

Definition at line 650 of file JetIDHelper.cc.

650  {
651  HcalDetId id(rawid);
652  if (id.subdet() == HcalEndcap) {
653  if (id.ieta() < 0)
654  return HEneg;
655  else
656  return HEpos;
657  }
658  if (id.subdet() == HcalBarrel && id.ieta() < 0)
659  return HBneg;
660  return HBpos;
661 }

References HcalBarrel, HcalEndcap, triggerObjects_cff::id, and LEDCalibrationChannels::ieta.

◆ hitsInN90()

int reco::helper::JetIDHelper::hitsInN90 ( ) const
inline

Definition at line 66 of file JetIDHelper.h.

66 { return hitsInN90_; }

References hitsInN90_.

Referenced by JetIDProducer::produce().

◆ hitsInNCarrying()

unsigned int reco::helper::JetIDHelper::hitsInNCarrying ( double  fraction,
const std::vector< subtower > &  descending_towers 
)
private

Definition at line 251 of file JetIDHelper.cc.

252  {
253  double totalE = 0;
254  for (unsigned int i = 0; i < descending_towers.size(); ++i)
255  totalE += descending_towers[i].E;
256 
257  double runningE = 0;
258  unsigned int NH = 0;
259 
260  // slightly odd loop structure avoids round-off problems when runningE never catches up with totalE
261  for (unsigned int i = descending_towers.size(); i > 0; --i) {
262  runningE += descending_towers[i - 1].E;
263  if (runningE >= (1 - fraction) * totalE)
264  NH += descending_towers[i - 1].Nhit;
265  }
266  return NH;
267 }

References HLT_FULL_cff::fraction, and mps_fire::i.

◆ initValues()

void reco::helper::JetIDHelper::initValues ( )

Definition at line 62 of file JetIDHelper.cc.

62  {
63  fHPD_ = -1.0;
64  fRBX_ = -1.0;
65  n90Hits_ = -1;
66  fSubDetector1_ = -1.0;
67  fSubDetector2_ = -1.0;
68  fSubDetector3_ = -1.0;
69  fSubDetector4_ = -1.0;
70  restrictedEMF_ = -1.0;
71  nHCALTowers_ = -1;
72  nECALTowers_ = -1;
73  approximatefHPD_ = -1.0;
74  approximatefRBX_ = -1.0;
75  hitsInN90_ = -1;
76  fEB_ = fEE_ = fHB_ = fHE_ = fHO_ = fLong_ = fShort_ = -1.0;
77  fLS_ = fHFOOT_ = -1.0;
78 }

◆ n90Hits()

int reco::helper::JetIDHelper::n90Hits ( ) const
inline

Definition at line 45 of file JetIDHelper.h.

45 { return n90Hits_; }

References n90Hits_.

Referenced by JetMETHLTOfflineSource::analyze(), HLTCaloJetIDProducer::produce(), and JetIDProducer::produce().

◆ nCarrying()

unsigned int reco::helper::JetIDHelper::nCarrying ( double  fraction,
const std::vector< double > &  descending_energies 
)
private

Definition at line 234 of file JetIDHelper.cc.

234  {
235  double totalE = 0;
236  for (unsigned int i = 0; i < descending_energies.size(); ++i)
237  totalE += descending_energies[i];
238 
239  double runningE = 0;
240  unsigned int NC = descending_energies.size();
241 
242  // slightly odd loop structure avoids round-off problems when runningE never catches up with totalE
243  for (unsigned int i = descending_energies.size(); i > 0; --i) {
244  runningE += descending_energies[i - 1];
245  if (runningE < (1 - fraction) * totalE)
246  NC = i - 1;
247  }
248  return NC;
249 }

References HLT_FULL_cff::fraction, and mps_fire::i.

◆ nECALTowers()

int reco::helper::JetIDHelper::nECALTowers ( ) const
inline

Definition at line 62 of file JetIDHelper.h.

62 { return nECALTowers_; }

References nECALTowers_.

Referenced by JetIDProducer::produce().

◆ nHCALTowers()

int reco::helper::JetIDHelper::nHCALTowers ( ) const
inline

Definition at line 61 of file JetIDHelper.h.

61 { return nHCALTowers_; }

References nHCALTowers_.

Referenced by JetIDProducer::produce().

◆ region()

reco::helper::JetIDHelper::Region reco::helper::JetIDHelper::region ( int  iEta)
private

Definition at line 670 of file JetIDHelper.cc.

670  {
671  if (iEta == 16 || iEta == -16)
672  return unknown_region; // both HB and HE cells belong to these towers
673  if (iEta == 29 || iEta == -29)
674  return unknown_region; // both HE and HF cells belong to these towers
675  if (iEta <= -30)
676  return HFneg;
677  if (iEta >= 30)
678  return HFpos;
679  if (iEta <= -17)
680  return HEneg;
681  if (iEta >= 17)
682  return HEpos;
683  if (iEta < 0)
684  return HBneg;
685  return HBpos;
686 }

References L1TowerCalibrationProducer_cfi::iEta.

◆ restrictedEMF()

double reco::helper::JetIDHelper::restrictedEMF ( ) const
inline

Definition at line 60 of file JetIDHelper.h.

60 { return restrictedEMF_; }

References restrictedEMF_.

Referenced by JetIDProducer::produce().

Member Data Documentation

◆ approximatefHPD_

double reco::helper::JetIDHelper::approximatefHPD_
private

Definition at line 125 of file JetIDHelper.h.

Referenced by approximatefHPD().

◆ approximatefRBX_

double reco::helper::JetIDHelper::approximatefRBX_
private

Definition at line 126 of file JetIDHelper.h.

Referenced by approximatefRBX().

◆ approximatefSubDetector1_

double reco::helper::JetIDHelper::approximatefSubDetector1_
private

Definition at line 128 of file JetIDHelper.h.

◆ approximatefSubDetector2_

double reco::helper::JetIDHelper::approximatefSubDetector2_
private

Definition at line 129 of file JetIDHelper.h.

◆ approximatefSubDetector3_

double reco::helper::JetIDHelper::approximatefSubDetector3_
private

Definition at line 130 of file JetIDHelper.h.

◆ approximatefSubDetector4_

double reco::helper::JetIDHelper::approximatefSubDetector4_
private

Definition at line 131 of file JetIDHelper.h.

◆ ebRecHitsColl_

edm::InputTag reco::helper::JetIDHelper::ebRecHitsColl_
private

Definition at line 140 of file JetIDHelper.h.

◆ eeRecHitsColl_

edm::InputTag reco::helper::JetIDHelper::eeRecHitsColl_
private

Definition at line 141 of file JetIDHelper.h.

◆ fEB_

double reco::helper::JetIDHelper::fEB_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fEB().

◆ fEE_

double reco::helper::JetIDHelper::fEE_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fEE().

◆ fHB_

double reco::helper::JetIDHelper::fHB_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fHB().

◆ fHE_

double reco::helper::JetIDHelper::fHE_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fHE().

◆ fHFOOT_

double reco::helper::JetIDHelper::fHFOOT_
private

Definition at line 134 of file JetIDHelper.h.

Referenced by fHFOOT().

◆ fHO_

double reco::helper::JetIDHelper::fHO_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fHO().

◆ fHPD_

double reco::helper::JetIDHelper::fHPD_
private

Definition at line 115 of file JetIDHelper.h.

Referenced by fHPD().

◆ fLong_

double reco::helper::JetIDHelper::fLong_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fLong().

◆ fLS_

double reco::helper::JetIDHelper::fLS_
private

Definition at line 134 of file JetIDHelper.h.

Referenced by fLSbad().

◆ fRBX_

double reco::helper::JetIDHelper::fRBX_
private

Definition at line 116 of file JetIDHelper.h.

Referenced by fRBX().

◆ fShort_

double reco::helper::JetIDHelper::fShort_
private

Definition at line 133 of file JetIDHelper.h.

Referenced by fShort().

◆ fSubDetector1_

double reco::helper::JetIDHelper::fSubDetector1_
private

Definition at line 118 of file JetIDHelper.h.

Referenced by fSubDetector1().

◆ fSubDetector2_

double reco::helper::JetIDHelper::fSubDetector2_
private

Definition at line 119 of file JetIDHelper.h.

Referenced by fSubDetector2().

◆ fSubDetector3_

double reco::helper::JetIDHelper::fSubDetector3_
private

Definition at line 120 of file JetIDHelper.h.

Referenced by fSubDetector3().

◆ fSubDetector4_

double reco::helper::JetIDHelper::fSubDetector4_
private

Definition at line 121 of file JetIDHelper.h.

Referenced by fSubDetector4().

◆ hbheRecHitsColl_

edm::InputTag reco::helper::JetIDHelper::hbheRecHitsColl_
private

Definition at line 137 of file JetIDHelper.h.

◆ hfRecHitsColl_

edm::InputTag reco::helper::JetIDHelper::hfRecHitsColl_
private

Definition at line 139 of file JetIDHelper.h.

◆ hitsInN90_

int reco::helper::JetIDHelper::hitsInN90_
private

Definition at line 127 of file JetIDHelper.h.

Referenced by hitsInN90().

◆ hoRecHitsColl_

edm::InputTag reco::helper::JetIDHelper::hoRecHitsColl_
private

Definition at line 138 of file JetIDHelper.h.

◆ input_EBRecHits_token_

edm::EDGetTokenT<EBRecHitCollection> reco::helper::JetIDHelper::input_EBRecHits_token_
private

Definition at line 148 of file JetIDHelper.h.

◆ input_EERecHits_token_

edm::EDGetTokenT<EERecHitCollection> reco::helper::JetIDHelper::input_EERecHits_token_
private

Definition at line 149 of file JetIDHelper.h.

◆ input_HBHERecHits_token_

edm::EDGetTokenT<HBHERecHitCollection> reco::helper::JetIDHelper::input_HBHERecHits_token_
private

Definition at line 145 of file JetIDHelper.h.

◆ input_HFRecHits_token_

edm::EDGetTokenT<HFRecHitCollection> reco::helper::JetIDHelper::input_HFRecHits_token_
private

Definition at line 147 of file JetIDHelper.h.

◆ input_HORecHits_token_

edm::EDGetTokenT<HORecHitCollection> reco::helper::JetIDHelper::input_HORecHits_token_
private

Definition at line 146 of file JetIDHelper.h.

◆ n90Hits_

int reco::helper::JetIDHelper::n90Hits_
private

Definition at line 117 of file JetIDHelper.h.

Referenced by n90Hits().

◆ nECALTowers_

int reco::helper::JetIDHelper::nECALTowers_
private

Definition at line 124 of file JetIDHelper.h.

Referenced by nECALTowers().

◆ nHCALTowers_

int reco::helper::JetIDHelper::nHCALTowers_
private

Definition at line 123 of file JetIDHelper.h.

Referenced by nHCALTowers().

◆ restrictedEMF_

double reco::helper::JetIDHelper::restrictedEMF_
private

Definition at line 122 of file JetIDHelper.h.

Referenced by restrictedEMF().

◆ sanity_checks_left_

std::atomic< int > reco::helper::JetIDHelper::sanity_checks_left_ {100}
staticprivate

Definition at line 143 of file JetIDHelper.h.

◆ useRecHits_

bool reco::helper::JetIDHelper::useRecHits_
private

Definition at line 136 of file JetIDHelper.h.

reco::helper::JetIDHelper::fSubDetector3_
double fSubDetector3_
Definition: JetIDHelper.h:120
reco::helper::JetIDHelper::HBpos
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::nHCALTowers_
int nHCALTowers_
Definition: JetIDHelper.h:123
HLT_FULL_cff.towers
towers
Definition: HLT_FULL_cff.py:36379
reco::helper::JetIDHelper::approximatefHPD_
double approximatefHPD_
Definition: JetIDHelper.h:125
HcalCaloFlagLabels::TimingErrorBit
Definition: HcalCaloFlagLabels.h:52
reco::helper::JetIDHelper::n90Hits_
int n90Hits_
Definition: JetIDHelper.h:117
HcalCaloFlagLabels::TimingSubtractedBit
Definition: HcalCaloFlagLabels.h:50
mps_fire.i
i
Definition: mps_fire.py:428
reco::helper::JetIDHelper::eeRecHitsColl_
edm::InputTag eeRecHitsColl_
Definition: JetIDHelper.h:141
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
reco::helper::JetIDHelper::ebRecHitsColl_
edm::InputTag ebRecHitsColl_
Definition: JetIDHelper.h:140
reco::helper::JetIDHelper::input_HORecHits_token_
edm::EDGetTokenT< HORecHitCollection > input_HORecHits_token_
Definition: JetIDHelper.h:146
reco::helper::JetIDHelper::fLS_
double fLS_
Definition: JetIDHelper.h:134
HcalTopology::mergedDepth29
bool mergedDepth29(HcalDetId id) const
Definition: HcalTopology.h:111
HcalCaloFlagLabels::HFTimingTrustBits
Definition: HcalCaloFlagLabels.h:32
egHLT::errCodes::HFRecHits
Definition: EgHLTErrCodes.h:21
reco::helper::JetIDHelper::input_EBRecHits_token_
edm::EDGetTokenT< EBRecHitCollection > input_EBRecHits_token_
Definition: JetIDHelper.h:148
EBDetId
Definition: EBDetId.h:17
egHLT::errCodes::HBHERecHits
Definition: EgHLTErrCodes.h:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::helper::subtower_has_greater_E
bool subtower_has_greater_E(reco::helper::JetIDHelper::subtower i, reco::helper::JetIDHelper::subtower j)
Definition: JetIDHelper.cc:37
DetId::Hcal
Definition: DetId.h:28
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
reco::helper::JetIDHelper::nCarrying
unsigned int nCarrying(double fraction, const std::vector< double > &descending_energies)
Definition: JetIDHelper.cc:234
reco::helper::JetIDHelper::region
Region region(int iEta)
Definition: JetIDHelper.cc:670
reco::helper::JetIDHelper::useRecHits_
bool useRecHits_
Definition: JetIDHelper.h:136
edm::SortedCollection
Definition: SortedCollection.h:49
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
reco::helper::JetIDHelper::hbheRecHitsColl_
edm::InputTag hbheRecHitsColl_
Definition: JetIDHelper.h:137
reco::helper::JetIDHelper::fHB_
double fHB_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::HBneg
Definition: JetIDHelper.h:107
HcalBarrel
Definition: HcalAssistant.h:33
reco::helper::JetIDHelper::fSubDetector4_
double fSubDetector4_
Definition: JetIDHelper.h:121
reco::helper::hasNonPositiveE
bool hasNonPositiveE(reco::helper::JetIDHelper::subtower x)
Definition: JetIDHelper.cc:35
nCells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ const uint32_t *__restrict__ nCells
Definition: CAHitNtupletGeneratorKernelsImpl.h:43
edm::Handle
Definition: AssociativeIterator.h:50
filterRecHits_cfi.EERecHits
EERecHits
Definition: filterRecHits_cfi.py:9
reco::helper::JetIDHelper::HEpos
Definition: JetIDHelper.h:107
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
reco::helper::JetIDHelper::fHE_
double fHE_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::restrictedEMF_
double restrictedEMF_
Definition: JetIDHelper.h:122
reco::helper::JetIDHelper::hfRecHitsColl_
edm::InputTag hfRecHitsColl_
Definition: JetIDHelper.h:139
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
reco::helper::JetIDHelper::sanity_checks_left_
static std::atomic< int > sanity_checks_left_
Definition: JetIDHelper.h:143
reco::helper::JetIDHelper::approximatefRBX_
double approximatefRBX_
Definition: JetIDHelper.h:126
Abs
T Abs(T a)
Definition: MathUtil.h:49
reco::helper::JetIDHelper::fShort_
double fShort_
Definition: JetIDHelper.h:133
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52823
reco::helper::JetIDHelper::fEE_
double fEE_
Definition: JetIDHelper.h:133
reco::helper::select2nd
static double select2nd(std::map< int, double >::value_type const &pair)
Definition: JetIDHelper.cc:33
HcalCaloFlagLabels::HFDigiTime
Definition: HcalCaloFlagLabels.h:38
reco::helper::JetIDHelper::input_HFRecHits_token_
edm::EDGetTokenT< HFRecHitCollection > input_HFRecHits_token_
Definition: JetIDHelper.h:147
edm::ESHandle< HcalTopology >
reco::helper::JetIDHelper::fEB_
double fEB_
Definition: JetIDHelper.h:133
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
HcalOuter
Definition: HcalAssistant.h:35
reco::helper::JetIDHelper::HFneg
Definition: JetIDHelper.h:107
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
reco::helper::JetIDHelper::hitsInN90_
int hitsInN90_
Definition: JetIDHelper.h:127
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
EEDetId
Definition: EEDetId.h:14
reco::helper::JetIDHelper::HBHE_region
Region HBHE_region(uint32_t)
Definition: JetIDHelper.cc:650
reco::helper::JetIDHelper::Region
Region
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::fHPD_
double fHPD_
Definition: JetIDHelper.h:115
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
reco::helper::JetIDHelper::fHO_
double fHO_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::input_HBHERecHits_token_
edm::EDGetTokenT< HBHERecHitCollection > input_HBHERecHits_token_
Definition: JetIDHelper.h:145
reco::helper::JetIDHelper::HFpos
Definition: JetIDHelper.h:107
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
reco::helper::JetIDHelper::fLong_
double fLong_
Definition: JetIDHelper.h:133
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::ParameterSetDescription::ifValue
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
Definition: ParameterSetDescription.h:220
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
reco::helper::JetIDHelper::HEneg
Definition: JetIDHelper.h:107
DetId::Detector
Detector
Definition: DetId.h:24
Max
T Max(T a, T b)
Definition: MathUtil.h:44
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
reco::helper::JetIDHelper::classifyJetTowers
void classifyJetTowers(const edm::Event &event, const reco::CaloJet &jet, std::vector< subtower > &subtowers, std::vector< subtower > &Ecal_subtowers, std::vector< subtower > &Hcal_subtowers, std::vector< subtower > &HO_subtowers, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, const int iDbg=0)
Definition: JetIDHelper.cc:520
reco::helper::JetIDHelper::unknown_region
Definition: JetIDHelper.h:107
reco::get
T get(const Candidate &c)
Definition: component.h:60
edm::Ptr
Definition: AssociationVector.h:31
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
reco::helper::JetIDHelper::hoRecHitsColl_
edm::InputTag hoRecHitsColl_
Definition: JetIDHelper.h:138
HcalForward
Definition: HcalAssistant.h:36
reco::helper::JetIDHelper::nECALTowers_
int nECALTowers_
Definition: JetIDHelper.h:124
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
HcalEndcap
Definition: HcalAssistant.h:34
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::helper::JetIDHelper::fSubDetector2_
double fSubDetector2_
Definition: JetIDHelper.h:119
HcalCaloFlagLabels::HFLongShort
Definition: HcalCaloFlagLabels.h:37
reco::helper::JetIDHelper::initValues
void initValues()
Definition: JetIDHelper.cc:62
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
reco::helper::JetIDHelper::HBHE_oddness
int HBHE_oddness(int iEta, int depth)
Definition: JetIDHelper.cc:643
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
reco::helper::JetIDHelper::fSubDetector1_
double fSubDetector1_
Definition: JetIDHelper.h:118
reco::helper::JetIDHelper::hitsInNCarrying
unsigned int hitsInNCarrying(double fraction, const std::vector< subtower > &descending_towers)
Definition: JetIDHelper.cc:251
event
Definition: event.py:1
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13168
ecaldqm::nTowers
Definition: EcalDQMCommonUtils.h:114
reco::helper::JetIDHelper::classifyJetComponents
void classifyJetComponents(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, std::vector< double > &energies, std::vector< double > &subdet_energies, std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies, std::vector< double > &HO_energies, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, double &LS_bad_energy, double &HF_OOT_energy, const int iDbg=0)
Definition: JetIDHelper.cc:269
HcalCaloFlagLabels::TimingAddedBit
Definition: HcalCaloFlagLabels.h:51
reco::helper::JetIDHelper::input_EERecHits_token_
edm::EDGetTokenT< EERecHitCollection > input_EERecHits_token_
Definition: JetIDHelper.h:149
edm::ParameterDescription
Definition: ParameterDescription.h:110
edm::InputTag
Definition: InputTag.h:15
reco::helper::JetIDHelper::fRBX_
double fRBX_
Definition: JetIDHelper.h:116
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
reco::helper::JetIDHelper::fHFOOT_
double fHFOOT_
Definition: JetIDHelper.h:134
filterRecHits_cfi.EBRecHits
EBRecHits
Definition: filterRecHits_cfi.py:8