5#include "Recon/Event/HgcrocTrigDigi.h"
6#include "Trigger/Event/TrigCaloCluster.h"
7#include "Trigger/Event/TrigCaloHit.h"
8#include "Trigger/IdealClusterBuilder.h"
13 hitCollName_ = ps.
getParameter<std::string>(
"hitCollName");
14 clusterCollName_ = ps.
getParameter<std::string>(
"clusterCollName");
19 getCondition<ecal::EcalTriggerGeometry>(
20 ecal::EcalTriggerGeometry::CONDITIONS_OBJECT_NAME);
22 if (!event.
exists(hitCollName_))
return;
24 event.getObject<ldmx::HgcrocTrigDigiCollection>(hitCollName_)};
26 std::vector<Hit> hits{};
28 for (
const auto& trigDigi : ecalTrigDigis) {
30 float e = cvt.calc(trigDigi.linearPrimitive(), tid.
layer());
51 hit.layer = tid.
layer();
53 hit.module_id = tid.
module();
54 hit.idx = hits.size();
60 if (!myGeo.is_initialized) {
61 for (
int imod = 0; imod < 7; imod++) {
62 for (
int icell = 0; icell < 48; icell++) {
65 myGeo.AddTP(
id.raw(), icell, imod, xx, yy);
71 builder.SetClusterGeo(&myGeo);
72 for (
const auto& h : hits) builder.AddHit(h);
74 builder.BuildClusters();
75 auto clusters = builder.GetClusters();
77 TrigCaloClusterCollection trigClusters;
78 for (
const auto& c : clusters) {
80 t.setXYZerr(c.xx, c.yy, c.zz);
87 t.setFirstLayer(c.first_layer);
88 t.setLastLayer(c.last_layer);
94 for (
const auto& c2d : c.clusters2d) nTP += c2d.hits.size();
97 trigClusters.push_back(t);
100 event.add(clusterCollName_, trigClusters);
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
ECal clustering algorithm.
defines the relationship between precision cells and trigger cells and provides geometry information ...
std::tuple< double, double, double > globalPosition(ldmx::EcalTriggerID triggerCell) const
Returns the center of the given trigger cell in world coordinates.
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.
Extension of DetectorID providing access to ECal trigger cell information.
int layer() const
Get the value of the layer field from the ID.
int module() const
Get the value of the module field from the ID.
int getTriggerCellID() const
Get the value of the trigger cell field from the ID.
Class for clusters built from trigger calo hits.
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.