Belle II Software development
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:
DigitBase RelationsInterface< BASE >

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.
 
 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.
 
void setWireID (const WireID &wireID)
 Setter for Wire ID using the WireID object directly.
 
void setStatus (unsigned short status)
 Setter for CDCHit status.
 
void set2ndHitFlag ()
 Setter for 2nd hit flag.
 
void setAlreadyCheckedFlag ()
 Setter for already-checked flag.
 
void setTDCCount (short tdcCount)
 Setter for TDC count.
 
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.
 
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.
 
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.
 
DigitBase::EAppendStatus addBGDigit (const DigitBase *bg) override
 Implementation of the base class function.
 
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).
 
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).
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).
 
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.
 
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.
 
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.
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation.
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation.
 
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.
 
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.
 
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.
 
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.
 
virtual std::string getName () const
 Return a short name that describes this object, e.g.
 
virtual std::string getInfoHTML () const
 Return a short summary of this object's contents in HTML format.
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format.
 
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.
 
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.

32 {
33 c_DontAppend = 0,
34 c_Append = 1
35 };
@ c_DontAppend
do not append BG digit to digits
Definition: DigitBase.h:33
@ c_Append
append BG digit to digits
Definition: DigitBase.h:34

Constructor & Destructor Documentation

◆ CDCHit() [1/3]

CDCHit ( )
inline

Empty constructor for ROOT IO.

Definition at line 43 of file CDCHit.h.

43 :
45 {
46 B2DEBUG(29, "Empty CDCHit Constructor called.");
47 }
unsigned short m_status
Status of CDCHit.
Definition: CDCHit.h:285
unsigned short m_tdcCount
TDC count in ns.
Definition: CDCHit.h:279
unsigned short m_eWire
Wire encoding.
Definition: CDCHit.h:276
unsigned short m_adcCountAtLeadingEdge
ADC count at leading edge.
Definition: CDCHit.h:294
unsigned short m_adcCount
ADC count of the integrated charge in the cell.
Definition: CDCHit.h:282
signed short m_otherHitIndex
Index to the other hit.
Definition: CDCHit.h:291
unsigned short m_tot
Time over threshod.
Definition: CDCHit.h:288

◆ CDCHit() [2/3]

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

◆ CDCHit() [3/3]

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 
)
inline

Constructor using the WireID object.

Definition at line 69 of file CDCHit.h.

71 {
72 setTDCCount(tdcCount);
73 setADCCount(adcCount);
74 setWireID(wireID);
75 setStatus(status);
76 setTOT(tot);
77 setOtherHitIndex(otherHitIndex);
78 setADCCountAtLeadingEdge(leadingEdgeADC);
79 }

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.

33{
34 const auto* bgDigit = static_cast<const CDCHit*>(bg);
35 const unsigned short tdc4Sg = m_tdcCount;
36 const unsigned short adc4Sg = m_adcCount;
37 const unsigned short tot4Sg = m_tot;
38 const unsigned short tdc4Bg = bgDigit->getTDCCount();
39 const unsigned short adc4Bg = bgDigit->getADCCount();
40 const unsigned short tot4Bg = bgDigit->getTOT();
41 // B2DEBUG(28, "Sg tdc,adc,tot= " << tdc4Sg << " " << adc4Sg << " " << tot4Sg);
42 // B2DEBUG(28, "Bg tdc,adc,tot= " << tdc4Bg << " " << adc4Bg << " " << tot4Bg);
43 int diff = static_cast<int>(m_tdcCount) - static_cast<int>(bgDigit->getTDCCount());
44
45 // If the BG hit is faster than the true hit, the TDC count is replaced, and
46 // relation is removed.
47 // ADC counts are summed up.
48 if (diff < 0) {
49 *this = *bgDigit;
50 auto relSimHits = this->getRelationsFrom<CDCSimHit>();
51 for (int i = relSimHits.size() - 1; i >= 0; --i) {
52 relSimHits.remove(i);
53 }
54 auto relMCParticles = this->getRelationsFrom<MCParticle>();
55 for (int i = relMCParticles.size() - 1; i >= 0; --i) {
56 relMCParticles.remove(i);
57 }
58 }
59
60 m_adcCount = adc4Sg + adc4Bg;
61
62 //Set TOT for signal+background case. It is assumed that the start timing
63 //of a pulse (input to ADC) is given by the TDC-count. This is an
64 //approximation becasue analog (for ADC) and digital (for TDC) parts are
65 //different in the front-end electronics.
66 unsigned short s1 = tdc4Sg; //start time of 1st pulse
67 unsigned short s2 = tdc4Bg; //start time of 2nd pulse
68 unsigned short w1 = 32 * tot4Sg; //its width
69 unsigned short w2 = 32 * tot4Bg; //its width
70 if (tdc4Sg < tdc4Bg) {
71 s1 = tdc4Bg;
72 w1 = 32 * tot4Bg;
73 s2 = tdc4Sg;
74 w2 = 32 * tot4Sg;
75 }
76 const unsigned short e1 = s1 - w1; //end time of 1st pulse
77 const unsigned short e2 = s2 - w2; //end time of 2nd pulse
78 // B2DEBUG(28, "s1,e1,w1,s2,e2,w2= " << s1 << " " << e1 << " " << w1 << " " << s2 << " " << e2 << " " << w2);
79
80 double pulseW = w1 + w2;
81 if (e1 <= e2) {
82 pulseW = w1;
83 } else if (e1 <= s2) {
84 pulseW = s1 - e2;
85 }
86
87 // maxtot=29 is hard-coded now
88 m_tot = std::min(std::round(pulseW / 32.), 29.);
89 // B2DEBUG(28, "adcCount,tot= " << m_adcCount << " " << m_tot);
90
92}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40

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

