Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JMechanics.hh
Go to the documentation of this file.
1#ifndef __JACOUSTICS__JMECHANICS__
2#define __JACOUSTICS__JMECHANICS__
3
4#include <istream>
5#include <ostream>
6#include <fstream>
7#include <iomanip>
8
9#include "JSystem/JStat.hh"
10
12
13#include "Jeep/JComment.hh"
14
16
17
18
19/**
20 * \file
21 *
22 * Mechanical modelling of string.
23 * \author mdejong
24 */
25namespace JACOUSTICS {}
26namespace JPP { using namespace JACOUSTICS; }
27
28namespace JACOUSTICS {
29
30 using JEEP::JComment;
31
32
33 /**
34 * Auxiliary data structure for mechanical model parameters with commented data.
35 */
38 {
39 /**
40 * Read detector mechanics from input.
41 *
42 * \param in input stream
43 * \param object detector mechanics
44 * \return input stream
45 */
46 friend inline std::istream& operator>>(std::istream& in, JDetectorMechanics& object)
47 {
48 using namespace JPP;
49
50 JStringStream is(in);
51
52 if (getFileStatus(is.str().c_str())) {
53 is.load();
54 }
55
56 object.clear();
57
58 is >> object.comment;
59
60 int string;
61 JMechanics mechanics;
62
63 while (is >> string >> mechanics) {
64 object[string] = mechanics;
65 }
66
67 return in;
68 }
69
70
71 /**
72 * Write detector mechanics to output.
73 *
74 * \param out output stream
75 * \param object detector mechanics
76 * \return output stream
77 */
78 friend inline std::ostream& operator<<(std::ostream& out, const JDetectorMechanics& object)
79 {
80 using namespace std;
81
82 out << object.comment;
83 out << static_cast<const JDetectorMechanics_t&>(object);
84
85 return out;
86 }
87
89 };
90}
91
92#endif
Mechanical modelling of string.
File status.
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
void load()
Load data from file with name corresponding to current contents.
Auxiliary classes and methods for acoustic position calibration.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for mechanical model parameters of strings in a given detector.
Auxiliary data structure for mechanical model parameters with commented data.
Definition JMechanics.hh:38
friend std::istream & operator>>(std::istream &in, JDetectorMechanics &object)
Read detector mechanics from input.
Definition JMechanics.hh:46
friend std::ostream & operator<<(std::ostream &out, const JDetectorMechanics &object)
Write detector mechanics to output.
Definition JMechanics.hh:78
Auxiliary data structure for parameters of mechanical model.
Auxiliary class for comment.
Definition JComment.hh:43