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

The SVD RecoDigit class. More...

#include <SVDRecoDigit.h>

Inheritance diagram for SVDRecoDigit:
Collaboration diagram for SVDRecoDigit:

Public Types

typedef uint16_t StoredProbType
 Types for internal storage of probability array.
 
typedef std::vector< StoredProbTypeStoredProbArray
 vector of StoreProbType objects
 
typedef double OutputProbType
 Type for output probability array. More...
 
typedef std::vector< OutputProbTypeOutputProbArray
 vector of OutProbType objects
 

Public Member Functions

template<typename T >
 SVDRecoDigit (VxdID sensorID, bool isU, short cellID, float fittedAmplitude, float fittedAmplitudeError, float fittedTime, float fittedTimeError, const T &probabilities, float chi2)
 Constructor using a stl container of time bin probabilities. More...
 
 SVDRecoDigit ()
 Default constructor for the ROOT IO.
 
VxdID getSensorID () const
 Get the sensor ID. More...
 
VxdID::baseType getRawSensorID () const
 Get raw sensor ID. More...
 
bool isUStrip () const
 Get strip direction. More...
 
short int getCellID () const
 Get strip ID. More...
 
float getAmplitude () const
 Get amplitude estimate. More...
 
float getCharge () const
 Get amplitude estimate, alternate getter name. More...
 
float getAmplitudeError () const
 Get amplitude error. More...
 
float getTime () const
 Get time estimate @returm fitted signal arrival time.
 
float getTimeError () const
 Get time error. More...
 
OutputProbArray getProbabilities () const
 Get signal time pdf. More...
 
float getChi2Ndf () const
 Get waveform fit chi2/ndf. More...
 
std::string toString () const
 Display main parameters in this object.
 
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.
 

Static Public Attributes

static const uint16_t storedProbArrayNorm = UINT16_MAX
 some constant
 

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

VxdID::baseType m_sensorID
 Compressed sensor identifier.
 
bool m_isU
 True if U, false if V.
 
short m_cellID
 Strip coordinate in pitch units.
 
float m_fittedAmplitude
 Fitted amplitude of the signal ("charge")
 
float m_fittedAmplitudeError
 Error estimate of amplitude fit.
 
float m_fittedTime
 Fitted arrival time of the signal.
 
float m_fittedTimeError
 Error estimate of time fit.
 
StoredProbArray m_probabilities
 pdf of the time estimate.
 
float m_fitChi2Ndf
 Standardized chi2 of the fit.
 
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

The SVD RecoDigit class.

The SVDRecoDigit is a calibrated and time-fitted strip signal. It contains strip identification data, plus fit and fit quality information. NB: This class will be bulky and is not intended for storage beyond the current event. NB: I tried to make the class as little dependent on the waveform fitter as possible. However, the current fitter produces a pdf for signal time and this may not be the case with a different fitter.

Definition at line 43 of file SVDRecoDigit.h.

Member Typedef Documentation

◆ OutputProbType

typedef double OutputProbType

Type for output probability array.

There is no link between this and what the fitter may produce.

Definition at line 56 of file SVDRecoDigit.h.

Constructor & Destructor Documentation

◆ SVDRecoDigit()

SVDRecoDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
float  fittedAmplitude,
float  fittedAmplitudeError,
float  fittedTime,
float  fittedTimeError,
const T &  probabilities,
float  chi2 
)
inline

Constructor using a stl container of time bin probabilities.

Parameters
sensorIDSensor VXD ID.
isUTrue if u strip, false if v.
cellIDStrip ID.
fittedAmplitudeamplitude estimate for the signal.
fittedAmplitudeErroramplitude error estimate.
fittedTimefitted time-of-arrival estimate.
fittedTimeErrortime error estimate.
probabilitiespdf for time estimate.
chi2Standardized chi2 for the fit.

Definition at line 71 of file SVDRecoDigit.h.