143 {
144 if (object)
146 object, object->m_cacheDataStoreEntry, object->m_cacheArrayIndex, weight, namedRelation);
147 }
void addRelation(const TObject *fromObject, StoreEntry *&fromEntry, int &fromIndex, const TObject *toObject, StoreEntry *&toEntry, int &toIndex, float weight, const std::string &namedRelation)
Add a relation from an object in a store array to another object in a store array.
Definition: DataStore.cc:492
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
DataStore::StoreEntry * m_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.

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

156 {
157 StoreEntry* toEntry = nullptr;
158 int toIndex = -1;
159 DataStore::Instance().addRelation(this, m_cacheDataStoreEntry, m_cacheArrayIndex, object, toEntry, toIndex, weight, namedRelation);
160 }

◆ adjustAppendedBGDigit()

virtual void adjustAppendedBGDigit ( )
inlinevirtualinherited

Virtual method for possible modification of BG digit which is just appended to simulation store array.

Reimplemented in SVDShaperDigit.

Definition at line 62 of file DigitBase.h.

62{}

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

171 {
172 if (!sourceObj)
173 return;
174 auto fromRels = sourceObj->getRelationsFrom<RelationsInterface<BASE>>("ALL");
175 for (unsigned int iRel = 0; iRel < fromRels.size(); iRel++) {
176 fromRels.object(iRel)->addRelationTo(this, fromRels.weight(iRel));
177 }
178
179 auto toRels = sourceObj->getRelationsTo<RelationsInterface<BASE>>("ALL");
180 for (unsigned int iRel = 0; iRel < toRels.size(); iRel++) {
181 this->addRelationTo(toRels.object(iRel), toRels.weight(iRel));
182 }
183 }
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).

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

◆ getADCCountAtLeadingEdge()

unsigned short getADCCountAtLeadingEdge ( ) const
inline

Getter for adcCountAtLeadingEdge.

Definition at line 242 of file CDCHit.h.

243 {
245 }

◆ getArrayIndex()

int getArrayIndex ( ) const
inlineinherited

Returns this object's array index (in StoreArray), or -1 if not found.

Definition at line 385 of file RelationsObject.h.

386 {
388 return m_cacheArrayIndex;
389 }
bool findStoreEntry(const TObject *object, StoreEntry *&entry, int &index)
Find an object in an array in the data store.
Definition: DataStore.cc:398

◆ getArrayName()

std::string getArrayName ( ) const
inlineinherited

Get name of array this object is stored in, or "" if not found.

Definition at line 377 of file RelationsObject.h.

◆ getArrayPointer()

TClonesArray * getArrayPointer ( ) const
inlineprotectedinherited

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

Definition at line 418 of file RelationsObject.h.

