Belle II Software  release-08-01-10
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)
 Constructor using c-array of samples. More...
 
template<typename T >
 SVDShaperDigit (VxdID sensorID, bool isU, short cellID, T samples, int8_t FADCTime=0)
 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...
 
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...
 
void adjustAppendedBGDigit () override
 Modify already appended BG digit if aquisition mode is 3 sample.
 
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 void setAPVMode (size_t mode, size_t firstSample)
 set APV mode for the event 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
 
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.
 

Static Private Attributes

static size_t s_APVSampleMode = 6
 APV acquisition mode (3 or 6)
 
static size_t s_APVSampleBegin = 0
 first sample number for 3 sample acquisition mode (0 - 3)
 

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.

Definition at line 32 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 43 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 32 of file DigitBase.h.

Constructor & Destructor Documentation

◆ SVDShaperDigit() [1/2]

SVDShaperDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
samples[c_nAPVSamples],
int8_t  FADCTime = 0 
)
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 mode.

Definition at line 60 of file SVDShaperDigit.h.

62  :
63  m_sensorID(sensorID), m_isU(isU), m_cellID(cellID), m_FADCTime(FADCTime)
64  {
65  std::transform(samples, samples + c_nAPVSamples, m_samples.begin(),
66  [](T x)->APVRawSampleType { return trimToSampleRange(x); }
67  );
68  }
bool m_isU
True if U, false if V.
static const std::size_t c_nAPVSamples
Number of APV samples stored.
VxdID::baseType m_sensorID
Compressed sensor identifier.
short m_cellID
Strip coordinate in pitch units.
int8_t m_FADCTime
digit time estimate from the FADC, in ns
APVRawSamples m_samples
6 APV signals from the strip.

◆ SVDShaperDigit() [2/2]

SVDShaperDigit ( VxdID  sensorID,
bool  isU,
short  cellID,
samples,
int8_t  FADCTime = 0 
)
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 mode.

Definition at line 79 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 204 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 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.

◆ getCellID()

short int getCellID ( ) const
inline

Get strip ID.

Returns
ID of the strip.

Definition at line 114 of file SVDShaperDigit.h.

◆ getFADCTime()

float getFADCTime ( ) const
inline

Get digit FADCTime estimate.

Returns
digit time estimate from FADC

Definition at line 155 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 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.

◆ 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 144 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 132 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, MCParticle, and Particle.

Definition at line 344 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 104 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 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.

◆ getSamples()

APVFloatSamples getSamples ( ) const
inline

Get array of samples.

Returns
std::array of 6 APV25 samples.

Definition at line 119 of file SVDShaperDigit.h.

◆ getSensorID()

VxdID getSensorID ( void  ) const
inline

Get the sensor ID.

Returns
ID of the sensor.

Definition at line 98 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 194 of file SVDShaperDigit.h.

◆ isUStrip()

bool isUStrip ( ) const
inline

Get strip direction.

Returns
true if u, false if v.

Definition at line 109 of file SVDShaperDigit.h.

◆ operator<()

bool operator< ( const SVDShaperDigit x) const
inline
Parameters

Definition at line 247 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 263 of file SVDShaperDigit.h.

◆ setAPVMode()

static void setAPVMode ( size_t  mode,
size_t  firstSample 
)
inlinestatic

set APV mode for the event

Parameters
mode= 3, 6 depending on the number of acquired samples
firstSample= first sample (of the 6) to be stored if mode = 3

Definition at line 282 of file SVDShaperDigit.h.

◆ trimToSampleRange()

static SVDShaperDigit::APVRawSampleType trimToSampleRange ( x)
inlinestatic

Convert a value to sample range.

Parameters
xvalue to be converted
Returns
APVRawSampleType representation of x

Definition at line 163 of file SVDShaperDigit.h.


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