2#include "Ecal/IntermediateCluster.h"
8IntermediateCluster::IntermediateCluster(
const ldmx::EcalHit& eh,
int layer)
9 : layer_{layer}, hits_{}, centroid_{} {
21 double new_e = hit_e + centroid_.E();
22 centroid_.SetXYZT((centroid_.x() * centroid_.E() + hit_e * hit_x) / new_e,
23 (centroid_.y() * centroid_.E() + hit_e * hit_y) / new_e,
24 (centroid_.z() * centroid_.E() + hit_e * hit_z) / new_e,
29 if (eh !=
nullptr) add(*eh);
32void IntermediateCluster::add(
const IntermediateCluster& wc) {
33 double new_e = wc.centroid().E() + centroid_.E();
35 (centroid_.x() * centroid_.E() + wc.centroid().x() * wc.centroid().E()) /
37 (centroid_.y() * centroid_.E() + wc.centroid().y() * wc.centroid().E()) /
39 (centroid_.z() * centroid_.E() + wc.centroid().z() * wc.centroid().E()) /
43 for (
const auto eh : wc.getHits()) {
48void IntermediateCluster::setLayer(
int layer) { layer_ = layer; }
51int IntermediateCluster::getLayer()
const {
return layer_; }
float getEnergy() const
Get the calorimetric energy of the hit, corrected for sampling factors [MeV].
float getYPos() const
Get the Y position of the hit [mm].
float getZPos() const
Get the Z position of the hit [mm].
float getXPos() const
Get the X position of the hit [mm].
Stores reconstructed hit information from the ECAL.