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_2018_cff.etaStripEndcap
etaStripEndcap
Definition: HLT_2018_cff.py:17512
mps_fire.i
i
Definition: mps_fire.py:355
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
edm::Handle
Definition: AssociativeIterator.h:50
HcalPFClusterIsolation::~HcalPFClusterIsolation
~HcalPFClusterIsolation()
Definition: HcalPFClusterIsolation.cc:29
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
edm::Ref
Definition: AssociativeIterator.h:58
deltaR.h
HLT_2018_cff.drMax
drMax
Definition: HLT_2018_cff.py:17514
Photon.h
HLT_2018_cff.useEt
useEt
Definition: HLT_2018_cff.py:13608
GsfElectron.h
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
HLT_2018_cff.drVetoBarrel
drVetoBarrel
Definition: HLT_2018_cff.py:17513
HLT_2018_cff.drVetoEndcap
drVetoEndcap
Definition: HLT_2018_cff.py:17517
HLT_2018_cff.energyBarrel
energyBarrel
Definition: HLT_2018_cff.py:17515
HLT_2018_cff.energyEndcap
energyEndcap
Definition: HLT_2018_cff.py:17509
RecoEcalCandidate.h
RecoChargedCandidate.h
HLT_2018_cff.etaStripBarrel
etaStripBarrel
Definition: HLT_2018_cff.py:17508
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
HcalPFClusterIsolation.h
HcalPFClusterIsolation
Definition: HcalPFClusterIsolation.h:17