1#ifndef __JACOUSTICS__JMECHANICS__
2#define __JACOUSTICS__JMECHANICS__
72 return height + this->
b * log(1.0 - this->
a * height);
85 return in >> parameters.
a >> parameters.
b;
98 return out <<
FIXED(7,5) << parameters.
a <<
' '
99 <<
FIXED(7,3) << parameters.
b;
137 void load(
const std::string& file_name)
139 std::ifstream in(file_name.c_str());
174 if ((p = this->find(
string)) != this->end())
176 else if ((p = this->find(
WILDCARD)) != this->end())
196 if (getFileStatus(is.str().c_str())) {
202 is >>
object.comment;
207 while (is >>
string >> mechanics) {
208 object[string] = mechanics;
226 out <<
object.comment;
228 for (JDetectorMechanics::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
229 out << setw(4) << i->first <<
' ' << i->second << endl;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
#define MAKE_STRING(A)
Make string.
Exception for opening of file.
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.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary data structure for mechanical model parameters of strings in a given detector.
void load(const int id)
Load mechanical model parameters for given detector identifier.
void load(const std::string &file_name)
Load mechanical model parameters from file.
const JMechanics & operator()(const int string) const
Get mechanical parameters for given string.
@ WILDCARD
wild card for string number.
static std::string getFilename(const int id)
Get file name with mechanical model parameters for given detector identifier.
friend std::istream & operator>>(std::istream &in, JDetectorMechanics &object)
Read detector mechanics from input.
friend std::ostream & operator<<(std::ostream &out, const JDetectorMechanics &object)
Write detector mechanics to output.
Auxiliary data structure for parameters of mechanical model.
double a
0 <= a < (maximal height)⁻1; [m^-1]
JMechanics(const double a, const double b)
Constructor.
friend std::istream & operator>>(std::istream &in, JMechanics ¶meters)
Read parameters from input stream.
friend std::ostream & operator<<(std::ostream &out, const JMechanics ¶meters)
Write parameters to output stream.
double getHeight(const double height) const
Get effective height for given actual height.
JMechanics()
Default constructor.