Constructor.
55 :
58 {
59 using namespace std;
61
63
64 for (size_t i = 0; i < ns; ++i) {
65
66 thread worker([this, geometry, emitters, velocity, parameters]() {
67
68 vector<JHit> data;
69
71
72 katoomba.estimator.reset(
getMEstimator(parameters.mestimator));
73
74 {
75 unique_lock<mutex> lock(
in);
76
77 cv.wait(lock, [
this]() {
return stop || this->
input.hasNext(); });
78
80 return;
81 }
82
84
85 data.clear();
86
87 for (JSuperEvt::rx_type::const_iterator hit = evt->
rx.begin(); hit != evt->
rx.end(); ++hit) {
88
89 data.push_back(
JHit(emitters[hit->id],
90 hit->counter,
91 JLocation(hit->string, hit->floor),
92 hit->toa,
93 parameters.sigma_s,
94 hit->weight));
95 }
96
98 }
99
100 const double chi2 = katoomba (data.begin(), data.end()) / katoomba.estimator->getRho(1.0);
101 const double ndf =
getWeight(data.begin(), data.end()) - katoomba.value.getN();
102
103 {
104 unique_lock<mutex> lock(
out);
105
107 }
108 }
109 });
110
111 workers.emplace_back(std::move(worker));
112 }
113 }
std::condition_variable cv
static JMATH::JQuantile_t Q
chi2/NDF
std::vector< std::thread > workers
double getWeight(T __begin, T __end)
Get total weight of data points.
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Template definition of fit function of acoustic model.
Acoustic super event fit.
Auxiliary data structure to convert event to model.