14HcalClusterProducer::HcalClusterProducer(
const std::string& name,
16 : Producer(name, process) {}
19 enoise_cut_ = parameters.
get<
double>(
"enoise_cut");
20 delta_time_ = parameters.
get<
double>(
"delta_time");
21 delta_r_ = parameters.
get<
double>(
"delta_r");
22 emin_cluster_ = parameters.
get<
double>(
"emin_cluster");
23 cut_off_ = parameters.
get<
double>(
"cut_off");
25 cluster_coll_name_ = parameters.
get<std::string>(
"cluster_coll_name");
26 hcal_hits_pass_name_ = parameters.
get<std::string>(
"hcal_hits_pass_name");
39 std::vector<ldmx::HcalCluster> hcal_clusters;
40 std::list<const ldmx::HcalHit*> seed_list;
41 std::vector<ldmx::HcalHit> hcal_hits =
42 event.getCollection<
ldmx::HcalHit>(
"HcalRecHits", hcal_hits_pass_name_);
44 if (hcal_hits.empty()) {
49 if (hit.getEnergy() < enoise_cut_)
continue;
50 if (hit.getEnergy() == 0)
continue;
52 finder.
add(&hit, pos.x(), pos.y(), pos.z());
55 finder.
cluster(emin_cluster_, cut_off_);
58 for (
size_t c = 0; c < wc_vec.size(); c++) {
59 if (wc_vec[c].empty())
continue;
62 cluster.
setCentroidXYZ(wc_vec[c].centroidX(), wc_vec[c].centroidY(),
63 wc_vec[c].centroidZ());
64 cluster.
setNHits(wc_vec[c].hits().size());
65 cluster.
addHits(wc_vec[c].hits());
66 auto hits = wc_vec[c].hits();
67 if (hits.size() > 0) {
68 std::sort(hits.begin(), hits.end(), compHitTimes);
69 cluster.setTime(hits[0]->getTime());
71 hcal_clusters.push_back(cluster);
73 event.add(cluster_coll_name_, hcal_clusters);
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that performs clustering of HCal hits_.
Weight function for Hcal cluster merging decisions.
Templated clustering algorithm for calorimeter hits.
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Make clusters from hits in the HCAL.
void setNHits(int nHits)
Sets total number of hits in the cluster.
void setCentroidXYZ(double centroid_x, double centroid_y, double centroid_z)
Sets the three coordinates of the cluster centroid.
void setEnergy(double energy)
Sets total energy for the cluster.
float getTime() const
Get the time of the hit [ns].
Stores cluster information from the HCal.
void addHits(const std::vector< const ldmx::HcalHit * > hitsVec)
Take in the hits that make up the cluster.
Implementation of HCal strip readout.
ROOT::Math::XYZVector getStripCenterPosition(ldmx::HcalID id) const
Get a strip center position from a combined hcal ID.
static constexpr const char * CONDITIONS_OBJECT_NAME
Conditions object: The name of the python configuration calling this class (Hcal/python/HcalGeometry....
Stores reconstructed hit information from the HCAL.
A templated agglomerative clustering algorithm.
void cluster(double seed_threshold, double cutoff)
Run the clustering algorithm.
std::vector< ClusterType > getClusters() const
Get the final clusters after filtering by seed threshold.
void add(const HitType &hit)
Add a hit to be clustered using its stored position.