CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
EgammaTowerIsolation Class Reference

#include <EgammaTowerIsolation.h>

Public Types

enum  HcalDepth { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 }
 

Public Member Functions

 EgammaTowerIsolation (float extRadiusI, float intRadiusI, float etLow, signed int depth, const CaloTowerCollection *towers)
 
double getTowerESum (const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
 
double getTowerESum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
 
double getTowerEtSum (const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
 
double getTowerEtSum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
 

Private Member Functions

double getSum (bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
 

Private Attributes

signed int depth_
 
float extRadius
 
float intRadius
 

Detailed Description

Definition at line 197 of file EgammaTowerIsolation.h.

Member Enumeration Documentation

◆ HcalDepth

Enumerator
AllDepths 
Undefined 
Depth1 
Depth2 

Definition at line 199 of file EgammaTowerIsolation.h.

199 { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 };

Constructor & Destructor Documentation

◆ EgammaTowerIsolation()

EgammaTowerIsolation::EgammaTowerIsolation ( float  extRadiusI,
float  intRadiusI,
float  etLow,
signed int  depth,
const CaloTowerCollection towers 
)

Definition at line 37 of file EgammaTowerIsolation.cc.

39  : depth_(depth), extRadius(extRadiusI), intRadius(intRadiusI) {
40  assert(0 == etLow);
41 
42  // extremely poor in quality (test of performance)
43  if (tls.newAlgo.get() == nullptr || towers != tls.oldTowers || towers->size() != tls.newAlgo->nt ||
44  (towers->size() > 15 && (*towers)[15].id() != tls.id15)) {
45  tls.newAlgo = std::make_unique<EgammaTowerIsolationNew<1>>(&extRadius, &intRadius, *towers);
46  tls.oldTowers = towers;
47  tls.id15 = towers->size() > 15 ? (*towers)[15].id() : 0;
48  }
49 }

References cms::cuda::assert(), extRadius, intRadius, and HLT_FULL_cff::towers.

Member Function Documentation

◆ getSum()

double EgammaTowerIsolation::getSum ( bool  et,
reco::SuperCluster const &  sc,
const std::vector< CaloTowerDetId > *  detIdToExclude 
) const
private

Definition at line 51 of file EgammaTowerIsolation.cc.

53  {
54  if (nullptr != detIdToExclude)
55  assert(0 == intRadius);
56 
57  // hack
58  tls.newAlgo->setRadius(&extRadius, &intRadius);
59 
61  if (detIdToExclude == nullptr) {
62  tls.newAlgo->compute(
63  et, sum, sc, static_cast<CaloTowerDetId const*>(nullptr), static_cast<CaloTowerDetId const*>(nullptr));
64  } else {
65  tls.newAlgo->compute(et, sum, sc, detIdToExclude->cbegin(), detIdToExclude->cend());
66  }
67 
68  switch (depth_) {
69  case AllDepths:
70  return detIdToExclude == nullptr ? sum.he[0] : sum.heBC[0];
71  case Depth1:
72  return detIdToExclude == nullptr ? sum.he[0] - sum.h2[0] : sum.heBC[0] - sum.h2BC[0];
73  case Depth2:
74  return detIdToExclude == nullptr ? sum.h2[0] : sum.h2BC[0];
75  default:
76  return 0;
77  }
78  return 0;
79 }

References AllDepths, cms::cuda::assert(), Depth1, Depth2, depth_, EgHLTOffHistBins_cfi::et, extRadius, EgammaTowerIsolationNew< NC >::Sum::h2, EgammaTowerIsolationNew< NC >::Sum::h2BC, EgammaTowerIsolationNew< NC >::Sum::he, EgammaTowerIsolationNew< NC >::Sum::heBC, and intRadius.

Referenced by getTowerESum(), and getTowerEtSum().

◆ getTowerESum() [1/2]

double EgammaTowerIsolation::getTowerESum ( const reco::Candidate cand,
const std::vector< CaloTowerDetId > *  detIdToExclude = nullptr 
) const
inline

Definition at line 209 of file EgammaTowerIsolation.h.

209  {
210  reco::SuperCluster const& sc = *cand->get<reco::SuperClusterRef>().get();
211  return getSum(false, sc, detIdToExclude);
212  }

References get, and getSum().

Referenced by EgammaHLTBcHcalIsolationProducersRegional::produce().

◆ getTowerESum() [2/2]

double EgammaTowerIsolation::getTowerESum ( reco::SuperCluster const *  sc,
const std::vector< CaloTowerDetId > *  detIdToExclude = nullptr 
) const
inline

Definition at line 217 of file EgammaTowerIsolation.h.

217  {
218  return getSum(false, *sc, detIdToExclude);
219  }

References getSum().

◆ getTowerEtSum() [1/2]

double EgammaTowerIsolation::getTowerEtSum ( const reco::Candidate cand,
const std::vector< CaloTowerDetId > *  detIdToExclude = nullptr 
) const
inline

Definition at line 205 of file EgammaTowerIsolation.h.

205  {
206  reco::SuperCluster const& sc = *cand->get<reco::SuperClusterRef>().get();
207  return getSum(true, sc, detIdToExclude);
208  }

References get, and getSum().

Referenced by EgammaHLTBcHcalIsolationProducersRegional::produce().

◆ getTowerEtSum() [2/2]

double EgammaTowerIsolation::getTowerEtSum ( reco::SuperCluster const *  sc,
const std::vector< CaloTowerDetId > *  detIdToExclude = nullptr 
) const
inline

Definition at line 213 of file EgammaTowerIsolation.h.

214  {
215  return getSum(true, *sc, detIdToExclude);
216  }

References getSum().

Member Data Documentation

◆ depth_

signed int EgammaTowerIsolation::depth_
private

Definition at line 225 of file EgammaTowerIsolation.h.

Referenced by getSum().

◆ extRadius

float EgammaTowerIsolation::extRadius
private

Definition at line 226 of file EgammaTowerIsolation.h.

Referenced by EgammaTowerIsolation(), and getSum().

◆ intRadius

float EgammaTowerIsolation::intRadius
private

Definition at line 227 of file EgammaTowerIsolation.h.

Referenced by EgammaTowerIsolation(), and getSum().

HLT_FULL_cff.towers
towers
Definition: HLT_FULL_cff.py:36379
EgammaTowerIsolationNew::Sum::h2
float h2[NC]
Definition: EgammaTowerIsolation.h:41
EgammaTowerIsolation::depth_
signed int depth_
Definition: EgammaTowerIsolation.h:225
reco::SuperCluster
Definition: SuperCluster.h:18
EgammaTowerIsolationNew::Sum::he
float he[NC]
Definition: EgammaTowerIsolation.h:40
EgammaTowerIsolationNew::Sum::heBC
float heBC[NC]
Definition: EgammaTowerIsolation.h:42
cms::cuda::assert
assert(be >=bs)
EgammaTowerIsolationNew::Sum
Definition: EgammaTowerIsolation.h:38
edm::Ref< SuperClusterCollection >
EgammaTowerIsolation::Depth2
Definition: EgammaTowerIsolation.h:199
EgammaTowerIsolation::AllDepths
Definition: EgammaTowerIsolation.h:199
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
cand
Definition: decayParser.h:32
EgammaTowerIsolation::Undefined
Definition: EgammaTowerIsolation.h:199
EgammaTowerIsolationNew::Sum::h2BC
float h2BC[NC]
Definition: EgammaTowerIsolation.h:43
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
get
#define get
EgammaTowerIsolation::extRadius
float extRadius
Definition: EgammaTowerIsolation.h:226
EgammaTowerIsolation::getSum
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
Definition: EgammaTowerIsolation.cc:51
EgammaTowerIsolation::Depth1
Definition: EgammaTowerIsolation.h:199
EgammaTowerIsolation::intRadius
float intRadius
Definition: EgammaTowerIsolation.h:227