1 #ifndef __JSIRENE__JEVENTSHAPEVARIABLES__
2 #define __JSIRENE__JEVENTSHAPEVARIABLES__
49 static const int MAX_STEPS = 20;
50 static const double epsilon = 1e-9;
53 Vec axis0(0.0, 0.0, 0.0);
78 double res = numeric_limits<double>::max();
80 for (
int k = 0; k < MAX_STEPS && res >
epsilon; ++k) {
82 Vec axis1(0.0, 0.0, 0.0);
90 axis1 += (p.
dot(axis0) > 0.0 ? p : -p);
96 res = acos( axis0.
dot(axis1) );
112 pSum += fabs(p.
dot(axis0));
184 for (
int k = 0; k < (int) this->size(); ++k) {
185 (*this)[k] += getContribution(p0,
p1, k) / Evis / Evis;
258 const double r = 2.0)
271 const double c =
pow(p.
len(),
r-2);
273 a00 += c * p.
x * p.
x;
274 a01 += c * p.
x * p.
y;
275 a02 += c * p.
x * p.
z;
277 a10 += c * p.
y * p.
x;
278 a11 += c * p.
y * p.
y;
279 a12 += c * p.
y * p.
z;
281 a20 += c * p.
z * p.
x;
282 a21 += c * p.
z * p.
y;
283 a22 += c * p.
z * p.
z;
285 norm += c * p.
dot(p);
302 const double r = 2.0) :
325 return 3 * (lambda[1] + lambda[2]) / 2.0;
336 return 3 * lambda[2] / 2.0;
347 return (fabs(lambda[0] + lambda[1]) > 0.0 ?
348 2 * lambda[1] / (lambda[0] + lambda[1]) : 0.0);
359 return 4 * lambda[0] * lambda[1] / (lambda[0] + lambda[1]) / (lambda[0] + lambda[1]);
370 return 3 * (lambda[0]*lambda[1] + lambda[0]*lambda[2] + lambda[1]*lambda[2]);
381 return 27 * lambda[0] * lambda[1] * lambda[2];
439 lambda = getEigenValues();
462 return lambda[2] / (lambda[0] + lambda[1] + lambda[2]);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Auxiliary methods for mathematics.
Data structure for position in three dimensions.
double getY() const
Get y position.
double getLengthSquared() const
Get length squared.
double getZ() const
Get z position.
double getX() const
Get x position.
Exception for accessing a value in a collection that is outside of its range.
eigen_values getEigenValues(const double epsilon=1e-6) const
Get eigen values.
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
JPosition3D getPosition(const Vec &pos)
Get position.
T pow(const T &x, const double y)
Power .
double legendre(const size_t n, const double x)
Legendre polynome.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const JCylinder3D getMaximumContainmentVolume()
Auxiliary function to retrieve the maximum cylindrical containment volume.
double getThrust(const Evt &event)
Compute thrust for a given event.
double getVisibleEnergy(const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
Get the visible energy of a track.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
The cylinder used for photon tracking.
Class for computing Fox-Wolfram moments.
std::vector< double >::reference reference
JFoxWolframMoments()
Default constructor.
double getContribution(const Vec &p0, const Vec &p1, const size_t n)
Get contribution to Fox-Wolfram moment from two momenta.
JFoxWolframMoments(const std::vector< Trk >::const_iterator __begin, const std::vector< Trk >::const_iterator __end, const JCylinder3D &can=getMaximumContainmentVolume(), const int N=4)
Constructor.
JFoxWolframMoments(const Evt &event, const JCylinder3D &can=getMaximumContainmentVolume(), const int N=4)
Constructor.
Class for hit inertia tensor calculations.
JHitInertiaTensor(const Evt &event, const JPosition3D &reference)
Constructor.
double getEigenvalueRatio() const
Get eigenvalue ratio.
JHitInertiaTensor()
Default constructor.
eigen_values lambda
eigenvalues
JMatrix3S::eigen_values eigen_values
JHitInertiaTensor(std::vector< Hit >::const_iterator __begin, std::vector< Hit >::const_iterator __end, const JPosition3D &reference)
Constructor.
Class for sphericity tensor calculations.
JMatrix3S::eigen_values eigen_values
JSphericityTensor()
Default constructor.
double getSphericity() const
Get sphericity.
double getAplanarity() const
Get aplanarity.
double getCircularity() const
Get circularity.
eigen_values lambda
sorted eigenvalues
JSphericityTensor(std::vector< Trk >::const_iterator __begin, std::vector< Trk >::const_iterator __end, const double r=2.0)
Constructor.
const eigen_values & getEigenValues() const
Get eigenvalues.
double getPlanarFlow() const
Get planar flow.
JSphericityTensor(const Evt &event, const double r=2.0)
Constructor.
double getC() const
Get C-variable.
double getD() const
Get D-variable.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
double len() const
Get length.
double dot(const Vec &v) const
Get dot product.
Vec & normalize()
Normalise this vector.