205 JParser<> zap(
"Main program to trigger acoustic data.");
207 zap[
'f'] =
make_field(inputFile,
"output of JConvertDB -q toashort");
208 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
212 zap[
'a'] =
make_field(detectorFile,
"detector file");
214 zap[
'p'] =
make_field(precision,
"precision time-of-arrival") = 1.0e-6;
221 catch(
const exception &error) {
222 FATAL(error.what() << endl);
239 const double TMaxExtra_s = 1.0e-3;
251 if (
i->getFloor() == 0) {
258 catch(
const exception&) {
264 i->getPosition() + pos,
265 i->getT0() * 1.0e-9);
287 while (inputFile.hasNext()) {
289 if (inputFile.getCounter()%1000 == 0) {
290 STATUS(
"counter: " << setw(8) << inputFile.getCounter() <<
'\r' << flush);
DEBUG(endl);
296 oid = parameters->
DETID;
299 if (oid != parameters->
DETID) {
300 FATAL(
"Invalid detector identifier " << parameters->
DETID <<
" != " << oid << endl);
303 if (waveforms.empty() || waveforms.count(parameters->
EMITTERID)) {
305 if (receivers.has(parameters->
DOMID)) {
327 buffer_type& buffer = receiver->second;
341 buffer_type& f2 = receiver->second;
342 double Qmin = parameters.Q;
344 if (parameters.Q > 0.0 && parameters.Q < 1.0) {
348 Qmin = Q1.getQuantile(parameters.Q);
353 copy(f2.begin(), __end, back_inserter(
data));
362 int number_of_events = 0;
364 for (buffer_type::const_iterator p =
data.begin(); p !=
data.end(); ++p) {
370 buffer_type::const_iterator q = p;
372 while (++q !=
data.end() && q->getToA() - p->getToA() <= parameters.TMax_s) {}
374 if (
distance(p,q) >= parameters.numberOfHits) {
378 buffer_type::iterator
root = buffer.begin();
379 buffer_type::iterator __p = buffer.begin();
380 buffer_type::iterator __q = buffer.begin();
387 for (buffer_type::const_iterator
i = p; ++
i != q; ) {
394 if (
distance(root,__q) >= parameters.numberOfHits) {
396 __q =
clusterize(__p, __q, match, parameters.numberOfHits - 1);
398 if (
distance(root,__q) >= parameters.numberOfHits) {
399 out[1] =
JEvent(oid, ++number_of_events,
ID, root, __q);
405 out[1] =
JEvent(oid, ++number_of_events,
ID, p, q);
410 if (!out[0].empty()) {
418 out[0].merge(out[1]);
425 if (!out[0].empty()) {
430 STATUS(
"triggers: " << setw(7) << number_of_events << endl);
Utility class to parse command line options.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
std::string DETID
constraint
*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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.
static const int FACTORY_LIMIT
Bit indicating max nhits reached in trigger.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
Auxiliary class for defining the range of iterations of objects.
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
JContainer< std::vector< JHydrophone > > hydrophones_container
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
int getID() const
Get identifier.
JPosition3D getPosition(const Vec &pos)
Get position.
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR $JPP_DATA km3net_reference detx set_variable NUMBER_OF_STRINGS set_variable ID if do_usage *then usage $script[detector file[identifier]] fi case set_variable ID
const JPosition3D & getPosition() const
Get position.
double getQ(const double D_m, const double f_kHz, const double d_m)
Get relative quality for given frequency at given distance.
Implementation for depth dependend velocity of sound.
double getT(const double t_s) const
Get corrected time.
Auxiliary data structure for average.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
Auxiliary class to compare transmissions.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
bool equals(const JFirst_t &first, const JSecond_t &second, const double precision=std::numeric_limits< double >::min())
Check equality.
do set_variable DETECTOR_TXT $WORKDIR detector
Match of two events considering overlap in time.
int EMITTERID
waveform identifier
static struct JTRIGGER::clusterize clusterize
do JPlot2D f $WORKDIR canberra[${EMITTER}] root
#define DEBUG(A)
Message macros.