29int main(
int argc,
char **argv)
40 bool overwriteDetector;
46 JParser<> zap(
"Program to correct detector file for inconsistencies in configuration of data filter.");
48 zap[
'f'] =
make_field(inputFile,
"original raw data file and reprocessed raw data file");
51 zap[
'S'] =
make_field(stdev,
"number of standard deviations for comparison of counts per optical module.") = 10.0;
52 zap[
'A'] =
make_field(overwriteDetector,
"overwrite detector file provided through '-a'.");
58 catch(
const exception& error) {
59 FATAL(error.what() << endl);
63 if (inputFile.size() != 2) {
64 FATAL(
"Wrong number of input files " << inputFile.size() <<
" != " << 2 << endl);
82 for (
int i = 0; i != 2; ++i) {
84 STATUS(
"Processing " << inputFile[i] << endl);
88 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
93 zmap[i][hit->getModuleID()] += 1;
101 for (map_type::const_iterator
103 q = zmap[1].begin(); (p != zmap[0].end() &&
104 q != zmap[1].end()); ) {
106 if (p->first < q->first) { ++p; }
107 else if (q->first < p->first) { ++q; }
110 if (max ((
double) p->second, (
double) q->second) > stdev * sqrt(p->second + q->second) &&
111 fabs((
double) p->second - (
double) q->second) > stdev * sqrt(p->second + q->second)) {
115 NOTICE(
"Module " << setw(8) << p->first <<
' ' << setw(6) << p->second <<
" <> " << setw(6) << q->second <<
' ' << (overwriteDetector ?
"-> set position to (0,0,0)" :
"") << endl);
117 if (overwriteDetector) {
127 if (overwriteDetector) {
129 NOTICE(
"Store calibration data on file " << detectorFile << endl);
int main(int argc, char **argv)
Data structure for detector geometry and calibration.
General purpose messaging.
#define DEBUG(A)
Message macros.
#define QAQC(A)
QA/QC output macro.
int qaqc
QA/QC file descriptor.
Direct access to module in detector data structure.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Scanning of objects from a single file according a format that follows from the extension of each fil...
ROOT TTree parameter settings of various packages.
Router for direct addressing of module data in detector data structure.
const int getIndex(const JObjectID &id) const
Get index of module.
Data structure for vector in three dimensions.
Utility class to parse command line options.
Object reading from a list of files.
virtual bool hasNext() override
Check availability of next element.
JTriggerCounter_t next()
Increment trigger counter.
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).
KM3NeT DAQ data structures and auxiliaries.
std::map< int, range_type > map_type
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.