326 int factoryLimit = 100000;
330 double DMax_m = 500.0;
331 double ZMax_m = 200.0;
332 double TMaxExtra_s = 100.0e-6;
333 double TMaxVertex_s = 1.0e-2;
334 double gridAngle_deg = 10.0;
360 JParser<> zap(
"Main program to trigger acoustic data.");
363 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
370 zap[
'a'] =
make_field(detectorFile,
"detector file");
376 catch(
const exception &error) {
377 FATAL(error.what() << endl);
393 const double v0 =
V(cylinder.getZmax());
415 const JPosition3D center(cylinder.getX(), cylinder.getY(), 0.5 * (cylinder.getZmin() + cylinder.getZmax()));
417 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
419 if (module->getFloor() != 0) {
421 receivers[module->getID()] =
JReceiver(module->getID(),
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) {
432 M1[
i] =
new TH1D(
MAKE_CSTRING(
"M[" <<
i <<
"]"), NULL, 1001, -0.5, 1000.5);
449 while (inputFile.hasNext()) {
451 if (inputFile.getCounter()%1000 == 0) {
452 STATUS(
"counter: " << setw(8) << inputFile.getCounter() <<
'\r' << flush);
DEBUG(endl);
455 const JToA* p = inputFile.next();
458 FATAL(
"Invalid detector identifier " << p->
DETID <<
" != " <<
detector.getID() << endl);
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) {
498 const chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
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; }
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) {
556 buffer_type::iterator __z = partition(__p, __q,
JBind2nd(match1D,*root));
572 if (!check.is_valid() || check(*root, __p, __z)) {
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()) {
629 for (TH1D* h1 : M1) {
Data structure for angles in three dimensions.
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Match of two events considering overlap in time.
Utility class to parse parameter values.
then usage else fatal Wrong number of arguments fi JCookie sh eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O CAN eval JPrintDetector a $DETECTOR O SUMMARY source JAcousticsToolkit sh expand_array RUNS for KEY in sound_velocity waveform
then usage $script< input file >[option] nPossible options count
int32_t WAVEFORMID
DOM unique identifeir.
*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
#define MAKE_CSTRING(A)
Make C-string.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Time-of-arrival data from acoustic piezo sensor or hydrophone.
Direction set covering (part of) solid angle.
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
Auxiliary data structure for floating point format specification.
3D match criterion for acoustic signals.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
do JPlot2D f $WORKDIR canberra[${EMITTER}\] root
std::vector< JHitW0 > buffer_type
hits
Auxiliary data structure for final check on event.
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.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int32_t RUN
detector identifier
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
static const double PI
Mathematical constants.
const JPosition3D & getPosition() const
Get position.
double TOA_S() const
Time of Arrival, expressed in seconds relative to Unix epoch (1 January 1970 00:00:00 UTC) ...
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
Implementation for depth dependend velocity of sound.
double getT(const double t_s) const
Get corrected time.
then JCookie sh JDataQuality D $DETECTOR_ID R
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.
JPosition3D getPiezoPosition()
Get relative position of piezo in optical module.
no fit printf nominal n $STRING awk v X
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
uint32_t DOMID
DAQ run number.
do set_variable DETECTOR_TXT $WORKDIR detector
static struct JTRIGGER::clusterize clusterize
#define DEBUG(A)
Message macros.