3 namespace TTbarAnalysis
14 for (
int i = 0; i < 3; i++)
25 for (
int i = 0; i < 3; i++)
27 vec.push_back(start[i] - end[i]);
30 for (
int i = 0; i < 3; i++)
39 for (
int i = 0; i < 3; i++)
41 vec.push_back(start[i] - end[i]);
44 for (
int i = 0; i < 3; i++)
55 for (
unsigned int i = 0; i < v.size(); i++)
59 module = sqrt(module);
66 for (
unsigned int i = 0; i < v.size(); i++)
70 module = sqrt(module);
76 for (
int i = 0; i < 3; i++)
78 module += vector1[i]*vector1[i];
86 if (module1 < 0.00000000001 || module2 < 0.000000000001)
91 for (
int i = 0; i < 3; i++)
93 product += vector1[i]*vector2[i];
95 return acos((
float)product/module1/module2);
99 vector< float > result;
100 float epsilon = 0.00001;
104 if (direction[0] > 0.0 && direction[1] > 0.0 - epsilon)
106 phi = atan(direction[1] / direction[0]);
108 if (direction[0] < 0.0 && direction[1] > 0.0)
110 phi = semi - atan(direction[1] / direction[0]) ;
112 if (direction[0] < 0.0 && direction[1] < 0.0 + epsilon)
114 phi = atan(direction[1] / direction[0]) +
pi;
116 if (direction[0] > 0.0 && direction[1] < 0.0 - epsilon)
118 phi = semi - atan(direction[1] / direction[0]) +
pi;
120 if (direction[1] > 0.0 && direction[0] < 0.0 + epsilon && direction[0] > 0.0 - epsilon)
124 if (direction[1] < 0.0 && direction[0] < 0.0 + epsilon && direction[0] > 0.0 - epsilon)
128 float teta = acos(direction[2]);
129 result.push_back(phi);
130 result.push_back(teta);
141 vector< float > vector1;
142 for (
int i = 0; i < 3; i++)
144 vector1.push_back((
float)(vectorPoint1[i] - vectorPoint2[i]));
147 for (
int i = 0; i < 3; i++)
149 vector1[i] = vector1[i]/module;
156 vector< float > vector1;
157 for (
int i = 0; i < 3; i++)
159 vector1.push_back(vectorPoint1[i] - vectorPoint2[i]);
162 for (
int i = 0; i < 3; i++)
164 vector1[i] = vector1[i]/module;
171 vector< float > vector1;
172 for (
int i = 0; i < 3; i++)
174 vector1.push_back(vectorPoint[i] / module);
181 vector<float> * result =
new vector<float>();
182 result->push_back(v1[1]*v2[2]-v1[2]*v2[1]);
183 result->push_back(v1[2]*v2[0]-v1[0]*v2[2]);
184 result->push_back(v1[0]*v2[1]-v1[1]*v2[0]);
192 vector< float > vector2;
193 for (
int i = 0; i < 3; i++)
195 vector2.push_back((
float)(vectorPoint1[i] - point->at(i)));
206 vector< float > vector2;
207 for (
int i = 0; i < 3; i++)
209 vector2.push_back(vectorPoint1[i] - point[i]);
220 int size = (
sizeof(array)/
sizeof(*array));
225 double * arrPoint1 =
new double[size];
226 for (
int i = 0; i < size; i++)
228 arrPoint1[i] = array[i];
234 vector< vector< int > * > * result =
new vector< vector< int > * >();
235 for (
int x = -2; x < 3; x++)
237 for (
int y = -2; y < 3; y++)
242 for (
int y = -2; y < 3; y+=4)
252 for (
int x = -2; x < 3; x+=4)
254 for (
int y = -1; y < 2; y++)
279 for (
int y = -2; y < 3; y++)
281 for (
int x = -2; x < 3; x++)
283 if (x == 0 && y == 0)
291 for (
int y = -1; y < 2; y++)
293 for (
int x = -1; x < 2; x++)
295 if (x == 0 && y == 0)
306 vector< int > * point =
new vector< int >();
314 return sqrt(momentum[0] * momentum[0] + momentum[1] * momentum[1]);
319 float pL = momentum[2];
323 result = 0.5 * log((p+pL)/(p-pL));
336 double * pt =
new double[3];
337 double product = 0.0;
338 for (
int i = 0; i < 3; i++)
340 product += momentum[i] * direction[i];
342 for (
int i = 0; i < 3; i++)
344 pt[i] = momentum[i] - direction[i] * product;
352 vector< double * > pts;
353 for (
unsigned int i = 0; i < vectors.size(); i++)
357 for (
int i = 0; i < 3; i++)
359 for (
unsigned int j = 0; j < vectors.size(); j++)
368 double * array =
new double[3]();
369 for (
int i = 0; i < size; i++)
371 array[i] = target[i];
static double * castIntToDouble(int *array)
static double * getPtOnVector(const double *momentum, const float *target)
static std::vector< float > getDirection(std::vector< int > &vectorPoint1, std::vector< int > &vectorPoint2)
static std::vector< float > * vectorProduct(const std::vector< float > &v1, const std::vector< float > &v2)
static float getModule(const std::vector< int > &v)
static bool approximatelyEqual(const double *start1, const double *end, double p)
static float getPt(const double *momentum)
static std::vector< std::vector< int > * > * GetMagicNumbers()
static std::vector< float > getAngles(std::vector< float > &direction)
static double * toDoubleArray(const float *target, int size)
static double getMissingPt(std::vector< const double * > &vectors, const float *target)
static std::vector< int > * getPoint(int x, int y, int z)
static float getDistance(const double *start, const double *end)
static float getDistanceTo(const std::vector< int > &vectorPoint1, const std::vector< float > &vector1, const std::vector< int > *pointOfLine)
static float getAngle(const double *vector1, const double *vector2)
static float getRapidity(const double *momentum)