125 std::unique_ptr<std::vector<recob::Hit>> FinalHits
134 std::vector<recob::Cluster> sccol;
135 std::vector<recob::Vertex> sv3col;
137 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit> >
139 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>
148 for(
unsigned int icl = 0; icl < tcl.size(); ++icl) {
149 ClusterCrawlerAlg::ClusterStore
const& clstr = tcl[icl];
150 if(clstr.ID < 0)
continue;
152 unsigned short plane = planeID.
Plane;
153 for(
unsigned short ii = 0; ii < clstr.tclhits.size(); ++ii) {
154 unsigned int iht = clstr.tclhits[ii];
155 recob::Hit const& theHit = FinalHits->at(iht);
157 std::cout<<
"CC: cluster-hit plane mis-match "<<theHit.
WireID().
Plane<<
" "<<plane
158 <<
" in cluster "<<clstr.ID<<
" WT "<<clstr.BeginWir<<
":"<<(int)clstr.BeginTim<<
"\n";
161 if(inClus[iht] != clstr.ID) {
162 std::cout <<
"CC: InClus mis-match " << inClus[iht]
163 <<
" ID " << clstr.ID <<
" in cluster " << icl <<
"\n";
170 std::vector<ClusterCrawlerAlg::Vtx3Store>
const& Vertices
173 double xyz[3] = {0, 0, 0};
174 unsigned int vtxID = 0,
end;
175 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
177 if(vtx3.Ptr2D[0] < 0)
continue;
178 if(vtx3.Ptr2D[1] < 0)
continue;
179 if(vtx3.Ptr2D[2] < 0)
continue;
184 sv3col.emplace_back(xyz, vtxID);
187 std::unique_ptr<std::vector<recob::Vertex> > v3col(
new std::vector<recob::Vertex>(std::move(sv3col)));
190 float sumChg, sumADC;
191 unsigned int clsID = 0, nclhits;
192 for(
unsigned int icl = 0; icl < tcl.size(); ++icl) {
193 ClusterCrawlerAlg::ClusterStore
const& clstr = tcl[icl];
194 if(clstr.ID < 0)
continue;
199 unsigned short plane = planeID.
Plane;
200 nclhits = clstr.tclhits.size();
201 std::vector<unsigned int> clsHitIndices;
203 for(
unsigned int itt = 0; itt < nclhits; ++itt) {
204 unsigned int iht = clstr.tclhits[itt];
210 unsigned int iht = clstr.tclhits[0];
214 (
float)clstr.BeginWir,
242 *
this, evt, *hc_assn, sccol.size()-1, clstr.tclhits.begin(), clstr.tclhits.end())
246 <<
"Failed to associate hit "<<iht<<
" with cluster "<<icl;
249 if(clstr.BeginVtx >= 0) {
252 unsigned short vtxIndex = 0;
253 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
255 if(vtx3.Ptr2D[0] < 0)
continue;
256 if(vtx3.Ptr2D[1] < 0)
continue;
257 if(vtx3.Ptr2D[2] < 0)
continue;
258 if(vtx3.Ptr2D[plane] == clstr.BeginVtx) {
262 <<
"Failed to associate cluster "<<icl<<
" with vertex";
269 if(clstr.EndVtx >= 0) {
272 unsigned short vtxIndex = 0;
273 for(ClusterCrawlerAlg::Vtx3Store
const& vtx3: Vertices) {
275 if(vtx3.Ptr2D[0] < 0)
continue;
276 if(vtx3.Ptr2D[1] < 0)
continue;
277 if(vtx3.Ptr2D[2] < 0)
continue;
278 if(vtx3.Ptr2D[plane] == clstr.EndVtx) {
282 <<
"Failed to associate cluster "<<icl<<
" with endpoint";
292 std::unique_ptr<std::vector<recob::Cluster> > ccol(
new std::vector<recob::Cluster>(std::move(sccol)));
294 shcol.use_hits(std::move(FinalHits));
301 evt.
put(std::move(ccol));
302 evt.
put(std::move(hc_assn));
303 evt.
put(std::move(v3col));
304 evt.
put(std::move(cv_assn));
void RunCCHitFinder(std::vector< recob::Wire > const &Wires)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
Initial tdc tick for hit.
hit::CCHitFinderAlg fCCHFAlg
The data type to uniquely identify a Plane.
std::vector< ClusterStore > const & GetClusters() const
Returns a constant reference to the clusters found.
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)
ProductID put(std::unique_ptr< PROD > &&product)
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
void RunCrawler(std::vector< recob::Hit > const &srchits)
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.
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
std::string fCalDataModuleLabel
label of module producing input wires
std::vector< Vtx3Store > const & GetVertices() const
Returns a constant reference to the 3D vertices found.
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)
std::vector< short > const & GetinClus() const
Returns (and loses) the collection of reconstructed hits.
2D representation of charge deposited in the TDC/wire plane
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Namespace collecting geometry-related classes utilities.