60 <<
"\nClusterCrawler module has been deprecated and will be removed." 61 "\nIt is now replaced by HitFinder and LineCluster modules.";
68 produces<std::vector<recob::Cluster>>();
69 produces<std::vector<recob::Vertex>>();
70 produces<art::Assns<recob::Cluster, recob::Hit>>();
71 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 *
this, 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)));
void RunCCHitFinder(std::vector< recob::Wire > const &Wires)
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
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.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
struct of temporary clusters
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.
art framework interface to geometry description
static const SentryArgument_t Sentry
An instance of the sentry object.
static geo::PlaneID DecodeCTP(CTP_t CTP)
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)
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.
void produce(art::Event &evt) override
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
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.
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
ProducesCollector & producesCollector() noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string fCalDataModuleLabel
label of module producing input wires
Declaration of signal hit object.
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
2D representation of charge deposited in the TDC/wire plane
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
LArSoft geometry interface.