146 produces< std::vector<recob::Cluster> >();
147 produces< art::Assns<recob::Cluster, recob::Hit> >();
191 auto prohib_algo_1_1 = new ::cmtool::CBAlgoTrackSeparate;
192 prohib_algo_1_1->SetUseEP(fTSep1UseEP);
194 auto prohib_algo_1_2 = new ::cmtool::CBAlgoOutOfConeSeparate;
195 prohib_algo_1_2->SetMaxAngleSep(fOOCS1MaxAngle);
197 auto prohib_algo_1 = new ::cmtool::CBAlgoArray;
198 prohib_algo_1->AddAlgo(prohib_algo_1_1,
false);
199 prohib_algo_1->AddAlgo(prohib_algo_1_2,
false);
204 auto merge_algo_1_1 = new ::cmtool::CBAlgoShortestDist;
205 merge_algo_1_1->SetMinHits(fSDMinHits);
206 merge_algo_1_1->SetSquaredDistanceCut(fSDSqDistCut);
208 auto merge_algo_1_2 = new ::cmtool::CBAlgoStartTrack;
210 auto merge_algo_1_3 = new ::cmtool::CBAlgoPolyContain;
212 auto merge_algo_1 = new ::cmtool::CBAlgoArray;
213 merge_algo_1->AddAlgo(merge_algo_1_1,
false);
214 merge_algo_1->AddAlgo(merge_algo_1_2,
false);
215 merge_algo_1->AddAlgo(merge_algo_1_3,
false);
225 auto prohib_algo_2_1 = new ::cmtool::CBAlgoTrackSeparate;
228 prohib_algo_2_1->SetUseEP(fTSep2UseEP);
230 auto prohib_algo_2_2 = new ::cmtool::CBAlgoOutOfConeSeparate;
233 prohib_algo_2_2->SetMaxAngleSep(fOOCS2MaxAngle);
235 auto prohib_algo_2_3 = new ::cmtool::CBAlgoAngleIncompat;
236 prohib_algo_2_3->SetMinHits(fAI2MinHits);
237 prohib_algo_2_3->SetAllow180Ambig(fAI2Allow180Ambig);
238 prohib_algo_2_3->SetUseOpeningAngle(fAI2UseOpeningAngle);
239 prohib_algo_2_3->SetAngleCut(fAI2AngleCut);
240 prohib_algo_2_3->SetMinLength(fAI2MinLength);
245 auto prohib_algo_2 = new ::cmtool::CBAlgoArray;
246 prohib_algo_2->AddAlgo(prohib_algo_2_1,
false);
247 prohib_algo_2->AddAlgo(prohib_algo_2_2,
false);
248 prohib_algo_2->AddAlgo(prohib_algo_2_3,
false);
253 auto merge_algo_2_1 = new ::cmtool::CBAlgoCenterOfMass;
256 merge_algo_2_1->UseCOMInPoly(fCOM2UseCOMInPoly);
257 merge_algo_2_1->UseCOMInCone(fCOM2UseCOMInCone);
258 merge_algo_2_1->UseCOMNearClus(fCOM2UseCOMNearClus);
259 merge_algo_2_1->SetLengthReach(fCOM2SetLengthReach);
262 auto merge_algo_2_2 = new ::cmtool::CBAlgoPolyOverlap;
263 merge_algo_2_2->SetMinNumHits(fPO2MinHits);
265 auto merge_algo_2_3 = new ::cmtool::CBAlgoPolyShortestDist;
266 merge_algo_2_3->SetMinNumHits(fPSD2MinHits);
267 merge_algo_2_3->SetMaxNumHits(fPSD2MaxHits);
268 merge_algo_2_3->SetMinDistSquared(fPSD2MinDistSqd);
269 merge_algo_2_3->SetDebug(
false);
271 auto merge_algo_2 = new ::cmtool::CBAlgoArray;
272 merge_algo_2->AddAlgo(merge_algo_2_1,
false);
273 merge_algo_2->AddAlgo(merge_algo_2_2,
false);
274 merge_algo_2->AddAlgo(merge_algo_2_3,
false);
279 auto priority_algo_2 = new ::cmtool::CPAlgoIgnoreTracks;
298 std::unique_ptr<std::vector<recob::Cluster> > out_clusters(
new std::vector<recob::Cluster>);
312 throw cet::exception(__FUNCTION__) <<
"Invalid input cluster label!" << std::endl;
315 std::vector<std::vector< ::util::PxHit> > local_clusters;
318 for(
size_t i=0; i<cHandle->size(); ++i) {
320 local_clusters.push_back(std::vector< ::util::PxHit>());
322 const std::vector<art::Ptr<recob::Hit> >& all_hits = hit_m.at(i);
323 std::vector<art::Ptr<recob::Hit>> good_hits;
325 all_hits.begin(), all_hits.end(), std::back_inserter(good_hits),
326 [](
auto const& pHit){
return pHit->Integral() > 0.; }
328 if (all_hits.size() > good_hits.size()) {
330 <<
"Dropped " << (all_hits.size() - good_hits.size()) <<
"/" 332 <<
" hits which had non-positive integral in cluster #" << i;
334 if (good_hits.empty()) {
336 <<
"Cluster #" << i <<
" is skipped because of no good hits!";
350 if(merged_clusters.size()!=cpan_v.size())
352 throw cet::exception(__FUNCTION__) <<
"LOGIC ERROR: merged cluster id length != output cluster counts..." << std::endl;
356 for(
size_t out_index=0; out_index < merged_clusters.size(); ++out_index) {
364 std::vector<art::Ptr<recob::Hit> > merged_hits;
365 for(
auto const& c_index : merged_clusters[out_index]) {
366 const std::vector<art::Ptr<recob::Hit> >&
hits = hit_m.at(c_index);
367 merged_hits.reserve(merged_hits.size() + hits.size());
368 for(
auto const&
hit : hits) {
369 if (
hit->Integral() > 0.) merged_hits.push_back(
hit);
376 if (!merged_hits.empty()) plane = merged_hits.front()->WireID().planeID();
382 out_clusters->emplace_back(
404 out_clusters->size(),
412 *(out_clusters.get()),
470 evt.
put(std::move(out_clusters));
471 evt.
put(std::move(out_assn));
Class def header for a class CBAlgoArray.
double fCOM2SetLengthReach
Class def header for a class CMergeHelper.
Algorithm class inheriting pre-computed results.
Algorithm class inheriting cluster parameters.
Class def header for a class CBAlgoShortestDistSmallCluster.
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 ~FuzzyClusterMerger()
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.
The data type to uniquely identify a Plane.
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.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
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.
Class def header for a class CBAlgoPolyShortestDist.
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.
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.
Class def header for a class CBAlgoAngleIncompat.
T get(std::string const &key) const
std::string fClusterModuleLabel
Input cluster data product producer name label.
::cmtool::CMergeHelper fCMerge
ClusterMergeHelper.
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
Declaration of cluster object.
virtual Measure_t IntegralStdDev() override
Computes the standard deviation on the charge of the cluster hits.
Detector simulation of raw signals on wires.
::util::GeometryUtilities fGeoU
GeometryUtilities instance.
virtual float Width() override
Computes the width of the cluster.
Class def header for a class CBAlgoShortestDist.
This merge algo is looking for short tracks from the start of a shower that are overlapping a blob th...
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
Class def header for a class CPAlgoIgnoreTracks.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Class def header for a class CBAlgoPolyOverlap.
Class def header for a class CBAlgoCenterOfMass.
void produce(art::Event &evt) override
Namespace collecting geometry-related classes utilities.
Class def header for a class CBAlgoPolyContain.
FuzzyClusterMerger(fhicl::ParameterSet const &p)
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception