31{
34
36 JLimit_t& numberOfEvents = inputFile.getLimit();
38 size_t Nmin;
41
42 try {
43
44 JParser<> zap(
"Auxiliary program to disable acoustic sensors based on acoustic events.");
45
46 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
49 zap[
'N'] =
make_field(Nmin,
"minimum number of transmissions");
52
54 }
55 catch(const exception &error) {
57 }
58
60
61 try {
63 }
66 }
67
69
70 while (inputFile.hasNext()) {
71
72 if (inputFile.getCounter()%1000 == 0) {
74 }
75
76 const JEvent* evt = inputFile.next();
77
78 for (JEvent::const_iterator i = evt->begin(); i != evt->end(); ++i) {
79 buffer[i->getID()] += 1;
80 }
81 }
83
84 if (inputFile.getCounter() == 0) {
86 }
87
89
90 if (buffer[
module->getID()] < Nmin) {
91
92 if (
module->getFloor() == 0) {
93
95
97
98 module->set(HYDROPHONE_DISABLE);
99 }
100
101 } else {
102
104
106
107 module->set(PIEZO_DISABLE);
108 }
109 }
110 }
111 }
112
114
116
118 }
119}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
static const int HYDROPHONE_DISABLE
Enable (disable) use of hydrophone if this status bit is 0 (1);.
static const int PIEZO_DISABLE
Enable (disable) use of piezo if this status bit is 0 (1);.
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.