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 31 of file EcalPFClusterIsolation.h.

Member Typedef Documentation

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

Definition at line 33 of file EcalPFClusterIsolation.h.

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

Definition at line 34 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 
)
template<typename T1 >
EcalPFClusterIsolation< T1 >::~EcalPFClusterIsolation ( )

Definition at line 35 of file EcalPFClusterIsolation.cc.

35 {}

Member Function Documentation

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

Definition at line 75 of file EcalPFClusterIsolation.cc.

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

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

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

Definition at line 95 of file EcalPFClusterIsolation.cc.

References HLTMuonOfflineAnalyzer_cfi::deltaR2, EcalPFClusterIsolation< T1 >::drMax_, and EcalPFClusterIsolation< T1 >::drVeto2_.

95  {
96  float dR2 = deltaR2(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
97  if (dR2 > (drMax_ * drMax_) || dR2 < drVeto2_)
98  return false;
99  else
100  return true;
101 }
template<typename T1>
double EcalPFClusterIsolation< T1 >::getSum ( T1Ref  ,
edm::Handle< std::vector< reco::PFCluster > >   
)

Definition at line 38 of file EcalPFClusterIsolation.cc.

References EcalPFClusterIsolation< T1 >::computedRVeto(), HLT_2018_cff::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().

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

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

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

Definition at line 53 of file EcalPFClusterIsolation.h.

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

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

Definition at line 56 of file EcalPFClusterIsolation.h.

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

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

Definition at line 57 of file EcalPFClusterIsolation.h.

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

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

Definition at line 54 of file EcalPFClusterIsolation.h.

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

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

Definition at line 55 of file EcalPFClusterIsolation.h.

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