Belle II Software development
CDCSimHit Class Reference

Example Detector. More...

#include <CDCSimHit.h>

Inheritance diagram for CDCSimHit:
SimHitBase RelationsInterface< BASE >

Public Member Functions

void setWireID (int iCLayerID, int iWireID)
 Setter for Wire ID.
 
void setTrackId (int trackId)
 The method to set track id.
 
void setPDGCode (int pdg)
 The method to set PDG code.
 
void setDriftLength (double driftLength)
 The method to set drift length.
 
void setFlightTime (double flightTime)
 The method to set flight time.
 
void setGlobalTime (double globalTime)
 The method to set global time.
 
void setEnergyDep (double edep)
 The method to set deposited energy.
 
void setStepLength (double stepLength)
 The method to set step length.
 
void setMomentum (const B2Vector3D &momentum)
 The method to set momentum.
 
void setPosWire (const B2Vector3D &posWire)
 The method to set position on wire.
 
void setPosIn (const B2Vector3D &posIn)
 The method to set position of pre-step.
 
void setPosOut (const B2Vector3D &posOut)
 The method to set position of post-step.
 
void setPosTrack (const B2Vector3D &posTrack)
 The method to set position on the track.
 
void setPosFlag (int zeroOrOne)
 The method to set position flag.
 
void setLeftRightPassageRaw (int minusOneOrZeroOrOne)
 The method to set new left/right info. for digitization.
 
void setLeftRightPassage (int minusOneOrZeroOrOne)
 The method to set new left/right info. for tracking.
 
WireID getWireID () const
 Getter for WireID object.
 
int getTrackId () const
 The method to get track id.
 
int getPDGCode () const
 The method to get PDG code.
 
double getDriftLength () const
 The method to get drift length.
 
double getFlightTime () const
 The method to get flight time.
 
double getEnergyDep () const
 The method to get deposited energy.
 
double getStepLength () const
 The method to get step length.
 
B2Vector3D getMomentum () const
 The method to get momentum.
 
B2Vector3D getPosWire () const
 The method to get position on wire.
 
B2Vector3D getPosIn () const
 The method to get position of pre-step.
 
B2Vector3D getPosOut () const
 The method to get position of post-step.
 
B2Vector3D getPosTrack () const
 The method to get position on the track.
 
int getPosFlag () const
 The method to get old left/right info.
 
int getLeftRightPassageRaw () const
 The method to get new left/right info. for digitization.
 
int getLeftRightPassage () const
 The method to get new left/right info. for tracking.
 
float getGlobalTime () const override
 The method to get global time.
 
 CDCSimHit ()
 Empty constructor.
 
 CDCSimHit (int layerId, int wireId, int trackId, int pdg, double driftLength, double flightTime, double edep, double stepLength, B2Vector3D momentum, B2Vector3D posWire, B2Vector3D posIn, B2Vector3D posOut, B2Vector3D posTrack, int leftRight, double globalTime)
 Useful Constructor.
 
virtual void shiftInTime (float delta) override
 Shift the SimHit in time.
 
 ClassDefOverride (CDCSimHit, 6)
 ROOT Macro.
 
virtual void setBackgroundTag (unsigned int backgroundTag)
 Set background tag.
 
virtual unsigned short getBackgroundTag () const
 Get background tag.
 
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).
 

Private Member Functions

 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

WireID m_wireID
 The WireID of the hit.
 
unsigned short m_trackId
 The track id of this hit.
 
int m_pdg
 Particle PDG (can be one of secondaries).
 
float m_driftLength
 Drift length of this hit.
 
float m_flightTime
 Flight time from IP.
 
float m_edep
 Deposited energy of this hit.
 
float m_stepLength
 Step length of this hit.
 
float m_momentum [3]
 The momentum at closest point.
 
float m_posWire [3]
 The position on wire which is closest to this hit.
 
float m_posIn [3]
 Position of pre-step.
 
float m_posOut [3]
 Position of post-step.
 
