6#include "Hcal/MyClusterWeight.h"
7#include "Hcal/TemplatedClusterFinder.h"
8#include "Hcal/WorkingCluster.h"
15HcalClusterProducer::HcalClusterProducer(
const std::string& name,
17 : Producer(name, process) {}
20 EnoiseCut_ = parameters.
getParameter<
double>(
"EnoiseCut");
21 deltaTime_ = parameters.
getParameter<
double>(
"deltaTime");
23 EminCluster_ = parameters.
getParameter<
double>(
"EminCluster");
26 clusterCollName_ = parameters.
getParameter<std::string>(
"clusterCollName");
39 std::vector<ldmx::HcalCluster> hcalClusters;
40 std::list<const ldmx::HcalHit*> seedList;
41 std::vector<ldmx::HcalHit> hcalHits =
44 if (hcalHits.empty()) {
49 if (hit.getEnergy() < EnoiseCut_)
continue;
50 if (hit.getEnergy() == 0)
continue;
51 finder.add(&hit, hcalGeom);
56 finder.cluster(EminCluster_, cutOff_, deltaTime_);
58 std::vector<WorkingCluster> wcVec = finder.getClusters();
59 for (
unsigned int c = 0; c < wcVec.size(); c++) {
60 if (wcVec[c].empty())
continue;
62 cluster.
setEnergy(wcVec[c].centroid().E());
63 cluster.
setCentroidXYZ(wcVec[c].centroid().Px(), wcVec[c].centroid().Py(),
64 wcVec[c].centroid().Pz());
65 cluster.
setNHits(wcVec[c].getHits().size());
66 cluster.
addHits(wcVec[c].getHits());
67 std::vector<const ldmx::HcalHit*> hits = wcVec[c].getHits();
68 if (hits.size() > 0) {
69 std::sort(hits.begin(), hits.end(), compHitTimes);
70 cluster.setTime(hits[0]->getTime());
72 hcalClusters.push_back(cluster);
74 event.add(clusterCollName_, hcalClusters);
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that performs clustering of HCal hits.
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
void setNHits(int nHits)
Sets total number of hits in the cluster.
void setEnergy(double energy)
Sets total energy for the cluster.
void setCentroidXYZ(double x, double y, double z)
Sets the three coordinates of the cluster centroid.
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.
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.