419 {
422 return nullptr;
424 }
TClonesArray * getPtrAsArray() const
Return ptr cast to TClonesArray.
Definition: StoreEntry.cc:83

◆ getICLayer()

unsigned short getICLayer ( ) const
inline

Getter for iCLayer (0-55).

Definition at line 178 of file CDCHit.h.

179 {
180 return WireID(m_eWire).getICLayer();
181 }

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

194 {
195 return m_eWire;
196 }

◆ getILayer()

unsigned short getILayer ( ) const
inline

Getter for iLayer.

Definition at line 172 of file CDCHit.h.

173 {
174 return WireID(m_eWire).getILayer();
175 }

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

371 {
373 }
virtual std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
std::string htmlToPlainText(const std::string &html)
See RelationsObject::getInfo()

◆ 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 Particle, Cluster, MCParticle, PIDLikelihood, SoftwareTriggerResult, Track, TrackFitResult, TRGSummary, and RecoTrack.

Definition at line 362 of file RelationsObject.h.

362{ return ""; }

◆ getISuperLayer()

unsigned short getISuperLayer ( ) const
inline

Getter for iSuperLayer.

Definition at line 184 of file CDCHit.h.

185 {
186 return WireID(m_eWire).getISuperLayer();
187 }

◆ getIWire()

unsigned short getIWire ( ) const
inline

Getter for iWire.

Definition at line 166 of file CDCHit.h.

167 {
168 return WireID(m_eWire).getIWire();
169 }

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

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

pi+ for an MCParticle.

Reimplemented in Particle, MCParticle, and SpacePoint.

Definition at line 344 of file RelationsObject.h.

344{ return ""; }

◆ getOtherHitIndex()

signed short getOtherHitIndex ( ) const
inline

Getter for otherHitIndex.

Definition at line 236 of file CDCHit.h.

237 {
238 return m_otherHitIndex;
239 }

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

279 {
281 T::Class(), name, namedRelation).object);
282 }
@ c_BothSides
Combination of c_FromSide and c_ToSide.
Definition: DataStore.h:79
Belle2::RelationEntry getRelationWith(ESearchSide searchSide, const TObject *object, StoreEntry *&entry, int &index, const TClass *withClass, const std::string &withName, const std::string &namedRelation)
Get the first relation between an object and another object in a store array.
Definition: DataStore.cc:597
TObject * object
Pointer to the object.
Definition: RelationEntry.h:32

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

264 {
266 m_cacheArrayIndex, FROM::Class(), name, namedRelation).object);
267 }
@ c_FromSide
Return relations/objects pointed from (to a given object).
Definition: DataStore.h:77

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

316 {
318 FROM::Class(), name, namedRelation);
319 return std::make_pair(static_cast<FROM*>(entry.object), entry.weight);
320 }

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

249 {
251 TO::Class(), name, namedRelation).object);
252 }
@ c_ToSide
Return relations/objects pointed to (from a given object).
Definition: DataStore.h:78

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

299 {
301 TO::Class(), name, namedRelation);
302 return std::make_pair(static_cast<TO*>(entry.object), entry.weight);
303 }

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

333 {
335 T::Class(), name, namedRelation);
336 return std::make_pair(static_cast<T*>(entry.object), entry.weight);
337 }

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

214 {
216 m_cacheArrayIndex, FROM::Class(), name, namedRelation));
217 }
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.

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

198 {
200 m_cacheArrayIndex, TO::Class(), name, namedRelation));
201 }

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

231 {
233 m_cacheArrayIndex, T::Class(), name, namedRelation));
234 }

◆ getStatus()

unsigned short getStatus ( ) const
inline

Getter for CDCHit status.

Definition at line 199 of file CDCHit.h.

200 {
201 return m_status;
202 }

◆ getTDCCount()

short getTDCCount ( ) const
inline

Getter for TDC count.

Definition at line 219 of file CDCHit.h.

220 {
221 return m_tdcCount;
222 }

◆ getTOT()

unsigned short getTOT ( ) const
inline

Getter for TOT.

Definition at line 248 of file CDCHit.h.

249 {
250 return m_tot;
251 }

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

258{return static_cast<unsigned int>(m_eWire);}

◆ is2ndHit()

bool is2ndHit ( ) const
inline

