21 int main(
int argc, 
char **argv)
 
   27   JPMTParametersMap parameters;
 
   35     JParser<> zap(
"Example program to test PMT signal processor probability.");
 
   39     zap[
'p'] = 
make_field(pmt)              = JPMTIdentifier(-1,0);
 
   46   catch(
const exception &error) {
 
   47     FATAL(error.what() << endl);
 
   51   const double QEmax = 1.0;
 
   53   JPMTParameters buffer = parameters.getPMTParameters(pmt);
 
   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->getRandomAmplitude(npe);
 
   84     if (cpu->applyThreshold(x)) {
 
   89   const double P = (double) number_of_hits / (
double) numberOfHits; 
 
   91   DEBUG(
"Number of generated hits " << setw(8) << right << numberOfHits   << endl);
 
   92   DEBUG(
"Number of accepted  hits " << setw(8) << right << number_of_hits << endl);
 
   93   DEBUG(
"Probability (real) " << 
FIXED(8,5) << P                                  << endl);
 
   94   DEBUG(
"Probability (calc) " << 
FIXED(8,5) << cpu->getSurvivalProbability(NPE)   << endl);
 
   96   ASSERT(fabs(P - cpu->getSurvivalProbability(NPE)) < precision * cpu->getSurvivalProbability(NPE));
 
Utility class to parse command line options. 
 
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. 
 
Auxiliary data structure for floating point format specification. 
 
I/O formatting auxiliaries. 
 
#define ASSERT(A)
Assert macro. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
General purpose messaging. 
 
Utility class to parse command line options. 
 
PMT analogue signal processor. 
 
#define DEBUG(A)
Message macros. 
 
int main(int argc, char *argv[])