Belle II Software development
SecMapTrainerHit Class Reference

simple Hit class used for sectorMap-training. More...

#include <SecMapTrainerHit.h>

Inheritance diagram for SecMapTrainerHit:
SpacePoint RelationsInterface< BASE >

Public Member Functions

 SecMapTrainerHit (const FullSecID &fullSecID, const SpacePoint &sp)
 Constructor of class SecMapTrainerHit.
 
 SecMapTrainerHit (const FullSecID &fullSecID, const B2Vector3D &position)
 constructor needed for the Virtual IP
 
 SecMapTrainerHit (double x, double y, double z)
 another constructor needed for the Virtual IP... eccpp
 
std::string getSectorIDString () const
 returns global hit position of current hit.
 
FullSecID getSectorID () const
 returns secID of sector containing this hit.
 
bool operator== (const SpacePoint &b) const
 Compare, if two SpacePoints are the same one.
 
bool operator!= (const SpacePoint &b) const
 Comparison for inequality with another SpacePoint.
 
std::string getName () const override
 Print out some info for this SpacePoint.
 
double X () const
 return the x-value of the global position of the SpacePoint
 
double Y () const
 return the y-value of the global position of the SpacePoint
 
double Z () const
 return the z-value of the global position of the SpacePoint
 
double TimeU () const
 return the time in ns of the cluster on the U side
 
double TimeV () const
 return the time in ns of the cluster on the V side
 
const B2Vector3DgetPosition () const
 return the position vector in global coordinates
 
const B2Vector3DgetPositionError () const
 return the hitErrors in sigma of the global position
 
Belle2::VXD::SensorInfoBase::SensorType getType () const
 Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
 
VxdID getVxdID () const
 Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
 
double getNormalizedLocalU () const
 Return normalized local coordinates of the cluster in u (0 <= posU <= 1).
 
double getNormalizedLocalV () const
 Return normalized local coordinates of the cluster in v (0 <= posV <= 1).
 
std::pair< bool, bool > getIfClustersAssigned () const
 Returns, if u(v)-coordinate is based on cluster information.
 
unsigned short getNClustersAssigned () const
 Returns the number of Clusters assigned to this SpacePoint.
 
void setAssignmentState (bool isAssigned) const
 Setter for association with a track.
 
bool isUOnly () const
 Returns true if the SP is single clustered and the cluster is a u cluster.
 
bool isVOnly () const
 Returns true if the SP is single clustered and the cluster is a v cluster.
 
bool isUAndV () const
 Returns true if the SP is not single clustered.
 
bool getAssignmentState () const
 Getter for status of assignment to a track.
 
void setQualityEstimation (float qualityIndicator)
 Setter for the quality of this SpacePoint.
 
float getQualityEstimation () const
 Getter for the quality of this SpacePoint.
 
void setQualityEstimationError (double qualityIndicatorError)
 Setter for the spacePoint quality index error.
 
float getQualityEstimationError () const
 Getter for the spacePoint quality index error.
 
virtual std::vector< genfit::PlanarMeasurement > getGenfitCompatible () const
 returns a vector of genfit::PlanarMeasurement, which is needed for genfit::track.
 
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 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.
 

Static Public Member Functions

