CMS 3D CMS Logo

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 };

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

◆ 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.

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 }

References reco::deltaPhi(), reco::deltaR2(), HLT_FULL_cff::dPhi, ENERGY, ET, PVValHelper::eta, spr::find(), HLTEgPhaseIITestSequence_cff::layerClusters, jets_cff::maxDR, PDWG_EXOHSCP_cff::minDR, particleFlowClusterECALTimeSelected_cfi::minEnergy, EgHLTOffEleSelection_cfi::minEt, phi, and funct::sin().

Referenced by emEnergyInCone(), and hadEnergyInCone().

◆ 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
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
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13702
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
PVValHelper::eta
Definition: PVValidationHelpers.h:69
EgHLTOffEleSelection_cfi.minEt
minEt
Definition: EgHLTOffEleSelection_cfi.py:10
HLTEgPhaseIITestSequence_cff.layerClusters
layerClusters
Definition: HLTEgPhaseIITestSequence_cff.py:2506
PDWG_EXOHSCP_cff.minDR
minDR
Definition: PDWG_EXOHSCP_cff.py:109
ET
#define ET
Definition: GenericBenchmark.cc:27
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
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
HGCalClusterTools::EType::ENERGY
DDAxes::phi
DetId::HGCalHSc
Definition: DetId.h:34
jets_cff.maxDR
maxDR
Definition: jets_cff.py:126