22 int main(
int argc,
char**argv)
33 JParser<> zap(
"Example program to test intersection of straight line with cylinder.");
42 catch(
const exception &error) {
43 FATAL(error.what() << endl);
46 gRandom->SetSeed(seed);
51 const JCylinder3D cylinder(JCircle2D(JVector2D(0.0,0.0), 2.0), -1.0, +1.0);
54 int number_of_errors = 0;
55 int number_of_events = 0;
57 for (
int i = 0; i != numberOfEvents; ++i) {
61 const double x = gRandom->Uniform(-1.0, +1.0);
62 const double y = gRandom->Uniform(-1.0, +1.0);
63 const double z = gRandom->Uniform(-1.0, +1.0);
69 gRandom->Sphere(dx, dy, dz, 1.0);
71 JAxis3D axis(JVector3D(x, y, z), JVersor3D(dx, dy, dz));
76 make_pair(intersection.first - 1*precision,
false),
77 make_pair(2*precision,
true),
78 make_pair(intersection.second - intersection.first - 2*precision,
true),
79 make_pair(2*precision,
false)
86 const int N =
sizeof(
path)/
sizeof(path[0]);
90 for (
int i = 0; i !=
N; ++i) {
92 axis.move(path[i].
first);
94 if ((
getDistance(cylinder, axis.getPosition()) < 1e-3*precision) != path[i].second) {
98 pos[i] = axis.getPosition();
103 for (
int i = 0; i !=
N; ++i) {
104 cout << endl <<
"point[" << noshowpos << setw(1) << i <<
"] = "
105 << showpos <<
FIXED(9,5) << pos[i].getX() <<
' '
106 << showpos <<
FIXED(9,5) << pos[i].getY() <<
' '
107 << showpos <<
FIXED(9,5) << pos[i].getZ() <<
' '
108 <<
SCIENTIFIC(12,3) << cylinder.getDistance(pos[i]) <<
' '
109 << (cylinder.getDistance(pos[i]) < 1e-3*precision ?
"in" :
"out") << endl;
119 NOTICE(
"Number of errors: " << number_of_errors <<
" out of " << number_of_events <<
" events." << endl);
121 ASSERT(number_of_events > 0);
122 ASSERT(number_of_errors == 0);
Utility class to parse command line options.
int main(int argc, char *argv[])
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
Auxiliary data structure for floating point format specification.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null)&';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null)&';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
#define ASSERT(A,...)
Assert macro.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Utility class to parse command line options.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
Auxiliary data structure for floating point format specification.