float m_posTrack [3]
 Position on the track.
 
unsigned char m_leftRight
 The flag to denote this hit is in the left or right side.
 
float m_globalTime
 Time of energy deposition.
 
unsigned short m_backgroundTag
 Background tag.
 
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

Example Detector.

Definition at line 21 of file CDCSimHit.h.

Constructor & Destructor Documentation

◆ CDCSimHit() [1/2]

CDCSimHit ( )
inline

Empty constructor.

Recommended for ROOT IO

Definition at line 254 of file CDCSimHit.h.

254 : SimHitBase(),
255 m_trackId(0), m_pdg(0), m_driftLength(0.0),
256 m_flightTime(0.0), m_edep(0.0), m_stepLength(1.0),
260 {}
float m_globalTime
Time of energy deposition.
Definition: CDCSimHit.h:70
float m_flightTime
Flight time from IP.
Definition: CDCSimHit.h:38
unsigned char m_leftRight
The flag to denote this hit is in the left or right side.
Definition: CDCSimHit.h:67
float m_posOut[3]
Position of post-step.
Definition: CDCSimHit.h:56
float m_posIn[3]
Position of pre-step.
Definition: CDCSimHit.h:53
int m_pdg
Particle PDG (can be one of secondaries).
Definition: CDCSimHit.h:32
float m_stepLength
Step length of this hit.
Definition: CDCSimHit.h:44
float m_posWire[3]
The position on wire which is closest to this hit.
Definition: CDCSimHit.h:50
unsigned short m_trackId
The track id of this hit.
Definition: CDCSimHit.h:29
float m_driftLength
Drift length of this hit.
Definition: CDCSimHit.h:35
float m_edep
Deposited energy of this hit.
Definition: CDCSimHit.h:41
float m_momentum[3]
The momentum at closest point.
Definition: CDCSimHit.h:47
float m_posTrack[3]
Position on the track.
Definition: CDCSimHit.h:59
SimHitBase()
Constructor.
Definition: SimHitBase.h:33

◆ CDCSimHit() [2/2]

CDCSimHit ( int  layerId,
int  wireId,
int  trackId,
int  pdg,
double  driftLength,
double  flightTime,
double  edep,
double  stepLength,
B2Vector3D  momentum,
B2Vector3D  posWire,
B2Vector3D  posIn,
B2Vector3D  posOut,
B2Vector3D  posTrack,
int  leftRight,
double  globalTime 
)
inline

Useful Constructor.

Definition at line 263 of file CDCSimHit.h.

277 : SimHitBase()
278 {
279
280 m_wireID.setWireID(layerId, wireId);
281 m_trackId = trackId;
282 m_pdg = pdg;
283 m_driftLength = driftLength;
284 m_flightTime = flightTime;
285 m_edep = edep;
286 m_stepLength = stepLength;
287 m_momentum[0] = momentum.X();
288 m_momentum[1] = momentum.Y();
289 m_momentum[2] = momentum.Z();
290 m_posWire[0] = posWire.X();
291 m_posWire[1] = posWire.Y();
292 m_posWire[2] = posWire.Z();
293 m_posIn[0] = posIn.X();
294 m_posIn[1] = posIn.Y();
295 m_posIn[2] = posIn.Z();
296 m_posOut[0] = posOut.X();
297 m_posOut[1] = posOut.Y();
298 m_posOut[2] = posOut.Z();
299 m_posTrack[0] = posTrack.X();
300 m_posTrack[1] = posTrack.Y();
301 m_posTrack[2] = posTrack.Z();
302 m_leftRight = (unsigned char)leftRight & 0x7; // mask 3 bits (LSB).
303 m_globalTime = globalTime;
304 }
WireID m_wireID
The WireID of the hit.
Definition: CDCSimHit.h:26
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter using official numbering.
Definition: WireID.h:112

Member Function Documentation

◆ addRelationTo() [1/2]

void addRelationTo ( const RelationsInterface< BASE > *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (with caching).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 142 of file RelationsObject.h.

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 }

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

