55 key_type(
const int first,
57 std::
pair<int, int>(first, second)
68 friend inline std::istream&
operator>>(std::istream&
in, key_type& key)
84 friend inline std::ostream&
operator<<(std::ostream& out,
const key_type& key)
100 friend inline bool operator<(
const key_type&
first,
const key_type& second)
102 if (first.first == second.first)
103 return first.second < second.second;
105 return first.first < second.first;
117 int main(
int argc,
char **argv)
131 tripods_container tripods;
132 hydrophones_container hydrophones;
138 JParser<> zap(
"Example program to plot hydrophone data.");
141 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
146 zap[
'T'] =
make_field(tripods,
"tripod data");
154 catch(
const exception &error) {
155 FATAL(error.what() << endl);
173 for (hydrophones_container::const_iterator i = hydrophones.begin(); i != hydrophones.end(); ++i) {
175 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
177 if (i->getLocation() == module->getLocation()) {
179 receivers[module->getID()] =
JReceiver(module->getID(),
180 module->getPosition() + i->getPosition(),
181 module->getT0() * 1.0e-9);
187 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
188 emitters[i->getID()] =
JEmitter(i->getID(),
189 i->getUTMPosition() -
detector.getUTMPosition());
195 while (inputFile.hasNext()) {
197 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
199 const JEvent* evt = inputFile.next();
202 buffer[evt->
getID()].push_back((*evt)[0].getToE());
211 TH1D h0(
MAKE_CSTRING(
"Q0 " << T0), NULL, 100, 0.0, 8.0);
216 for (
int counter = 0; toashortFile.hasNext(); ++counter) {
218 if (counter%1000 == 0) {
219 STATUS(
"counter: " << setw(8) << counter <<
'\r' << flush);
DEBUG(endl);
228 if (emitters.has(
id) && receivers.has(parameters->
DOMID) && !buffer[id].empty()) {
234 double t1 = numeric_limits<double>::max();
235 double w1 = 1.0 / (double) buffer[
id].size();
239 const double ti = transmission.
getToE() - *i;
241 if (fabs(ti) < fabs(t1)) {
246 H1[key_type(parameters->
DOMID,
id)]->Fill(t1);
250 const double Q = log10(transmission.
getQ());
252 if (T0(t1)) { h0.Fill(Q); }
253 if (T1(t1)) { h1.Fill(Q); }
261 out << h0 << h1 <<
H1;
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
double getQ() const
Get quality.
bool operator<(const Head &first, const Head &second)
Less than operator.
General purpose class for hash map of unique elements.
ROOT TTree parameter settings.
*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
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Dynamic ROOT object management.
double getToE() const
Get estimated time of emission.
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.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings.
General purpose messaging.
Implementation for 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.
JTransmission getTransmission(const JToAshort &data, const JAbstractSoundVelocity &V=getSoundVelocity) const
Get transmission.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
int EMITTERID
waveform identifier