|
|
Go to the documentation of this file.
16 #include "vdt/vdtMath.h"
20 using namespace hgcal;
45 float energy = 0.f, energyHad = 0.f;
48 const auto&
id =
hit.first;
61 switch (
id.subdetId()) {
71 throw cms::Exception(
"HGCalClusterTools") <<
" Cluster contains hits that are not from HGCal! " << std::endl;
78 throw cms::Exception(
"HGCalClusterTools") <<
" Cluster contains hits that are not from HGCal! " << std::endl;
95 double totweight = 0.;
97 for (
const auto& ptr : clu.
clusters()) {
99 if (ptr->energy() < .01 * mcenergy)
102 const double weight = ptr->energy();
103 acc_x += ptr->x() *
weight;
104 acc_y += ptr->y() *
weight;
105 acc_z += ptr->z() *
weight;
108 if (totweight != 0) {
121 for (
const auto& ptr : clu.
clusters()) {
122 acc += ptr->energy();
130 double& sigmaetaetal,
131 double& sigmaphiphil)
const {
145 for (
unsigned int ih = 0; ih < nhit; ++ih) {
156 double logweight = 0;
162 sigmaetaeta += deltaetaeta2 *
weight;
163 sigmaphiphi += deltaphiphi2 *
weight;
164 sigmaetaetal += deltaetaeta2 * logweight;
165 sigmaphiphil += deltaphiphi2 * logweight;
167 sumlogw += logweight;
180 sigmaetaetal /= sumlogw;
182 sigmaphiphil /= sumlogw;
const edm::PtrVector< reco::BasicCluster > & clusters() const
constexpr float energy() const
U second(std::pair< T, U > const &p)
XYZPointD XYZPoint
point in space with cartesian internal representation
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
static int position[264][3]
const math::XYZPoint & position() const
cluster centroid position
iterator find(key_type k)
double energy() const
cluster energy
Geom::Phi< T > phi() const