1 #ifndef _MathOperator_hh_
2 #define _MathOperator_hh_
7 namespace TTbarAnalysis
24 static float getModule(
const std::vector< int > & v);
25 static float getModule(
const std::vector< float > & v);
26 static float getModule(
const double * vector1);
31 static float getDistance(
const double * start,
const double * end);
32 static float getDistance(
const float * start,
const float * end);
34 static std::vector< float > *
vectorProduct(
const std::vector< float > & v1,
const std::vector< float > & v2);
36 static std::vector< float >
getAngles(std::vector< float > & direction);
37 static float getAngle(
const double * vector1,
const double * vector2);
39 static float getDistanceTo(
const std::vector< int > & vectorPoint1,
const std::vector< float > & vector1,
const std::vector< int > * pointOfLine );
40 static float getDistanceTo(
const double * vectorPoint1, std::vector< float > & vector1,
const double * pointOfLine );
42 static std::vector< float >
getDirection(std::vector< int > & vectorPoint1, std::vector< int > & vectorPoint2);
43 static std::vector< float >
getDirection(
const double * vectorPoint1,
const double * vectorPoint2);
44 static std::vector< float >
getDirection(
const double * vectorPoint1);
45 static std::vector< float >
getDirection(
const float * vectorPoint1);
47 static std::vector< int > *
getPoint(
int x,
int y,
int z);
48 static float getPt(
const double * momentum);
50 static double *
getPtOnVector(
const double * momentum,
const float * target);
51 static double getMissingPt(std::vector< const double * > & vectors,
const float * target);
52 static double *
toDoubleArray(
const float * target,
int size);
57 static std::vector< T * > *
MergeVectors(std::vector< T * > * vector1, std::vector< T * > * vector2);
72 if (!vector1 || !vector2)
76 std::vector< T *> * result =
new std::vector< T *>();
77 for (
int i = 0; i < vector1->size(); i++)
79 result->push_back(vector1->at(i));
81 for (
int i = 0; i < vector2->size(); i++)
83 result->push_back(vector2->at(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 std::vector< T * > * MergeVectors(std::vector< T * > *vector1, std::vector< T * > *vector2)
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)