CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HcalPFClusterIsolation< T1 > Class Template Reference

#include <HcalPFClusterIsolation.h>

Public Types

typedef std::vector< T1 > T1Collection
 
typedef edm::Ref< T1CollectionT1Ref
 

Public Member Functions

double getSum (const T1Ref candRef, const std::vector< edm::Handle< reco::PFClusterCollection >> &clusterHandles)
 
double getSum (const T1 cand, const std::vector< edm::Handle< reco::PFClusterCollection >> &clusterHandles)
 
 HcalPFClusterIsolation (double drMax, double drVetoBarrel, double drVetoEndcap, double etaStripBarrel, double etaStripEndcap, double energyBarrel, double energyEndcap, bool useEt)
 
 ~HcalPFClusterIsolation ()
 

Private Attributes

const double drMax_
 
const double drVetoBarrel_
 
const double drVetoEndcap_
 
const double energyBarrel_
 
const double energyEndcap_
 
const double etaStripBarrel_
 
const double etaStripEndcap_
 
const bool useEt_
 

Detailed Description

template<typename T1>
class HcalPFClusterIsolation< T1 >

Definition at line 17 of file HcalPFClusterIsolation.h.

Member Typedef Documentation

◆ T1Collection

template<typename T1>
typedef std::vector<T1> HcalPFClusterIsolation< T1 >::T1Collection

Definition at line 19 of file HcalPFClusterIsolation.h.

◆ T1Ref

template<typename T1>
typedef edm::Ref<T1Collection> HcalPFClusterIsolation< T1 >::T1Ref

Definition at line 20 of file HcalPFClusterIsolation.h.

Constructor & Destructor Documentation

◆ HcalPFClusterIsolation()

template<typename T1 >
HcalPFClusterIsolation< T1 >::HcalPFClusterIsolation ( double  drMax,
double  drVetoBarrel,
double  drVetoEndcap,
double  etaStripBarrel,
double  etaStripEndcap,
double  energyBarrel,
double  energyEndcap,
bool  useEt 
)

Definition at line 11 of file HcalPFClusterIsolation.cc.

19  : drMax_(drMax),
26  useEt_(useEt) {}

◆ ~HcalPFClusterIsolation()

template<typename T1 >
HcalPFClusterIsolation< T1 >::~HcalPFClusterIsolation ( )

Definition at line 29 of file HcalPFClusterIsolation.cc.

29 {}

Member Function Documentation

◆ getSum() [1/2]

template<typename T1 >
double HcalPFClusterIsolation< T1 >::getSum ( const T1Ref  candRef,
const std::vector< edm::Handle< reco::PFClusterCollection >> &  clusterHandles 
)

Definition at line 78 of file HcalPFClusterIsolation.cc.

Referenced by EgammaHcalPFClusterIsolationProducer< T1 >::produce(), and HLTHcalPFClusterIsolationProducer< T1 >::produce().

79  {
80  return getSum(*ref, clusterHandles);
81 }
double getSum(const T1Ref candRef, const std::vector< edm::Handle< reco::PFClusterCollection >> &clusterHandles)

◆ getSum() [2/2]

template<typename T1 >
double HcalPFClusterIsolation< T1 >::getSum ( const T1  cand,
const std::vector< edm::Handle< reco::PFClusterCollection >> &  clusterHandles 
)

Definition at line 32 of file HcalPFClusterIsolation.cc.

References funct::abs(), HLTMuonOfflineAnalyzer_cfi::deltaR2, HLT_2024v13_cff::dEta, ALPAKA_ACCELERATOR_NAMESPACE::dR2(), and mps_fire::i.

33  {
34  double etSum = 0.;
35  double candAbsEta = std::abs(cand.eta());
36 
37  float etaStrip = 0;
38  float dRVeto = 0;
39  if (candAbsEta < 1.479) {
40  dRVeto = drVetoBarrel_;
41  etaStrip = etaStripBarrel_;
42  } else {
43  dRVeto = drVetoEndcap_;
44  etaStrip = etaStripEndcap_;
45  }
46 
47  for (unsigned int nHandle = 0; nHandle < clusterHandles.size(); nHandle++) {
48  for (unsigned i = 0; i < clusterHandles[nHandle]->size(); i++) {
49  const reco::PFClusterRef pfclu(clusterHandles[nHandle], i);
50 
51  if (candAbsEta < 1.479) {
52  if (std::abs(pfclu->pt()) < energyBarrel_)
53  continue;
54  } else {
55  if (std::abs(pfclu->energy()) < energyEndcap_)
56  continue;
57  }
58 
59  float dEta = std::abs(cand.eta() - pfclu->eta());
60  if (dEta < etaStrip)
61  continue;
62 
63  float dR2 = deltaR2(cand.eta(), cand.phi(), pfclu->eta(), pfclu->phi());
64  if (dR2 > (drMax_ * drMax_) || dR2 < (dRVeto * dRVeto))
65  continue;
66 
67  if (useEt_)
68  etSum += pfclu->pt();
69  else
70  etSum += pfclu->energy();
71  }
72  }
73 
74  return etSum;
75 }
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

◆ drMax_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::drMax_
private

Definition at line 36 of file HcalPFClusterIsolation.h.

◆ drVetoBarrel_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::drVetoBarrel_
private

Definition at line 37 of file HcalPFClusterIsolation.h.

◆ drVetoEndcap_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::drVetoEndcap_
private

Definition at line 38 of file HcalPFClusterIsolation.h.

◆ energyBarrel_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::energyBarrel_
private

Definition at line 41 of file HcalPFClusterIsolation.h.

◆ energyEndcap_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::energyEndcap_
private

Definition at line 42 of file HcalPFClusterIsolation.h.

◆ etaStripBarrel_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::etaStripBarrel_
private

Definition at line 39 of file HcalPFClusterIsolation.h.

◆ etaStripEndcap_

template<typename T1>
const double HcalPFClusterIsolation< T1 >::etaStripEndcap_
private

Definition at line 40 of file HcalPFClusterIsolation.h.

◆ useEt_

template<typename T1>
const bool HcalPFClusterIsolation< T1 >::useEt_
private

Definition at line 43 of file HcalPFClusterIsolation.h.