◆ 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

◆ getBackgroundTag()

virtual unsigned short getBackgroundTag ( ) const
inlinevirtualinherited

Get background tag.

Returns
The background tag value.

Definition at line 46 of file SimHitBase.h.

46{ return m_backgroundTag; }
unsigned short m_backgroundTag
Background tag.
Definition: SimHitBase.h:68

◆ getDriftLength()

double getDriftLength ( ) const
inline

The method to get drift length.

Definition at line 181 of file CDCSimHit.h.

181{ return m_driftLength; }

◆ getEnergyDep()

double getEnergyDep ( ) const
inline

The method to get deposited energy.

Definition at line 187 of file CDCSimHit.h.

187{ return m_edep; }

◆ getFlightTime()

double getFlightTime ( ) const
inline

The method to get flight time.

Definition at line 184 of file CDCSimHit.h.

184{ return m_flightTime; }

◆ getGlobalTime()

float getGlobalTime ( ) const
inlineoverridevirtual

The method to get global time.

Reimplemented from SimHitBase.

Definition at line 248 of file CDCSimHit.h.

248{ return m_globalTime; }

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

◆ getLeftRightPassage()

int getLeftRightPassage ( ) const
inline

The method to get new left/right info. for tracking.

Definition at line 238 of file CDCSimHit.h.

239 {
240 // int minusOneOrOne = (int((m_leftRight & 0x4) >> 2) == 0) ? -1 : 1;
241 // return minusOneOrOne;
242 int zeroOrOne = (int((m_leftRight & 0x4) >> 2) == 0) ? 0 : 1;
243 return zeroOrOne;
244 }

◆ getLeftRightPassageRaw()

int getLeftRightPassageRaw ( ) const
inline

The method to get new left/right info. for digitization.

Definition at line 229 of file CDCSimHit.h.

230 {
231 // int minusOneOrOne = (int((m_leftRight & 0x2) >> 1) == 0) ? -1 : 1;
232 // return minusOneOrOne;
233 int zeroOrOne = (int((m_leftRight & 0x2) >> 1) == 0) ? 0 : 1;
234 return zeroOrOne;
235 }

◆ getMomentum()

B2Vector3D getMomentum ( ) const
inline

The method to get momentum.

Definition at line 193 of file CDCSimHit.h.

194 {
195 return B2Vector3D(m_momentum[0], m_momentum[1], m_momentum[2]);
196 }
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

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

◆ getPDGCode()

int getPDGCode ( ) const
inline

The method to get PDG code.

Definition at line 178 of file CDCSimHit.h.

178{ return m_pdg; }

◆ getPosFlag()

int getPosFlag ( ) const
inline

The method to get old left/right info.

Definition at line 223 of file CDCSimHit.h.

224 {
225 return (int)(m_leftRight & 0x1);
226 }

◆ getPosIn()

B2Vector3D getPosIn ( ) const
inline

The method to get position of pre-step.

Definition at line 205 of file CDCSimHit.h.

206 {
207 return B2Vector3D(m_posIn[0], m_posIn[1], m_posIn[2]);
208 }

◆ getPosOut()

B2Vector3D getPosOut ( ) const
inline

The method to get position of post-step.

Definition at line 211 of file CDCSimHit.h.

212 {
213 return B2Vector3D(m_posOut[0], m_posOut[1], m_posOut[2]);
214 }

◆ getPosTrack()

B2Vector3D getPosTrack ( ) const
inline

The method to get position on the track.

Definition at line 217 of file CDCSimHit.h.

218 {
219 return B2Vector3D(m_posTrack[0], m_posTrack[1], m_posTrack[2]);
220 }

◆ getPosWire()

B2Vector3D getPosWire ( ) const
inline

The method to get position on wire.

Definition at line 199 of file CDCSimHit.h.

200 {
201 return B2Vector3D(m_posWire[0], m_posWire[1], m_posWire[2]);
202 }

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

