Go to the documentation of this file.
58 friend inline bool operator<(
const JElement_t& first,
const JElement_t& second)
60 return first.t1 < second.t1;
75 int main(
int argc,
char **argv)
95 JParser<> zap(
"Example program to analyse acoustic data from data base.");
110 catch(
const exception &error) {
111 FATAL(error.what() << endl);
115 const double SOUND_VELOCITY = 1481.0;
129 const int MODULE[] = {
146 DEBUG(
"Tripods" << endl);
154 DEBUG(setw(2) << i->first <<
' '
180 runs.getLowerLimit(),
181 runs.getUpperLimit());
183 ResultSet& rs =
getResultSet(getTable<JToAshort>(), selector);
185 int number_of_rows = 0;
187 for (
JToAshort parameters; rs >> parameters; ++number_of_rows) {
189 STATUS(setw(8) << number_of_rows <<
'\r' << flush);
DEBUG(endl);
195 const double d1 = (router.
getModule(parameters.DOMID).
getPosition() - tripod[parameters.EMITTERID]).getLength();
196 const double t1 = parameters.UNIXTIMEBASE + parameters.TOA_S - d1 / SOUND_VELOCITY;
197 const double q1 = parameters.QUALITYFACTOR;
199 f1[parameters.EMITTERID][parameters.DOMID].push_back(JElement_t(t1,q1));
203 catch(
const exception& error) {
204 FATAL(error.what() << endl);
210 TH1D* h1 = H1[emitter->first];
214 for (
int i = 0; i !=
sizeof(MODULE)/
sizeof(MODULE[0]); ++i) {
216 buffer_type& buffer = emitter->second[MODULE[i]];
218 JQuantile Q1(
"quality", buffer.begin(), buffer.end(), &JElement_t::q1);
224 buffer.erase(__end, buffer.end());
226 sort(buffer.begin(), buffer.end());
231 buffer_type::const_iterator p0 = emitter->second[MODULE[0]].begin();
232 buffer_type::const_iterator
p1 = emitter->second[MODULE[1]].begin();
234 buffer_type::const_iterator end0 = emitter->second[MODULE[0]].end();
235 buffer_type::const_iterator end1 = emitter->second[MODULE[1]].end();
237 if (p0 != end0 &&
p1 != end1) {
239 for ( ; ; ++p0, ++
p1) {
241 while (p0 != end0 && p0->t1 <
p1->t1 - TMax_s) { ++p0; }
242 while (
p1 != end1 &&
p1->t1 < p0->t1 - TMax_s) { ++
p1; }
244 if (p0 != end0 &&
p1 != end1)
245 h1->Fill(
p1->t1 - p0->t1);
Auxiliary data structure for floating point format specification.
bool is_integer(const std::string &buffer)
Check if string is an integer.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
double getZ() const
Get z position.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g.
bool operator<(const Head &first, const Head &second)
Less than operator.
static const JDetectorsHelper & getDetector
Function object for mapping serial number and object identifier of detectors.
ResultSet & getResultSet(const std::string &query)
Get result set.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Logical location of module.
int main(int argc, char **argv)
Data structure for position in three dimensions.
Data structure for UTM position.
Template definition for getting table specific selector.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
void reset(JCLBInput &data, size_t size)
Reset CLB buffers.
Router for direct addressing of module data in detector data structure.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const JPosition3D & getPosition() const
Get position.
JPosition3D getPosition(const Vec &v)
Get position.
#define DEBUG(A)
Message macros.
double getY() const
Get y position.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Auxiliary class for specifying selection of database data.
double getX() const
Get x position.
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.