CMS 3D CMS Logo

HcalPFClusterIsolation.cc
Go to the documentation of this file.
2 
7 
9 
10 template <typename T1>
12  double drVetoBarrel,
13  double drVetoEndcap,
14  double etaStripBarrel,
15  double etaStripEndcap,
16  double energyBarrel,
17  double energyEndcap,
18  bool useEt)
19  : drMax_(drMax),
20  drVetoBarrel_(drVetoBarrel),
21  drVetoEndcap_(drVetoEndcap),
22  etaStripBarrel_(etaStripBarrel),
23  etaStripEndcap_(etaStripEndcap),
24  energyBarrel_(energyBarrel),
25  energyEndcap_(energyEndcap),
26  useEt_(useEt) {}
27 
28 template <typename T1>
30 
31 template <typename T1>
33  const std::vector<edm::Handle<reco::PFClusterCollection>>& clusterHandles) {
34  double etSum = 0.;
35 
36  float etaStrip = 0;
37  float dRVeto = 0;
38  if (fabs(candRef->eta()) < 1.479) {
39  dRVeto = drVetoBarrel_;
40  etaStrip = etaStripBarrel_;
41  } else {
42  dRVeto = drVetoEndcap_;
43  etaStrip = etaStripEndcap_;
44  }
45 
46  for (unsigned int nHandle = 0; nHandle < clusterHandles.size(); nHandle++) {
47  for (unsigned i = 0; i < clusterHandles[nHandle]->size(); i++) {
48  const reco::PFClusterRef pfclu(clusterHandles[nHandle], i);
49 
50  if (fabs(candRef->eta()) < 1.479) {
51  if (fabs(pfclu->pt()) < energyBarrel_)
52  continue;
53  } else {
54  if (fabs(pfclu->energy()) < energyEndcap_)
55  continue;
56  }
57 
58  float dEta = fabs(candRef->eta() - pfclu->eta());
59  if (dEta < etaStrip)
60  continue;
61 
62  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
63  if (dR > drMax_ || dR < dRVeto)
64  continue;
65 
66  if (useEt_)
67  etSum += pfclu->pt();
68  else
69  etSum += pfclu->energy();
70  }
71  }
72 
73  return etSum;
74 }
75 
HLT_FULL_cff.useEt
useEt
Definition: HLT_FULL_cff.py:14990
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.drVetoEndcap
drVetoEndcap
Definition: HLT_FULL_cff.py:18961
HLT_FULL_cff.etaStripBarrel
etaStripBarrel
Definition: HLT_FULL_cff.py:18952
HcalPFClusterIsolation::getSum
double getSum(const T1Ref candRef, const std::vector< edm::Handle< reco::PFClusterCollection >> &clusterHandles)
Definition: HcalPFClusterIsolation.cc:32
HcalPFClusterIsolation::HcalPFClusterIsolation
HcalPFClusterIsolation(double drMax, double drVetoBarrel, double drVetoEndcap, double etaStripBarrel, double etaStripEndcap, double energyBarrel, double energyEndcap, bool useEt)
Definition: HcalPFClusterIsolation.cc:11
HLT_FULL_cff.energyEndcap
energyEndcap
Definition: HLT_FULL_cff.py:18953
edm::Handle
Definition: AssociativeIterator.h:50
HcalPFClusterIsolation::~HcalPFClusterIsolation
~HcalPFClusterIsolation()
Definition: HcalPFClusterIsolation.cc:29
edm::Ref
Definition: AssociativeIterator.h:58
Photon.h
GsfElectron.h
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
deltaR.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HLT_FULL_cff.drVetoBarrel
drVetoBarrel
Definition: HLT_FULL_cff.py:18957
RecoEcalCandidate.h
RecoChargedCandidate.h
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
HLT_FULL_cff.etaStripEndcap
etaStripEndcap
Definition: HLT_FULL_cff.py:18956
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
HcalPFClusterIsolation.h
HLT_FULL_cff.energyBarrel
energyBarrel
Definition: HLT_FULL_cff.py:18959
HcalPFClusterIsolation
Definition: HcalPFClusterIsolation.h:17
HLT_FULL_cff.drMax
drMax
Definition: HLT_FULL_cff.py:18958