◆ getStepLength()

double getStepLength ( ) const
inline

The method to get step length.

Definition at line 190 of file CDCSimHit.h.

190{ return m_stepLength; }

◆ getTrackId()

int getTrackId ( ) const
inline

The method to get track id.

Definition at line 175 of file CDCSimHit.h.

175{ return m_trackId; }

◆ getWireID()

WireID getWireID ( ) const
inline

Getter for WireID object.

Definition at line 172 of file CDCSimHit.h.

172{return m_wireID;}

◆ setBackgroundTag()

virtual void setBackgroundTag ( unsigned int  backgroundTag)
inlinevirtualinherited

Set background tag.

Parameters
backgroundTagThe desired setting of the background tag.

Definition at line 39 of file SimHitBase.h.

40 { m_backgroundTag = static_cast<unsigned short>(backgroundTag); }

◆ setDriftLength()

void setDriftLength ( double  driftLength)
inline

The method to set drift length.

Definition at line 91 of file CDCSimHit.h.

91{ m_driftLength = driftLength; }

◆ setEnergyDep()

void setEnergyDep ( double  edep)
inline

The method to set deposited energy.

Definition at line 100 of file CDCSimHit.h.

100{ m_edep = edep; }

◆ setFlightTime()

void setFlightTime ( double  flightTime)
inline

The method to set flight time.

Definition at line 94 of file CDCSimHit.h.

94{ m_flightTime = flightTime; }

◆ setGlobalTime()

void setGlobalTime ( double  globalTime)
inline

The method to set global time.

Definition at line 97 of file CDCSimHit.h.

97{ m_globalTime = globalTime; }

◆ setLeftRightPassage()

void setLeftRightPassage ( int  minusOneOrZeroOrOne)
inline

The method to set new left/right info. for tracking.

Definition at line 164 of file CDCSimHit.h.

165 {
166 int zeroOrOne = (minusOneOrZeroOrOne <= 0) ? 0 : 1;
167 m_leftRight &= 0x3;
168 m_leftRight = (m_leftRight | ((unsigned char)zeroOrOne << 2));
169 }

◆ setLeftRightPassageRaw()

void setLeftRightPassageRaw ( int  minusOneOrZeroOrOne)
inline

The method to set new left/right info. for digitization.

Definition at line 156 of file CDCSimHit.h.

157 {
158 int zeroOrOne = (minusOneOrZeroOrOne <= 0) ? 0 : 1;
159 m_leftRight &= 0x5;
160 m_leftRight = (m_leftRight | ((unsigned char)zeroOrOne << 1));
161 }

◆ setMomentum()

void setMomentum ( const B2Vector3D momentum)
inline

The method to set momentum.

Definition at line 106 of file CDCSimHit.h.

107 {
108 m_momentum[0] = momentum.X();
109 m_momentum[1] = momentum.Y();
110 m_momentum[2] = momentum.Z();
111 }

◆ setPDGCode()

void setPDGCode ( int  pdg)
inline

The method to set PDG code.

Definition at line 88 of file CDCSimHit.h.

88{ m_pdg = pdg; }

◆ setPosFlag()

void setPosFlag ( int  zeroOrOne)
inline

The method to set position flag.

Definition at line 149 of file CDCSimHit.h.

150 {
151 m_leftRight &= 0x6;
152 m_leftRight = (m_leftRight | (unsigned char)zeroOrOne);
153 }

◆ setPosIn()

void setPosIn ( const B2Vector3D posIn)
inline

The method to set position of pre-step.

Definition at line 122 of file CDCSimHit.h.

123 {
124 m_posIn[0] = posIn.X();
125 m_posIn[1] = posIn.Y();
126 m_posIn[2] = posIn.Z();
127 }

◆ setPosOut()

void setPosOut ( const B2Vector3D posOut)
inline

The method to set position of post-step.

Definition at line 130 of file CDCSimHit.h.

