26 int main(
const int argc,
const char *
const argv[])
35 bool overwriteDetector;
38 JParser<> zap(
"Auxiliary program to find the bad channels (PMTs) according to the small ToT fraction (i.e. the noise to signal ratio).");
39 zap[
'a'] =
make_field(detectorFile,
"detector file");
40 zap[
'f'] =
make_field(inputFile,
"output file of JIntegrateToT");
41 zap[
't'] =
make_field(stfCut,
"small ToT fraction cut-off") = 0.5;
43 zap[
'A'] =
make_field(overwriteDetector,
"overwrite detector file with bad channel boolean.");
46 catch(
const exception& error) {
47 FATAL(error.what() << endl);
60 NOTICE(
"Set detector version to " <<
detector.getVersion() << endl);
65 ifstream istr(inputFile.c_str());
68 DEBUG(
"Computing small ToT fraction for DOM" << curPar.domId <<
" - PMT " << curPar.pmtId << endl);
69 vParameters.push_back(curPar);
74 if (overwriteDetector) {
78 const double ratio = par->signal ? par->noise/par->signal : 1;
79 const bool status = ratio > stfCut ?
true :
false;
81 detector.getModule(module).getPMT(par->pmtId).setStatus(status);
83 NOTICE(
"bad channel: pmt " << par->pmtId <<
", dom "
84 << par->domId <<
" with a STF of " << ratio << endl);
88 NOTICE(
"Store calibration data on file " << detectorFile << endl);
Utility class to parse command line options.
ROOT TTree parameter settings of various packages.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Router for direct addressing of module data in detector data structure.
Data structure for detector geometry and calibration.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
General purpose messaging.
Direct access to module in detector data structure.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Utility class to parse command line options.
bool hasModule(const JObjectID &id) const
Has module.
do set_variable DETECTOR_TXT $WORKDIR detector
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])