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

Class containing the result of the unpacker in raw data and the result of the digitizer in simulation. More...

#include <CDCHit.h>

Inheritance diagram for CDCHit:
Collaboration diagram for CDCHit:

Public Types

enum  EAppendStatus {
  c_DontAppend = 0 ,
  c_Append = 1
}
 Enum for return state of addBGDigit function. More...
 

Public Member Functions

 CDCHit ()
 Empty constructor for ROOT IO.
 
 CDCHit (unsigned short tdcCount, unsigned short adcCount, unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire, unsigned short status=0, unsigned short tot=0, signed short otherHitIndex=-1, unsigned short leadingEdgeADC=0)
 Constructor to set all internal variables. More...
 
 CDCHit (unsigned short tdcCount, unsigned short adcCount, const WireID &wireID, unsigned short status=0, unsigned short tot=0, signed short otherHitIndex=-1, unsigned short leadingEdgeADC=0)
 Constructor using the WireID object.
 
void setWireID (unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
 Setter for Wire ID. More...
 
void setWireID (const WireID &wireID)
 Setter for Wire ID using the WireID object directly.
 
void setStatus (unsigned short status)
 Setter for CDCHit status. More...
 
void set2ndHitFlag ()
 Setter for 2nd hit flag.
 
void setAlreadyCheckedFlag ()
 Setter for already-checked flag.
 
void setTDCCount (short tdcCount)
 Setter for TDC count. More...
 
void setADCCount (unsigned short adcCount)
 Setter for ADC count.
 
void setOtherHitIndex (signed short index)
 Setter for the other hit index.
 
void setOtherHitIndices (CDCHit *otherHit)
 Setter for the other hit indices.
 
void setADCCountAtLeadingEdge (unsigned short adcCount)
 Setter for ADCcount at leading edge.
 
void setTOT (unsigned short tot)
 Setter for TOT.
 
unsigned short getIWire () const
 Getter for iWire.
 
unsigned short getILayer () const
 Getter for iLayer.
 
unsigned short getICLayer () const
 Getter for iCLayer (0-55).
 
unsigned short getISuperLayer () const
 Getter for iSuperLayer.
 
unsigned short getID () const
 Getter for encoded wire number. More...
 
unsigned short getStatus () const
 Getter for CDCHit status.
 
bool is2ndHit () const
 Getter for 2nd hit flag.
 
bool isAlreadyChecked () const
 Getter for already-checked flag.
 
short getTDCCount () const
 Getter for TDC count.
 
unsigned short getADCCount () const
 Getter for integrated charge. More...
 
signed short getOtherHitIndex () const
 Getter for otherHitIndex.
 
unsigned short getADCCountAtLeadingEdge () const
 Getter for adcCountAtLeadingEdge.
 
unsigned short getTOT () const
 Getter for TOT.
 
unsigned int getUniqueChannelID () const override
 Implementation of the base class function. More...
 
DigitBase::EAppendStatus addBGDigit (const DigitBase *bg) override
 Implementation of the base class function. More...
 
virtual void adjustAppendedBGDigit ()
 Virtual method for possible modification of BG digit which is just appended to simulation store array.
 
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).
 

Protected Attributes

unsigned short m_eWire
 Wire encoding. More...
 
unsigned short m_tdcCount
 TDC count in ns.
 
unsigned short m_adcCount
 ADC count of the integrated charge in the cell.
 
unsigned short m_status
 Status of CDCHit.
 
unsigned short m_tot
 Time over threshod.
 
signed short m_otherHitIndex
 Index to the other hit.
 
unsigned short m_adcCountAtLeadingEdge
 ADC count at leading edge.
 

Private Member Functions

 ClassDefOverride (CDCHit, 8)
 ROOT Macro.
 
 ClassDef (DigitBase, 2)
 ClassDef.
 

Private Attributes

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 containing the result of the unpacker in raw data and the result of the digitizer in simulation.

This class is optimized for low disc usage.
For reconstruction purposes, use the corresponding CDCRecoHit class or create your own class.

It stores the TDC count (timing information of the hit),
the accumulated ADC count of the charge in the hit cell,
and the WireID.

Regarding the treatment of 2nd fastest hit timing recorded by the front end, if it exists,
the unpacker creates another individual CDCHit object for the 2nd hit in addition to the CDCHit for the 1st hit.
In both case, the hit timing is stored as the TDC count.
To identify if the CDCHit is 1st hit or 2nd hit, the first bit of member variable, m_status, is assigned.
If such bit is 0(1), The CDCHit belongs to the 1st (2nd) hit.
The method CDCHit::is2ndHit() has to be used for this purpose.

