2#include "Hcal/WorkingCluster.h"
16 TVector3 hitpos = hex.getStripCenterPosition(eh->
getID());
17 double hitX = hitpos.x();
18 double hitY = hitpos.y();
19 double hitZ = hitpos.z();
22 double newE = hitE + centroid_.E();
23 double newCentroidX = (centroid_.Px() * centroid_.E() + hitE * hitX) / newE;
24 double newCentroidY = (centroid_.Py() * centroid_.E() + hitE * hitY) / newE;
25 double newCentroidZ = (centroid_.Pz() * centroid_.E() + hitE * hitZ) / newE;
30 centroid_.SetPxPyPzE(newCentroidX, newCentroidY, newCentroidZ, newE);
34void WorkingCluster::add(
const WorkingCluster& wc) {
35 double clusterE = wc.centroid().E();
36 double centroidX = wc.centroid().Px();
37 double centroidY = wc.centroid().Py();
38 double centroidZ = wc.centroid().Pz();
40 double newE = clusterE + centroid_.E();
42 (centroid_.Px() * centroid_.E() + clusterE * centroidX) / newE;
44 (centroid_.Py() * centroid_.E() + clusterE * centroidY) / newE;
46 (centroid_.Pz() * centroid_.E() + clusterE * centroidZ) / newE;
48 centroid_.SetPxPyPzE(newCentroidX, newCentroidY, newCentroidZ, newE);
53 std::vector<const ldmx::HcalHit*> clusterHits = wc.getHits();
55 for (
unsigned int i = 0; i < clusterHits.size(); i++) {
56 hits_.push_back(clusterHits[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.