Belle II Software  release-05-02-19
SVDShaperDigit Class Reference

The SVD ShaperDigit class. More...

#include <SVDShaperDigit.h>

Inheritance diagram for SVDShaperDigit:
Collaboration diagram for SVDShaperDigit:

Public Types

typedef uint8_t APVRawSampleType
 Types for array of samples received from DAQ. More...
 
typedef std::array< APVRawSampleType, c_nAPVSamplesAPVRawSamples
 array of APVRawSamplesType objects
 
typedef float APVFloatSampleType
 Types for array of samples for processing.
 
typedef std::array< APVFloatSampleType, c_nAPVSamplesAPVFloatSamples
 array of APVFloatSampleType objects
 
enum  EAppendStatus {
  c_DontAppend = 0,
  c_Append = 1
}
 Enum for return state of addBGDigit function. More...
 

Public Member Functions

template<typename T >
 SVDShaperDigit (VxdID sensorID, bool isU, short cellID, T samples[c_nAPVSamples], int8_t FADCTime=0, SVDModeByte mode=SVDModeByte())
 Constructor using c-array of samples. More...
 
template<typename T >
 SVDShaperDigit (VxdID sensorID, bool isU, short cellID, T samples, int8_t FADCTime=0, SVDModeByte mode=SVDModeByte())
 Constructor using a stl container of samples. More...
 
 SVDShaperDigit ()
 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...
 
APVFloatSamples getSamples () const
 Get array of samples. More...
 
int getMaxTimeBin () const
 Get the max bin. More...
 
int getMaxADCCounts () const
 Get the ADC counts corresponding to the higher sample amplitude. More...
 
float getFADCTime () const
 Get digit FADCTime estimate. More...
 
SVDModeByte getModeByte () const
 Get the SVDMOdeByte object containing information on trigger FADCTime and DAQ mode. More...
 
std::string toString () const
 Display main parameters in this object.
 
unsigned int getUniqueChannelID () const override
 Implementation of base class function. More...
 
DigitBase::EAppendStatus addBGDigit (const DigitBase *bg) override
 Implementation of base class function. More...
 
bool operator< (const SVDShaperDigit &x) const
 
bool passesZS (int nSamples, float cutMinSignal) const
 does the strip pass the ZS cut? 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.
 

Static Public Member Functions

template<typename T >
static SVDShaperDigit::APVRawSampleType trimToSampleRange (T x)
 Convert a value to sample range. More...
 

Static Public Attributes

static const std::size_t c_nAPVSamples = 6
 Number of APV samples stored.
 

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 (DigitBase, 2)
 ClassDef.
 

Private Attributes

VxdID::baseType m_sensorID = 0
 Compressed sensor identifier.
 
bool m_isU = false
 True if U, false if V.
 
short m_cellID = 0
 Strip coordinate in pitch units.
 
APVRawSamples m_samples
 6 APV signals from the strip.
 
int8_t m_FADCTime = 0
 digit time estimate from the FADC, in ns
 
SVDModeByte::baseType m_mode = SVDModeByte::c_DefaultID
 Mode byte, trigger FADCTime + DAQ mode.
 
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 ShaperDigit class.

The SVDShaperDigit holds a set of 6 raw APV25 signal samples, zero-padded in 3-sample mode) taken on a strip. It also holds DAQ mode (3 or 6 samples) and trigger time information in an SVDModeByte structure, and time fit from FADC (when available).

Definition at line 46 of file SVDShaperDigit.h.

Member Typedef Documentation

◆ APVRawSampleType

typedef uint8_t APVRawSampleType

Types for array of samples received from DAQ.

An integer type is sufficient for storage, but getters will return array of doubles suitable for computing.

Definition at line 57 of file SVDShaperDigit.h.

Member Enumeration Documentation

◆ EAppendStatus

enum EAppendStatus
inherited

Enum for return state of addBGDigit function.

Enumerator
c_DontAppend 

do not append BG digit to digits

c_Append 

append BG digit to digits

Definition at line 42 of file DigitBase.h.

Constructor & Destructor Documentation

◆ SVDShaperDigit() [1/2]

SVDShaperDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
samples[c_nAPVSamples],
int8_t  FADCTime = 0,
SVDModeByte  mode = SVDModeByte() 
)
inline

Constructor using c-array of samples.

Parameters
sensorIDSensor VXD ID.
isUTrue if u strip, false if v.
cellIDStrip ID.
samplesstd::array of 6 APV raw samples.
FADCTimeTime estimate from FADC
modeSVDModeByte structure, packed trigger time bin and DAQ mode.

Definition at line 75 of file SVDShaperDigit.h.

89  :
90  m_sensorID(sensorID), m_isU(isU), m_cellID(cellID), m_FADCTime(FADCTime),

◆ SVDShaperDigit() [2/2]

SVDShaperDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
samples,
int8_t  FADCTime = 0,
SVDModeByte  mode = SVDModeByte() 
)
inline

Constructor using a stl container of samples.

