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;
 
   83         detector.getModule(address).getPMT(par->pmtId).setStatus(status);
 
   86           NOTICE(
"bad channel: pmt " << par->pmtId << 
", dom " 
   87                  << par->domId << 
" with a STF of " << ratio << endl);
 
   91     NOTICE(
"Store calibration data on file " << detectorFile << endl);
 
Utility class to parse command line options. 
 
int main(int argc, char *argv[])
 
ROOT TTree parameter settings of various packages. 
 
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. 
 
Address of module in detector data structure. 
 
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. 
 
const JModuleAddress & getAddress(const JObjectID &id) const 
Get address of module. 
 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
 
bool hasModule(const JObjectID &id) const 
Has module. 
 
do set_variable DETECTOR_TXT $WORKDIR detector