7 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 8 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 11 #include "cetlib/pow.h" 19 : epsilon(pset.
get<float>(
"epsilon"))
20 , minpts(pset.
get<unsigned int>(
"minpts"))
21 , badchannelweight(pset.
get<double>(
"badchannelweight"))
22 , neighbors(pset.
get<unsigned int>(
"neighbors"))
34 lariov::ChannelStatusProvider
const& channelStatus =
40 unsigned int nbadchs = 0;
42 if (wid1 == wid2)
continue;
50 std::cout <<
"Done building bad channel map." << std::endl;
54 for (
auto& spt : sps) {
60 auto&
hits = hitFromSp.at(spt.key());
72 perror(
"Failed to allocate node.");
87 if (en->
head == NULL) {
103 perror(
"Failed to allocate epsilon neighbours.");
106 for (
unsigned int i = 0; i <
points.size(); ++i) {
107 if (i == index)
continue;
136 unsigned int i, cluster_id = 0;
137 for (i = 0; i <
points.size(); ++i) {
148 if (seeds == NULL)
return FAILURE;
153 points[index].cluster_id = cluster_id;
174 unsigned int cluster_id)
177 if (spread == NULL)
return FAILURE;
202 Double32_t
const* a_xyz = a->
sp->
XYZ();
203 Double32_t
const* b_xyz = b->
sp->
XYZ();
205 float const dx = a_xyz[0] - b_xyz[0];
206 float const dy = a_xyz[1] - b_xyz[1];
207 float const dz = a_xyz[2] - b_xyz[2];
208 float const dist = cet::sum_of_squares(dx, dy, dz) - cet::square(nbadchannels *
badchannelweight);
210 return std::max(dist, 0.
f);
std::map< geo::WireID, int > badchannelmap
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
Functions to help with numbers.
art::Ptr< recob::SpacePoint > sp
Declaration of signal hit object.
The data type to uniquely identify a Plane.
epsilon_neighbours_t * get_epsilon_neighbours(unsigned int index)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Access the description of detector geometry.
void init(const std::vector< art::Ptr< recob::SpacePoint >> &sps, art::FindManyP< recob::Hit > &hitFromSp)
float dist(point_t *a, point_t *b) const
int expand(unsigned int index, unsigned int cluster_id)
const Double32_t * XYZ() const
Description of geometry of one entire detector.
Detector simulation of raw signals on wires.
node_t * create_node(unsigned int index)
int append_at_end(unsigned int index, epsilon_neighbours_t *en)
std::vector< TrajPoint > seeds
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
DBScan3DAlg(fhicl::ParameterSet const &pset)
constexpr auto absDiff(A const &a, B const &b)
Returns the absolute value of the difference between two values.
std::vector< point_t > points
int spread(unsigned int index, epsilon_neighbours_t *seeds, unsigned int cluster_id)
unsigned int nbadchannels
art framework interface to geometry description
void destroy_epsilon_neighbours(epsilon_neighbours_t *en)