41 using namespace KM3NETDAQ;
54 JParser<> zap(
"Auxiliary program to integrate time-over-threshold distributions.");
56 zap[
'f'] =
make_field(inputFile,
"input file (output from JCalibrateToT).");
58 zap[
'a'] =
make_field(detectorFile,
"detector file.");
59 zap[
'x'] =
make_field(fitRange,
"ROOT integration range for noise.") = JRange_t(0.0, 8.0);
61 zap[
'r'] =
make_field(runNb,
"current run number");
66 catch(
const exception &error) {
67 FATAL(error.what() << endl);
84 TFile*
in = TFile::Open(inputFile.c_str(),
"exist");
85 if (
in == NULL || !
in->IsOpen()) {
86 FATAL(
"File: " << inputFile <<
" not opened." << endl);
88 ofstream ostr(
outputFile.c_str(), ios::out|ios::app);
90 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
91 DEBUG(
"Module " << module->getID() << endl);
94 WARNING(
"No histogram " << module->getID() <<
"; skip calculation." << endl);
98 for (
int ix = 1; ix <= h2s->GetXaxis()->GetNbins(); ++ix) {
101 const int domId = module->getID();
104 for (
int iy = h2s->GetNbinsY(); iy >= 1; --iy) {
105 const double y = h2s->GetBinContent(ix, iy);
107 if ((iy >= fitRange.getLowerLimit()) && (iy <= fitRange.getUpperLimit())) noise += y;
109 const double ratio = (signal != 0? noise/signal : 0);
110 const JModule dom = moduleRouter.getModule(domId);
112 const JParameters curPar(runNb, domId, ix - 1, -1, noise, signal, ratio > 0.5);
113 ostr << curPar << endl;
Utility class to parse command line options.
TString replace(const TString &target, const TRegexp ®exp, const T &replacement)
Replace regular expression in input by given replacement.
Data structure for a composite optical module.
Router for direct addressing of module data in detector data structure.
#define MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
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