1 #ifndef __JACOUSTICS__JMECHANICS__
2 #define __JACOUSTICS__JMECHANICS__
27 namespace JACOUSTICS {}
28 namespace JPP {
using namespace JACOUSTICS; }
30 namespace JACOUSTICS {
70 return height + this->
b * log(1.0 - this->
a * height);
83 return in >> parameters.
a >> parameters.
b;
96 return out <<
FIXED(7,5) << parameters.
a <<
' '
97 <<
FIXED(7,3) << parameters.
b;
131 const string file_name =
MAKE_STRING(
"mechanics_" <<
FILL(8,
'0') <<
id <<
".txt");
142 void load(
const std::string& file_name)
144 std::ifstream
in(file_name.c_str());
175 if ((p = this->find(
string)) != this->end())
177 else if ((p = this->find(
WILD_CARD)) != this->end())
195 JStringStream
is(in);
203 is >>
object.comment;
208 while (is >>
string >> mechanics) {
209 object[string] = mechanics;
227 out <<
object.comment;
229 for (JDetectorMechanics::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
230 out << setw(4) << i->first <<
' ' << i->second << endl;
Auxiliary data structure for mechanical model parameters of strings in a given detector.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
static const char *const LD_LIBRARY_PATH
Nick names of environment variables.
const JMechanics & operator()(const int string) const
Get mechanical parameters for given string.
*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
Auxiliary data structure for floating point format specification.
JMechanics(const double a, const double b)
Constructor.
#define MAKE_STRING(A)
Make string.
friend std::istream & operator>>(std::istream &in, JDetectorMechanics &object)
Read detector mechanics from input.
friend std::istream & operator>>(std::istream &in, JMechanics ¶meters)
Read parameters from input stream.
wild card for string number.
double a
0 <= a < (maximal height)⁻1; [m^-1]
double getHeight(const double height) const
Get effective height for given actual height.
JMechanics()
Default constructor.
void load(const std::string &file_name)
Load mechanical model parameters from file.
Auxiliary data structure for sequence of same character.
static JStat getFileStatus
Function object for file status.
void load(const int id)
Load mechanical model parameters for given detector identifier.
static std::string getFilename(const int id)
Get file name with mechanical model parameters for given detector identifier.
friend std::ostream & operator<<(std::ostream &out, const JMechanics ¶meters)
Write parameters to output stream.
friend std::ostream & operator<<(std::ostream &out, const JDetectorMechanics &object)
Write detector mechanics to output.
std::string getFullFilename(const std::string &variable, const std::string &file_name)
Get full file name (see JEEP::getPath).
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Auxiliary data structure for parameters of mechanical model.