14 hitCollName_ = ps.
getParameter<std::string>(
"hitCollName");
15 clusterCollName_ = ps.
getParameter<std::string>(
"clusterCollName");
17 singleCluster_ = ps.
getParameter<
bool>(
"doSingleCluster");
18 logEnergyWeight_ = ps.
getParameter<
bool>(
"logEnergyWeight");
20 minClusterHitMult_ = ps.
getParameter<
int>(
"minClusterHitMult");
21 clusterHitDist_ = ps.
getParameter<
double>(
"clusterHitDist");
22 clusterZBias_ = ps.
getParameter<
double>(
"clusterZBias", 1);
27 if (!event.
exists(hitCollName_))
return;
28 const auto hcalRecHits =
event.getCollection<
ldmx::HcalHit>(hitCollName_);
30 for (
const auto& h : hcalRecHits) eTotal += h.
getEnergy();
32 std::vector<ldmx::CaloCluster> pfClusters;
33 if (!singleCluster_) {
37 std::vector<const ldmx::CalorimeterHit*> ptrs;
38 for (
const auto& h : hcalRecHits) ptrs.push_back(&h);
39 std::vector<std::vector<const ldmx::CalorimeterHit*> > all_hit_ptrs =
40 cb.runDBSCAN(ptrs,
false);
42 for (
const auto& hit_ptrs : all_hit_ptrs) {
44 cb.fillClusterInfoFromHits(&cl, hit_ptrs, logEnergyWeight_);
45 pfClusters.push_back(cl);
50 std::vector<const ldmx::CalorimeterHit*> ptrs;
51 ptrs.reserve(hcalRecHits.size());
52 for (
const auto& h : hcalRecHits) {
56 dummy.fillClusterInfoFromHits(&cl, ptrs, logEnergyWeight_);
57 pfClusters.push_back(cl);
61 std::sort(pfClusters.begin(), pfClusters.end(),
63 return a.getEnergy() > b.getEnergy();
65 event.add(clusterCollName_, pfClusters);
66 event.add(
"HcalTotalEnergy" + suffix_, eTotal);
Class that stores calorimeter cluster information.
Class that represents a reconstructed hit in a calorimeter cell within the detector.
Implementation of DBSCAN clustering algo.
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that stores cluster information from the ECal.
Class that stores Stores reconstructed hit information from the HCAL.
HCal clustering skeleton for PFlow Reco.
Implements an event buffer system for storing event data.
bool exists(const std::string &name, const std::string &passName="", bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Stores cluster information from the ECal.
float getEnergy() const
Get the calorimetric energy of the hit, corrected for sampling factors [MeV].
Stores reconstructed hit information from the HCAL.
virtual void configure(framework::config::Parameters &ps)
Callback for the EventProcessor to configure itself from the given set of parameters.
virtual void produce(framework::Event &event)
Process the event and put new data products into it.