61 <<
"\nClusterCrawler module has been deprecated and will be removed." 62 "\nIt is now replaced by HitFinder and LineCluster modules.";
69 produces<std::vector<recob::Cluster>>();
70 produces<std::vector<recob::Vertex>>();
71 produces<art::Assns<recob::Cluster, recob::Hit>>();
72 produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
89 auto const clock_data =
97 auto FinalHits = std::make_unique<std::vector<recob::Hit>>(
fCCAlg.
YieldHits());
105 std::vector<recob::Cluster> sccol;
106 std::vector<recob::Vertex> sv3col;
108 auto hc_assn = std::make_unique<art::Assns<recob::Cluster, recob::Hit>>();
109 auto cv_assn = std::make_unique<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
116 for (
unsigned int icl = 0; icl < tcl.size(); ++icl) {
118 if (clstr.
ID < 0)
continue;
120 unsigned short plane = planeID.
Plane;
121 for (
unsigned short ii = 0; ii < clstr.
tclhits.size(); ++ii) {
122 unsigned int iht = clstr.
tclhits[ii];
123 recob::Hit const& theHit = FinalHits->at(iht);
125 std::cout <<
"CC: cluster-hit plane mis-match " << theHit.
WireID().
Plane <<
" " << plane
126 <<
" in cluster " << clstr.
ID <<
" WT " << clstr.
BeginWir <<
":" 130 if (inClus[iht] != clstr.
ID) {
131 std::cout <<
"CC: InClus mis-match " << inClus[iht] <<
" ID " << clstr.
ID 132 <<
" in cluster " << icl <<
"\n";
139 std::vector<ClusterCrawlerAlg::Vtx3Store>
const& Vertices =
fCCAlg.
GetVertices();
141 double xyz[3] = {0, 0, 0};
142 unsigned int vtxID = 0,
end;
145 if (vtx3.Ptr2D[0] < 0)
continue;
146 if (vtx3.Ptr2D[1] < 0)
continue;
147 if (vtx3.Ptr2D[2] < 0)
continue;
152 sv3col.emplace_back(xyz, vtxID);
155 std::unique_ptr<std::vector<recob::Vertex>> v3col(
156 new std::vector<recob::Vertex>(std::move(sv3col)));
159 float sumChg, sumADC;
160 unsigned int clsID = 0, nclhits;
161 for (
unsigned int icl = 0; icl < tcl.size(); ++icl) {
163 if (clstr.
ID < 0)
continue;
168 unsigned short plane = planeID.
Plane;
169 nclhits = clstr.
tclhits.size();
170 std::vector<unsigned int> clsHitIndices;
172 for (
unsigned int itt = 0; itt < nclhits; ++itt) {
173 unsigned int iht = clstr.
tclhits[itt];
179 unsigned int iht = clstr.
tclhits[0];
182 sccol.emplace_back((
float)clstr.
BeginWir,
210 evt, *hc_assn, sccol.size() - 1, clstr.
tclhits.begin(), clstr.
tclhits.end())) {
212 <<
"Failed to associate hit " << iht <<
" with cluster " << icl;
218 unsigned short vtxIndex = 0;
221 if (vtx3.Ptr2D[0] < 0)
continue;
222 if (vtx3.Ptr2D[1] < 0)
continue;
223 if (vtx3.Ptr2D[2] < 0)
continue;
224 if (vtx3.Ptr2D[plane] == clstr.
BeginVtx) {
227 <<
"Failed to associate cluster " << icl <<
" with vertex";
237 unsigned short vtxIndex = 0;
240 if (vtx3.Ptr2D[0] < 0)
continue;
241 if (vtx3.Ptr2D[1] < 0)
continue;
242 if (vtx3.Ptr2D[2] < 0)
continue;
243 if (vtx3.Ptr2D[plane] == clstr.
EndVtx) {
246 <<
"Failed to associate cluster " << icl <<
" with endpoint";
256 std::unique_ptr<std::vector<recob::Cluster>> ccol(
257 new std::vector<recob::Cluster>(std::move(sccol)));
259 shcol.
use_hits(std::move(FinalHits));
266 evt.
put(std::move(ccol));
267 evt.
put(std::move(hc_assn));
268 evt.
put(std::move(v3col));
269 evt.
put(std::move(cv_assn));
void RunCCHitFinder(std::vector< recob::Wire > const &Wires)
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.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
hit::CCHitFinderAlg fCCHFAlg
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.
Definition of basic raw digits.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
struct of temporary clusters
geo::WireID const & WireID() const
Initial tdc tick for hit.
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
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.
Hit finder algorithm designed to work with Cluster Crawler.
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.
ClusterCrawler(fhicl::ParameterSet const &pset)
Helper functions to create a hit.
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
#define DEFINE_ART_MODULE(klass)
A class handling a collection of hits and its associations.
void produce(art::Event &evt) override
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
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
std::string fCalDataModuleLabel
label of module producing input wires
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)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void put_into(art::Event &)
Moves the data into the event.
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Declaration of basic channel signal object.
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.
Namespace collecting geometry-related classes utilities.
art framework interface to geometry description