6 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 7 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 10 #include "cetlib/pow.h" 18 : epsilon(pset.
get<float>(
"epsilon"))
19 , minpts(pset.
get<unsigned int>(
"minpts"))
20 , badchannelweight(pset.
get<double>(
"badchannelweight"))
21 , neighbors(pset.
get<unsigned int>(
"neighbors"))
32 lariov::ChannelStatusProvider
const& channelStatus =
39 unsigned int nbadchs = 0;
41 if (wid1 == wid2)
continue;
49 std::cout <<
"Done building bad channel map." << std::endl;
53 for (
auto& spt : sps) {
59 auto&
hits = hitFromSp.at(spt.key());
71 perror(
"Failed to allocate node.");
86 if (en->
head ==
nullptr) {
102 perror(
"Failed to allocate epsilon neighbours.");
105 for (
unsigned int i = 0; i <
points.size(); ++i) {
106 if (i == index)
continue;
135 unsigned int i, cluster_id = 0;
136 for (i = 0; i <
points.size(); ++i) {
147 if (seeds ==
nullptr)
return FAILURE;
152 points[index].cluster_id = cluster_id;
173 unsigned int cluster_id)
176 if (spread ==
nullptr)
return FAILURE;
201 Double32_t
const* a_xyz = a->
sp->
XYZ();
202 Double32_t
const* b_xyz = b->
sp->
XYZ();
204 float const dx = a_xyz[0] - b_xyz[0];
205 float const dy = a_xyz[1] - b_xyz[1];
206 float const dz = a_xyz[2] - b_xyz[2];
207 float const dist = cet::sum_of_squares(dx, dy, dz) - cet::square(nbadchannels *
badchannelweight);
209 return std::max(dist, 0.
f);
std::map< geo::WireID, int > badchannelmap
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)
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void init(const std::vector< art::Ptr< recob::SpacePoint >> &sps, art::FindManyP< recob::Hit > &hitFromSp)
Interface for a class providing readout channel mapping to geometry.
float dist(point_t *a, point_t *b) const
virtual raw::ChannelID_t PlaneWireToChannel(WireID const &wireID) const =0
Returns the channel ID a wire is connected to.
int expand(unsigned int index, unsigned int cluster_id)
const Double32_t * XYZ() const
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
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.
range_type< T > Iterate() const
std::vector< point_t > points
int spread(unsigned int index, epsilon_neighbours_t *seeds, unsigned int cluster_id)
unsigned int nbadchannels
void destroy_epsilon_neighbours(epsilon_neighbours_t *en)