27 int main(
int argc, 
char**argv)
 
   45     JParser<> zap(
"Test program for fit of quaternions.");
 
   49     zap[
'x'] = 
make_field(X,               
"tilt angle around x-axis [deg]") = 0.0;
 
   50     zap[
'y'] = 
make_field(Y,               
"tilt angle around y-axis [deg]") = 0.0;
 
   51     zap[
'z'] = 
make_field(Z,               
"tilt angle around z-axis [deg]") = 0.0;
 
   52     zap[
'a'] = 
make_field(alpha,           
"twist angle [deg/m]");
 
   60   catch(
const exception &error) {
 
   61     FATAL(error.what() << endl);
 
   65   gRandom->SetSeed(seed);
 
   70   TH1D hc(
"chi2/NDF", NULL, 100, 0.0,  2.0);
 
   71   TH1D h0(
"tilt",     NULL, 100, 0.0,  2.0);
 
   72   TH1D h1(
"twist",    NULL, 100, 0.0,  0.1);
 
   95   for (
int counter = 0; counter != numberOfEvents; ++counter) {
 
   97     STATUS(
"event: " << setw(10) << counter << 
'\r'); 
DEBUG(endl);
 
  102     const double z1  = 30.0;                       
 
  103     const double dz  = 10.0;                       
 
  104     const double eps = 1.0e-6;                     
 
  108     for (
int i = 1; i <= N; ++i) {
 
  110       const double z = z1 + (i - 1) * dz;          
 
  124       DEBUG(
FIXED(4,1) << i->getZ() << 
' ' << 
FIXED(12,8) << i->getQuaternion() << endl);
 
  137       simplex.
step.resize(4);
 
  145       const int    ndf  = 
data.size() * 4 - simplex.
step.size();
 
  151       DEBUG(
"chi2 " << chi2 << 
'/' << ndf << endl);
 
General purpose messaging.
 
#define DEBUG(A)
Message macros.
 
Utility class to parse command line options.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
int main(int argc, char **argv)
Test program for fit of quaternions.
 
std::vector< JModel_t > step
 
Data structure for direction in three dimensions.
 
Data structure for position in three dimensions.
 
Data structure for unit quaternion in three dimensions.
 
Utility class to parse command line options.
 
double getChi2(const double P)
Get chi2 corresponding to given probability.
 
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
 
static const double PI
Mathematical constants.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Auxiliary data structure for floating point format specification.
 
Model for fit to acoustics data.
 
Auxiliary data structure for chi2 evaluation.
 
static int debug
debug level (default is off).
 
This class represents a rotation around the x-axis.
 
This class represents a rotation around the y-axis.
 
This class represents a rotation around the z-axis.