14 #include "vdt/vdtMath.h" 18 using namespace hgcal;
45 float energy=0.f, energyHad=0.f;
48 const auto&
id =
hit.first;
51 switch(
id.subdetId() ) {
64 <<
" Cluster contains hits that are not from HGCal! " << std::endl;
72 <<
" Cluster contains hits that are not from HGCal! " << std::endl;
77 fraction = energyHad/energy;
89 double totweight = 0.;
91 for(
const auto& ptr : clu.
clusters() ) {
93 if(ptr->energy()<.01*mcenergy)
continue;
95 const double weight = ptr->energy();
101 if (totweight != 0) {
116 for(
const auto& ptr : clu.
clusters() ) {
117 acc += ptr->energy();
136 for (
unsigned int ih=0; ih<nhit; ++ih) {
147 double logweight = 0;
153 sigmaetaeta += deltaetaeta2*
weight;
154 sigmaphiphi += deltaphiphi2 *
weight;
155 sigmaetaetal += deltaetaeta2* logweight;
156 sigmaphiphil += deltaphiphi2 * logweight;
158 sumlogw += logweight;
163 if (sumw<=0.)
return false;
171 sigmaetaetal /= sumlogw;
173 sigmaphiphil /= sumlogw;
const math::XYZPoint & position() const
cluster centroid position
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Geom::Phi< T > phi() const
std::vector< HGCRecHit >::const_iterator const_iterator
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
U second(std::pair< T, U > const &p)
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]