15 #include "vdt/vdtMath.h" 19 using namespace hgcal;
41 float energy = 0.f, energyHad = 0.f;
44 const auto&
id =
hit.first;
57 switch (
id.subdetId()) {
67 throw cms::Exception(
"HGCalClusterTools") <<
" Cluster contains hits that are not from HGCal! " << std::endl;
74 throw cms::Exception(
"HGCalClusterTools") <<
" Cluster contains hits that are not from HGCal! " << std::endl;
79 fraction = energyHad /
energy;
91 double totweight = 0.;
93 for (
const auto& ptr : clu.
clusters()) {
95 if (ptr->energy() < .01 * mcenergy)
98 const double weight = ptr->energy();
99 acc_x += ptr->x() *
weight;
100 acc_y += ptr->y() *
weight;
101 acc_z += ptr->z() *
weight;
104 if (totweight != 0) {
117 for (
const auto& ptr : clu.
clusters()) {
118 acc += ptr->energy();
126 double& sigmaetaetal,
127 double& sigmaphiphil)
const {
141 for (
unsigned int ih = 0; ih < nhit; ++ih) {
152 double logweight = 0;
158 sigmaetaeta += deltaetaeta2 *
weight;
159 sigmaphiphi += deltaphiphi2 *
weight;
160 sigmaetaetal += deltaetaeta2 * logweight;
161 sigmaphiphil += deltaphiphi2 * logweight;
163 sumlogw += logweight;
176 sigmaetaetal /= sumlogw;
178 sigmaphiphil /= sumlogw;
constexpr float energy() const
const math::XYZPoint & position() const
cluster centroid position
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Geom::Phi< T > phi() const
U second(std::pair< T, U > const &p)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
const edm::PtrVector< reco::BasicCluster > & clusters() const
double energy() const
cluster energy
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
iterator find(key_type k)
static int position[264][3]