2#include "Hcal/WorkingCluster.h"
16 ROOT::Math::XYZVector hitpos =
hex.getStripCenterPosition(eh->
getID());
17 double hit_x = hitpos.x();
18 double hit_y = hitpos.y();
19 double hit_z = hitpos.z();
22 double new_e = hit_e + centroid_.E();
23 double new_centroid_x =
24 (centroid_.Px() * centroid_.E() + hit_e * hit_x) / new_e;
25 double new_centroid_y =
26 (centroid_.Py() * centroid_.E() + hit_e * hit_y) / new_e;
27 double new_centroid_z =
28 (centroid_.Pz() * centroid_.E() + hit_e * hit_z) / new_e;
33 centroid_.SetPxPyPzE(new_centroid_x, new_centroid_y, new_centroid_z, new_e);
37void WorkingCluster::add(
const WorkingCluster& wc) {
38 double cluster_e = wc.centroid().E();
39 double centroid_x = wc.centroid().Px();
40 double centroid_y = wc.centroid().Py();
41 double centroid_z = wc.centroid().Pz();
43 double new_e = cluster_e + centroid_.E();
44 double new_centroid_x =
45 (centroid_.Px() * centroid_.E() + cluster_e * centroid_x) / new_e;
46 double new_centroid_y =
47 (centroid_.Py() * centroid_.E() + cluster_e * centroid_y) / new_e;
48 double new_centroid_z =
49 (centroid_.Pz() * centroid_.E() + cluster_e * centroid_z) / new_e;
51 centroid_.SetPxPyPzE(new_centroid_x, new_centroid_y, new_centroid_z, new_e);
56 std::vector<const ldmx::HcalHit*> cluster_hits = wc.getHits();
58 for (
unsigned int i = 0; i < cluster_hits.size(); i++) {
59 hits_.push_back(cluster_hits[i]);
float getEnergy() const
Get the calorimetric energy of the hit, corrected for sampling factors [MeV].
float getTime() const
Get the time of the hit [ns].
int getID() const
Get the detector ID.
Implementation of HCal strip readout.
Stores reconstructed hit information from the HCAL.
A very simple wrapper enabling us to more easily tell the output stream to style the input word in he...