24 std::normal_distribution<double> spread(0.0,
gaussian);
25 for (
int idepo=0;idepo<
ndepos;++idepo) {
27 for (
int iele=0; iele<
neles; ++iele) {
28 Point delta(0, spread(generator), spread(generator));
29 points.push_back(cp+delta);
40 const int nlayers = raypairs.size();
48 const auto& centers = coords.
centers();
51 em(
"make coordinates");
53 std::vector< std::vector<Activity::value_t> > measures(nlayers);
54 for (
size_t ipt=0; ipt<points.size(); ++ipt ) {
55 const auto&
p = points[ipt];
56 for (
int ilayer = 0; ilayer<nlayers; ++ilayer) {
57 const auto& pit = pitches[ilayer];
58 const auto& cen = centers[ilayer];
59 const auto rel =
p-cen;
60 const int pit_ind = pit.dot(rel)/pitch_mags[ilayer];
61 auto&
m = measures[ilayer];
63 std::cerr <<
"Generated negative pitch index: " << pit_ind
64 <<
" on L" << ilayer <<
" p=" <<
p 68 if ((
int)
m.size() <= pit_ind) {
69 m.resize(pit_ind+1, 0.0);
75 em(
"generated activity");
78 for (
int ilayer = 0; ilayer<nlayers; ++ilayer) {
79 auto&
m = measures[ilayer];
80 std::cerr << ilayer <<
": " <<
m.size() <<
std::endl;
86 em(
"filled activity");
89 for (
int i=0; i<100; ++i) {
92 em(
"made clusers 100 times");
93 std::cerr << blobs.size() <<
" blobs\n";
D3Vector< double > Point
A 3D Cartesian point in double precision.
const vector_array1d_t & pitch_dirs() const
const double pitch_magnitude
def activity(output, slices, slice_line, cluster_tap_file)
const vector_array1d_t & centers() const
const std::vector< double > & pitch_mags() const
static int max(int a, int b)
std::vector< Blob > blobs_t
blobs_t make_blobs(const Coordinates &coords, const activities_t &activities)
std::vector< Activity > activities_t
ray_pair_vector_t make_raypairs(double width=100, double height=100, double pitch_mag=3, double angle=60.0 *M_PI/180.0)
std::string summary() const
Return summary up to now.
std::vector< Point > random_points(int ndepos=1000, int neles=10)
QTextStream & endl(QTextStream &s)