37 int main(
int argc,
char **argv)
41 using namespace KM3NETDAQ;
47 double Tmax_s = 300.0;
58 JParser<> zap(
"Example program to process DAQ and acoustic events.");
63 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
74 TH1D
h1(
"h1", NULL, 101, -0.5, +100.5);
75 TH1D hn(
"hn", NULL, 101, -0.5, +100.5);
76 TH1D ht(
"ht", NULL, 100, -1.0e3, +1.0e3);
85 for (JTreeScanner_t::iterator p = in.begin(), q; p != in.end(); p = q) {
87 STATUS(
"event " <<
FIXED(20,6) << p->begin()->getToE() <<
'\r');
DEBUG(endl);
89 for (q = p; ++q != in.end() && q->begin()->getToE() <= p->rbegin()->getToE() + Tmax_s; ) {}
98 for (JTreeScanner_t::iterator i = p; i != q; ++i) {
99 if (i->rbegin()->getToE() - p->begin()->getToE() >
range) {
100 range = i->rbegin()->getToE() - p->begin()->getToE();
104 data[p->begin()->getToE()] =
range;
110 while (inputFile.hasNext()) {
119 double t1 = (p != data.end() ? p->first : 0.0);
121 if (p != data.begin()) {
125 if (fabs(t1 - t0) > fabs(p->first - t0)) { t1 = p->first; }
126 if (fabs(t1 - t0) > fabs(p->first + p->second - t0)) { t1 = p->first + p->second; }
136 out << h1 << hn << ht;
Utility class to parse command line options.
double getUNIXTime(const KM3NETDAQ::JDAQChronometer &chronometer)
Get UNIX time of given DAQ object.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
ROOT TTree parameter settings.
Utility class to parse parameter values.
then for HISTOGRAM in h0 h1
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.
Template definition for direct access of elements in ROOT TChain.
Utility class to parse parameter values.
size_t getNumberOfEmitters(T __begin, T __end)
Get number of emitters.
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Base class for JTreeScanner.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
const JLimit & getLimit() const
Get limit.
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
JTriggerCounter_t next()
Increment trigger counter.
#define DEBUG(A)
Message macros.