51 std::unique_ptr<ClusterCrawlerAlg>
fCCAlg;
98 produces< std::vector<recob::Cluster> >();
99 produces< std::vector<recob::Vertex> >();
100 produces< std::vector<recob::EndPoint2D> >();
101 produces< art::Assns<recob::Cluster, recob::Hit> >();
102 produces< art::Assns<recob::Cluster, recob::Vertex, unsigned short> >();
103 produces< art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short> >();
133 fCCAlg->RunCrawler(*hitVecHandle);
135 std::unique_ptr<std::vector<recob::Hit>> FinalHits
136 (
new std::vector<recob::Hit>(std::move(
fCCAlg->YieldHits())));
142 std::vector<recob::Cluster> sccol;
143 std::vector<recob::Vertex> sv3col;
144 std::vector<recob::EndPoint2D> sv2col;
146 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit> >
148 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>
150 std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>
153 std::vector<ClusterCrawlerAlg::ClusterStore>
const& Clusters =
fCCAlg->GetClusters();
181 std::vector<ClusterCrawlerAlg::VtxStore>
const& EndPts =
fCCAlg->GetEndPoints();
182 std::vector<unsigned int> indxToIndx(EndPts.size());
184 unsigned short vtxID = 0,
end, wire, ivx;
185 for(ivx = 0; ivx < EndPts.size(); ++ivx) {
186 if(EndPts[ivx].NClusters == 0)
continue;
187 indxToIndx[ivx] = vtxID;
190 wire = (0.5 + EndPts[ivx].Wire);
194 sv2col.emplace_back((
double)EndPts[ivx].Time,
202 std::unique_ptr<std::vector<recob::EndPoint2D> > v2col(
new std::vector<recob::EndPoint2D>(std::move(sv2col)));
205 std::vector<ClusterCrawlerAlg::Vtx3Store>
const& Vertices =
fCCAlg->GetVertices();
206 double xyz[3] = {0, 0, 0};
210 if(vtx3.Ptr2D[0] < 0)
continue;
211 if(vtx3.Ptr2D[1] < 0)
continue;
212 if(vtx3.Ptr2D[2] < 0)
continue;
217 sv3col.emplace_back(xyz, vtxID);
220 std::unique_ptr<std::vector<recob::Vertex> > v3col(
new std::vector<recob::Vertex>(std::move(sv3col)));
223 float sumChg, sumADC;
224 unsigned int clsID = 0, nclhits;
225 for(
unsigned int icl = 0; icl < Clusters.size(); ++icl) {
227 if(clstr.
ID < 0)
continue;
232 unsigned short plane = planeID.
Plane;
233 nclhits = clstr.
tclhits.size();
234 std::vector<unsigned int> clsHitIndices;
236 for(
unsigned int itt = 0; itt < nclhits; ++itt) {
237 unsigned int iht = clstr.
tclhits[itt];
243 unsigned int iht = clstr.
tclhits[0];
275 *
this, evt, *hc_assn, sccol.size()-1, clstr.
tclhits.begin(), clstr.
tclhits.end())
279 <<
"Failed to associate hit "<<iht<<
" with cluster "<<icl;
290 unsigned short vtxIndex = 0;
293 if(vtx3.Ptr2D[0] < 0)
continue;
294 if(vtx3.Ptr2D[1] < 0)
continue;
295 if(vtx3.Ptr2D[2] < 0)
continue;
296 if(vtx3.Ptr2D[plane] == clstr.
BeginVtx) {
300 <<
"Failed to associate cluster "<<icl<<
" with vertex";
315 unsigned short vtxIndex = 0;
318 if(vtx3.Ptr2D[0] < 0)
continue;
319 if(vtx3.Ptr2D[1] < 0)
continue;
320 if(vtx3.Ptr2D[2] < 0)
continue;
321 if(vtx3.Ptr2D[plane] == clstr.
EndVtx) {
325 <<
"Failed to associate cluster "<<icl<<
" with endpoint";
335 std::unique_ptr<std::vector<recob::Cluster> > ccol(
new std::vector<recob::Cluster>(std::move(sccol)));
337 shcol.use_hits(std::move(FinalHits));
344 evt.
put(std::move(ccol));
345 evt.
put(std::move(hc_assn));
346 evt.
put(std::move(v2col));
347 evt.
put(std::move(v3col));
348 evt.
put(std::move(cv_assn));
349 evt.
put(std::move(cep_assn));
void reconfigure(fhicl::ParameterSet const &pset)
void produce(art::Event &evt) override
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
The data type to uniquely identify a Plane.
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.
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
struct of temporary 3D vertices
virtual ~LineCluster()=default
static const SentryArgument_t Sentry
An instance of the sentry object.
static geo::PlaneID DecodeCTP(CTP_t CTP)
std::unique_ptr< ClusterCrawlerAlg > fCCAlg
ProductID put(std::unique_ptr< PROD > &&product)
Helper functions to create a hit.
#define DEFINE_ART_MODULE(klass)
bool CreateAssnD(PRODUCER const &prod, 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.
T get(std::string const &key) const
art::InputTag fHitFinderLabel
label of module producing input hits
A class handling a collection of hits and its associations.
Wrapper for ClusterParamsAlgBase objects to accept arbitrary input.
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
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.
Produces clusters by ClusterCrawler algorithm.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Utility object to perform functions of association.
std::vector< unsigned int > tclhits
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
LineCluster(fhicl::ParameterSet const &pset)
2D representation of charge deposited in the TDC/wire plane
Interface to class computing cluster parameters.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
TPCID_t TPC
Index of the TPC within its cryostat.