12 #include "cetlib/cpu_timer.h" 86 std::unique_ptr<lar_cluster3d::IClusterParametersBuilder>
107 std::vector<double>
const wirePitchVec{
108 wireReadoutGeom.Plane(
geo::PlaneID{tpcid, 0}).WirePitch(),
109 wireReadoutGeom.Plane(
geo::PlaneID{tpcid, 1}).WirePitch(),
110 wireReadoutGeom.Plane(
geo::PlaneID{tpcid, 2}).WirePitch()};
112 float maxBestDist = 1.99 * *std::max_element(wirePitchVec.begin(), wirePitchVec.end());
114 kdTreeParams.
put_or_replace<
float>(
"RefLeafBestDist", maxBestDist);
126 cet::cpu_timer theClockDBScan;
142 for (
const auto&
hit : hitPairList) {
151 float bestDistance(std::numeric_limits<float>::max());
173 theClockDBScan.stop();
179 cet::cpu_timer theClockBuildClusters;
187 theClockBuildClusters.stop();
192 mf::LogDebug(
"Cluster3D") <<
">>>>> DBScan done, found " << clusterParametersList.size()
193 <<
" clusters" << std::endl;
203 cet::cpu_timer theClockDBScan;
219 for (
const auto&
hit : hitPairList) {
228 float bestDistance(std::numeric_limits<float>::max());
250 theClockDBScan.stop();
256 cet::cpu_timer theClockBuildClusters;
264 theClockBuildClusters.stop();
269 mf::LogDebug(
"Cluster3D") <<
">>>>> DBScan done, found " << clusterParametersList.size()
270 <<
" clusters" << std::endl;
281 while (!candPairList.empty()) {
292 float bestDistance(std::numeric_limits<float>::max());
297 if (neighborCandPairList.size() >= minPts) {
298 std::copy(neighborCandPairList.begin(),
299 neighborCandPairList.end(),
300 std::back_inserter(candPairList));
310 candPairList.pop_front();
void expandCluster(const kdTree::KdTreeNode &, kdTree::CandPairList &, reco::ClusterParameters &, size_t) const
the main routine for DBScan
std::list< reco::ClusterHit3D > HitPairList
bool m_enableMonitoring
Data members to follow.
The data type to uniquely identify a Plane.
std::list< KdTreeNode > KdTreeNodeList
Implements a kdTree for use in clustering.
size_t FindNearestNeighbors(const reco::ClusterHit3D *, const KdTreeNode &, CandPairList &, float &) const
Labelled "noise" by a clustering algorithm.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Cluster finding and building.
IClusterAlg interface class definiton.
unsigned int getStatusBits() const
T get(std::string const &key) const
TimeValues
enumerate the possible values for time checking if monitoring timing
std::list< const reco::ClusterHit3D * > HitPairListPtr
This provides an art tool interface definition for 3D Cluster algorithms.
The data type to uniquely identify a TPC.
std::unique_ptr< lar_cluster3d::IClusterParametersBuilder > m_clusterBuilder
Common cluster builder tool.
Detector simulation of raw signals on wires.
std::list< CandPair > CandPairList
void Cluster3DHits(reco::HitPairList &hitPairList, reco::ClusterParametersList &clusterParametersList) const override
Given a set of recob hits, run DBscan to form 3D clusters.
Encapsulate the construction of a single detector plane .
DBScanAlg(fhicl::ParameterSet const &pset)
Constructor.
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
DBScanAlg class definiton.
float getTimeToExecute(IClusterAlg::TimeValues index) const override
If monitoring, recover the time to execute a particular function.
float getTimeToExecute() const
"visited" by a clustering algorithm
std::vector< float > m_timeVector
void put_or_replace(std::string const &key)
KdTreeNode & BuildKdTree(Hit3DVec::iterator, Hit3DVec::iterator, KdTreeNodeList &, int depth=0) const
Given an input set of ClusterHit3D objects, build a kd tree structure.
std::list< ClusterParameters > ClusterParametersList
void addHit3D(const reco::ClusterHit3D *hit3D)
void setStatusBit(unsigned bits) const