28 int main(
int argc, 
char **argv)
 
   33   typedef JContainer< set<JTransmission_t> > disable_container;
 
   43     JParser<> zap(
"Auxiliary program to set disable status based on time-of-arrival histograms.");
 
   45     zap[
'f'] = 
make_field(inputFile,       
"input file (output from JCanberra).");
 
   46     zap[
'N'] = 
make_field(Nmin,            
"minimum number of entries")      = 1;
 
   47     zap[
'T'] = 
make_field(Tmax_us,         
"maximal time [us]")              = 60.0;
 
   48     zap[
'!'] = 
make_field(disableFile,     
"disable transmission file")      = 
"";
 
   53   catch(
const exception &error) {
 
   54     FATAL(error.what() << endl);
 
   58   disable_container disable;
 
   60   if (disableFile != 
"") {
 
   62     ifstream 
in(disableFile.c_str());
 
   69   disable.comment.add(JMeta(argc, argv));
 
   76     DEBUG(
"Processing " << *i << endl) ;
 
   78     TFile 
in(i->c_str(), 
"read");
 
   80     TIter iter(
in.GetListOfKeys());
 
   82     for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
   84       if (TString(key->GetName()).EndsWith(
".toa")) {
 
   86         TH1* 
h1 = 
dynamic_cast<TH1*
>(key->ReadObj());
 
   90           TString buffer(h1->GetName());
 
   92           const char* regexp = 
"[^0-9][0-9]* [0-9]*[^0-9]";
 
   94           buffer = buffer(TRegexp(regexp));
 
   95           buffer = buffer(1, buffer.Length() - 2);
 
   97           if (buffer.Length() > 0 && buffer.IsDigit()) {
 
  101             istringstream(buffer.Data()) >> 
id;
 
  105             h1->GetQuantiles(
Q.size(), 
R.data(), 
Q.data());
 
  107             const int    N    =  h1->GetEntries();
 
  108             const double T_us = (*
R.rbegin() - *
R.begin()) * 1.0e6;
 
  110             if (N < Nmin || T_us > Tmax_us) {
 
  112               NOTICE(
"disable: " << 
id << 
' '  
  113                      << setw(6)    << N     << (N    < Nmin    ? 
"*" : 
"") << 
"  "  
  114                      << 
FIXED(5,1) << T_us  << (T_us > Tmax_us ? 
"*" : 
"") << 
" [us]" << endl);
 
  121             ERROR(
"Histogram name " << h1->GetName() << 
" not compatible with regular expression " << regexp << 
"." << endl);
 
  130   if (disableFile != 
"") {
 
  132     ofstream out(disableFile.c_str());
 
Utility class to parse command line options. 
 
Q(UTCMax_s-UTCMin_s)-livetime_s
 
int main(int argc, char *argv[])
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
then for HISTOGRAM in h0 h1
 
Auxiliary data structure for floating point format specification. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
then usage $script[distance] fi case set_variable R
 
General purpose messaging. 
 
Utility class to parse command line options. 
 
Acoustic transmission identifier. 
 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
 
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