5#include "Ecal/WorkingCluster.h"
21 auto [hitX, hitY, hitZ] =
hex.getPosition(eh->
getID());
23 double newE = hitE + centroid_.E();
24 double newCentroidX = (centroid_.Px() * centroid_.E() + hitE * hitX) / newE;
25 double newCentroidY = (centroid_.Py() * centroid_.E() + hitE * hitY) / newE;
26 double newCentroidZ = (centroid_.Pz() * centroid_.E() + hitE * hitZ) / newE;
28 centroid_.SetPxPyPzE(newCentroidX, newCentroidY, newCentroidZ, newE);
34 double clusterE = wc.centroid().E();
35 double centroidX = wc.centroid().Px();
36 double centroidY = wc.centroid().Py();
37 double centroidZ = wc.centroid().Pz();
39 double newE = clusterE + centroid_.E();
41 (centroid_.Px() * centroid_.E() + clusterE * centroidX) / newE;
43 (centroid_.Py() * centroid_.E() + clusterE * centroidY) / newE;
45 (centroid_.Pz() * centroid_.E() + clusterE * centroidZ) / newE;
47 centroid_.SetPxPyPzE(newCentroidX, newCentroidY, newCentroidZ, newE);
49 std::vector<const ldmx::EcalHit*> clusterHits = wc.getHits();
51 for (
size_t i = 0; i < clusterHits.size(); i++) {
52 hits_.push_back(clusterHits[i]);
void add(const ldmx::EcalHit *eh, const ldmx::EcalGeometry &geom)
float getEnergy() const
Get the calorimetric energy of the hit, corrected for sampling factors [MeV].
int getID() const
Get the detector ID.
Translation between real-space positions and cell IDs within the ECal.
Stores reconstructed hit information from the ECAL.
A very simple wrapper enabling us to more easily tell the output stream to style the input word in he...