Getter for 2nd hit flag.

Definition at line 205 of file CDCHit.h.

206 {
207 bool tOrf = (m_status & 0x01) ? true : false;
208 return tOrf;
209 }

◆ isAlreadyChecked()

bool isAlreadyChecked ( ) const
inline

Getter for already-checked flag.

Definition at line 212 of file CDCHit.h.

213 {
214 bool tOrf = (m_status & 0x02) ? true : false;
215 return tOrf;
216 }

◆ set2ndHitFlag()

void set2ndHitFlag ( )
inline

Setter for 2nd hit flag.

Definition at line 113 of file CDCHit.h.

114 {
115 m_status |= 0x01;
116 }

◆ setADCCount()

void setADCCount ( unsigned short  adcCount)
inline

Setter for ADC count.

Definition at line 135 of file CDCHit.h.

136 {
137 m_adcCount = adcCount;
138 }

◆ setADCCountAtLeadingEdge()

void setADCCountAtLeadingEdge ( unsigned short  adcCount)
inline

Setter for ADCcount at leading edge.

Definition at line 154 of file CDCHit.h.

155 {
156 m_adcCountAtLeadingEdge = adcCount;
157 }

◆ setAlreadyCheckedFlag()

void setAlreadyCheckedFlag ( )
inline

Setter for already-checked flag.

Definition at line 119 of file CDCHit.h.

120 {
121 m_status |= 0x02;
122 }

◆ setOtherHitIndex()

void setOtherHitIndex ( signed short  index)
inline

Setter for the other hit index.

Definition at line 141 of file CDCHit.h.

142 {
143 m_otherHitIndex = index;
144 }

◆ setOtherHitIndices()

void setOtherHitIndices ( CDCHit otherHit)
inline

Setter for the other hit indices.

Definition at line 147 of file CDCHit.h.

148 {
149 m_otherHitIndex = otherHit->getArrayIndex();
150 otherHit->setOtherHitIndex(this->getArrayIndex());
151 }
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.

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

107 {
108 B2DEBUG(29, "setStatus called with " << status);
109 m_status = status;
110 }

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

129 {
130 B2DEBUG(29, "setTDCCount called with " << tdcCount);
131 m_tdcCount = tdcCount;
132 }

◆ setTOT()

void setTOT ( unsigned short  tot)
inline

Setter for TOT.

Definition at line 160 of file CDCHit.h.

161 {
162 m_tot = tot;
163 }

◆ setWireID() [1/2]

void setWireID ( const WireID wireID)
inline

Setter for Wire ID using the WireID object directly.

Definition at line 97 of file CDCHit.h.

98 {
99 m_eWire = wireID.getEWire();
100 }

◆ setWireID() [2/2]

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.

91 {
92 B2DEBUG(29, "setWireId called with" << iSuperLayer << ", " << iLayer << ", " << iWire);
93 m_eWire = WireID(iSuperLayer, iLayer, iWire).getEWire();
94 }

Member Data Documentation

◆ m_adcCount

unsigned short m_adcCount
protected

ADC count of the integrated charge in the cell.

Definition at line 282 of file CDCHit.h.

◆ m_adcCountAtLeadingEdge

unsigned short m_adcCountAtLeadingEdge
protected

ADC count at leading edge.

Definition at line 294 of file CDCHit.h.

◆ m_cacheArrayIndex

int m_cacheArrayIndex
mutableprivateinherited

Cache of the index in the TClonesArray to which this object belongs.

Definition at line 432 of file RelationsObject.h.

◆ m_cacheDataStoreEntry

DataStore::StoreEntry* m_cacheDataStoreEntry
mutableprivateinherited

Cache of the data store entry to which this object belongs.

Definition at line 429 of file RelationsObject.h.

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

◆ m_otherHitIndex

signed short m_otherHitIndex
protected

Index to the other hit.

Definition at line 291 of file CDCHit.h.

◆ m_status

unsigned short m_status
protected

Status of CDCHit.

Definition at line 285 of file CDCHit.h.

◆ m_tdcCount

unsigned short m_tdcCount
protected

TDC count in ns.

Definition at line 279 of file CDCHit.h.

◆ m_tot

unsigned short m_tot
protected

Time over threshod.

Definition at line 288 of file CDCHit.h.


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