CMS 3D CMS Logo

HGCalClusterTools.cc
Go to the documentation of this file.
2 
6 
8  const float phi,
9  const std::vector<reco::CaloCluster>& layerClusters,
10  const float minDR,
11  const float maxDR,
12  const float minEt,
13  const float minEnergy,
14  const std::vector<DetId::Detector>& subDets,
15  const HGCalClusterTools::EType& eType) {
16  float hadValue = 0.;
17 
18  const float minDR2 = minDR * minDR;
19  const float maxDR2 = maxDR * maxDR;
20 
21  for (auto& clus : layerClusters) {
22  if (clus.energy() < minEnergy) {
23  continue;
24  }
25 
26  if (std::find(subDets.begin(), subDets.end(), clus.seed().det()) == subDets.end()) {
27  continue;
28  }
29 
30  float clusEt = clus.energy() * std::sin(clus.position().theta());
31  if (clusEt < minEt) {
32  continue;
33  }
34 
35  //this is a prefilter on the clusters before we calculuate
36  //the expensive eta() of the cluster
37  float dPhi = reco::deltaPhi(phi, clus.phi());
38  if (dPhi > maxDR) {
39  continue;
40  }
41 
42  float dR2 = reco::deltaR2(eta, phi, clus.eta(), clus.phi());
43  if (dR2 < minDR2 || dR2 > maxDR2) {
44  continue;
45  }
46  switch (eType) {
47  case EType::ET:
48  hadValue += clusEt;
49  break;
50  case EType::ENERGY:
51  hadValue += clus.energy();
52  break;
53  }
54  }
55  return hadValue;
56 }
particleFlowClusterECALTimeSelected_cfi.minEnergy
minEnergy
Definition: particleFlowClusterECALTimeSelected_cfi.py:9
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
HGCalClusterTools::EType::ET
HGCalClusterTools.h
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HGCalClusterTools::EType
EType
Definition: HGCalClusterTools.h:9
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
deltaR.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
EgHLTOffEleSelection_cfi.minEt
minEt
Definition: EgHLTOffEleSelection_cfi.py:10
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
hltEgammaHGCALIDVarsL1Seeded_cfi.layerClusters
layerClusters
Definition: hltEgammaHGCALIDVarsL1Seeded_cfi.py:5
PDWG_EXOHSCP_cff.minDR
minDR
Definition: PDWG_EXOHSCP_cff.py:109
HGCalClusterTools::energyInCone
static float energyInCone(const float eta, const float phi, const std::vector< reco::CaloCluster > &layerClusters, const float minDR, const float maxDR, const float minEt, const float minEnergy, const std::vector< DetId::Detector > &subDets, const HGCalClusterTools::EType &eType=EType::ENERGY)
Definition: HGCalClusterTools.cc:7
PVValHelper::phi
Definition: PVValidationHelpers.h:68
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
hltEgammaEleL1TrkIsoL1Seeded_cfi.maxDR
maxDR
Definition: hltEgammaEleL1TrkIsoL1Seeded_cfi.py:10
HGCalClusterTools::EType::ENERGY
DDAxes::phi
deltaPhi.h
CaloCluster.h