CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=0) const
 
double getTowerESum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
 
double getTowerEtSum (const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
 
double getTowerEtSum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=0) 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 212 of file EgammaTowerIsolation.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 35 of file EgammaTowerIsolation.cc.

References assert(), extRadius, intRadius, edm::SortedCollection< T, SORT >::size(), and HLT_25ns14e33_v1_cff::towers.

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

Member Function Documentation

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

Definition at line 56 of file EgammaTowerIsolation.cc.

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

Referenced by getTowerESum(), and getTowerEtSum().

56  {
57 
58  if (0!=detIdToExclude) assert(0==intRadius);
59 
60  // hack
61  tls.newAlgo->setRadius(&extRadius,&intRadius);
62 
64  tls.newAlgo->compute(et, sum, sc,
65  (detIdToExclude==0) ? nullptr : &((*detIdToExclude).front()),
66  (detIdToExclude==0) ? nullptr : (&(*detIdToExclude).back())+1
67  );
68 
69  switch(depth_){
70  case AllDepths: return detIdToExclude==0 ? sum.he[0] : sum.heBC[0];
71  case Depth1: return detIdToExclude==0 ? sum.he[0]-sum.h2[0] : sum.heBC[0]-sum.h2BC[0];
72  case Depth2:return detIdToExclude==0 ? sum.h2[0] : sum.h2BC[0];
73  default: return 0;
74  }
75  return 0;
76 }
assert(m_qm.get())
double EgammaTowerIsolation::getTowerESum ( const reco::Candidate cand,
const std::vector< CaloTowerDetId > *  detIdToExclude = 0 
) const
inline

Definition at line 228 of file EgammaTowerIsolation.h.

References reco::Candidate::get(), and getSum().

Referenced by ConvertedPhotonProducer::buildCollections(), ConversionTrackCandidateProducer::buildCollections(), PhotonProducer::fillPhotonCollection(), GEDPhotonProducer::fillPhotonCollection(), ElectronHcalHelper::hcalESumDepth1(), and ElectronHcalHelper::hcalESumDepth2().

228  {
229  reco::SuperCluster const & sc = *cand->get<reco::SuperClusterRef>().get();
230  return getSum(false,sc,detIdToExclude);
231  }
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
T get() const
get a component
Definition: Candidate.h:217
double EgammaTowerIsolation::getTowerESum ( reco::SuperCluster const *  sc,
const std::vector< CaloTowerDetId > *  detIdToExclude = 0 
) const
inline

Definition at line 235 of file EgammaTowerIsolation.h.

References getSum().

235  {
236  return getSum(false,*sc,detIdToExclude);
237  }
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
double EgammaTowerIsolation::getTowerEtSum ( const reco::Candidate cand,
const std::vector< CaloTowerDetId > *  detIdToExclude = 0 
) const
inline

Definition at line 224 of file EgammaTowerIsolation.h.

References reco::Candidate::get(), and getSum().

Referenced by PhotonIsolationCalculator::calculateHcalTowerIso(), GsfElectronAlgo::createElectron(), and EgammaHLTBcHcalIsolationProducersRegional::produce().

224  {
225  reco::SuperCluster const & sc = *cand->get<reco::SuperClusterRef>().get();
226  return getSum(true,sc,detIdToExclude);
227  }
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
T get() const
get a component
Definition: Candidate.h:217
double EgammaTowerIsolation::getTowerEtSum ( reco::SuperCluster const *  sc,
const std::vector< CaloTowerDetId > *  detIdToExclude = 0 
) const
inline

Definition at line 232 of file EgammaTowerIsolation.h.

References getSum().

232  {
233  return getSum(true,*sc,detIdToExclude);
234  }
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const

Member Data Documentation

signed int EgammaTowerIsolation::depth_
private

Definition at line 243 of file EgammaTowerIsolation.h.

Referenced by getSum().

float EgammaTowerIsolation::extRadius
private

Definition at line 244 of file EgammaTowerIsolation.h.

Referenced by EgammaTowerIsolation(), and getSum().

float EgammaTowerIsolation::intRadius
private

Definition at line 245 of file EgammaTowerIsolation.h.

Referenced by EgammaTowerIsolation(), and getSum().