73  :
74  m_sensorID(sensorID), m_isU(isU), m_cellID(cellID),
75  m_fittedAmplitude(fittedAmplitude), m_fittedAmplitudeError(fittedAmplitudeError),
76  m_fittedTime(fittedTime), m_fittedTimeError(fittedTimeError), m_fitChi2Ndf(chi2)
77  {
78  // Expecting input array normalized to 1, but don't rely on it.
79  double inputNorm = std::accumulate(probabilities.begin(), probabilities.end(), 0.0);
80  if (inputNorm < 0.1) inputNorm = 1.0;
81  double normCoef = static_cast<double>(storedProbArrayNorm) / inputNorm;
82  std::transform(probabilities.begin(), probabilities.end(),
83  std::back_inserter(m_probabilities),
84  [normCoef](typename T::value_type x)->StoredProbType
85  { return static_cast<StoredProbType>(normCoef * x); }
86  );
87  }
StoredProbArray m_probabilities
pdf of the time estimate.
Definition: SVDRecoDigit.h:192
float m_fitChi2Ndf
Standardized chi2 of the fit.
Definition: SVDRecoDigit.h:193
bool m_isU
True if U, false if V.
Definition: SVDRecoDigit.h:185
VxdID::baseType m_sensorID
Compressed sensor identifier.
Definition: SVDRecoDigit.h:184
float m_fittedAmplitude
Fitted amplitude of the signal ("charge")
Definition: SVDRecoDigit.h:188
float m_fittedTime
Fitted arrival time of the signal.
Definition: SVDRecoDigit.h:190
short m_cellID
Strip coordinate in pitch units.
Definition: SVDRecoDigit.h:186
static const uint16_t storedProbArrayNorm
some constant
Definition: SVDRecoDigit.h:51
float m_fittedTimeError
Error estimate of time fit.
Definition: SVDRecoDigit.h:191
float m_fittedAmplitudeError
Error estimate of amplitude fit.
Definition: SVDRecoDigit.h:189

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.

◆ getAmplitude()

float getAmplitude ( ) const
inline

Get amplitude estimate.

Returns
fitted amplitude in e-

Definition at line 119 of file SVDRecoDigit.h.

◆ getAmplitudeError()

float getAmplitudeError ( ) const
inline

Get amplitude error.

Returns
amplitude error estimate in e-

Definition at line 129 of file SVDRecoDigit.h.

◆ getCellID()

short int getCellID ( ) const
inline

Get strip ID.

Returns
ID of the strip.

Definition at line 114 of file SVDRecoDigit.h.

◆ getCharge()

float getCharge ( void  ) const
inline

Get amplitude estimate, alternate getter name.

Returns
fitted amplitude in e-

Definition at line 124 of file SVDRecoDigit.h.

◆ getChi2Ndf()

float getChi2Ndf ( ) const
inline

Get waveform fit chi2/ndf.

Returns
chi2/ndf for the fit

Definition at line 163 of file SVDRecoDigit.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.

◆ getProbabilities()

OutputProbArray getProbabilities ( ) const
inline

Get signal time pdf.

Returns
array containing bin probabilities, normalized to 1.

Definition at line 144 of file SVDRecoDigit.h.

◆ getRawSensorID()

VxdID::baseType getRawSensorID ( ) const
inline

Get raw sensor ID.

For use in Python

Returns
basetype ID of the sensor.

Definition at line 104 of file SVDRecoDigit.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.

◆ getSensorID()

VxdID getSensorID ( void  ) const
inline

Get the sensor ID.

Returns
ID of the sensor.

Definition at line 98 of file SVDRecoDigit.h.

◆ getTimeError()

float getTimeError ( ) const
inline

Get time error.

Returns
time error estimate

Definition at line 139 of file SVDRecoDigit.h.

◆ isUStrip()

bool isUStrip ( ) const
inline

Get strip direction.

Returns
true if u, false if v.

Definition at line 109 of file SVDRecoDigit.h.


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