86 produces< std::vector<recob::Cluster> >();
87 produces< art::Assns<recob::Cluster, recob::Hit> >();
148 std::unique_ptr<std::vector<recob::Cluster> > out_clusters(
new std::vector<recob::Cluster>);
162 throw cet::exception(__FUNCTION__) <<
"Invalid input cluster label!" << std::endl;
165 std::vector<std::vector< ::util::PxHit> > local_clusters;
168 for(
size_t i=0; i<cHandle->size(); ++i) {
170 local_clusters.push_back(std::vector< ::util::PxHit>());
172 const std::vector<art::Ptr<recob::Hit> >&
hits = hit_m.at(i);
184 if(merged_clusters.size()!=cpan_v.size())
186 throw cet::exception(__FUNCTION__) <<
"LOGIC ERROR: merged cluster id length != output cluster counts..." << std::endl;
188 for(
size_t out_index=0; out_index < merged_clusters.size(); ++out_index) {
196 std::vector<art::Ptr<recob::Hit> > merged_hits;
197 for(
auto const& c_index : merged_clusters[out_index]) {
198 const std::vector<art::Ptr<recob::Hit> >&
hits = hit_m.at(c_index);
199 merged_hits.reserve(merged_hits.size() + hits.size());
200 for(
auto const& ptr : hits) merged_hits.push_back(ptr);
206 if (!merged_hits.empty()) plane = merged_hits.front()->WireID().planeID();
212 out_clusters->emplace_back(
234 out_clusters->size(),
242 *(out_clusters.get()),
249 evt.
put(std::move(out_clusters));
250 evt.
put(std::move(out_assn));
Class def header for a class CBAlgoArray.
Class def header for a class CMergeHelper.
Algorithm class inheriting pre-computed results.
Algorithm class inheriting cluster parameters.
SimpleClusterMerger(fhicl::ParameterSet const &p)
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
virtual Measure_t EndAngle() override
Computes the angle of the cluster.
virtual size_t NHits() override
Returns the number of hits in the cluster.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
::util::GeometryUtilities fGeoU
GeometryUtilities instance.
The data type to uniquely identify a Plane.
::cmtool::CBAlgoTrackSeparate fProhibitAlg
Example prohibit algorithm.
Class def header for a class CBAlgoAngleCompat.
Double_t TimeToCm() const
Double_t WireToCm() const
virtual Measure_t SummedADC() override
Computes the total charge of the cluster from Hit::SummedADC()
virtual Measure_t StartCharge() override
Computes the charge on the first and last wire of the track.
Cluster finding and building.
static const SentryArgument_t Sentry
An instance of the sentry object.
virtual Measure_t EndOpeningAngle() override
Computes the opening angle at the start or end of the cluster.
virtual Measure_t Integral() override
Computes the total charge of the cluster from Hit::Integral()
ProductID put(std::unique_ptr< PROD > &&product)
Class def header for a class CBAlgoTrackSeparate.
View_t View() const
Which coordinate does this plane measure.
std::string fClusterModuleLabel
Input cluster data product producer name label.
void GeneratePxHit(const std::vector< unsigned int > &hit_index, const std::vector< art::Ptr< recob::Hit >> hits, std::vector< util::PxHit > &pxhits) const
Generate: from 1 set of hits => 1 set of PxHits using indexes (association)
#define DEFINE_ART_MODULE(klass)
Class def header for a class CBAlgoAngleSeparate.
virtual Measure_t EndCharge() override
Computes the charge on the first and last wire of the track.
T get(std::string const &key) const
::cmtool::CBAlgoArray fMergeAlg
Example merging algorithm: algorithm array container.
virtual Measure_t SummedADCStdDev() override
Computes the standard deviation on the charge of the cluster hits.
virtual float MultipleHitDensity() override
Fraction of wires in the cluster with more than one hit.
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.
util::PxPoint start_point
start point
::cmtool::CMergeHelper fCMerge
ClusterMergeHelper.
Declaration of cluster object.
virtual Measure_t IntegralStdDev() override
Computes the standard deviation on the charge of the cluster hits.
void produce(art::Event &evt) override
virtual float Width() override
Computes the width of the cluster.
Class def header for a class CBAlgoShortestDist.
Utility object to perform functions of association.
util::PxPoint end_point
end point
virtual Measure_t StartOpeningAngle() override
Computes the opening angle at the start or end of the cluster.
virtual Measure_t StartAngle() override
Computes the angle of the cluster.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
::cmtool::CBAlgoAngleCompat fAngleAlg
Merging algorithm 2.
::cmtool::CBAlgoShortestDist fDistAlg
Merging algorithm 1.
Namespace collecting geometry-related classes utilities.
virtual ~SimpleClusterMerger()
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception