26 int main(
int argc,
char**argv)
39 JParser<> zap(
"Example program to test angle of incidence of a photon from a muon on a PMT.");
42 zap[
'P'] =
make_field(pmt) = JAxis3D(JVector3D(0,0,1), JVersor3D(0,0,1));
49 catch(
const exception &error) {
50 FATAL(error.what() << endl);
53 gRandom->SetSeed(seed);
58 int number_of_errors = 0;
59 int number_of_events = 0;
61 for (
int i = 0;
i != numberOfEvents; ++
i) {
65 const double x = gRandom->Uniform(-1.0, +1.0);
66 const double y = gRandom->Uniform(-1.0, +1.0);
67 const double z = gRandom->Uniform(-1.0, +1.0);
69 const double dx = gRandom->Uniform(-1.0, +1.0);
70 const double dy = gRandom->Uniform(-1.0, +1.0);
71 const double dz = gRandom->Uniform(-1.0, +1.0);
73 JTrack3D ta(JVector3D(x, y, z), JVersor3D(dx, dy, dz), 0.0);
78 if (ta.getDistance(pmt) > precision) {
84 if (fabs(tb.getDirection().getDot(U) - ta.getDot(pmt)) > precision) {
89 DEBUG(
"distance " << ta.getDistance(pmt) << endl);
90 DEBUG(
"dot (1) " << tb.getDirection().getDot(U) << endl);
91 DEBUG(
"dot (2) " << ta.getDot(pmt) << endl);
95 NOTICE(
"Number of errors: " << number_of_errors <<
" out of " << number_of_events <<
" events." << endl);
97 ASSERT(number_of_events > 0);
98 ASSERT(number_of_errors == 0);
Utility class to parse command line options.
int main(int argc, char *argv[])
double getCosThetaC()
Get average cosine of Cherenkov angle of water corresponding to group velocity.
#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.
double getSinThetaC()
Get average sine of Cherenkov angle of water corresponding to group velocity.
#define DEBUG(A)
Message macros.