Parameters
sensorIDSensor VXD ID.
isUTrue if u strip, false if v.
cellIDStrip ID.
samplesstd::array of 6 APV raw samples.
FADCTimeTime estimate from FADC
modeSVDModeByte structure, packed trigger time bin and DAQ mode.

Definition at line 96 of file SVDShaperDigit.h.

Member Function Documentation

◆ addBGDigit()

DigitBase::EAppendStatus addBGDigit ( const DigitBase bg)
inlineoverridevirtual

Implementation of base class function.

Addition is always possible, so we always return successful merge. Pile-up method.

Parameters
bgbeam background digit
Returns
append status

Implements DigitBase.

Definition at line 233 of file SVDShaperDigit.h.

◆ 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 144 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 157 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 172 of file RelationsObject.h.

◆ getCellID()

short int getCellID ( ) const
inline

Get strip ID.

Returns
ID of the strip.

Definition at line 132 of file SVDShaperDigit.h.

◆ getFADCTime()

float getFADCTime ( ) const
inline

Get digit FADCTime estimate.

Returns
digit time estimate from FADC

Definition at line 174 of file SVDShaperDigit.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 372 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();
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 TrackFitResult, TRGSummary, Track, SoftwareTriggerResult, Particle, RecoTrack, MCParticle, Cluster, and PIDLikelihood.

Definition at line 364 of file RelationsObject.h.

◆ getMaxADCCounts()

int getMaxADCCounts ( ) const
inline

Get the ADC counts corresponding to the higher sample amplitude.

Returns
int of the ADC counts corresponding to the higher sample amplitude

Definition at line 162 of file SVDShaperDigit.h.

◆ getMaxTimeBin()

int getMaxTimeBin ( ) const
inline

Get the max bin.

Returns
int time bin corresponding to the higher sample amplitude

Definition at line 150 of file SVDShaperDigit.h.

◆ getModeByte()

SVDModeByte getModeByte ( ) const
inline

Get the SVDMOdeByte object containing information on trigger FADCTime and DAQ mode.

Returns
the SVDModeByte object of the digit

Definition at line 180 of file SVDShaperDigit.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, Particle, and MCParticle.

Definition at line 346 of file RelationsObject.h.

◆ getRawSensorID()

VxdID::baseType getRawSensorID ( ) const
inline

Get raw sensor ID.

For use in Python

Returns
basetype ID of the sensor.

Definition at line 122 of file SVDShaperDigit.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 280 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 265 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 316 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 250 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 299 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 333 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 214 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 199 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 232 of file RelationsObject.h.

◆ getSamples()

APVFloatSamples getSamples ( ) const
inline

Get array of samples.

Returns
std::array of 6 APV25 samples.

Definition at line 137 of file SVDShaperDigit.h.

◆ getSensorID()

VxdID getSensorID ( ) const
inline

Get the sensor ID.

Returns
ID of the sensor.

Definition at line 116 of file SVDShaperDigit.h.

◆ getUniqueChannelID()

unsigned int getUniqueChannelID ( ) const
inlineoverridevirtual

Implementation of base class function.

Enables BG overlay module to identify uniquely the physical channel of this Digit.

Returns
unique channel ID, composed of VxdID (1 - 16), strip side (17), and strip number (18-28)

Implements DigitBase.

Definition at line 223 of file SVDShaperDigit.h.

◆ isUStrip()

bool isUStrip ( ) const
inline

Get strip direction.

Returns
true if u, false if v.

Definition at line 127 of file SVDShaperDigit.h.

◆ operator<()

bool operator< ( const SVDShaperDigit x) const
inline
Parameters

Definition at line 253 of file SVDShaperDigit.h.

◆ passesZS()

bool passesZS ( int  nSamples,
float  cutMinSignal 
) const
inline

does the strip pass the ZS cut?

Parameters
nSamplesmin number of samples above threshold
cutMinSignalSN threshold
Returns
true if the strip have st least nSamples above threshold, false otherwise

Definition at line 269 of file SVDShaperDigit.h.

◆ trimToSampleRange()

static SVDShaperDigit::APVRawSampleType trimToSampleRange ( x)
inlinestatic

Convert a value to sample range.

Parameters
valueto be converted
Returns
APVRawSampleType representation of x

Definition at line 188 of file SVDShaperDigit.h.


The documentation for this class was generated from the following file:
Belle2::SVDShaperDigit::m_cellID
short m_cellID
Strip coordinate in pitch units.
Definition: SVDShaperDigit.h:288
Belle2::SVDShaperDigit::m_sensorID
VxdID::baseType m_sensorID
Compressed sensor identifier.
Definition: SVDShaperDigit.h:286
Belle2::SVDShaperDigit::m_FADCTime
int8_t m_FADCTime
digit time estimate from the FADC, in ns
Definition: SVDShaperDigit.h:290
Belle2::HTML::getString
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:18
Belle2::SVDShaperDigit::m_isU
bool m_isU
True if U, false if V.
Definition: SVDShaperDigit.h:287