static B2Vector3D getGlobalCoordinates (const std::pair< double, double > &hitLocal, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
 converts a local hit on a given sensor into global coordinates.
 
static std::pair< double, double > convertLocalToNormalizedCoordinates (const std::pair< double, double > &hitLocal, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
 converts a local hit into sensor-independent relative coordinates.
 
static std::pair< double, double > convertNormalizedToLocalCoordinates (const std::pair< double, double > &hitNormalized, Belle2::VxdID vxdID, const Belle2::VXD::SensorInfoBase *aSensorInfo=nullptr)
 converts a hit in sensor-independent relative coordinates into local coordinate of given sensor.
 
static double getUWedged (const std::pair< double, double > &hitLocalUnwedged, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
 takes a general uCoordinate, and transforms it to corrected uCoordinate for wedged sensors.
 
static double getUUnwedged (const std::pair< double, double > &hitLocalWedged, VxdID::baseType vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
 takes a wedged uCoordinate, and transforms it to general uCoordinate.
 
static void boundaryEnforce (double &value, const double &otherValue, double lower=0, double higher=1, unsigned int side=0, VxdID vxdID=VxdID())
 Enforce 'value' in the range ['lower', 'higher'].
 

Protected Member Functions

void setPositionError (double uSigma, double vSigma, const VXD::SensorInfoBase *aSensorInfo)
 Setter for global position error from on-sensor sigmas.
 
TClonesArray * getArrayPointer () const
 Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).
 

Protected Attributes

FullSecID m_secID
 ID of sector containing this hit.
 
B2Vector3D m_position
 Global position vector.
 
B2Vector3D m_positionError
 Global position error vector in sigma.
 
std::pair< double, double > m_normalizedLocal
 Local position vector normalized to sensor size (0 <= x <= 1).
 
double m_UClusterTime
 Time of the cluster on the U side in ns.
 
double m_VClusterTime
 Time of the cluster on the V side in ns.
 
std::pair< bool, bool > m_clustersAssigned {false, false}
 The bool value is true, when correct information of the coordinate exists.
 
VxdID::baseType m_vxdID
 Stores the VxdID.
 
VXD::SensorInfoBase::SensorType m_sensorType
 Stores the SensorType using the scheme of SensorInfoBase.
 
float m_qualityIndicator {0.5}
 Stores a quality indicator.
 
float m_qualityIndicatorError {0.5}
 Stores the error on the quality indicator.
 
bool m_isAssigned {false}
 Stores whether this SpacePoint is connected to a track.
 

Private Member Functions

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

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

simple Hit class used for sectorMap-training.

Definition at line 25 of file SecMapTrainerHit.h.

Constructor & Destructor Documentation

◆ SecMapTrainerHit() [1/3]

SecMapTrainerHit ( const FullSecID fullSecID,
const SpacePoint sp 
)
inline

Constructor of class SecMapTrainerHit.

Definition at line 28 of file SecMapTrainerHit.h.

28 :
29 SpacePoint(sp),
30 m_secID(fullSecID) {}
FullSecID m_secID
ID of sector containing this hit.
SpacePoint()
Default constructor for the ROOT IO.
Definition: SpacePoint.h:63

◆ SecMapTrainerHit() [2/3]

SecMapTrainerHit ( const FullSecID fullSecID,
const B2Vector3D position 
)
inline

constructor needed for the Virtual IP

Definition at line 33 of file SecMapTrainerHit.h.

33 :
34 SpacePoint(position, B2Vector3D(0., 0., 0.),
35 std::pair<double, double> (0., 0.),
36 std::pair<bool, bool>(), VxdID(),
38 m_secID(fullSecID) {}
SensorType
Enum specifing the type of sensor the SensorInfo represents.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

◆ SecMapTrainerHit() [3/3]

SecMapTrainerHit ( double  x,
double  y,
double  z 
)
inline

another constructor needed for the Virtual IP... eccpp

Definition at line 41 of file SecMapTrainerHit.h.

41 :
42 SpacePoint(B2Vector3D(x, y, z),
43 B2Vector3D(0., 0., 0.),
44 std::pair<double, double> (0., 0.),
45 std::pair<bool, bool>(), VxdID(),
47 m_secID() {}

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 }

◆ boundaryEnforce()

static void boundaryEnforce ( double &  value,
const double &  otherValue,
double  lower = 0,
double  higher = 1,
unsigned int  side = 0,
VxdID  vxdID = VxdID() 
)
inlinestaticinherited

Enforce 'value' in the range ['lower', 'higher'].

param = min(max(param,lower),higher)

Parameters
valueis the coordinate that must be constrained in the range
otherValueis for debugging and logging purposes
loweris the lower limit of the prescribed range
higheris the upper limit of the prescribed range
sideis for debugging purposes: 0 for U side 1 for V side
vxdIDis for debugging purposes

Definition at line 296 of file SpacePoint.h.

298 {
299 // Times to times there are normalized coordinates that are out of the boundaries.
300 // We do apply a smal sloppyness here
301
302 double sloppyTerm = 1e-3;
303 if (value < lower - sloppyTerm) {
304 B2WARNING("SpacePoint::boundaryEnforce: value had to be moved (lowerCheck)! old: " << value << ", new: " << lower);
305 B2WARNING("On sensor: " << vxdID << " side: " << (side == 0 ? " U " : " V") <<
306 " when the other coordinate is: " << otherValue);
307
308 value = lower;
309 }
310 if (value > higher + sloppyTerm) {
311 B2WARNING("SpacePoint::boundaryEnforce: value had to be moved (higherCheck)! old: " << value << ", new: " << higher);
312 B2WARNING("On sensor: " << vxdID << " side: " << (side == 0 ? " U " : " V") <<
313 " when the other coordinate is: " << otherValue);
314 value = higher;
315 }
316
317 }

◆ convertLocalToNormalizedCoordinates()

std::pair< double, double > convertLocalToNormalizedCoordinates ( const std::pair< double, double > &  hitLocal,
VxdID  vxdID,
const VXD::SensorInfoBase aSensorInfo = nullptr 
)
staticinherited

converts a local hit into sensor-independent relative coordinates.

first parameter is the local hit (as provided by SpacePoint::getUWedged(...) and Cluster::getV!) stored as a pair of doubles. second parameter is the coded vxdID, which carries the sensorID. third parameter, a sensorInfo can be passed for testing purposes. If no sensorInfo is passed, the member gets its own pointer to it.

ATTENTION: this function assumes, that for wedged sensors, the uCoordinate is already adapted to the vCoordinate! The normalized coordinates are independent of wedged-sensor-issues

Definition at line 149 of file SpacePoint.cc.

152{
153 //We need some handle to translate IDs to local and global
154 // coordinates.
155 if (aSensorInfo == nullptr) {
156 aSensorInfo = &VXD::GeoCache::getInstance().getSensorInfo(vxdID);
157 }
158
159 //As the 0 is in the middle of sensor in the geometry, and we want
160 // to normalize all positions to numbers between [0,1],
161 // where the middle will be 0.5,
162 // we need to do some calculation.
163 double sensorSizeU = aSensorInfo->getUSize(hitLocal.second); // this deals with the case of trapezoidal sensors too
164 double sensorSizeV = aSensorInfo->getVSize();
165
166 double normalizedUPosition = (hitLocal.first + 0.5 * sensorSizeU) /
167 sensorSizeU; // indepedent of the trapezoidal sensor-issue by definition
168 double normalizedVPosition = (hitLocal.second + 0.5 * sensorSizeV) / sensorSizeV;
169
170 boundaryEnforce(normalizedUPosition, normalizedVPosition, 0, 1, 0, vxdID);
171 boundaryEnforce(normalizedVPosition, normalizedUPosition, 0, 1, 1, vxdID);
172
173 return { normalizedUPosition, normalizedVPosition };
174}
static void boundaryEnforce(double &value, const double &otherValue, double lower=0, double higher=1, unsigned int side=0, VxdID vxdID=VxdID())
Enforce 'value' in the range ['lower', 'higher'].
Definition: SpacePoint.h:296
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
double getVSize() const
Return the length of the sensor.
double getUSize(double v=0) const
Return the width of the sensor.

◆ convertNormalizedToLocalCoordinates()

std::pair< double, double > convertNormalizedToLocalCoordinates ( const std::pair< double, double > &  hitNormalized,
Belle2::VxdID  vxdID,
const Belle2::VXD::SensorInfoBase aSensorInfo = nullptr 
)
staticinherited

converts a hit in sensor-independent relative coordinates into local coordinate of given sensor.

first parameter is the hit in sensor-independent normalized ! coordinates stored as a pair of floats. second parameter is the coded vxdID, which carries the sensorID. third parameter, a sensorInfo can be passed for testing purposes. If no sensorInfo is passed, the member gets its own pointer to it.

Definition at line 178 of file SpacePoint.cc.

181{
182 //We need some handle to translate IDs to local and global
183 // coordinates.
184 if (aSensorInfo == nullptr) {
185 aSensorInfo = &VXD::GeoCache::getInstance().getSensorInfo(vxdID);
186 }
187
188 // normalized coordinate range is from 0 to 1
189 // local coordinate range is from - halfSensorSize to + halfSensorSize
190 double localVPosition = (hitNormalized.second - 0.5) * aSensorInfo->getVSize();
191 double uSizeAtHit = aSensorInfo->getUSize(localVPosition);
192 double localUPosition = (hitNormalized.first - 0.5) * uSizeAtHit;
193
194 boundaryEnforce(localVPosition, localUPosition,
195 -0.5 * aSensorInfo->getVSize(), 0.5 * aSensorInfo->getVSize(), 1, vxdID); // restrain hits to sensor boundaries
196
197 boundaryEnforce(localUPosition, localVPosition, -0.5 * uSizeAtHit, 0.5 * uSizeAtHit,
198 0, vxdID); // restrain hits to sensor boundaries
199
200 return { localUPosition, localVPosition };
201}

◆ 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

◆ getAssignmentState()

bool getAssignmentState ( ) const
inlineinherited

Getter for status of assignment to a track.

Definition at line 185 of file SpacePoint.h.

185{ return m_isAssigned; }
bool m_isAssigned
Stores whether this SpacePoint is connected to a track.
Definition: SpacePoint.h:396

◆ getGenfitCompatible()

std::vector< genfit::PlanarMeasurement > getGenfitCompatible ( ) const
virtualinherited

returns a vector of genfit::PlanarMeasurement, which is needed for genfit::track.

This member ensures compatibility with genfit2. The return type is detector independent, but each entry will be of the same detector type, since a spacePoint can not contain clusters of different sensors and therefore of different detector types.

Definition at line 117 of file SpacePoint.cc.

118{
119 // XYRecoHit will be stored as their base-class, which is detector-independent.
120 std::vector< genfit::PlanarMeasurement > collectedMeasurements;
121
122
123 // get the related clusters to this spacePoint and create a genfit::PlanarMeasurement for each of them:
125
126 auto relatedClusters = this->getRelationsTo<SVDCluster>("ALL");
127 for (unsigned i = 0; i < relatedClusters.size(); i++) {
128 collectedMeasurements.push_back(SVDRecoHit(relatedClusters[i]));
129 }
130
132
133 // since we do not know the name of the attached PXDCluster, getRelatedTo does not work, however, getRelationsTo seems to be less sensible and therefore can be used, but in this case, one has to loop over the entries (which should be only one in this case)
134 auto relatedClusters = this->getRelationsTo<PXDCluster>("ALL");
135 for (unsigned i = 0; i < relatedClusters.size(); i++) {
136 collectedMeasurements.push_back(PXDRecoHit(relatedClusters[i]));
137 }
138
139 } else {
140 B2FATAL("unknown detector type");
141 }
142
143 B2DEBUG(20, "SpacePoint::getGenfitCompatible(): collected " << collectedMeasurements.size() << " meaturements");
144
145 return collectedMeasurements;
146}
PXDRecoHit - an extended form of PXDCluster containing geometry information.
Definition: PXDRecoHit.h:49
SVDRecoHit - an extended form of SVDHit containing geometry information.
Definition: SVDRecoHit.h:47
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
Definition: SpacePoint.h:145

◆ getGlobalCoordinates()

B2Vector3D getGlobalCoordinates ( const std::pair< double, double > &  hitLocal,
VxdID  vxdID,
const VXD::SensorInfoBase aSensorInfo = nullptr 
)
staticinherited

converts a local hit on a given sensor into global coordinates.

so this practically does what sensorInfo::pointToGlobal is doing, the difference is, that you do not need to have the sensorInfo beforehand (it will be retrieved using the VxdID) first parameter is the local hit (as provided by getU and getV!) stored as a pair of doubles. second parameter is the coded vxdID, which carries the sensorID. third parameter, a sensorInfo can be passed for testing purposes. If no sensorInfo is passed, the member gets its own pointer to it.

ATTENTION: this function assumes, that for wedged sensors, the uCoordinate is already adapted to the vCoordinate!

Definition at line 204 of file SpacePoint.cc.

206{
207 //We need some handle to translate IDs to local and global coordinates.
208 if (aSensorInfo == nullptr) {
209 aSensorInfo = &VXD::GeoCache::getInstance().getSensorInfo(vxdID);
210 }
211
212 // the second parameter set to true results in alignment constants being applied
213 return aSensorInfo->pointToGlobal(ROOT::Math::XYZVector(hitLocal.first, hitLocal.second, 0), true);
214}
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.

◆ getIfClustersAssigned()

std::pair< bool, bool > getIfClustersAssigned ( ) const
inlineinherited

Returns, if u(v)-coordinate is based on cluster information.

.first is true, if u-cluster information is present
.second is true, if v-cluster information is present.

Definition at line 162 of file SpacePoint.h.

162{ return m_clustersAssigned; }
std::pair< bool, bool > m_clustersAssigned
The bool value is true, when correct information of the coordinate exists.
Definition: SpacePoint.h:365

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

◆ getName()

std::string getName ( ) const
inlineoverridevirtualinherited

Print out some info for this SpacePoint.

Reimplemented from RelationsInterface< BASE >.

Definition at line 115 of file SpacePoint.h.

116 {
117 return "SpacePoint with index: " + std::to_string(getArrayIndex()) +
118 "and VxdID: " + std::to_string(VxdID(m_vxdID));
119 }
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
VxdID::baseType m_vxdID
Stores the VxdID.
Definition: SpacePoint.h:368

◆ getNClustersAssigned()

unsigned short getNClustersAssigned ( ) const
inlineinherited

Returns the number of Clusters assigned to this SpacePoint.

Definition at line 165 of file SpacePoint.h.

166 {
168 m_clustersAssigned.first && m_clustersAssigned.second) {
169 return 2;
170 }
171 return 1;
172 }
VXD::SensorInfoBase::SensorType m_sensorType
Stores the SensorType using the scheme of SensorInfoBase.
Definition: SpacePoint.h:375

◆ getNormalizedLocalU()

double getNormalizedLocalU ( ) const
inlineinherited

Return normalized local coordinates of the cluster in u (0 <= posU <= 1).

Definition at line 151 of file SpacePoint.h.

151{ return m_normalizedLocal.first; }
std::pair< double, double > m_normalizedLocal
Local position vector normalized to sensor size (0 <= x <= 1).
Definition: SpacePoint.h:349

◆ getNormalizedLocalV()

double getNormalizedLocalV ( ) const
inlineinherited

Return normalized local coordinates of the cluster in v (0 <= posV <= 1).

Definition at line 154 of file SpacePoint.h.

154{ return m_normalizedLocal.second; }

◆ getPosition()

const B2Vector3D & getPosition ( ) const
inlineinherited

return the position vector in global coordinates

Definition at line 138 of file SpacePoint.h.

138{ return m_position; }
B2Vector3D m_position
Global position vector.
Definition: SpacePoint.h:336

◆ getPositionError()

const B2Vector3D & getPositionError ( ) const
inlineinherited

return the hitErrors in sigma of the global position

Definition at line 141 of file SpacePoint.h.

141{ return m_positionError; }
B2Vector3D m_positionError
Global position error vector in sigma.
Definition: SpacePoint.h:342

◆ getQualityEstimation()

float getQualityEstimation ( ) const
inlineinherited

Getter for the quality of this SpacePoint.

Definition at line 191 of file SpacePoint.h.

191{ return m_qualityIndicator; }
float m_qualityIndicator
Stores a quality indicator.
Definition: SpacePoint.h:381

◆ getQualityEstimationError()

float getQualityEstimationError ( ) const
inlineinherited

Getter for the spacePoint quality index error.

Definition at line 197 of file SpacePoint.h.

float m_qualityIndicatorError
Stores the error on the quality indicator.
Definition: SpacePoint.h:388

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

◆ getSectorID()

FullSecID getSectorID ( ) const
inline

returns secID of sector containing this hit.

Definition at line 65 of file SecMapTrainerHit.h.

65{ return m_secID; }

◆ getSectorIDString()

std::string getSectorIDString ( ) const
inline

returns global hit position of current hit.

returns global x-position. returns global y-position. returns global z-position. returns secID of sector containing this hit.

Definition at line 62 of file SecMapTrainerHit.h.

62{ return m_secID.getFullSecString(); }
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
Definition: FullSecID.cc:116

◆ getType()

Belle2::VXD::SensorInfoBase::SensorType getType ( ) const
inlineinherited

Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.

Definition at line 145 of file SpacePoint.h.

145{ return m_sensorType; }

◆ getUUnwedged()

static double getUUnwedged ( const std::pair< double, double > &  hitLocalWedged,
VxdID::baseType  vxdID,
const VXD::SensorInfoBase aSensorInfo = nullptr 
)
inlinestaticinherited

takes a wedged uCoordinate, and transforms it to general uCoordinate.

Use this if you want to "unwedge" your u-coordinate. The returned value shall be like the value delivered by a uCluster without information of v (== aCluster.getPosition() ). This is only relevant for wedged/slanted sensors because of their trapezoidal shape, for rectangular shapes, the value does not change

Definition at line 278 of file SpacePoint.h.

280 {
281 if (aSensorInfo == nullptr) { aSensorInfo = &VXD::GeoCache::getInstance().getSensorInfo(vxdID); }
282 return (aSensorInfo->getWidth() / aSensorInfo->getWidth(hitLocalWedged.second)) * hitLocalWedged.first;
283 }

◆ getUWedged()

static double getUWedged ( const std::pair< double, double > &  hitLocalUnwedged,
VxdID  vxdID,
const VXD::SensorInfoBase aSensorInfo = nullptr 
)
inlinestaticinherited

takes a general uCoordinate, and transforms it to corrected uCoordinate for wedged sensors.

Use this if you want to add the information of the vCluster to the local uPosition. The returned value is now dependent of vCluster and valid only for this cluster! This is only relevant for wedged/slanted sensors because of their trapezoidal shape, for rectangular shapes, the value does not change

function kept only for backward compatibility with VXDTF1

Definition at line 263 of file SpacePoint.h.

265 {
266 if (aSensorInfo == nullptr) { aSensorInfo = &VXD::GeoCache::getInstance().getSensorInfo(vxdID); }
267 return (aSensorInfo->getWidth(hitLocalUnwedged.second) / aSensorInfo->getWidth()) * hitLocalUnwedged.first;
268 }

◆ getVxdID()

VxdID getVxdID ( ) const
inlineinherited

Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.

Definition at line 148 of file SpacePoint.h.

148{ return m_vxdID; }

◆ isUAndV()

bool isUAndV ( ) const
inlineinherited

Returns true if the SP is not single clustered.

Definition at line 182 of file SpacePoint.h.

182{ return m_clustersAssigned.first and m_clustersAssigned.second; }

◆ isUOnly()

bool isUOnly ( ) const
inlineinherited

Returns true if the SP is single clustered and the cluster is a u cluster.

Definition at line 178 of file SpacePoint.h.

178{ return m_clustersAssigned.first and not m_clustersAssigned.second; }

◆ isVOnly()

bool isVOnly ( ) const
inlineinherited

Returns true if the SP is single clustered and the cluster is a v cluster.

Definition at line 180 of file SpacePoint.h.

180{ return not m_clustersAssigned.first and m_clustersAssigned.second; }

◆ operator!=()

bool operator!= ( const SpacePoint b) const
inlineinherited

Comparison for inequality with another SpacePoint.

Definition at line 109 of file SpacePoint.h.

110 {
111 return !(*this == b);
112 }

◆ operator==()

bool operator== ( const SpacePoint b) const
inlineinherited

Compare, if two SpacePoints are the same one.

As SpacePoints should live in the DataStore and comparing positions doesn't guarantee, that different underlying clusters are used, we compare here only the indices of the SpacePoint within their StoreArray --> SpacePoints are equal, if the share the index.

Definition at line 103 of file SpacePoint.h.

104 {
105 return getArrayIndex() == b.getArrayIndex();
106 }

◆ setAssignmentState()

void setAssignmentState ( bool  isAssigned) const
inlineinherited

Setter for association with a track.

Definition at line 175 of file SpacePoint.h.

175{ m_isAssigned = isAssigned; }

◆ setPositionError()

void setPositionError ( double  uSigma,
double  vSigma,
const VXD::SensorInfoBase aSensorInfo 
)
inlineprotectedinherited

Setter for global position error from on-sensor sigmas.

Definition at line 322 of file SpacePoint.h.

323 {
324 //As only variances, but not the sigmas transform linearly, we need to use some acrobatics.
325 m_positionError = aSensorInfo->vectorToGlobal(ROOT::Math::XYZVector(uSigma * uSigma, vSigma * vSigma, 0),
326 true // use alignment in transformation
327 );
329 }
void Sqrt()
calculates the square root of the absolute values of the coordinates element-wise
Definition: B2Vector3.h:414

◆ setQualityEstimation()

void setQualityEstimation ( float  qualityIndicator)
inlineinherited

Setter for the quality of this SpacePoint.

Definition at line 188 of file SpacePoint.h.

188{m_qualityIndicator = qualityIndicator; }

◆ setQualityEstimationError()

void setQualityEstimationError ( double  qualityIndicatorError)
inlineinherited

Setter for the spacePoint quality index error.

Definition at line 194 of file SpacePoint.h.

194{m_qualityIndicatorError = qualityIndicatorError;}

◆ TimeU()

double TimeU ( ) const
inlineinherited

return the time in ns of the cluster on the U side

Definition at line 132 of file SpacePoint.h.

132{ return m_UClusterTime; }
double m_UClusterTime
Time of the cluster on the U side in ns.
Definition: SpacePoint.h:353

◆ TimeV()

double TimeV ( ) const
inlineinherited

return the time in ns of the cluster on the V side

Definition at line 135 of file SpacePoint.h.

135{ return m_VClusterTime; }
double m_VClusterTime
Time of the cluster on the V side in ns.
Definition: SpacePoint.h:357

◆ X()

double X ( ) const
inlineinherited

return the x-value of the global position of the SpacePoint

Definition at line 123 of file SpacePoint.h.

123{ return m_position.X(); }
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431

◆ Y()

double Y ( ) const
inlineinherited

return the y-value of the global position of the SpacePoint

Definition at line 126 of file SpacePoint.h.

126{ return m_position.Y(); }
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433

◆ Z()

double Z ( ) const
inlineinherited

return the z-value of the global position of the SpacePoint

Definition at line 129 of file SpacePoint.h.

129{ return m_position.Z(); }
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435

Member Data Documentation

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

std::pair<bool, bool> m_clustersAssigned {false, false}
protectedinherited

The bool value is true, when correct information of the coordinate exists.

.first is true, if this SpacePoint has a UCluster (only relevant for SVD, PXD always true), .second is true, if this SpacePoint has a VCluster (only relevant for SVD, PXD always true),

Definition at line 365 of file SpacePoint.h.

◆ m_isAssigned

bool m_isAssigned {false}
mutableprotectedinherited

Stores whether this SpacePoint is connected to a track.

We assume, that const for SpacePoint means, things like position et cetera remain constant. The assignment status is therefore a mutable on purpose and SpacePoints can be const during tracking.

Definition at line 396 of file SpacePoint.h.

◆ m_normalizedLocal

std::pair<double, double> m_normalizedLocal
protectedinherited

Local position vector normalized to sensor size (0 <= x <= 1).

.first: u, .second: v

Definition at line 349 of file SpacePoint.h.

◆ m_position

B2Vector3D m_position
protectedinherited

Global position vector.

[0]: x, [1] : y, [2] : z

Definition at line 336 of file SpacePoint.h.

◆ m_positionError

B2Vector3D m_positionError
protectedinherited

Global position error vector in sigma.

[0]: x-uncertainty, [1] : y-uncertainty, [2] : z-uncertainty

Definition at line 342 of file SpacePoint.h.

◆ m_qualityIndicator

float m_qualityIndicator {0.5}
protectedinherited

Stores a quality indicator.

The value shall be between 0. and 1., where 1. means "good" and 0. means "bad".

Definition at line 381 of file SpacePoint.h.

◆ m_qualityIndicatorError

float m_qualityIndicatorError {0.5}
protectedinherited

Stores the error on the quality indicator.

The value comes from the binning error on the pdfs from which the QI is derived.

Definition at line 388 of file SpacePoint.h.

◆ m_secID

FullSecID m_secID
protected

ID of sector containing this hit.

Definition at line 68 of file SecMapTrainerHit.h.

◆ m_sensorType

VXD::SensorInfoBase::SensorType m_sensorType
protectedinherited

Stores the SensorType using the scheme of SensorInfoBase.

Currently there are the following types possible:
PXD, SVD, TEL, VXD

Definition at line 375 of file SpacePoint.h.

◆ m_UClusterTime

double m_UClusterTime
protectedinherited

Time of the cluster on the U side in ns.

Definition at line 353 of file SpacePoint.h.

◆ m_VClusterTime

double m_VClusterTime
protectedinherited

Time of the cluster on the V side in ns.

Definition at line 357 of file SpacePoint.h.

◆ m_vxdID

VxdID::baseType m_vxdID
protectedinherited

Stores the VxdID.

Definition at line 368 of file SpacePoint.h.


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