CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Types | Static Public Member Functions
HGCalClusterTools Class Reference

#include <HGCalClusterTools.h>

Public Types

enum  EType { EType::ET, EType::ENERGY }
 

Static Public Member Functions

static float emEnergyInCone (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 HGCalClusterTools::EType &eType=EType::ENERGY)
 
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)
 
static float hadEnergyInCone (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 HGCalClusterTools::EType &eType=EType::ENERGY)
 

Detailed Description

Definition at line 7 of file HGCalClusterTools.h.

Member Enumeration Documentation

◆ EType

Enumerator
ET 
ENERGY 

Definition at line 9 of file HGCalClusterTools.h.

9 { ET, ENERGY };
#define ET

Member Function Documentation

◆ emEnergyInCone()

static float HGCalClusterTools::emEnergyInCone ( 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 HGCalClusterTools::EType eType = EType::ENERGY 
)
inlinestatic

Definition at line 32 of file HGCalClusterTools.h.

References energyInCone(), PVValHelper::eta, DetId::HGCalEE, hltEgammaHGCALIDVarsL1Seeded_cfi::layerClusters, L1TPhase2MuonOffline_cfi::maxDR, HLT_2024v10_cff::minDR, particleFlowClusterECALTimeSelected_cfi::minEnergy, EgHLTOffEleSelection_cfi::minEt, and phi.

Referenced by HLTHGCalLayerClusterIsolationProducer< T1 >::produce().

39  {
41  }
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)

◆ energyInCone()

float HGCalClusterTools::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 
)
static

Definition at line 7 of file HGCalClusterTools.cc.

References reco::deltaPhi(), reco::deltaR2(), HLT_2024v10_cff::dPhi, ALPAKA_ACCELERATOR_NAMESPACE::dR2(), ENERGY, ET, PVValHelper::eta, spr::find(), hltEgammaHGCALIDVarsL1Seeded_cfi::layerClusters, L1TPhase2MuonOffline_cfi::maxDR, HLT_2024v10_cff::minDR, particleFlowClusterECALTimeSelected_cfi::minEnergy, EgHLTOffEleSelection_cfi::minEt, phi, and funct::sin().

Referenced by emEnergyInCone(), and hadEnergyInCone().

15  {
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 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ hadEnergyInCone()

static float HGCalClusterTools::hadEnergyInCone ( 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 HGCalClusterTools::EType eType = EType::ENERGY 
)
inlinestatic

Definition at line 21 of file HGCalClusterTools.h.

References energyInCone(), PVValHelper::eta, DetId::HGCalHSc, DetId::HGCalHSi, hltEgammaHGCALIDVarsL1Seeded_cfi::layerClusters, L1TPhase2MuonOffline_cfi::maxDR, HLT_2024v10_cff::minDR, particleFlowClusterECALTimeSelected_cfi::minEnergy, EgHLTOffEleSelection_cfi::minEt, and phi.

Referenced by EgammaHLTHGCalIDVarProducer::produce(), and HLTHGCalLayerClusterIsolationProducer< T1 >::produce().

28  {
29  return energyInCone(
31  }
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)