58 key_type(
const int first,
60 std::
pair<int, int>(first, second)
71 friend inline std::istream&
operator>>(std::istream&
in, key_type& key)
87 friend inline std::ostream&
operator<<(std::ostream& out,
const key_type& key)
103 friend inline bool operator<(
const key_type&
first,
const key_type& second)
105 if (first.first == second.first)
106 return first.second < second.second;
108 return first.first < second.first;
120 int main(
int argc,
char **argv)
135 transmitters_container transmitters;
136 hydrophones_container hydrophones;
142 JParser<> zap(
"Example program to plot hydrophone data.");
145 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
158 catch(
const exception &error) {
159 FATAL(error.what() << endl);
177 for (hydrophones_container::const_iterator i = hydrophones.begin(); i != hydrophones.end(); ++i) {
179 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
181 if (i->getLocation() == module->getLocation()) {
183 receivers[module->getID()] =
JReceiver(module->getID(),
184 module->getPosition() + i->getPosition(),
185 module->getT0() * 1.0e-9);
191 for (tripods_container::const_iterator i =
tripods.begin(); i !=
tripods.end(); ++i) {
192 emitters[i->getID()] =
JEmitter(i->getID(),
193 i->getUTMPosition() -
detector.getUTMPosition());
196 for (transmitters_container::const_iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
198 emitters[i->getID()] =
JEmitter(i->getID(),
201 catch(
const exception&) {
210 TH1D h0(
MAKE_CSTRING(
"Q0 " << T0), NULL, 100, 0.0, 8.0);
211 TH1D h1(
MAKE_CSTRING(
"Q1 " << T1), NULL, 100, 0.0, 8.0);
216 while (inputFile.hasNext()) {
218 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
220 const JEvent* evt = inputFile.next();
222 if (!evt->empty() && emitters.has(evt->
getID())) {
226 for (JEvent::const_iterator hit = evt->begin(); hit != evt->end(); ++hit) {
227 if (receivers.has(hit->getID())) {
228 buffer[hit->getID()].push_back(*hit);
238 if (hit->getQ() >=
Q) {
241 const JPosition3D&
p2 = receivers[hit->getID()].getPosition();
244 const double Vi =
V.getInverseVelocity(D, p1.
getZ(), p2.
getZ());
246 const double t0 = evt->begin()->getToE() + D * Vi;
247 const double t1 = hit->getToA() - t0;
249 H1[key_type(hit->getID(), evt->
getID())]->Fill(t1);
251 const double Q =
log10(hit->getQ());
253 if (T0(t1)) { h0.Fill(Q); }
254 if (T1(t1)) { h1.Fill(Q); }
263 out << h0 << h1 << H1;
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
bool operator<(const Head &first, const Head &second)
Less than operator.
General purpose class for hash map of unique elements.
ROOT TTree parameter settings.
#define MAKE_CSTRING(A)
Make C-string.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Dynamic ROOT object management.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
double getDistance(const JVector3D &pos) const
Get distance to point.
Data structure for detector geometry and calibration.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Data structure for hydrophone.
Auxiliary class for defining the range of iterations of objects.
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
I/O formatting auxiliaries.
Data structure for transmitter.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
set_variable E_E log10(E_{fit}/E_{#mu})"
JPosition3D getPosition(const Vec &pos)
Get position.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
ROOT TTree parameter settings.
double getQ(const double D_m, const double f_kHz, const double d_m)
Get relative quality for given frequency at given distance.
General purpose messaging.
Implementation for depth dependend velocity of sound.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Auxiliary class to define a range between two values.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
static JEmitterID getEmitterID
Function object for emitter identification.
do set_variable DETECTOR_TXT $WORKDIR detector
int getID() const
Get identifier.
Data structure for tripod.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
do echo Generating $dir eval D
double getZ() const
Get z position.
#define DEBUG(A)
Message macros.