95 public JClonable< JMatch<hit_type>, JMatch3D>
142 public JClonable< JMatch<hit_type>, JMatch1D>
221 for (
double x = X.getLowerLimit(); x < X.getUpperLimit() + 0.5*X.getBinWidth(); x += X.getBinWidth()) {
222 for (
double y = Y.getLowerLimit(); y < Y.getUpperLimit() + 0.5*Y.getBinWidth(); y += Y.getBinWidth()) {
223 for (
double z = Z.getLowerLimit(); z < Z.getUpperLimit() + 0.5*Z.getBinWidth(); z += Z.getBinWidth()) {
259 const double t0 =
root.getToA() *
V -
u->getLength();
263 for (T p = __begin; p != __end; ++p) {
267 if (fabs(t1 - t0) <=
Dmax_m) {
300 out <<
"event: " <<
setw(6) <<
event.getCounter() <<
' ' <<
FIXED(12,2) << 0.5 * (
event.begin()->getToA() +
event.rbegin()->getToA()) <<
" [s] " <<
setw(4) <<
event.size() <<
endl;
323 JLimit_t& numberOfEvents = inputFile.getLimit();
326 int factoryLimit = 100000;
327 int numberOfHits = 0;
330 double DMax_m = 500.0;
331 double ZMax_m = 200.0;
334 double gridAngle_deg = 10.0;
360 JParser<> zap(
"Main program to trigger acoustic data.");
376 catch(
const exception &error) {
395 if (parameters.TMax_s < parameters.DMax_m /
v0) {
397 parameters.TMax_s = parameters.DMax_m /
v0;
399 NOTICE(
"Set maximal time [s] " <<
FIXED(7,3) << parameters.TMax_s <<
endl);
402 const JMatch3D match3D(
v0, parameters.DMax_m, parameters.TMaxExtra_s);
403 const JMatch1D match1D(
v0, parameters.DMax_m, parameters.ZMax_m, parameters.TMaxExtra_s);
407 const JCheck check(X, Y, Z,
v0, parameters.TMaxVertex_s, parameters.numberOfHits);
419 if (
module->getFloor() != 0) {
421 receivers[
module->getID()] = JReceiver(module->getID(),
422 module->getPosition() + getPiezoPosition() - center,
423 module->getT0() * 1.0e-9);
427 TH1D h0(
"h0",
NULL, 21, -0.5, 20.5);
431 for (
size_t i = 2; i <= 5; ++i) {
449 while (inputFile.hasNext()) {
451 if (inputFile.getCounter()%1000 == 0) {
455 const JToA* p = inputFile.next();
467 const double toa = p->
TOA_S();
489 const chrono::steady_clock::time_point t0 = chrono::steady_clock::now();
491 size_t trigger_counter = 0;
493 for (buffer_type::const_iterator p = data.begin(), q = p; p != data.end(); ++p) {
495 if (
distance(data.cbegin(),p)%10000 == 0) {
498 const chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
501 <<
FIXED(5,1) << (
double) (100 *
distance(data.cbegin(),p)) / (
double) data.size() <<
"%" <<
' '
502 <<
FIXED(8,1) << p->getToA() <<
" [s]" <<
' '
503 <<
setw(6) << chrono::duration_cast<chrono::seconds>(t1 - t0).count() <<
" [s]" <<
' '
504 <<
setw(6) << trigger_counter <<
endl);
509 while (q != data.end() && q->getToA() - p->getToA() <= parameters.TMax_s) { ++q; }
511 if (
distance(p,q) >= parameters.numberOfHits) {
515 if (
distance(p,q) < parameters.factoryLimit) {
519 buffer_type::iterator
root = buffer.begin();
520 buffer_type::iterator __p = buffer.begin();
521 buffer_type::iterator
__q = buffer.begin();
528 for (buffer_type::const_iterator i = p; ++i != q; ) {
529 if (match3D(*
root,*i)) {
548 const double W = 1.0 / (
double) rotator.size();
552 for (buffer_type::iterator i =
root; i !=
__q; ++i) {
574 trigger_counter += 1;
590 trigger_counter += 1;
595 if (!out[1].empty()) {
597 if (out[0].empty()) {
601 }
else if (
overlap(out[0],out[1])) {
603 out[0].
merge(out[1]);
619 if (!out[0].empty()) {
ROOT TTree parameter settings.
Algorithms for hit clustering and sorting.
int main(int argc, char **argv)
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.
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.
#define MAKE_CSTRING(A)
Make C-string.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
1D match criterion for acoustic signals.
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
JMatch1D(const double V, const double Rmax_m, const double Zmax_m, const double Tmax_s)
Constructor.
3D match criterion for acoustic signals.
const JAbstractSoundVelocity & V
JMatch3D(const double V, const double Dmax_m, const double Tmax_s)
Constructor.
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
Utility class to parse parameter values.
Data structure for angles in three dimensions.
Direction set covering (part of) solid angle.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
Data structure for vector in three dimensions.
double getDistance(const JVector3D &pos) const
Get distance to point.
double getZ() const
Get z position.
Template definition of a multi-dimensional oscillation probability interpolation table.
Function object interface for hit matching.
Auxiliary classes and methods for acoustic position calibration.
void print(std::ostream &out, const JEvent &event)
Print event.
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
std::ostream & print(std::ostream &out, const JTestSummary &summary, T __begin, T __end, const bool useColors=true, const JFormat_t &formatting=JFormat_t(18, 3, std::ios::fixed))
Print test summary.
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.
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
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
JHitIterator_t clusterize(JHitIterator_t __begin, JHitIterator_t __end, const JMatch_t &match, const int Nmin=1)
Partition data according given binary match operator.
Auxiliary data structure for floating point format specification.
Auxiliary data structure for final check on event.
JCheck(const JHistogram_t &X, const JHistogram_t &Y, const JHistogram_t &Z, const double V, const double Tmax_s, const int Nmin)
Constructor.
bool operator()(const hit_type &root, T __begin, T __end) const
Check event.
std::vector< JVector3D > U
bool is_valid() const
Check validity.
int getCounter() const
Get counter.
Match of two events considering overlap in time and position.
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.
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)
double getToA() const
Get calibrated time of arrival.
Transmission with position.
hit_type()
Default constructor.
hit_type(const JPosition3D &position, const JTransmission &transmission)
Constructor.
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.
static counter_type max()
Get maximum counter value.