40 const int nlayers = raypairs.size();
47 const auto& pitches = coords.pitch_dirs();
48 const auto& centers = coords.centers();
49 const auto& pitch_mags = coords.pitch_mags();
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";
const double pitch_magnitude
def activity(output, slices, slice_line, cluster_tap_file)
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::vector< Point > random_points(int ndepos=1000, int neles=10)
QTextStream & endl(QTextStream &s)