21 int main(
int argc,
char **argv)
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);
71 int number_of_hits = 0;
73 for (
int i = 0; i != numberOfHits; ++i) {
77 for (
int __i = 0; __i != NPE; ++__i) {
83 double x = cpu->getRandomCharge(npe);
87 if (cpu->applyThreshold(
x)) {
99 const double P = (double) number_of_hits / (
double) numberOfHits;
101 DEBUG(
"Number of generated hits " << setw(8) << right << numberOfHits << endl);
102 DEBUG(
"Number of accepted hits " << setw(8) << right << number_of_hits << endl);
103 DEBUG(
"Probability (real) " <<
FIXED(8,5) << P << endl);
104 DEBUG(
"Probability (calc) " <<
FIXED(8,5) << cpu->getSurvivalProbability(NPE) << endl);
106 ASSERT(fabs(P - cpu->getSurvivalProbability(NPE)) < precision * cpu->getSurvivalProbability(NPE));
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
PMT analogue signal processor.
int main(int argc, char **argv)
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Auxiliary class for map of PMT parameters.
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT parameters.
double QE
relative quantum efficiency
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
PMT signal processor interface.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
virtual const char * what() const override
Get error message.
Exception for accessing a value in a collection that is outside of its range.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
PMT analogue signal processor.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...