86 public JClonable< JMatch<hit_type>, JMatch3D>
116 const double dt = fabs(first.
getToA() - second.
getToA());
155 if (first .empty())
return false;
156 if (second.empty())
return false;
182 int main(
int argc,
char **argv)
192 JLimit_t& numberOfEvents = inputFile.getLimit();
194 int factoryLimit = 10000;
195 double TMaxExtra_s = 100.0e-6;
213 JParser<> zap(
"Main program to trigger acoustic data.");
215 zap[
'f'] =
make_field(inputFile,
"output of JConvertDB -q toashort");
216 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
217 zap[
'@'] =
make_field(properties,
"trigger parameters");
220 zap[
'a'] =
make_field(detectorFile,
"detector file");
222 zap[
'p'] =
make_field(precision,
"precision time-of-arrival") = 1.0e-6;
228 catch(
const exception &error) {
229 FATAL(error.what() << endl);
252 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
256 if (i->getFloor() == 0) {
263 catch(
const exception&) {
268 receivers[i->getID()] =
JReceiver(i->getID(),
269 i->getPosition() + pos,
270 i->getT0() * 1.0e-9);
295 JToA* parameters = inputFile.
next();
298 FATAL(
"Invalid detector identifier " << parameters->
DETID <<
" != " <<
detector.getID() << endl);
301 if (receivers.
has(parameters->
DOMID)) {
305 double toa = parameters->
TOA_S();
316 catch(
const exception&) {}
331 buffer_type::iterator __end = unique(receiver->second.begin(), receiver->second.end(),
JTransmission::equals(precision));
335 for (buffer_type::const_iterator p = receiver->second.begin(); p != __end; ++p) {
336 if (p->getQ() >= parameters.
Q * (parameters.
Q <= 1.0 ? p->getW() : 1.0)) {
347 for (buffer_type::const_iterator p =
data.begin(); p !=
data.end(); ++p) {
350 STATUS(
"processed[" << i->first <<
"]: " <<
FIXED(5,1) << (
double) (100 *
distance(
data.cbegin(),p)) / (
double)
data.size() <<
"%" <<
'\r' << flush);
DEBUG(endl);
353 buffer_type::const_iterator q = p;
355 while (++q !=
data.end() && q->getToA() - p->getToA() <= parameters.
TMax_s) {}
361 buffer_type::iterator
root = buffer.begin();
362 buffer_type::iterator __p = buffer.begin();
363 buffer_type::iterator __q = buffer.begin();
370 for (buffer_type::const_iterator i = p; ++i != q; ) {
391 if (out[0].empty()) {
395 }
else if (
overlap(out[0],out[1])) {
397 out[0].
merge(out[1]);
410 if (!out[0].empty()) {
415 STATUS(
"triggers[" << i->first <<
"]: " << setw(7) << out[0].getCounter() << endl);
int main(int argc, char **argv)
ROOT TTree parameter settings.
Acoustic trigger parameters.
Algorithms for hit clustering and sorting.
Data structure for detector geometry and calibration.
Recording of objects on file according a format that follows from the file name extension.
General purpose class for hash map of unique elements.
Data structure for hydrophone.
Base class for match operations for cluster and hit-preprocessing methods.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Auxiliary class to define a range between two values.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
3D match criterion for acoustic signals.
JMatch3D(const JSoundVelocity &V, const double Tmax_s=0.0)
Constructor.
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
int getString() const
Get string number.
Utility class to parse parameter values.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
double getZ() const
Get z position.
int getID() const
Get identifier.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
Function object interface for hit matching.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
Auxiliary classes and methods for acoustic position calibration.
static JEmitterID getEmitterID
Function object for emitter identification.
JVector3D getPosition(T __begin, T __end, const JPredicate< JTypename_t, JComparator_t > &predicate)
Get position from element in data which corresponds to given predicate.
JContainer< std::vector< JHydrophone > > hydrophones_container
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
static const struct JTRIGGER::clusterize clusterize
Auxiliary data structure for floating point format specification.
int getCounter() const
Get counter.
Match of two events considering overlap in time.
JRange< double > time_range
Type definition of time range.
bool operator()(const JEvent &first, const JEvent &second) const
Match criterion.
JEventOverlap(const double Tmax_s=0.0)
Constructor.
void merge(const JEvent &event)
Merge event.
double getT(const double t_s) const
Get corrected time.
Implementation for depth dependend velocity of sound.
JSoundVelocity & set(const double z0)
Set depth.
virtual double getTime(const double D_m, const double z1, const double z2) const override
Get propagation time of sound.
Time-of-arrival data from acoustic piezo sensor or hydrophone.
uint32_t DOMID
DAQ run number.
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
int32_t WAVEFORMID
DOM unique identifeir.
int32_t RUN
detector identifier
double TOA_S() const
Time of Arrival, expressed in seconds relative to Unix epoch (1 January 1970 00:00:00 UTC)
Auxiliary class to compare transmissions.
Auxiliary class to compare transmissions.
double getToA() const
Get calibrated time of arrival.
double Q
minimal quality if larger than one; else minimal normalised quality
double TMax_s
maximal difference between times of emission [s]
int numberOfHits
minimal number of hits to trigger event
hit_type()
Default constructor.
hit_type(const JPosition3D &position, const JTransmission &transmission)
Constructor.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
Template class for object cloning.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.