93 produces<std::vector<recob::Cluster>>();
94 produces<std::vector<recob::Vertex>>();
95 produces<std::vector<recob::EndPoint2D>>();
96 produces<art::Assns<recob::Cluster, recob::Hit>>();
97 produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
98 produces<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>();
110 auto const clock_data =
112 auto const det_prop =
116 auto FinalHits = std::make_unique<std::vector<recob::Hit>>(std::move(
fCCAlg.
YieldHits()));
122 std::vector<recob::Cluster> sccol;
123 std::vector<recob::Vertex> sv3col;
124 std::vector<recob::EndPoint2D> sv2col;
126 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> hc_assn(
128 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>> cv_assn(
130 std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>> cep_assn(
133 std::vector<ClusterCrawlerAlg::ClusterStore>
const& Clusters =
fCCAlg.
GetClusters();
161 std::vector<unsigned int> indxToIndx(EndPts.size());
163 unsigned short vtxID = 0,
end, wire, ivx;
164 for (ivx = 0; ivx < EndPts.size(); ++ivx) {
165 if (EndPts[ivx].NClusters == 0)
continue;
166 indxToIndx[ivx] = vtxID;
169 wire = (0.5 + EndPts[ivx].Wire);
173 sv2col.emplace_back((
double)EndPts[ivx].Time,
181 std::unique_ptr<std::vector<recob::EndPoint2D>> v2col(
182 new std::vector<recob::EndPoint2D>(std::move(sv2col)));
185 std::vector<ClusterCrawlerAlg::Vtx3Store>
const& Vertices =
fCCAlg.
GetVertices();
186 double xyz[3] = {0, 0, 0};
190 if (vtx3.Ptr2D[0] < 0)
continue;
191 if (vtx3.Ptr2D[1] < 0)
continue;
192 if (vtx3.Ptr2D[2] < 0)
continue;
197 sv3col.emplace_back(xyz, vtxID);
200 std::unique_ptr<std::vector<recob::Vertex>> v3col(
201 new std::vector<recob::Vertex>(std::move(sv3col)));
204 float sumChg, sumADC;
205 unsigned int clsID = 0, nclhits;
206 for (
unsigned int icl = 0; icl < Clusters.size(); ++icl) {
208 if (clstr.
ID < 0)
continue;
213 unsigned short plane = planeID.
Plane;
214 nclhits = clstr.
tclhits.size();
215 std::vector<unsigned int> clsHitIndices;
217 for (
unsigned int itt = 0; itt < nclhits; ++itt) {
218 unsigned int iht = clstr.
tclhits[itt];
224 unsigned int iht = clstr.
tclhits[0];
227 sccol.emplace_back((
float)clstr.
BeginWir,
255 evt, *hc_assn, sccol.size() - 1, clstr.
tclhits.begin(), clstr.
tclhits.end())) {
257 <<
"Failed to associate hit " << iht <<
" with cluster " << icl;
265 <<
"Failed to associate cluster " << clsID <<
" with EndPoint2D " << clstr.
BeginVtx;
268 unsigned short vtxIndex = 0;
271 if (vtx3.Ptr2D[0] < 0)
continue;
272 if (vtx3.Ptr2D[1] < 0)
continue;
273 if (vtx3.Ptr2D[2] < 0)
continue;
274 if (vtx3.Ptr2D[plane] == clstr.
BeginVtx) {
277 <<
"Failed to associate cluster " << icl <<
" with vertex";
289 <<
"Failed to associate cluster " << clsID <<
" with EndPoint2D " << clstr.
BeginVtx;
292 unsigned short vtxIndex = 0;
295 if (vtx3.Ptr2D[0] < 0)
continue;
296 if (vtx3.Ptr2D[1] < 0)
continue;
297 if (vtx3.Ptr2D[2] < 0)
continue;
298 if (vtx3.Ptr2D[plane] == clstr.
EndVtx) {
301 <<
"Failed to associate cluster " << icl <<
" with endpoint";
311 std::unique_ptr<std::vector<recob::Cluster>> ccol(
312 new std::vector<recob::Cluster>(std::move(sccol)));
314 shcol.
use_hits(std::move(FinalHits));
321 evt.
put(std::move(ccol));
322 evt.
put(std::move(hc_assn));
323 evt.
put(std::move(v2col));
324 evt.
put(std::move(v3col));
325 evt.
put(std::move(cv_assn));
326 evt.
put(std::move(cep_assn));
bool CreateAssnD(art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t &&data)
Creates a single one-to-one association with associated data.
void produce(art::Event &evt) override
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
The data type to uniquely identify a Plane.
std::vector< ClusterStore > const & GetClusters() const
Returns a constant reference to the clusters found.
CryostatID_t Cryostat
Index of cryostat.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
struct of temporary clusters
Cluster finding and building.
struct of temporary 3D vertices
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
static const SentryArgument_t Sentry
An instance of the sentry object.
static geo::PlaneID DecodeCTP(CTP_t CTP)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Helper functions to create a hit.
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
std::vector< VtxStore > const & GetEndPoints() const
Returns a constant reference to the 2D end points found.
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void put_into(art::Event &)
Moves the data into the event.
art::InputTag fHitFinderLabel
label of module producing input hits
A class handling a collection of hits and its associations.
PlaneID_t Plane
Index of the plane within its TPC.
Declaration of cluster object.
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
ProducesCollector & producesCollector() noexcept
Produces clusters by ClusterCrawler algorithm.
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Utility object to perform functions of association.
std::vector< Vtx3Store > const & GetVertices() const
Returns a constant reference to the 3D vertices found.
std::vector< unsigned int > tclhits
void RunCrawler(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, std::vector< recob::Hit > const &srchits)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
LineCluster(fhicl::ParameterSet const &pset)
2D representation of charge deposited in the TDC/wire plane
TPCID_t TPC
Index of the TPC within its cryostat.