38 bool overwriteDetector;
43 JParser<> zap(
"Auxiliary program to update the PMT status in the detector file based on the fraction of short time-over-threshold values.");
45 zap[
'f'] =
make_field(inputFile,
"input file (output from JCalibrateToT).");
46 zap[
'a'] =
make_field(detectorFile,
"detector file.");
47 zap[
'x'] =
make_field(
range,
"integration range for noise.") = JRange_t(0.0, 8.0);
48 zap[
't'] =
make_field(fraction,
"maximal fraction of signal allowed for noise.") = 0.5;
49 zap[
'A'] =
make_field(overwriteDetector,
"overwrite detector file.");
54 catch(
const exception& error) {
55 FATAL(error.what() << endl);
71 NOTICE(
"Set detector version to " <<
detector.getVersion() << endl);
75 gErrorIgnoreLevel = kError;
77 TFile*
in = TFile::Open(inputFile.c_str(),
"exist");
79 if (
in == NULL || !
in->IsOpen()) {
80 FATAL(
"File: " << inputFile <<
" not opened." << endl);
84 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
86 if (!module->empty()) {
92 for (
int ix = 1; ix <= h2s->GetXaxis()->GetNbins(); ++ix) {
97 for (
int iy = 1; iy <= h2s->GetYaxis()->GetNbins(); ++iy) {
99 const double x = h2s->GetYaxis()->GetBinCenter(iy);
100 const double y = h2s->GetBinContent(ix, iy);
109 const bool disable = noise > fraction * signal;
112 cout <<
"PMT " <<
FILL(10,
'0') << module->getID() <<
"." <<
FILL(2,
'0') << (ix - 1) <<
FILL()
113 <<
" noise/signal " <<
FIXED(7,0) << noise <<
"/" <<
FIXED(7,0) << signal << (disable ?
" *" :
"") << endl;
116 if (overwriteDetector) {
118 module->getPMT(ix - 1).getStatus().set(
PMT_DISABLE);
125 WARNING(
"No histogram for module " << module->getID() <<
"; skip." << endl);
132 if (overwriteDetector) {
134 NOTICE(
"Store PMT status on file " << detectorFile << endl);
Utility class to parse command line options.
#define MAKE_CSTRING(A)
Make C-string.
Auxiliary data structure for floating point format specification.
#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.
static const int PMT_DISABLE
KM3NeT Data Definitions v2.1.0-7-g97845ea https://git.km3net.de/common/km3net-dataformat.
Auxiliary data structure for sequence of same character.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
static const char *const _2SToT
Histogram naming.
do set_variable DETECTOR_TXT $WORKDIR detector
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in