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};
208 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
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) {
226 ClusterCrawlerAlg::ClusterStore
const& clstr = Clusters[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];
247 (
float)clstr.BeginWir,
275 *
this, evt, *hc_assn, sccol.size()-1, clstr.tclhits.begin(), clstr.tclhits.end())
279 <<
"Failed to associate hit "<<iht<<
" with cluster "<<icl;
282 if(clstr.BeginVtx >= 0) {
290 unsigned short vtxIndex = 0;
291 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
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";
307 if(clstr.EndVtx >= 0) {
315 unsigned short vtxIndex = 0;
316 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
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));
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
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.
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)
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.
art::InputTag fHitFinderLabel
label of module producing input hits
A class handling a collection of hits and its associations.
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.
Detector simulation of raw signals on wires.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
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)
2D representation of charge deposited in the TDC/wire plane
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
TPCID_t TPC
Index of the TPC within its cryostat.