76 fMinHits = pset.get<
unsigned int>(
"MinHits");
79 produces<std::vector<art::PtrVector<recob::SpacePoint>>>();
80 produces<std::vector<recob::SpacePoint>>();
81 produces<art::Assns<recob::SpacePoint, recob::Hit>>();
82 if (fClusterAssns) produces<art::Assns<recob::SpacePoint, recob::Cluster>>();
87 <<
"SpacePointFinder configured with the following parameters:\n" 89 <<
" Minimum Hits per Cluster = " << fMinHits <<
"\n" 119 std::unique_ptr<std::vector<art::PtrVector<recob::SpacePoint>>> sptvecs(
121 std::unique_ptr<std::vector<recob::SpacePoint>> spts(
new std::vector<recob::SpacePoint>);
122 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> sphitassn(
124 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Cluster>> spclassn(
133 auto const clockData =
140 int nclus = clusterh->size();
141 for (
int iclus = 0; iclus < nclus; ++iclus) {
145 std::vector<art::Ptr<recob::Hit>> ihits = fm.at(iclus);
155 unsigned int nihits = ihits.size();
165 for (
int jclus = 0; jclus < iclus; ++jclus) {
169 std::vector<art::Ptr<recob::Hit>> jhits = fm.at(jclus);
181 unsigned int njhits = jhits.size();
182 assert(hits.
size() >= nihits);
184 while (hits.
size() > nihits)
186 assert(hits.
size() == nihits);
196 std::vector<recob::SpacePoint> new_spts;
201 if (new_spts.size() > 0) {
210 int nspt = spts->size();
211 spts->insert(spts->end(), new_spts.begin(), new_spts.end());
216 for (
unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
229 sptvecs->push_back(sptvec);
235 for (
int kclus = 0; kclus < jclus; ++kclus) {
239 std::vector<art::Ptr<recob::Hit>> khits = fm.at(kclus);
247 kview != iview && kview != jview) {
251 unsigned int nkhits = khits.size();
252 assert(hits.
size() >= nihits + njhits);
254 while (hits.
size() > nihits + njhits)
256 assert(hits.
size() == nihits + njhits);
257 hits.
reserve(nihits + njhits + nkhits);
265 std::vector<recob::SpacePoint> new_spts;
270 if (new_spts.size() > 0) {
280 int nspt = spts->size();
281 spts->insert(spts->end(), new_spts.begin(), new_spts.end());
286 for (
unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
299 sptvecs->push_back(sptvec);
310 evt.
put(std::move(spts));
311 evt.
put(std::move(sptvecs));
312 evt.
put(std::move(sphitassn));
324 <<
"SpacePointFinder statistics:\n" 325 <<
" Number of events = " <<
fNumEvent <<
"\n" 326 <<
" Number of 2-view space points created = " <<
fNumSpt2 <<
"\n" 327 <<
" Number of 3-view space points created = " <<
fNumSpt3;
SpacePointFinder(fhicl::ParameterSet const &pset)
void reserve(size_type n)
bool enableW() const noexcept
bool enableV() const noexcept
ProductID getProductID(std::string const &instance_name="") const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
Planes which measure Z direction.
int minViews() const noexcept
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
bool isValid() const noexcept
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
EDProductGetter const * productGetter(ProductID const pid) const
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
void makeSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
Declaration of cluster object.
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.
geo::View_t View() const
Returns the view for this cluster.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
bool enableU() const noexcept
Algorithm for generating space points from hits.
std::string fClusterModuleLabel
art framework interface to geometry description
void produce(art::Event &evt) override