Belle II Software  release-08-01-10
EventShapeContainer Class Reference

Class for collecting the basic objects related to the event shape. More...

#include <EventShapeContainer.h>

Inheritance diagram for EventShapeContainer:
Collaboration diagram for EventShapeContainer:

Public Member Functions

 EventShapeContainer ()
 Default constructor, resets the sphericity matrix.
 
void setSphericityEigenvector (short i, ROOT::Math::XYZVector eigenvector)
 Sets the i-th sphericity eigenvector. More...
 
void setSphericityEigenvalue (short i, float eigenvalue)
 Sets the i-th sphericity eigenvalue. More...
 
void setFWMoment (short order, float moment)
 Sets the Fox-Wolfram (FW) moment of order n. More...
 
void setThrust (float thrust)
 Sets the thrust of the event. More...
 
void setThrustAxis (ROOT::Math::XYZVector thrustAxis)
 Sets the thrust axis, normalizing it. More...
 
void setSpherocityAxis (ROOT::Math::XYZVector spherocityAxis)
 Sets the spherocity axis, normalizing it. More...
 
void setHarmonicMomentThrust (short order, float moment)
 Sets the harmonic moment of order n, calculated using the thrust axis. More...
 
void setHarmonicMomentCollision (short order, float moment)
 Sets the harmonic moment of order n, calculated using the collision axis. More...
 
void setCleoConeThrust (short order, float moment)
 Sets the Cleo cone of order n, calculated using the thrust axis. More...
 
void setCleoConeCollision (short order, float moment)
 Sets the Cleo cone of order n, calculated using the collision axis. More...
 
void setForwardHemisphere4Momentum (ROOT::Math::PxPyPzEVector mom)
 Sets the 4-momentum of the forward hemisphere, as defined by the thrust axis. More...
 
void setBackwardHemisphere4Momentum (ROOT::Math::PxPyPzEVector mom)
 Sets the 4-momentum of the backward hemisphere, as defined by the thrust axis. More...
 
float getThrust () const
 Returns the thrust. More...
 
ROOT::Math::XYZVector getThrustAxis () const
 Returns the thrust axis (normalized). More...
 
ROOT::Math::XYZVector getSpherocityAxis () const
 Returns the spherocity axis (normalized). More...
 
float getSphericityEigenvalue (short i) const
 Returns the i-th sphericity matrix eigenvalue. More...
 
ROOT::Math::XYZVector getSphericityEigenvector (short i) const
 Returns the i-th sphericity matrix eigenvector. More...
 
float getFWMoment (short order) const
 Returns the Fox-Wolfram moment of a given order. More...
 
float getHarmonicMomentCollision (short order) const
 Returns the harmonic moment of a given order, calculated respect to the beam axis. More...
 
float getHarmonicMomentThrust (short order) const
 Returns the harmonic moment of a given order, calculated respect to the thrust axis. More...
 
float getCleoConeCollision (short order) const
 Returns the Cleo cone of a given order, calculated respect to the beam axis. More...
 
float getCleoConeThrust (short order) const
 Returns the Cleo cone of a given order, calculated respect to the thrust axis. More...
 
ROOT::Math::PxPyPzEVector getForwardHemisphere4Momentum () const
 Returns the 4-momentum of the forward hemisphere, as defined by the thrust axis. More...
 
ROOT::Math::PxPyPzEVector getBackwardHemisphere4Momentum () const
 Return the 4-momentum of the backward hemisphere, as defined by the thrust axis. More...
 
