CMS 3D CMS Logo

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

#include <EcalPFClusterIsolation.h>

Public Types

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

Public Member Functions

 EcalPFClusterIsolation (double drMax, double drVetoBarrel, double drVetoEndcap, double etaStripBarrel, double etaStripEndcap, double energyBarrel, double energyEndcap)
 
double getSum (T1Ref, edm::Handle< std::vector< reco::PFCluster > >)
 
 ~EcalPFClusterIsolation ()
 

Private Member Functions

bool computedRVeto (T1Ref candRef, reco::PFClusterRef pfclu)
 
template<>
bool computedRVeto (T1Ref candRef, reco::PFClusterRef pfclu)
 

Private Attributes

const double drMax_
 
double drVeto2_
 
const double drVetoBarrel_
 
const double drVetoEndcap_
 
const double energyBarrel_
 
const double energyEndcap_
 
const double etaStripBarrel_
 
const double etaStripEndcap_
 

Detailed Description

template<typename T1>
class EcalPFClusterIsolation< T1 >

Definition at line 32 of file EcalPFClusterIsolation.h.

Member Typedef Documentation

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

Definition at line 35 of file EcalPFClusterIsolation.h.

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

Definition at line 36 of file EcalPFClusterIsolation.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file EcalPFClusterIsolation.cc.

25  :
26  drMax_(drMax),
33 {}
template<typename T1 >
EcalPFClusterIsolation< T1 >::~EcalPFClusterIsolation ( )

Definition at line 36 of file EcalPFClusterIsolation.cc.

37 {}

Member Function Documentation

template<typename T1 >
bool EcalPFClusterIsolation< T1 >::computedRVeto ( T1Ref  candRef,
reco::PFClusterRef  pfclu 
)
private

Definition at line 76 of file EcalPFClusterIsolation.cc.

References reco::deltaR2(), EcalPFClusterIsolation< T1 >::drMax_, and edm::Ref< C, T, F >::isNonnull().

Referenced by EcalPFClusterIsolation< T1 >::getSum().

76  {
77 
78  float dR2 = deltaR2(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
79  if(dR2 > (drMax_*drMax_))
80  return false;
81 
82  if (candRef->superCluster().isNonnull()) {
83  // Exclude clusters that are part of the candidate
84  for (reco::CaloCluster_iterator it = candRef->superCluster()->clustersBegin(); it != candRef->superCluster()->clustersEnd(); ++it) {
85  if ((*it)->seed() == pfclu->seed()) {
86  return false;
87  }
88  }
89  }
90 
91  return true;
92 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
template<>
bool EcalPFClusterIsolation< reco::RecoChargedCandidate >::computedRVeto ( T1Ref  candRef,
reco::PFClusterRef  pfclu 
)
private

Definition at line 95 of file EcalPFClusterIsolation.cc.

References reco::deltaR2(), EcalPFClusterIsolation< T1 >::drMax_, and EcalPFClusterIsolation< T1 >::drVeto2_.

95  {
96 
97  float dR2 = deltaR2(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
98  if(dR2 > (drMax_*drMax_) || dR2 < drVeto2_)
99  return false;
100  else
101  return true;
102 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
template<typename T1>
double EcalPFClusterIsolation< T1 >::getSum ( T1Ref  ,
edm::Handle< std::vector< reco::PFCluster > >   
)

Definition at line 40 of file EcalPFClusterIsolation.cc.

References EcalPFClusterIsolation< T1 >::computedRVeto(), particleFlow_cfi::dEta, EcalPFClusterIsolation< T1 >::drVeto2_, EcalPFClusterIsolation< T1 >::drVetoBarrel_, EcalPFClusterIsolation< T1 >::drVetoEndcap_, EcalPFClusterIsolation< T1 >::energyBarrel_, EcalPFClusterIsolation< T1 >::energyEndcap_, EcalPFClusterIsolation< T1 >::etaStripBarrel_, EcalPFClusterIsolation< T1 >::etaStripEndcap_, and mps_fire::i.

Referenced by EgammaEcalPFClusterIsolationProducer< T1 >::produce(), and HLTEcalPFClusterIsolationProducer< T1 >::produce().

40  {
41 
42  drVeto2_ = -1.;
43  float etaStrip = -1;
44 
45  if (fabs(candRef->eta()) < 1.479) {
47  etaStrip = etaStripBarrel_;
48  } else {
50  etaStrip = etaStripEndcap_;
51  }
52 
53  float etSum = 0;
54  for (size_t i=0; i<clusterHandle->size(); i++) {
55  reco::PFClusterRef pfclu(clusterHandle, i);
56 
57  if (fabs(candRef->eta()) < 1.479) {
58  if (fabs(pfclu->pt()) < energyBarrel_)
59  continue;
60  } else {
61  if (fabs(pfclu->energy()) < energyEndcap_)
62  continue;
63  }
64 
65  float dEta = fabs(candRef->eta() - pfclu->eta());
66  if(dEta < etaStrip) continue;
67  if (not computedRVeto(candRef, pfclu)) continue;
68 
69  etSum += pfclu->pt();
70  }
71 
72  return etSum;
73 }
bool computedRVeto(T1Ref candRef, reco::PFClusterRef pfclu)

Member Data Documentation

template<typename T1>
const double EcalPFClusterIsolation< T1 >::drMax_
private
template<typename T1>
double EcalPFClusterIsolation< T1 >::drVeto2_
private
template<typename T1>
const double EcalPFClusterIsolation< T1 >::drVetoBarrel_
private

Definition at line 54 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().

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

Definition at line 55 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().

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

Definition at line 58 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().

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

Definition at line 59 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().

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

Definition at line 56 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().

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

Definition at line 57 of file EcalPFClusterIsolation.h.

Referenced by EcalPFClusterIsolation< T1 >::getSum().