131 {
132 m_posOut[0] = posOut.X();
133 m_posOut[1] = posOut.Y();
134 m_posOut[2] = posOut.Z();
135 }

◆ setPosTrack()

void setPosTrack ( const B2Vector3D posTrack)
inline

The method to set position on the track.

Definition at line 138 of file CDCSimHit.h.

139 {
140 m_posTrack[0] = posTrack.X();
141 m_posTrack[1] = posTrack.Y();
142 m_posTrack[2] = posTrack.Z();
143 }

◆ setPosWire()

void setPosWire ( const B2Vector3D posWire)
inline

The method to set position on wire.

Definition at line 114 of file CDCSimHit.h.

115 {
116 m_posWire[0] = posWire.X();
117 m_posWire[1] = posWire.Y();
118 m_posWire[2] = posWire.Z();
119 }

◆ setStepLength()

void setStepLength ( double  stepLength)
inline

The method to set step length.

Definition at line 103 of file CDCSimHit.h.

103{ m_stepLength = stepLength; }

◆ setTrackId()

void setTrackId ( int  trackId)
inline

The method to set track id.

Definition at line 85 of file CDCSimHit.h.

85{ m_trackId = (unsigned short)trackId; }

◆ setWireID()

void setWireID ( int  iCLayerID,
int  iWireID 
)
inline

Setter for Wire ID.

Parameters
iCLayerIDnumber of layer with continuous counting method.
iWireIDnumber of wire within the layer.

Definition at line 79 of file CDCSimHit.h.

80 {
81 m_wireID.setWireID(iCLayerID, iWireID);
82 }

◆ shiftInTime()

virtual void shiftInTime ( float  delta)
inlineoverridevirtual

Shift the SimHit in time.

Parameters
deltaThe value of the time shift.

Reimplemented from SimHitBase.

Definition at line 309 of file CDCSimHit.h.

310 {
311 m_globalTime += delta;
312 }

Member Data Documentation

◆ m_backgroundTag

unsigned short m_backgroundTag
privateinherited

Background tag.

Definition at line 68 of file SimHitBase.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_driftLength

float m_driftLength
private

Drift length of this hit.

Definition at line 35 of file CDCSimHit.h.

◆ m_edep

float m_edep
private

Deposited energy of this hit.

Definition at line 41 of file CDCSimHit.h.

◆ m_flightTime

float m_flightTime
private

Flight time from IP.

Definition at line 38 of file CDCSimHit.h.

◆ m_globalTime

float m_globalTime
private

Time of energy deposition.

Definition at line 70 of file CDCSimHit.h.

◆ m_leftRight

unsigned char m_leftRight
private

The flag to denote this hit is in the left or right side.

bit0: old L/R flag; bit1: new L/R flag for digitization; bit2: new L/R flag for tracking.

Definition at line 67 of file CDCSimHit.h.

◆ m_momentum

float m_momentum[3]
private

The momentum at closest point.

Definition at line 47 of file CDCSimHit.h.

◆ m_pdg

int m_pdg
private

Particle PDG (can be one of secondaries).

Definition at line 32 of file CDCSimHit.h.

◆ m_posIn

float m_posIn[3]
private

Position of pre-step.

Definition at line 53 of file CDCSimHit.h.

◆ m_posOut

float m_posOut[3]
private

Position of post-step.

Definition at line 56 of file CDCSimHit.h.

◆ m_posTrack

float m_posTrack[3]
private

Position on the track.

Definition at line 59 of file CDCSimHit.h.

◆ m_posWire

float m_posWire[3]
private

The position on wire which is closest to this hit.

Definition at line 50 of file CDCSimHit.h.

◆ m_stepLength

float m_stepLength
private

Step length of this hit.

Definition at line 44 of file CDCSimHit.h.

◆ m_trackId

unsigned short m_trackId
private

The track id of this hit.

Definition at line 29 of file CDCSimHit.h.

◆ m_wireID

WireID m_wireID
private

The WireID of the hit.

Definition at line 26 of file CDCSimHit.h.


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