Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JSydney.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4#include <vector>
5#include <set>
6#include <algorithm>
7#include <limits>
8#include <sys/stat.h>
9
10#include <type_traits>
11#include <functional>
12#include <future>
13#include <mutex>
14#include <thread>
15#include <vector>
16#include <queue>
17
18#include "TROOT.h"
19#include "TFile.h"
20
22
23#include "JLang/JPredicate.hh"
24#include "JLang/JComparator.hh"
25#include "JLang/JComparison.hh"
29
30#include "JSystem/JStat.hh"
31
34#include "JDetector/JTripod.hh"
36#include "JDetector/JModule.hh"
39
40#include "JFit/JGradient.hh"
41
42#include "JTools/JHashMap.hh"
43#include "JTools/JRange.hh"
44
45#include "JMath/JQuantile_t.hh"
46
48
52#include "JAcoustics/JHit.hh"
55#include "JAcoustics/JEvent.hh"
62
63#include "Jeep/JTimer.hh"
64#include "Jeep/JeepToolkit.hh"
65#include "Jeep/JContainer.hh"
66#include "Jeep/JParser.hh"
67#include "Jeep/JMessage.hh"
68
69
70namespace JACOUSTICS {
71
73 using JEEP::JContainer;
75
76 using namespace JDETECTOR;
77
78
82
83
84 /**
85 * Script commands.
86 */
87 static const char skip_t = '#'; //!< skip line
88 static const std::string initialise_t = "initialise"; //!< initialise
89 static const std::string fix_t = "fix"; //!< fix objects
90 static const std::string string_t = "string"; //!< string
91 static const std::string tripod_t = "tripod"; //!< tripod
92 static const std::string stage_t = "stage"; //!< fit stage
93
94
95 /**
96 * Auxiliary data structure for handling of file names.
97 */
98 struct JFilenames {
99 /**
100 * Strip leading and trailing white spaces.
101 *
102 * \return file names
103 */
113
114 std::string detector; //!< detector
115 std::string tripod; //!< tripod
116 std::string hydrophone; //!< hydrophone
117 std::string transmitter; //!< transmitter
118 };
119
120
121 /**
122 * Auxiliary data structure for setup of complete system.
123 */
124 struct JSetup {
125 JDetector detector; //!< detector
127 struct :
129 {
130 /**
131 * Check if there is a hydrophone on given string.
132 *
133 * \param id string identifier
134 * \return true if hydrophone present; else false
135 */
136 bool hasString(const int id) const
137 {
138 using namespace std;
139
140 return (find_if(this->begin(), this->end(), make_predicate(&JHydrophone::getString, id)) != this->end());
141 }
142 } hydrophones; //!< hydrophones
144 };
145
146
147 /**
148 * Main class for pre-calibration using acoustics data.
149 */
150 struct JSydney {
151
152 static constexpr double RADIUS_M = 1.0; //!< maximal horizontal distance between T-bar and emitter/hydrophone
153
154 /**
155 * List of object identifiers.
156 */
157 struct ids_t :
158 public std::set<int>
159 {
160 /**
161 * Default constructor.
162 */
164 {}
165
166
167 /**
168 * Copy constructor.
169 *
170 * \param buffer list of identifiers
171 */
172 ids_t(const std::vector<int>& buffer) :
173 std::set<int>(buffer.begin(), buffer.end())
174 {}
175
176
177 /**
178 * Difference constructor.
179 * Make list of all object identifiers in A that are not in B.
180 *
181 * \param A list of identifiers
182 * \param B list of identifiers
183 */
184 ids_t(const ids_t& A,
185 const ids_t& B)
186 {
187 std::set_difference(A.begin(), A.end(), B.begin(), B.end(), std::inserter(*this, this->begin()));
188 }
189
190
191 /**
192 * Fix.
193 * Keep list of object identifiers that are not in B.
194 *
195 * \param B list of identifiers
196 */
197 void fix(const ids_t& B)
198 {
199 ids_t A;
200
201 this->swap(A);
202
203 std::set_difference(A.begin(), A.end(), B.begin(), B.end(), std::inserter(*this, this->begin()));
204 }
205
206
207 /**
208 * Read identifiers from input stream
209 *
210 * \param in input stream
211 * \param object identifiers
212 * \return input stream
213 */
214 friend inline std::istream& operator>>(std::istream& in, ids_t& object)
215 {
216 for (int id; in >> id; ) {
217 object.insert(id);
218 }
219
220 if (!in.bad()) {
221 in.clear();
222 }
223
224 return in;
225 }
226
227
228 /**
229 * Write identifiers to output stream
230 *
231 * \param out output stream
232 * \param object identifiers
233 * \return output stream
234 */
235 friend inline std::ostream& operator<<(std::ostream& out, const ids_t& object)
236 {
237 for (const int id : object) {
238 out << ' ' << id;
239 }
240
241 return out;
242 }
243 };
244
245
246 /**
247 * Auxiliary data structure for group of lists of identifiers of to-be-fitted objects.
248 */
249 struct fits_t {
250 /**
251 * Default constructor.
252 */
254 {}
255
256
257 /**
258 * Initialise.
259 *
260 * \param setup setup
261 */
263 {
264 using namespace JPP;
265
266 strings = make_array(setup.detector .begin(), setup.detector .end(), &JModule ::getString);
267 tripods = make_array(setup.tripods .begin(), setup.tripods .end(), &JTripod ::getID);
268 hydrophones = make_array(setup.hydrophones .begin(), setup.hydrophones .end(), &JHydrophone ::getString);
269 transmitters = make_array(setup.transmitters.begin(), setup.transmitters.end(), &JTransmitter::getString);
270 }
271
272 ids_t strings; //!< identifiers of strings
273 ids_t tripods; //!< identifiers of tripods
274 ids_t hydrophones; //!< identifiers of strings with hydrophone
275 ids_t transmitters; //!< identifiers of strings with transmitter
276 };
277
278
279 /**
280 * Auxiliary class to edit (z) position of module.
281 */
283 public JParameter_t
284 {
285 /**
286 * Constructor.
287 *
288 * \param module module
289 */
294
295
296 /**
297 * Constructor.
298 *
299 * \param module module
300 * \param direction direction
301 */
306
307
308 /**
309 * Apply step.
310 *
311 * \param step step
312 */
313 virtual void apply(const double step) override
314 {
315 using namespace JPP;
316
317 module.add(direction * step);
318 }
319
320 private:
323 };
324
325
326 /**
327 * Auxiliary class to edit (x,y,z) position of string.
328 */
330 public JParameter_t
331 {
332 /**
333 * Constructor.
334 *
335 * The option <tt>true</tt> and <tt>false</tt> correspond to all modules and optical modules only, respectively.
336 *
337 * \param setup setup
338 * \param id string number
339 * \param direction direction
340 * \param option option
341 */
342 JStringEditor(JSetup& setup, const int id, const JVector3D& direction, const bool option) :
345 {
346 for (size_t i = 0; i != detector.size(); ++i) {
347 if (detector[i].getString() == id && (detector[i].getFloor() != 0 || option)) {
348 index.push_back(i);
349 }
350 }
351 }
352
353
354 /**
355 * Apply step.
356 *
357 * \param step step
358 */
359 virtual void apply(const double step) override
360 {
361 for (const auto i : index) {
362 detector[i].add(direction * step);
363 }
364 }
365
366 private:
370 };
371
372
373 /**
374 * Auxiliary class to edit length of Dyneema ropes.
375 */
377 public JParameter_t
378 {
379 /**
380 * Constructor.
381 *
382 * \param setup setup
383 * \param id string number
384 * \param z0 reference position
385 */
386 JDyneemaEditor(JSetup& setup, const int id, const double z0 = 0.0) :
388 z0 (z0)
389 {
390 for (size_t i = 0; i != detector.size(); ++i) {
391 if (detector[i].getString() == id && detector[i].getFloor() != 0) {
392 index.push_back(i);
393 }
394 }
395 }
396
397
398 /**
399 * Apply step.
400 *
401 * \param step step
402 */
403 virtual void apply(const double step) override
404 {
405 for (const auto i : index) {
406
407 JModule& module = detector[i];
408
409 if (step > 0.0)
410 module.set(JVector3D(module.getX(), module.getY(), z0 + (module.getZ() - z0) * (1.0 + step)));
411 else if (step < 0.0)
412 module.set(JVector3D(module.getX(), module.getY(), z0 + (module.getZ() - z0) / (1.0 - step)));
413 }
414 }
415
416 private:
418 double z0;
420 };
421
422
423 /**
424 * Auxiliary class to edit (x,y,z) position of tripod.
425 */
427 public JParameter_t
428 {
429 /**
430 * Constructor.
431 *
432 * \param setup setup
433 * \param id tripod identifier
434 * \param direction direction
435 */
436 JTripodEditor(JSetup& setup, const int id, const JVector3D& direction) :
439 {
440 using namespace std;
441 using namespace JPP;
442
443 index = distance(tripods.begin(), find_if(tripods.begin(), tripods.end(), make_predicate(&JTripod::getID, id)));
444 }
445
446
447 /**
448 * Apply step.
449 *
450 * \param step step
451 */
452 virtual void apply(const double step) override
453 {
454 tripods[index].add(direction * step);
455 }
456
457 private:
460 size_t index;
461 };
462
463
464 /**
465 * Auxiliary class to edit orientation of anchor.
466 */
468 public JParameter_t
469 {
470 /**
471 * Constructor.
472 *
473 * \param setup setup
474 * \param id string identifier
475 */
476 JAnchorEditor(JSetup& setup, const int id) :
479 {
480 using namespace std;
481 using namespace JPP;
482
483 index[0] = distance(hydrophones .begin(), find_if(hydrophones .begin(), hydrophones .end(), make_predicate(&JHydrophone ::getString, id)));
484 index[1] = distance(transmitters.begin(), find_if(transmitters.begin(), transmitters.end(), make_predicate(&JTransmitter::getString, id)));
485 }
486
487
488 /**
489 * Apply step.
490 *
491 * \param step step
492 */
493 virtual void apply(const double step) override
494 {
495 using namespace JPP;
496
497 const JRotation3Z R(step);
498
499 if (index[0] != hydrophones .size()) { hydrophones [index[0]].rotate(R); }
500 if (index[1] != transmitters.size()) { transmitters[index[1]].rotate(R); }
501 }
502
503 private:
506 size_t index[2];
507 };
508
509
510 /**
511 * Extended data structure for parameters of stage.
512 */
514 public JFitParameters
515 {
516 /**
517 * Default constuctor.
518 */
520 Nmax (std::numeric_limits<size_t>::max()),
521 Nextra (0),
522 epsilon(1.0e-4),
523 debug (3)
524 {}
525
526
527 /**
528 * Read parameters from input stream
529 *
530 * \param in input stream
531 * \param object parameters
532 * \return input stream
533 */
534 friend inline std::istream& operator>>(std::istream& in, JParameters_t& object)
535 {
536 object = JParameters_t();
537
538 in >> object.option
539 >> object.mestimator
540 >> object.sigma_s
541 >> object.stdev
542 >> object.Nextra;
543
544 if (in) {
545
546 for (double value; in >> value; ) {
547 object.steps.push_back(value);
548 }
549
550 if (!in.bad()) {
551 in.clear();
552 }
553 }
554
555 return in;
556 }
557
558
559 /**
560 * Write parameters to output stream
561 *
562 * \param out output stream
563 * \param object parameters
564 * \return output stream
565 */
566 friend inline std::ostream& operator<<(std::ostream& out, const JParameters_t& object)
567 {
568 using namespace std;
569
570 out << setw(2) << object.option << ' '
571 << setw(2) << object.mestimator << ' '
572 << SCIENTIFIC(9,3) << object.sigma_s << ' '
573 << SCIENTIFIC(9,3) << object.stdev << ' '
574 << setw(3) << object.Nextra;
575
576 for (const double value : object.steps) {
577 out << ' ' << FIXED(9,5) << value;
578 }
579
580 return out;
581 }
582
583 size_t Nmax;
584 size_t Nextra;
585 double epsilon;
586 int debug;
588 };
589
590
591 /**
592 * Constructor.
593 *
594 * \param filenames file names
595 * \param V sound velocity
596 * \param threads threads
597 * \param debug debug
598 */
600 const JSoundVelocity& V,
601 const size_t threads,
602 const int debug) :
604 V(V),
606 debug(debug)
607 {
609
611
612 if (filenames.hydrophone != "") { setup.hydrophones .load(filenames.hydrophone .c_str()); }
614
615 for (JDetector::const_iterator i = setup.detector.begin(); i != setup.detector.end(); ++i) {
616 receivers[i->getID()] = i->getLocation();
617 }
618
619 // detach PMTs
620
622
623 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
624 module->clear();
625 }
626
628
630
631 this->V.set(setup.detector.getUTMZ()); // sound velocity at detector depth
632
635
637
638 ROOT::EnableThreadSafety();
639 }
640
641
642 /**
643 * Auxiliary data structure for decomposed string.
644 */
645 struct string_type :
646 public std::vector<JModule> // optical modules
647 {
648 /**
649 * Add module.
650 *
651 * \param module module
652 */
653 void push_back(const JModule& module)
654 {
655 if (module.getFloor() == 0)
656 this->base = module;
657 else
659 }
660
661 JModule base; // base module
662 };
663
664
665 /**
666 * Auxiliary data structure for detector with decomposed strings.
667 */
669 public std::map<int, string_type>
670 {
671 /**
672 * Add module.
673 *
674 * \param module module
675 */
676 void push_back(const JModule& module)
677 {
678 (*this)[module.getString()].push_back(module);
679 }
680 };
681
682
683 /**
684 * Fit procedure to determine the positions of tripods and transmitters using strings that are fixed.
685 *
686 * \param parameters parameters
687 */
689 {
690 using namespace std;
691 using namespace JPP;
692
693 this->parameters = parameters;
694
695 JDetector A; // old strings
696 detector_type B; // new strings with transmitter -> fit only base module
697 JDetector C; // new strings w/o transmitter -> discard completely from fit
698
699 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
700
701 if (fits.strings .count(module->getString()) == 0)
702 A.push_back(*module);
703 else if (fits.transmitters.count(module->getString()) != 0)
704 B.push_back(*module);
705 else
706 C.push_back(*module);
707 }
708
709 setup.detector.swap(A);
710
711 for (const auto& element : B) {
712 setup.detector.push_back(element.second.base);
713 }
714
716
717 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
718
719 for (const int i : fits.tripods) {
720 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.x: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3X_t), parameters.steps[0]));
721 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.y: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3Y_t), parameters.steps[0]));
722 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.z: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3Z_t), parameters.steps[0]));
723 }
724
725 for (const int i : fits.transmitters) {
726 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "transmitter.x: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3X_t, true), parameters.steps[0]));
727 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "transmitter.y: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3Y_t, true), parameters.steps[0]));
728 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "transmitter.z: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3Z_t, true), parameters.steps[0]));
729 }
730
731 const double chi2 = fit(*this);
732
733 for (auto& element : B) {
734
735 const JModule& base = setup.detector.getModule(router->getAddress(JLocation(element.second.base.getString(),0)));
736 const JVector3D pos = base.getPosition() - element.second.base.getPosition();
737
738 for (string_type::iterator module = element.second.begin(); module != element.second.end(); ++module) {
739
740 module->add(pos);
741
742 setup.detector.push_back(*module);
743 }
744 }
745
746 copy(C.begin(), C.end(), back_inserter(setup.detector));
747
748 sort(setup.detector.begin(), setup.detector.end(), make_comparator(&JModule::getLocation));
749
751
752 STATUS("detector: " << FIXED(9,4) << chi2 << endl);
753 }
754
755
756 /**
757 * Fit procedure to determine the positions of the strings and tripods.
758 *
759 * \param parameters parameters
760 */
762 {
763 using namespace std;
764 using namespace JPP;
765
766 this->parameters = parameters;
767
768 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
769
770 for (const int i : fits.strings) {
771 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "string.x: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3X_t, true), parameters.steps[0]));
772 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "string.y: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3Y_t, true), parameters.steps[0]));
773 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "string.z: " << RIGHT(4) << i), new JStringEditor(setup, i, JVector3Z_t, false), parameters.steps[0]));
774 }
775
776 for (const int i : fits.tripods) {
777 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.x: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3X_t), parameters.steps[1]));
778 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.y: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3Y_t), parameters.steps[1]));
779 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "tripod.z: " << RIGHT(4) << i), new JTripodEditor(setup, i, JVector3Z_t), parameters.steps[1]));
780 }
781
782 for (const int i : ids_t(fits.hydrophones, fits.transmitters)) {
783 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "anchor.R: " << RIGHT(4) << i), new JAnchorEditor(setup, i), parameters.steps[0] / RADIUS_M));
784 }
785
786 for (const int i : fits.transmitters) {
787
788 JModule& module = setup.detector.getModule(router->getAddress(JLocation(i,0)));
789
790 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "anchor.R: " << RIGHT(4) << i), new JAnchorEditor(setup, i), parameters.steps[0] / RADIUS_M));
791 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "anchor.z: " << RIGHT(4) << i), new JModuleEditor(module), parameters.steps[0]));
792 }
793
794 const double chi2 = fit(*this);
795
796 STATUS("detector: " << FIXED(9,4) << chi2 << endl);
797 }
798
799
800 /**
801 * Fit procedure to determine the stretching and z-positions of individual strings.
802 *
803 * \param parameters parameters
804 */
806 {
807 using namespace std;
808 using namespace JPP;
809
810 this->parameters = parameters;
811
812 map<int, JDetector> buffer;
813
814 double z0 = 0.0;
815
816 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
817
818 buffer[module->getString()].push_back(*module);
819
820 if (module->getZ() > z0) {
821 z0 = module->getZ();
822 }
823 }
824
825 JDetector tx;
826
827 for (transmitters_container::iterator i = setup.transmitters.begin(); i != setup.transmitters.end(); ++i) {
828 try {
829 tx.push_back(router->getModule(i->getLocation()));
830 }
831 catch(const exception&) {}
832 }
833
834 for (const int i : fits.strings) {
835
836 setup.detector.swap(buffer[i]);
837
838 copy(tx.begin(), tx.end(), back_inserter(setup.detector));
839
841
842 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
843
844 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "string.M: " << RIGHT(4) << i), new JDyneemaEditor(setup, i, z0), parameters.steps[0]));
845 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "string.z: " << RIGHT(4) << i), new JStringEditor (setup, i, JVector3Z_t, false), parameters.steps[1]));
846
847 const double chi2 = fit(*this);
848
849 STATUS("string: " << setw(4) << i << ' ' << FIXED(9,4) << chi2 << endl);
850
851 buffer[i].clear();
852
853 copy_if(setup.detector.begin(), setup.detector.end(), back_inserter(buffer[i]), make_predicate(&JModule::getString, i));
854 }
855
856 setup.detector.clear();
857
858 for (const auto& element : buffer) {
859 copy(element.second.begin(), element.second.end(), back_inserter(setup.detector));
860 }
861
863 }
864
865
866 /**
867 * Fit procedure to determine the z-positions of the modules.
868 *
869 * \param parameters parameters
870 */
872 {
873 using namespace std;
874 using namespace JPP;
875
876 this->parameters = parameters;
877
878 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
879
880 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
881 if (fits.strings.count(module->getString()) != 0 && module->getFloor() != 0) {
882 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "module.z: " << right << module->getLocation()), new JModuleEditor(*module), parameters.steps[0]));
883 }
884 }
885
886 const double chi2 = fit(*this);
887
888 STATUS("detector: " << FIXED(9,4) << chi2 << endl);
889 }
890
891
892 /**
893 * Fit procedure to determine the z-positions of anchors.
894 *
895 * \param parameters parameters
896 */
898 {
899 using namespace std;
900 using namespace JPP;
901
902 this->parameters = parameters;
903
904 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
905
906 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
907 if (fits.strings.count(module->getString()) != 0 && module->getFloor() == 0) {
908 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "module.z: " << right << module->getLocation()), new JModuleEditor(*module), parameters.steps[0]));
909 }
910 }
911
912 const double chi2 = fit(*this);
913
914 STATUS("detector: " << FIXED(9,4) << chi2 << endl);
915 }
916
917
918 /**
919 * Fit procedure to determine the (x,y,z) positions of the modules.
920 * This procedure should be considered unorthodox - it can be used to modify the detector file in such a way
921 * to accommodate anomalies in the shapes of a string (e.g. entanglement of string in D0ORCA018).
922 *
923 * \param parameters parameters
924 */
926 {
927 using namespace std;
928 using namespace JPP;
929
930 this->parameters = parameters;
931
932 JGradient fit(parameters.Nmax, parameters.Nextra, parameters.epsilon, parameters.debug);
933
934 for (JDetector::iterator module = setup.detector.begin(); module != setup.detector.end(); ++module) {
935 if (fits.strings.count(module->getString()) != 0 && module->getFloor() != 0) {
936 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "module.x: " << right << module->getLocation()), new JModuleEditor(*module, JVector3X_t), parameters.steps[0]));
937 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "module.y: " << right << module->getLocation()), new JModuleEditor(*module, JVector3Y_t), parameters.steps[0]));
938 fit.push_back(JModifier_t(MAKE_STRING(LEFT(16) << "module.z: " << right << module->getLocation()), new JModuleEditor(*module, JVector3Z_t), parameters.steps[0]));
939 }
940 }
941
942 const double chi2 = fit(*this);
943
944 STATUS("detector: " << FIXED(9,4) << chi2 << endl);
945 }
946
947
948 /**
949 * Get chi2.
950 *
951 * \param option option
952 * \return chi2/NDF
953 */
954 double operator()(const int option) const
955 {
956 using namespace std;
957 using namespace JPP;
958
959 const JGeometry geometry(setup.detector, setup.hydrophones);
960
962
963 for (tripods_container::const_iterator i = setup.tripods.begin(); i != setup.tripods.end(); ++i) {
964 {
965 emitters[i->getID()] = JEmitter(i->getID(), i->getUTMPosition() - setup.detector.getUTMPosition());
966 }
967 }
968
969 for (transmitters_container::const_iterator i = setup.transmitters.begin(); i != setup.transmitters.end(); ++i) {
970 try {
971 emitters[i->getID()] = JEmitter(i->getID(), i->getPosition() + router->getModule(i->getLocation()).getPosition());
972 }
973 catch(const exception&) {} // if no module available, discard transmitter
974 }
975
976 if (option == 0 || // step wise improvement of the chi2
977 option == 1) { // evaluation of the chi2 before the determination of the gradient of the chi2
978
979 this->output.clear();
980
981 JSTDObjectWriter<JSuperEvt> out(this->output); // write data for subsequent use
982
983 JFremantle::output = (option == 1 ? &out : NULL);
984
985 {
986 JFremantle fremantle(geometry, V, parameters, threads, 2 * threads);
987
988 for (const input_type& superevt : input) {
989
990 const JWeight getWeight(superevt.begin(), superevt.end());
991
992 vector<JHit> data;
993
994 for (input_type::const_iterator evt = superevt.begin(); evt != superevt.end(); ++evt) {
995
996 if (emitters.has(evt->getID())) {
997
998 const JEmitter& emitter = emitters [evt->getID()];
999 const double weight = getWeight(evt->getID());
1000
1001 for (JEvent::const_iterator i = evt->begin(); i != evt->end(); ++i) {
1002
1003 if (geometry.hasLocation(receivers[i->getID()])) {
1004
1005 data.push_back(JHit(emitter,
1006 distance(superevt.begin(), evt),
1007 receivers[i->getID()],
1008 i->getToA(),
1010 weight));
1011 }
1012 }
1013 }
1014 }
1015
1016 if (getMinimumNumberOfEmitters(data.begin(), data.end()) >= parameters.Nmin) {
1017 fremantle.enqueue(data);
1018 }
1019 }
1020 }
1021
1022 return JFremantle::Q.getMean(numeric_limits<float>::max());
1023
1024 } else if (option == 2) { // evaluation of the derivative of the chi2 to each fit parameter
1025
1026 {
1028
1029 JPlatypus platypus(geometry, emitters, V, parameters, in, threads);
1030 }
1031
1032 return JPlatypus::Q.getMean(numeric_limits<float>::max());
1033
1034 } else {
1035
1036 return numeric_limits<float>::max();
1037 }
1038 }
1039
1040
1041 /**
1042 * Run.
1043 *
1044 * \param script steering script
1045 */
1046 void run(const std::string& script)
1047 {
1048 using namespace std;
1049 using namespace JPP;
1050
1051 ifstream in(script.c_str());
1052
1053 while (in) {
1054
1055 string buffer, key;
1056
1057 if (getline(in, buffer)) {
1058
1059 if (buffer.empty() || buffer[0] == skip_t) {
1060 continue;
1061 }
1062
1063 istringstream is(buffer);
1064
1065 is >> key;
1066
1067 if (key == initialise_t) { // set object identifiers
1068
1070
1071 } else if (key == fix_t) { // fix object identifiers
1072
1073 string type; // type of object
1074 ids_t id; // identifiers
1075
1076 if (is >> type >> id) {
1077 if (type == string_t) {
1078 fits.strings .fix(id);
1079 fits.hydrophones .fix(id);
1080 fits.transmitters.fix(id);
1081 } else if (type == tripod_t) {
1082 fits.tripods .fix(id);
1083 } else {
1084 THROW(JValueOutOfRange, "Invalid type <" << type << ">");
1085 }
1086 }
1087
1088 } else if (key == stage_t) { // stage
1089
1090 string stage;
1092
1093 if (is >> stage >> input) {
1094
1095 STATUS("stage " << setw(3) << stage << " {" << input << "}" << endl);
1096
1097 JTimer timer;
1098
1099 timer.start();
1100
1101 ofstream out(MAKE_CSTRING("stage-" << stage << ".log"));
1102
1103 {
1104 JRedirectStream redirect(cout, out);
1105
1106 switch (stage[stage.size() - 1]) {
1107
1108 case '0':
1109 stage_0(input);
1110 break;
1111
1112 case 'a':
1113 case 'A':
1114 stage_a(input);
1115 break;
1116
1117 case 'b':
1118 case 'B':
1119 stage_b(input);
1120 break;
1121
1122 case 'c':
1123 case 'C':
1124 stage_c(input);
1125 break;
1126
1127 case 'd':
1128 case 'D':
1129 stage_d(input);
1130 break;
1131
1132 case 'x':
1133 case 'X':
1134 stage_x(input);
1135 break;
1136
1137 default:
1138 THROW(JValueOutOfRange, "Invalid stage <" << stage << ">");
1139 break;
1140 }
1141 }
1142
1143 out.close();
1144
1145 store(stage);
1146 store();
1147
1148 timer.stop();
1149
1150 STATUS("Elapsed time " << FIXED(12,3) << timer.usec_wall * 1.0e-6 << " s." << endl);
1151 }
1152
1153 } else {
1154 THROW(JValueOutOfRange, "Invalid key <" << key << ">");
1155 }
1156 }
1157 }
1158
1159 in.close();
1160 }
1161
1162
1163 /**
1164 * Store data in given directory.
1165 *
1166 * \param dir directory
1167 */
1168 void store(const std::string& dir = ".")
1169 {
1170 using namespace JPP;
1171
1172 if (getFileStatus(dir.c_str()) || (mkdir(dir.c_str(), S_IRWXU | S_IRWXG) != -1)) {
1173
1174 // attach PMTs
1175
1176 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
1177 module->set(router->getModule(module->getLocation()).getPosition());
1178 }
1179
1181
1183
1184 if (filenames.hydrophone != "") { setup.hydrophones .store(getFilename(dir, filenames.hydrophone) .c_str()); }
1186
1187 } else {
1188
1189 THROW(JValueOutOfRange, "Invalid directory <" << dir << ">");
1190 }
1191 }
1192
1193
1194 /**
1195 * Get list of identifiers of receivers.
1196 *
1197 * \return list of identifiers
1198 */
1200 {
1201 ids_t buffer;
1202
1203 for (JDetector::const_iterator i = setup.detector.begin(); i != setup.detector.end(); ++i) {
1204 if ((i->getFloor() != 0 && !i->has(PIEZO_DISABLE)) || (setup.hydrophones.hasString(i->getString()) && !i->has(HYDROPHONE_DISABLE))) {
1205 buffer.insert(i->getID());
1206 }
1207 }
1208
1209 return buffer;
1210 }
1211
1212
1213 /**
1214 * Get list of identifiers of emitters.
1215 *
1216 * \return list of identifiers
1217 */
1219 {
1220 using namespace std;
1221
1222 ids_t buffer;
1223
1224 for (tripods_container::const_iterator i = setup.tripods.begin(); i != setup.tripods.end(); ++i) {
1225 buffer.insert(i->getID());
1226 }
1227
1228 for (transmitters_container::const_iterator i = setup.transmitters.begin(); i != setup.transmitters.end(); ++i) {
1229
1230 try {
1231
1232 const JModule& module = router->getModule(i->getLocation());
1233
1234 if (!module.has(TRANSMITTER_DISABLE)) {
1235 buffer.insert(i->getID());
1236 }
1237 }
1238 catch(const exception&) {}
1239 }
1240
1241 return buffer;
1242 }
1243
1244
1247 size_t threads;
1251
1253 std::unique_ptr<JLocationRouter> router;
1254
1257
1258 private:
1260
1263 };
1264}
1265
1266
1267/**
1268 * \file
1269 *
1270 * Application to perform acoustic pre-calibration.
1271 * \author mdejong
1272 */
1273int main(int argc, char **argv)
1274{
1275 using namespace std;
1276 using namespace JPP;
1277
1278 typedef JContainer< std::set<JTransmission_t> > disable_container;
1279
1281 JLimit_t& numberOfEvents = inputFile.getLimit();
1282 JFilenames filenames; // file names
1283 JFitParameters parameters; // fit parameters
1284 string script; // script file
1285 JSoundVelocity V = getSoundVelocity; // default sound velocity
1286 disable_container disable; // disable tansmissions
1287 size_t threads; // number of threads
1288 int debug;
1289
1290 try {
1291
1292 JParser<> zap("Application to perform acoustic pre-calibration.");
1293
1294 zap['f'] = make_field(inputFile, "output of JAcousticEventBuilder[.sh]");
1295 zap['n'] = make_field(numberOfEvents) = JLimit::max();
1296 zap['a'] = make_field(filenames.detector);
1297 zap['@'] = make_field(parameters) = JPARSER::initialised();
1298 zap['s'] = make_field(script, "steering script");
1299 zap['V'] = make_field(V, "sound velocity") = JPARSER::initialised();
1300 zap['T'] = make_field(filenames.tripod, "tripod file");
1301 zap['Y'] = make_field(filenames.transmitter, "transmitter file") = JPARSER::initialised();
1302 zap['H'] = make_field(filenames.hydrophone, "hydrophone file") = JPARSER::initialised();
1303 zap['M'] = make_field(getMechanics, "mechanics data") = JPARSER::initialised();
1304 zap['!'] = make_field(disable, "disable transmission") = JPARSER::initialised();
1305 zap['N'] = make_field(threads, "number of threads") = 1;
1306 zap['d'] = make_field(debug) = 1;
1307
1308 zap(argc, argv);
1309 }
1310 catch(const exception &error) {
1311 FATAL(error.what() << endl);
1312 }
1313
1314 if (threads == 0) {
1315 FATAL("Invalid number of threads " << threads << endl);
1316 }
1317
1318 JSydney sydney(filenames.strip(), V, threads, debug);
1319
1320 const JSydney::ids_t receivers = sydney.getReceivers();
1321 const JSydney::ids_t emitters = sydney.getEmitters();
1322
1324
1325 buffer_type zbuf;
1326
1327 while (inputFile.hasNext()) {
1328
1329 const JEvent* evt = inputFile.next();
1330
1331 if (emitters.count(evt->getID())) {
1332 zbuf.push_back(*evt);
1333 }
1334 }
1335
1336 sort(zbuf.begin(), zbuf.end()); // sort according first time-of-emission
1337
1338 for (buffer_type::iterator p = zbuf.begin(), q; p != zbuf.end(); p = q) {
1339
1340 for (q = p; ++q != zbuf.end() && q->begin()->getToE() <= p->rbegin()->getToE() + parameters.Tmax_s; ) {}
1341
1342 JEvent::overlap(p, q, parameters.deadTime_s); // empty overlapping events
1343
1344 JSydney::input_type buffer;
1345
1346 for (buffer_type::iterator evt = p; evt != q; ++evt) {
1347
1348 sort(evt->begin(), evt->end(), JKatoomba<>::compare);
1349
1350 JEvent::iterator __end = unique(evt->begin(), evt->end(), make_comparator(&JTransmission::getID, JComparison::eq()));
1351
1352 for (JEvent::iterator i = evt->begin(); i != __end; ) {
1353
1354 if (disable.count(JTransmission_t(evt->getID(), i->getID())) == 0 &&
1355 disable.count(JTransmission_t(-1, i->getID())) == 0) {
1356
1357 if (receivers.count(i->getID()) && i->getQ() >= parameters.Qmin * (parameters.Qmin <= 1.0 ? i->getW() : 1.0)) {
1358 ++i; continue;
1359 }
1360 }
1361
1362 iter_swap(i, --__end);
1363 }
1364
1365 buffer.push_back(JEvent(evt->getDetectorID(), buffer.size(), evt->getID(), evt->begin(), __end));
1366 }
1367
1368 if (getNumberOfEmitters(buffer.begin(), buffer.end()) >= parameters.Nmin) {
1369 sydney.input.push_back(buffer);
1370 }
1371 }
1372
1373 sydney.run(script);
1374}
Acoustics toolkit.
Acoustic event.
Acoustic hit.
ROOT TTree parameter settings.
Container I/O.
Data structure for detector geometry and calibration.
Acoustic emitter.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Acoustic fit parameters.
General purpose class for hash map of unique elements.
Data structure for hydrophone.
Fit functions of acoustic model.
Direct access to location in detector data structure.
General purpose messaging.
#define STATUS(A)
Definition JMessage.hh:63
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Data structure for optical module.
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
Definition JParser.hh:2142
#define MAKE_CSTRING(A)
Make C-string.
Definition JPrint.hh:72
#define MAKE_STRING(A)
Make string.
Definition JPrint.hh:63
Auxiliary class to define a range between two values.
Sound velocity.
File status.
Acoustic super event fit toolkit.
Acoustic event fit.
int main(int argc, char **argv)
Definition JSydney.cc:1273
Acoustic transmission identifier.
Data structure for transmitter.
Data structure for tripod.
Auxiliary methods for handling file names, type names and environment.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Thread pool for global fits.
static output_type * output
optional output
void enqueue(input_type &data)
Queue data.
static JMATH::JQuantile_t Q
chi2/NDF
Thread pool for global fits using super events.
static JMATH::JQuantile_t Q
chi2/NDF
Detector data structure.
Definition JDetector.hh:96
const JModule & getModule(const JModuleAddress &address) const
Get module parameters.
Definition JDetector.hh:270
Router for direct addressing of location data in detector data structure.
Logical location of module.
Definition JLocation.hh:40
int getFloor() const
Get floor number.
Definition JLocation.hh:146
int getString() const
Get string number.
Definition JLocation.hh:135
Data structure for a composite optical module.
Definition JModule.hh:75
bool has(const int bit) const
Test PMT status.
Definition JStatus.hh:120
Auxiliary class for CPU timing and usage.
Definition JTimer.hh:33
unsigned long long usec_wall
Definition JTimer.hh:238
void stop()
Stop timer.
Definition JTimer.hh:127
void start()
Start timer.
Definition JTimer.hh:106
const JPosition3D & getPosition() const
Get position.
Rotation around Z-axis.
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
This class can be used to temporarily redirect one output (input) stream to another output (input) st...
Implementation of object output from STD container.
Exception for accessing a value in a collection that is outside of its range.
Utility class to parse command line options.
Definition JParser.hh:1698
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
bool has(const T &value) const
Test whether given value is present.
double getUTMZ() const
Get UTM Z.
const JUTMPosition & getUTMPosition() const
Get UTM position.
static const int HYDROPHONE_DISABLE
Enable (disable) use of hydrophone if this status bit is 0 (1);.
static const int TRANSMITTER_DISABLE
Enable (disable) use of transmitter if this status bit is 0 (1);.
static const int PIEZO_DISABLE
Enable (disable) use of piezo if this status bit is 0 (1);.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition JHead.cc:163
Auxiliary classes and methods for acoustic position calibration.
static const std::string string_t
string
Definition JSydney.cc:90
size_t getMinimumNumberOfEmitters(T __begin, T __end)
Get minimum number of emitters for any string in data.
double getWeight(T __begin, T __end)
Get total weight of data points.
static const std::string tripod_t
tripod
Definition JSydney.cc:91
JContainer< std::vector< JTripod > > tripods_container
Definition JSydney.cc:79
JContainer< std::vector< JTransmitter > > transmitters_container
Definition JSydney.cc:81
static const std::string initialise_t
initialise
Definition JSydney.cc:88
JContainer< std::vector< JHydrophone > > hydrophones_container
Definition JSydney.cc:80
static const char skip_t
Script commands.
Definition JSydney.cc:87
static const std::string stage_t
fit stage
Definition JSydney.cc:92
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
static const std::string fix_t
fix objects
Definition JSydney.cc:89
size_t getNumberOfEmitters(T __begin, T __end)
Get number of emitters.
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
file Auxiliary data structures and methods for detector calibration.
Definition JAnchor.hh:12
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
static const JVector3D JVector3X_t(1, 0, 0)
unit x-vector
static const JVector3D JVector3Y_t(0, 1, 0)
unit y-vector
static const JVector3D JVector3Z_t(0, 0, 1)
unit z-vector
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition JVectorize.hh:54
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition JString.hh:478
@ LEFT
Definition JTwosome.hh:18
@ RIGHT
Definition JTwosome.hh:18
static const double C
Physics constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
Definition JPerth.cc:70
JFIT::JEvent JEvent
Definition JHistory.hh:404
static JStat getFileStatus
Function object for file status.
Definition JStat.hh:173
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Detector file.
Definition JHead.hh:227
Acoustic emitter.
Definition JEmitter.hh:30
int getID() const
Get emitter identifier.
Auxiliary data structure for handling of file names.
Definition JSydney.cc:98
std::string transmitter
transmitter
Definition JSydney.cc:117
JFilenames & strip()
Strip leading and trailing white spaces.
Definition JSydney.cc:104
std::string detector
detector
Definition JSydney.cc:114
std::string hydrophone
hydrophone
Definition JSydney.cc:116
std::string tripod
tripod
Definition JSydney.cc:115
double Qmin
minimal quality transmission
double deadTime_s
dead time between events [s]
size_t Nmin
minimum number of emitters
double sigma_s
time-of-arrival resolution [s]
double Tmax_s
time window to combine events [s]
bool hasLocation(const JLocation &location) const
Check if this detector has given location.
Definition JGeometry.hh:588
Acoustics hit.
Template definition of fit function of acoustic model.
Auxiliary data structure for setup of complete system.
Definition JSydney.cc:124
tripods_container tripods
tripods
Definition JSydney.cc:126
hydrophones
hydrophones
transmitters_container transmitters
transmitters
Definition JSydney.cc:143
JDetector detector
detector
Definition JSydney.cc:125
Implementation for depth dependend velocity of sound.
JSoundVelocity & set(const double z0)
Set depth.
Auxiliary class to edit orientation of anchor.
Definition JSydney.cc:469
virtual void apply(const double step) override
Apply step.
Definition JSydney.cc:493
JAnchorEditor(JSetup &setup, const int id)
Constructor.
Definition JSydney.cc:476
std::vector< JTransmitter > & transmitters
Definition JSydney.cc:505
std::vector< JHydrophone > & hydrophones
Definition JSydney.cc:504
Auxiliary class to edit length of Dyneema ropes.
Definition JSydney.cc:378
JDyneemaEditor(JSetup &setup, const int id, const double z0=0.0)
Constructor.
Definition JSydney.cc:386
std::vector< size_t > index
Definition JSydney.cc:419
virtual void apply(const double step) override
Apply step.
Definition JSydney.cc:403
Auxiliary class to edit (z) position of module.
Definition JSydney.cc:284
virtual void apply(const double step) override
Apply step.
Definition JSydney.cc:313
JModuleEditor(JModule &module, const JVector3D &direction)
Constructor.
Definition JSydney.cc:302
JModuleEditor(JModule &module)
Constructor.
Definition JSydney.cc:290
Extended data structure for parameters of stage.
Definition JSydney.cc:515
JParameters_t()
Default constuctor.
Definition JSydney.cc:519
friend std::ostream & operator<<(std::ostream &out, const JParameters_t &object)
Write parameters to output stream.
Definition JSydney.cc:566
std::vector< double > steps
Definition JSydney.cc:587
friend std::istream & operator>>(std::istream &in, JParameters_t &object)
Read parameters from input stream.
Definition JSydney.cc:534
Auxiliary class to edit (x,y,z) position of string.
Definition JSydney.cc:331
std::vector< size_t > index
Definition JSydney.cc:369
JStringEditor(JSetup &setup, const int id, const JVector3D &direction, const bool option)
Constructor.
Definition JSydney.cc:342
virtual void apply(const double step) override
Apply step.
Definition JSydney.cc:359
Auxiliary class to edit (x,y,z) position of tripod.
Definition JSydney.cc:428
JTripodEditor(JSetup &setup, const int id, const JVector3D &direction)
Constructor.
Definition JSydney.cc:436
virtual void apply(const double step) override
Apply step.
Definition JSydney.cc:452
std::vector< JTripod > & tripods
Definition JSydney.cc:458
Auxiliary data structure for detector with decomposed strings.
Definition JSydney.cc:670
void push_back(const JModule &module)
Add module.
Definition JSydney.cc:676
Auxiliary data structure for group of lists of identifiers of to-be-fitted objects.
Definition JSydney.cc:249
ids_t transmitters
identifiers of strings with transmitter
Definition JSydney.cc:275
ids_t tripods
identifiers of tripods
Definition JSydney.cc:273
void initialise(const JSetup &setup)
Initialise.
Definition JSydney.cc:262
ids_t hydrophones
identifiers of strings with hydrophone
Definition JSydney.cc:274
fits_t()
Default constructor.
Definition JSydney.cc:253
ids_t strings
identifiers of strings
Definition JSydney.cc:272
List of object identifiers.
Definition JSydney.cc:159
ids_t(const ids_t &A, const ids_t &B)
Difference constructor.
Definition JSydney.cc:184
friend std::istream & operator>>(std::istream &in, ids_t &object)
Read identifiers from input stream.
Definition JSydney.cc:214
friend std::ostream & operator<<(std::ostream &out, const ids_t &object)
Write identifiers to output stream.
Definition JSydney.cc:235
void fix(const ids_t &B)
Fix.
Definition JSydney.cc:197
ids_t()
Default constructor.
Definition JSydney.cc:163
ids_t(const std::vector< int > &buffer)
Copy constructor.
Definition JSydney.cc:172
Auxiliary data structure for decomposed string.
Definition JSydney.cc:647
void push_back(const JModule &module)
Add module.
Definition JSydney.cc:653
Main class for pre-calibration using acoustics data.
Definition JSydney.cc:150
double operator()(const int option) const
Get chi2.
Definition JSydney.cc:954
JSydney(const JFilenames &filenames, const JSoundVelocity &V, const size_t threads, const int debug)
Constructor.
Definition JSydney.cc:599
void stage_x(const JParameters_t &parameters)
Fit procedure to determine the (x,y,z) positions of the modules.
Definition JSydney.cc:925
ids_t getReceivers() const
Get list of identifiers of receivers.
Definition JSydney.cc:1199
JFilenames filenames
Definition JSydney.cc:1245
std::unique_ptr< JLocationRouter > router
Definition JSydney.cc:1253
JTOOLS::JHashMap< int, JLocation > receivers
Definition JSydney.cc:1252
void run(const std::string &script)
Run.
Definition JSydney.cc:1046
static constexpr double RADIUS_M
maximal horizontal distance between T-bar and emitter/hydrophone
Definition JSydney.cc:152
JDetector detector
PMTs.
Definition JSydney.cc:1261
void store(const std::string &dir=".")
Store data in given directory.
Definition JSydney.cc:1168
ids_t getEmitters() const
Get list of identifiers of emitters.
Definition JSydney.cc:1218
JSoundVelocity V
Definition JSydney.cc:1246
std::vector< input_type > input
Definition JSydney.cc:1256
void stage_c(const JParameters_t &parameters)
Fit procedure to determine the z-positions of the modules.
Definition JSydney.cc:871
std::vector< JSuperEvt > output
Definition JSydney.cc:1259
JFitParameters parameters
Definition JSydney.cc:1262
void stage_0(const JParameters_t &parameters)
Fit procedure to determine the positions of tripods and transmitters using strings that are fixed.
Definition JSydney.cc:688
std::vector< JEvent > input_type
Definition JSydney.cc:1255
void stage_d(const JParameters_t &parameters)
Fit procedure to determine the z-positions of anchors.
Definition JSydney.cc:897
void stage_b(const JParameters_t &parameters)
Fit procedure to determine the stretching and z-positions of individual strings.
Definition JSydney.cc:805
void stage_a(const JParameters_t &parameters)
Fit procedure to determine the positions of the strings and tripods.
Definition JSydney.cc:761
Acoustic transmission identifier.
int getID() const
Get identifier.
Auxiliary data structure to unify weights of acoustics data according to the number of pings per emit...
Auxiliary wrapper for I/O of container with optional comment (see JComment).
Definition JContainer.hh:42
Conjugate gradient fit.
Definition JGradient.hh:75
Auxiliary data structure for editable parameter.
Definition JGradient.hh:49
Auxiliary data structure for fit parameter.
Definition JGradient.hh:28
void store(const char *file_name) const
Store to output file.
void load(const char *file_name)
Load from input file.
Implementation of object iteration from STD container.
double getMean() const
Get mean value.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
General purpose class for hash map of unique keys.
Definition JHashMap.hh:75
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488