void addRelationTo (const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (with caching). More...
 
void addRelationTo (const TObject *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (no caching, can be quite slow). More...
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights). More...
 
template<class TO >
RelationVector< TO > getRelationsTo (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from this object to another store array. More...
 
template<class FROM >
RelationVector< FROM > getRelationsFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from another store array to this object. More...
 
template<class T >
RelationVector< T > getRelationsWith (const std::string &name="", const std::string &namedRelation="") const
 Get the relations between this object and another store array. More...
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation. More...
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation. More...
 
template<class T >
T * getRelated (const std::string &name="", const std::string &namedRelation="") const
 Get the object to or from which this object has a relation. More...
 
template<class TO >
std::pair< TO *, float > getRelatedToWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing to an array. More...
 
template<class FROM >
std::pair< FROM *, float > getRelatedFromWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from an array. More...
 
template<class T >
std::pair< T *, float > getRelatedWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from/to an array. More...
 
virtual std::string getName () const
 Return a short name that describes this object, e.g. More...
 
virtual std::string getInfoHTML () const
 Return a short summary of this object's contents in HTML format. More...
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format. More...
 
std::string getArrayName () const
 Get name of array this object is stored in, or "" if not found.
 
int getArrayIndex () const
 Returns this object's array index (in StoreArray), or -1 if not found.
 

Protected Member Functions

TClonesArray * getArrayPointer () const
 Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).
 

Private Member Functions

 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

ROOT::Math::XYZVector m_thrustAxis
 Thrust axis. More...
 
ROOT::Math::XYZVector m_spherocityAxis
 Spherocity axis. More...
 
ROOT::Math::XYZVector m_sphericityEigenvector [3]
 Sphericity tensor eigenvectors.
 
float m_sphericityEigenvalue [3] = {0.}
 Sphericity tensor eigenvalues.
 
float m_foxWolframMoments [10] = {0.}
 Fox Wolfram moments up to order 9.
 
float m_thrust = 0
 Thrust value.
 
float m_harmonicMomentsThrust [10] = {0.}
 Harmonic moments up to order 9, calculated respect to the thrust axis.
 
float m_cleoConesThrust [10] = {0.}
 Cleo cones up to order 9, calculated respect to the thrust axis.
 
float m_harmonicMomentsCollision [10] = {0.}
 Harmonic moments up to order 9, calculated respect to the collision axis.
 
float m_cleoConesCollision [10] = {0.}
 Cleo cones up to order 9, calculated respect to the collision axis.
 
ROOT::Math::PxPyPzEVector m_forwardHemisphere4Momentum
 Total 4-momentum of the particles in the forward hemisphere.
 
ROOT::Math::PxPyPzEVector m_backwardHemisphere4Momentum
 Total 4-momentum of the particles in the backward hemisphere.
 
DataStore::StoreEntrym_cacheDataStoreEntry
 Cache of the data store entry to which this object belongs.
 
int m_cacheArrayIndex
 Cache of the index in the TClonesArray to which this object belongs.
 

Detailed Description

Class for collecting the basic objects related to the event shape.

This object is written by the EventShapeCalculator module, that stores here the quantities that require long calculations like the FW moments, the sphericity(-like) tensors and the shape axes (like thrust axis or jet axes). These quantities will be then used by the VaribaleManager functions to get the final EventShape variable, which are usually very simple to calculate. For example, the EventShapeCalculator will store here the Fox-Wolfram moments, while the ratios of them will be calculated on fly by the Variable Manager. We prefer this approach rather than storing every event shape variable directly here to keep a reasonably small data object, and making adding more variables easier.

All the quantities are defined and calculated in the center of mass frame.

The Event shape variables stored here can be divided into two classes: axis independent and axis-based. The first one are uniquely defined by the particles in the event, while the latter one require also a reference axis to be calculated.

The axis-independent quantities currently implemented are:

  • sphericity tensor eigenvalues and eigenvectors
  • Fow-Wolfram moments from 0 to 9

The axis-dependent quantities currently implemented are:

  • Harmonic moments from 0 to 9
  • Thrust
  • Cleo cones All these quantities are can be stored in two versions:
  • calculated respect to the e+e- collision axis (defined by the beam parameters)
  • calculated respect to the thrust axis (calculated by the EventShapeCalculator module)

Definition at line 53 of file EventShapeContainer.h.

Member Function Documentation

◆ addRelationTo() [1/2]

void addRelationTo ( const RelationsInterface< BASE > *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (with caching).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 142 of file RelationsObject.h.

◆ addRelationTo() [2/2]

void addRelationTo ( const TObject *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (no caching, can be quite slow).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 155 of file RelationsObject.h.

◆ copyRelations()

void copyRelations ( const RelationsInterface< BASE > *  sourceObj)
inlineinherited

Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).

Useful if you want to make a complete copy of a StoreArray object to make modifications to it, but retain all information on linked objects.

Note: this only works if sourceObj inherits from the same base (e.g. RelationsObject), and only for related objects that also inherit from the same base.

Definition at line 170 of file RelationsObject.h.

◆ getBackwardHemisphere4Momentum()

ROOT::Math::PxPyPzEVector getBackwardHemisphere4Momentum ( ) const
inline

Return the 4-momentum of the backward hemisphere, as defined by the thrust axis.

Returns
PxPyPzEVector of the particles in the hemisphere

Definition at line 368 of file EventShapeContainer.h.

369  {
371  };
ROOT::Math::PxPyPzEVector m_backwardHemisphere4Momentum
Total 4-momentum of the particles in the backward hemisphere.

◆ getCleoConeCollision()

float getCleoConeCollision ( short  order) const
inline

Returns the Cleo cone of a given order, calculated respect to the beam axis.

Parameters
orderOrder of the harmonic moment
Returns
float Cleo cone

Definition at line 331 of file EventShapeContainer.h.

◆ getCleoConeThrust()

float getCleoConeThrust ( short  order) const
inline

Returns the Cleo cone of a given order, calculated respect to the thrust axis.

Parameters
orderOrder of the harmonic moment
Returns
float Cleo cone

Definition at line 345 of file EventShapeContainer.h.

◆ getForwardHemisphere4Momentum()

ROOT::Math::PxPyPzEVector getForwardHemisphere4Momentum ( ) const
inline

Returns the 4-momentum of the forward hemisphere, as defined by the thrust axis.

Returns
PxPyPzEVector of the particles in the hemisphere

Definition at line 359 of file EventShapeContainer.h.

◆ getFWMoment()

float getFWMoment ( short  order) const
inline

Returns the Fox-Wolfram moment of a given order.

Parameters
orderOrder of the FW moment
Returns
float FW moment

Definition at line 288 of file EventShapeContainer.h.

◆ getHarmonicMomentCollision()

float getHarmonicMomentCollision ( short  order) const
inline

Returns the harmonic moment of a given order, calculated respect to the beam axis.

Parameters
orderOrder of the harmonic moment
Returns
float harmonic moment

Definition at line 302 of file EventShapeContainer.h.

◆ getHarmonicMomentThrust()

float getHarmonicMomentThrust ( short  order) const
inline

Returns the harmonic moment of a given order, calculated respect to the thrust axis.

Parameters
orderOrder of the harmonic moment
Returns
float harmonic moment

Definition at line 316 of file EventShapeContainer.h.

◆ getInfo()

std::string getInfo ( ) const
inlineinherited

Return a short summary of this object's contents in raw text format.

Returns the contents of getInfoHTML() while translating line-breaks etc.

Note
: You don't need to implement this function (it's not virtual), getInfoHTML() is enough.

Definition at line 370 of file RelationsObject.h.

◆ getInfoHTML()

virtual std::string getInfoHTML ( ) const
inlinevirtualinherited

Return a short summary of this object's contents in HTML format.

Reimplement this in your own class to provide useful output for display or debugging purposes. For example, you might do something like:

std::stringstream out;
out << "<b>PDG</b>: " << m_pdg << "<br>";
out << "<b>Covariance Matrix</b>: " << HTML::getString(getCovariance5()) << "<br>";
return out.str();
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:24
See also
Particle::getInfoHTML() for a more complex example.
HTML for some utility functions.
Use getInfo() to get a raw text version of this output.

Reimplemented in RecoTrack, TRGSummary, TrackFitResult, Track, SoftwareTriggerResult, PIDLikelihood, MCParticle, Cluster, and Particle.

Definition at line 362 of file RelationsObject.h.

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

Return a short name that describes this object, e.g.

pi+ for an MCParticle.

Reimplemented in SpacePoint, MCParticle, and Particle.

Definition at line 344 of file RelationsObject.h.

◆ getRelated()

T* getRelated ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to or from which this object has a relation.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 278 of file RelationsObject.h.

◆ getRelatedFrom()

FROM* getRelatedFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object from which this object has a relation.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 263 of file RelationsObject.h.

◆ getRelatedFromWithWeight()

std::pair<FROM*, float> getRelatedFromWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from an array.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 314 of file RelationsObject.h.

◆ getRelatedTo()

TO* getRelatedTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to which this object has a relation.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 248 of file RelationsObject.h.

◆ getRelatedToWithWeight()

std::pair<TO*, float> getRelatedToWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing to an array.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 297 of file RelationsObject.h.

◆ getRelatedWithWeight()

std::pair<T*, float> getRelatedWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from/to an array.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 331 of file RelationsObject.h.

◆ getRelationsFrom()

RelationVector<FROM> getRelationsFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from another store array to this object.

Template Parameters
FROMThe class of objects from which the relations point.
Parameters
nameThe name of the store array from which the relations point. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 212 of file RelationsObject.h.

◆ getRelationsTo()

RelationVector<TO> getRelationsTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from this object to another store array.

Template Parameters
TOThe class of objects to which the relations point.
Parameters
nameThe name of the store array to which the relations point. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 197 of file RelationsObject.h.

◆ getRelationsWith()

RelationVector<T> getRelationsWith ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations between this object and another store array.

Relations in both directions are returned.

Template Parameters
TThe class of objects to or from which the relations point.
Parameters
nameThe name of the store array to or from which the relations point. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 230 of file RelationsObject.h.

◆ getSphericityEigenvalue()

float getSphericityEigenvalue ( short  i) const
inline

Returns the i-th sphericity matrix eigenvalue.

Parameters
ithe number of the eigenvalue (0,1,2)
Returns
float the eigenvalue

Definition at line 256 of file EventShapeContainer.h.

◆ getSphericityEigenvector()

ROOT::Math::XYZVector getSphericityEigenvector ( short  i) const
inline

Returns the i-th sphericity matrix eigenvector.

Parameters
ithe number of the eigenvalue (0,1,2)
Returns
float the eigenvector

Definition at line 271 of file EventShapeContainer.h.

◆ getSpherocityAxis()

ROOT::Math::XYZVector getSpherocityAxis ( ) const
inline

Returns the spherocity axis (normalized).

Returns
XYZVector the spherocity axis, normalized

Definition at line 246 of file EventShapeContainer.h.

◆ getThrust()

float getThrust ( ) const
inline

Returns the thrust.

Returns
XYZVector the thrust axis, normalized

Definition at line 228 of file EventShapeContainer.h.

◆ getThrustAxis()

ROOT::Math::XYZVector getThrustAxis ( ) const
inline

Returns the thrust axis (normalized).

Returns
XYZVector the thrust axis, normalized

Definition at line 237 of file EventShapeContainer.h.

◆ setBackwardHemisphere4Momentum()

void setBackwardHemisphere4Momentum ( ROOT::Math::PxPyPzEVector  mom)
inline

Sets the 4-momentum of the backward hemisphere, as defined by the thrust axis.

Parameters
momPxPyPzEVector of the particles in the backward hemisphere

Definition at line 213 of file EventShapeContainer.h.

◆ setCleoConeCollision()

void setCleoConeCollision ( short  order,
float  moment 
)
inline

Sets the Cleo cone of order n, calculated using the collision axis.

Parameters
orderThe order (0 to 9)
momentThe Cleo cone value

Definition at line 192 of file EventShapeContainer.h.

◆ setCleoConeThrust()

void setCleoConeThrust ( short  order,
float  moment 
)
inline

Sets the Cleo cone of order n, calculated using the thrust axis.

Parameters
orderThe order (0 to 9)
momentThe Cleo cone value

Definition at line 179 of file EventShapeContainer.h.

◆ setForwardHemisphere4Momentum()

void setForwardHemisphere4Momentum ( ROOT::Math::PxPyPzEVector  mom)
inline

Sets the 4-momentum of the forward hemisphere, as defined by the thrust axis.

Parameters
momPxPyPzEVector of the particles in the forward hemisphere

Definition at line 204 of file EventShapeContainer.h.

◆ setFWMoment()

void setFWMoment ( short  order,
float  moment 
)
inline

Sets the Fox-Wolfram (FW) moment of order n.

This is NOT the normalized FW moment (R1, R2...), but the original one.

Parameters
orderThe order (0 to 9)
momentThe Fox-Wolfram moment value

Definition at line 109 of file EventShapeContainer.h.

◆ setHarmonicMomentCollision()

void setHarmonicMomentCollision ( short  order,
float  moment 
)
inline

Sets the harmonic moment of order n, calculated using the collision axis.

Parameters
orderThe order (0 to 9)
momentThe harmonic moment value

Definition at line 166 of file EventShapeContainer.h.

◆ setHarmonicMomentThrust()

void setHarmonicMomentThrust ( short  order,
float  moment 
)
inline

Sets the harmonic moment of order n, calculated using the thrust axis.

Parameters
orderThe order (0 to 9)
momentThe harmonic moment value

Definition at line 153 of file EventShapeContainer.h.

◆ setSphericityEigenvalue()

void setSphericityEigenvalue ( short  i,
float  eigenvalue 
)
inline

Sets the i-th sphericity eigenvalue.

Parameters
ithe order (0,1,2)
eigenvaluethe eigenvalue

Definition at line 96 of file EventShapeContainer.h.

◆ setSphericityEigenvector()

void setSphericityEigenvector ( short  i,
ROOT::Math::XYZVector  eigenvector 
)
inline

Sets the i-th sphericity eigenvector.

Parameters
ithe order (0,1,2)
eigenvectorthe eigenvector

Definition at line 83 of file EventShapeContainer.h.

◆ setSpherocityAxis()

void setSpherocityAxis ( ROOT::Math::XYZVector  spherocityAxis)
inline

Sets the spherocity axis, normalizing it.

Parameters
spherocityAxissperocity axis. Must have magnitude equal to the thrust value.

Definition at line 141 of file EventShapeContainer.h.

◆ setThrust()

void setThrust ( float  thrust)
inline

Sets the thrust of the event.

Parameters
thrustthrust value

Definition at line 121 of file EventShapeContainer.h.

◆ setThrustAxis()

void setThrustAxis ( ROOT::Math::XYZVector  thrustAxis)
inline

Sets the thrust axis, normalizing it.

Parameters
thrustAxisthrust axis.

Definition at line 130 of file EventShapeContainer.h.

Member Data Documentation

◆ m_spherocityAxis

ROOT::Math::XYZVector m_spherocityAxis
private

Spherocity axis.

It is not normalized, and it's length is the spherocity value

Definition at line 378 of file EventShapeContainer.h.

◆ m_thrustAxis

ROOT::Math::XYZVector m_thrustAxis
private

Thrust axis.

It is not normalized, and it's length is the thrust value

Definition at line 377 of file EventShapeContainer.h.


The documentation for this class was generated from the following file: