30int main(
int argc,
char **argv)
36 JLimit_t& numberOfEvents = inputFile.getLimit();
39 bool overwriteDetector;
44 JParser<> zap(
"Auxiliary program to disable acoustic sensors based on acoustic events.");
46 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
49 zap[
'N'] =
make_field(Nmin,
"minimum number of transmissions");
50 zap[
'A'] =
make_field(overwriteDetector,
"overwrite detector file provided through '-a' with status of acoustic sensor.");
55 catch(
const exception &error) {
56 FATAL(error.what() << endl);
78 for (JEvent::const_iterator i = evt->begin(); i != evt->end(); ++i) {
79 buffer[i->getID()] += 1;
85 FATAL(
"No events in input." << endl);
88 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
90 if (buffer[module->getID()] < Nmin) {
92 if (module->getFloor() == 0) {
96 NOTICE(
"Module " << setw(10) << module->getID() <<
' ' <<
getLabel(module->getLocation()) <<
" disable hydrophone." << endl);
98 module->set(HYDROPHONE_DISABLE);
105 NOTICE(
"Module " << setw(10) << module->getID() <<
' ' <<
getLabel(module->getLocation()) <<
" disable piezo." << endl);
107 module->set(PIEZO_DISABLE);
113 if (overwriteDetector) {
115 NOTICE(
"Store calibration data on file " << detectorFile << endl);
ROOT TTree parameter settings.
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
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.