1 #ifndef __JACOUSTICS__JFREMANTLE_T__
2 #define __JACOUSTICS__JFREMANTLE_T__
23 namespace JACOUSTICS {}
24 namespace JPP {
using namespace JACOUSTICS; }
26 namespace JACOUSTICS {
51 const size_t backlog = std::numeric_limits<size_t>::max()) :
60 for (
size_t i = 0;
i <
ns; ++
i) {
62 thread worker([
this, geometry, velocity, parameters]() {
66 for (
JGlobalfit katoomba(geometry, velocity, parameters); ; ) {
69 unique_lock<mutex> lock(
in);
71 cv.wait(lock, [
this]() {
return stop || !
input.empty(); });
77 data.swap(
input.front());
84 const auto result = katoomba(data.begin(), data.end());
86 if (
result.chi2 /
result.ndf <= katoomba.parameters.chi2perNDF) {
89 unique_lock<mutex> lock(
out);
110 workers.emplace_back(std::move(worker));
123 unique_lock<mutex> lock(
in);
146 unique_lock<mutex> lock(
in);
151 throw runtime_error(
"The thread pool has been stopped.");
154 input.emplace(std::move(data));
170 std::condition_variable
cv;
171 std::condition_variable
cw;
Fit function of acoustic model.
JLANG::JObjectOutput< JSuperEvt > output_type
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
std::condition_variable cv
void enqueue(input_type &data)
Queue data.
Global fit of prameterised detector geometry to acoustics data.
static std::string oid
detector identifier
JFremantle(const JGeometry &geometry, const JSoundVelocity &velocity, const JFitParameters ¶meters, const size_t ns, const size_t backlog=std::numeric_limits< size_t >::max())
Constructor.
std::queue< input_type > input
Implementation for depth dependend velocity of sound.
static JQuantile Q
chi2/NDF
Auxiliary data structure for average.
std::vector< JHit > input_type
static output_type * output
optional output
void put(const double x)
Put value.
Thread pool for global fits.
Template interface of object output for single data type.
virtual bool put(const T &object)=0
Object output.
static bool squash
squash transmissions in output
Auxiliary data structure to convert model to super event.
std::vector< std::thread > workers
std::condition_variable cw