Example program to test PMT signal processor probability.  
More...
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Example program to test PMT signal processor probability. 
- Author
 - mdejong 
 
Definition in file JPMTSignalProcessor.cc.
 
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 21 of file JPMTSignalProcessor.cc.
   35     JParser<> zap(
"Example program to test PMT signal processor probability.");
 
   46   catch(
const exception &error) {
 
   47     FATAL(error.what() << endl);
 
   51   const double QEmax = 1.0;
 
   55   DEBUG(
"PMT parameters:" << endl);
 
   58   if (buffer.QE > QEmax) {
 
   60     WARNING(
"PMT QE set to " << QEmax << endl);
 
   65   JPMTSignalProcessorInterface* cpu = 
new JPMTAnalogueSignalProcessor(buffer);
 
   70   int number_of_hits = 0;
 
   72   for (
int i = 0; i != numberOfHits; ++i) {
 
   76     for (
int __i = 0; __i != NPE; ++__i) {
 
   82     double x = cpu->getRandomCharge(npe);
 
   86       if (cpu->applyThreshold(x) >= cpu->ABOVE_THRESHOLD) {
 
   90     } 
catch (
const JValueOutOfRange& exception) {
 
   92       DEBUG(exception.what());
 
   98   const double P = (double) number_of_hits / (
double) numberOfHits; 
 
  100   DEBUG(
"Number of generated hits " << setw(8) << right << numberOfHits   << endl);
 
  101   DEBUG(
"Number of accepted  hits " << setw(8) << right << number_of_hits << endl);
 
  102   DEBUG(
"Probability (real) " << 
FIXED(8,5) << 
P                                  << endl);
 
  103   DEBUG(
"Probability (calc) " << 
FIXED(8,5) << cpu->getSurvivalProbability(NPE)   << endl);
 
  105   ASSERT(fabs(
P - cpu->getSurvivalProbability(NPE)) < precision * cpu->getSurvivalProbability(NPE));
 
Utility class to parse command line options. 
 
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
 
Simple data structure to support I/O of equations (see class JLANG::JEquation). 
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
Auxiliary data structure for floating point format specification. 
 
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
 
#define ASSERT(A,...)
Assert macro. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
#define DEBUG(A)
Message macros.