The relastion between the 1st hit object and the 2nd hit object is established with the variable, m_otherHitIndex.
Users can call the CDCHit::getOtherHitIndex() to obtain the index of CDCHit array for the other hit.

Definition at line 40 of file CDCHit.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

◆ CDCHit()

CDCHit ( unsigned short  tdcCount,
unsigned short  adcCount,
unsigned short  iSuperLayer,
unsigned short  iLayer,
unsigned short  iWire,
unsigned short  status = 0,
unsigned short  tot = 0,
signed short  otherHitIndex = -1,
unsigned short  leadingEdgeADC = 0 
)

Constructor to set all internal variables.

Currently the setters are called for the actual assignment, for reducing the number of places where to encode the transformation into the internal encoding.

Parameters
tdcCountTiming measurement of the hit.
adcCountADC count of the accumulated charge in the drift cell for this hit.
iSuperLayerSuper Layer of the wire.
iLayerLayer number inside the Super Layer.
iWireWire number in the Layer.
statusStatus of the hit.
totTime over threshold.
otherHitIndexIndex to the other hit.
leadingEdgeADCFADCcount at a sampling point near the leading edge.

Definition at line 18 of file CDCHit.cc.

21 {
22  setTDCCount(tdcCount);
23  setADCCount(charge);
24  setWireID(iSuperLayer, iLayer, iWire);
25  setStatus(status);
26  setTOT(tot);
27  setOtherHitIndex(otherHitIndex);
28  setADCCountAtLeadingEdge(leadingEdgeCharge);
29 }
void setADCCountAtLeadingEdge(unsigned short adcCount)
Setter for ADCcount at leading edge.
Definition: CDCHit.h:154
void setTDCCount(short tdcCount)
Setter for TDC count.
Definition: CDCHit.h:128
void setOtherHitIndex(signed short index)
Setter for the other hit index.
Definition: CDCHit.h:141
void setTOT(unsigned short tot)
Setter for TOT.
Definition: CDCHit.h:160
void setADCCount(unsigned short adcCount)
Setter for ADC count.
Definition: CDCHit.h:135
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter for Wire ID.
Definition: CDCHit.h:90
void setStatus(unsigned short status)
Setter for CDCHit status.
Definition: CDCHit.h:106

Member Function Documentation

◆ addBGDigit()

DigitBase::EAppendStatus addBGDigit ( const DigitBase bg)
overridevirtual

Implementation of the base class function.

Overlay method.

Parameters
bgBG digit
Returns
append status

Implements DigitBase.

Definition at line 32 of file CDCHit.cc.

◆ 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.

◆ getADCCount()

unsigned short getADCCount ( ) const
inline

Getter for integrated charge.

Note: This is the integrated charge over the cell. In principle, this charge can come from more than just the track, this hit belongs to.

Definition at line 230 of file CDCHit.h.

231  {
232  return m_adcCount;
233  }
unsigned short m_adcCount
ADC count of the integrated charge in the cell.
Definition: CDCHit.h:282

◆ getID()

unsigned short getID ( ) const
inline

Getter for encoded wire number.

This number can be used directly e.g. with the = operator to create a WireID object.

Definition at line 193 of file CDCHit.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.

◆ getUniqueChannelID()

unsigned int getUniqueChannelID ( ) const
inlineoverridevirtual

Implementation of the base class function.

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

Returns
unique channel ID, the WireID is returned for the CDC.

Implements DigitBase.

Definition at line 258 of file CDCHit.h.

◆ setStatus()

void setStatus ( unsigned short  status)
inline

Setter for CDCHit status.

Parameters
statusindicates the CDCHit object status.

Definition at line 106 of file CDCHit.h.

◆ setTDCCount()

void setTDCCount ( short  tdcCount)
inline

Setter for TDC count.

Parameters
tdcCountInformation for timing of the hit.

Definition at line 128 of file CDCHit.h.

◆ setWireID()

void setWireID ( unsigned short  iSuperLayer,
unsigned short  iLayer,
unsigned short  iWire 
)
inline

Setter for Wire ID.

The numbering scheme is the same as in the one used in this document.

Parameters
iSuperLayerValues should be between [0, 8].
iLayerValues should be between [0, 7], depending on the SuperLayer.
iWireValues should be between [0, 511], depending on the SuperLayer.

Definition at line 90 of file CDCHit.h.

Member Data Documentation

◆ m_eWire

unsigned short m_eWire
protected

Wire encoding.

Details are now explained in the separate WireID object. I save only the encoded wire number instead of an WireID object to avoid streaming issues with ROOT.

Definition at line 276 of file CDCHit.h.


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