Belle II Software
release-08-01-10
|
Storage for (VXD) SpacePoint-based track candidates. More...
#include <SpacePointTrackCand.h>
Public Types | |
enum | RefereeStatusBit { c_checkedByReferee = 1 , c_checkedClean = 2 , c_hitsOnSameSensor = 4 , c_hitsLowDistance = 8 , c_removedHits = 16 , c_checkedTrueHits = 32 , c_checkedSameSensors = 64 , c_checkedMinDistance = 128 , c_curlingTrack = 256 , c_omittedClusters = 512 , c_singleClustersSPs = 1024 , c_isActive = 2048 , c_isReserved = 4096 , c_hasFittedRecoTrack = 1 << 13 , c_initialState = 0 + c_isActive } |
Status information that can be set to indicate several properties of the SpacePointTrackCand. More... | |
Public Member Functions | |
BELLE2_DEFINE_EXCEPTION (UnsupportedDetType, "The Detector Type is not supported by this class. Supported are: PXD and SVD") | |
Exception thrown, when an Unsupported Detector Type occurs. More... | |
BELLE2_DEFINE_EXCEPTION (SPTCIndexOutOfBounds, "Trying to acces a SpacePoint from a SpacePointTrackCand via an" " index that is out of bounds!") | |
Exception thrown, when trying to access SpacePoints by their index inside of SpacePointTrackCand, but index is out of bounds. | |
BELLE2_DEFINE_EXCEPTION (SPTCSortingParameterSizeInvalid, "Trying to modify SortingParameters, but number of new SortingParameters differs from number of SpacePoints") | |
Exception thrown, when the size of the vector containing the spacePoints has a different size than the vector containing the sorting parameters. | |
SpacePointTrackCand ()=default | |
Empty constructor with default values, including it to be active. More... | |
SpacePointTrackCand (const std::vector< const Belle2::SpacePoint * > &spacePoints, int pdgCode=0, double charge=0, int mcTrackID=-1) | |
Constructor from a vector<SpacePoint*> and some additional information. More... | |
bool | operator== (const SpacePointTrackCand &rhs) const |
Checks the equality of the pointers to the contained SpacePoints (pdg-code and charge estimate are not compared!) NOTE: returns false if both TrackCands do not contain any SpacePoints. | |
const std::vector< const Belle2::SpacePoint * > & | getHits () const |
get hits (space points) of track candidate | |
const std::vector< const Belle2::SpacePoint * > | getSortedHits () const |
get hits (space points) sorted by their respective sorting parameter | |
std::vector< const Belle2::SpacePoint * >::const_iterator | begin () const |
returns a const_iterator (begin()) for easily looping over hits of SpacePointTrackCand. More... | |
std::vector< const Belle2::SpacePoint * >::const_iterator | end () const |
returns a const_iterator (end()) for easily looping over hits of SpacePointTrackCand. More... | |
const std::vector< const Belle2::SpacePoint * > | getHitsInRange (int firstInd, int lastInd) const |
get hits (SpacePoints) in range (indices of SpacePoint inside SpacePointTrackCand) including first index and excluding last index (the SpacePoint on firstInd but not the one on lastIndex wil be returned!). More... | |
unsigned int | getNHits () const |
get the number of hits (space points) in the track candidate | |
unsigned int | size () const |
get the number of hits (space points) in the track candidate | |
int | getPdgCode () const |
get pdg code | |
double | getChargeSeed () const |
get charge | |
const TMatrixDSym & | getCovSeed () const |
get the covariance matrix seed (6D). More... | |
const TVectorD & | getStateSeed () const |
get state seed as 6D vector | |
const ROOT::Math::XYZVector | getPosSeed () const |
get position seed as ROOT::Math::XYZVector | |
const ROOT::Math::XYZVector | getMomSeed () const |
get momentum seed as ROOT::Math::XYZVector | |
const std::vector< double > & | getSortingParameters () const |
get the sorting parameters | |
const std::vector< double > | getSortingParametersInRange (int firstIndex, int lastIndex) const |
get the sorting parameters in range (indices of SpacePoints inside SpacePointTrackCand) including firstIndex and excluding lastIndex NOTE: for all hits range is from zero to getNHits(). More... | |
int | getTrackStubIndex () const |
get TrackStub Index | |
int | getMcTrackID () const |
get the MC Track ID | |
int | getMcTrackId () const |
get the MC Track ID (same writing as in genfit::TrackCand) | |
unsigned short int | getRefereeStatus (unsigned short int bitmask=USHRT_MAX) const |
Return the refere status code of the SpacePointTrackCand. More... | |
bool | hasRefereeStatus (unsigned int short bitmask) const |
Check if the SpacePointTrackCand has the status characterized by the bitmask. | |
double | getQualityIndicator () const |
returns the current status of the estimated quality of this track candidate. | |
bool | hasHitsOnSameSensor () const |
Check if the SpacePointTrackCand contains consecutive SpacePoints that are on the same sensor WARNING: does not check if this has actually been assigned! | |
bool | checkedSameSensors () const |
Check if the SpacePointTrackCand has been checked for consecutive hits on same sensor. | |
bool | hasHitsLowDistance () const |
Check if consecutive SpacePoints are far enough apart throughout the SpacePointTrackCand WARNING: does not check if this has actually been assigned! | |
bool | checkedMinDistance () const |
Check if the SpacePointTrackCand has been checked for consecutive hits being far enough apart. | |
bool | hasRemovedHits () const |
Check if a SpacePointTrackCand has removed hits (i.e. More... | |
bool | isOutgoing () const |
check if particle is outgoing (simply returns member m_flightDirection)! | |
bool | isCurling () const |
get if the TrackCand is curling. More... | |
bool | checkedForCurling () const |
check if the TrackCand has been checked for Curling. | |
bool | isPartOfCurlingTrack () const |
check if the TrackCand is part of a curling TrackCand. More... | |
void | print (int debuglevel=25, const Option_t *="") const |
print the Track Candidate in its "full beauty". More... | |
std::string | getRefereeStatusString (std::string delimiter=" ") const |
get the refereeStatus as a string (easier to read than an unsigned short int) More... | |
short | getFamily () const |
return family identifier | |
void | setFamily (short family) |
assign family identifier | |
void | setSortingParameters (const std::vector< double > &sortParams) |
set the sorting parameters | |
void | setPdgCode (int pdgCode) |
set a hypothesis for the particle by setting a pdgcode (will also set the appropriate charge) | |
void | setChargeSeed (double charge) |
Setter for assumed charge of tracked particle. | |
void | set6DSeed (const TVectorD &state6D) |
set the 6D state seed | |
void | setCovSeed (const TMatrixDSym &cov) |
set the covariance matrix seed | |
void | setQualityIndicator (const double newIndicator) |
sets the new status of the estimated quality of this track candidate. More... | |
void | addSpacePoint (const SpacePoint *newSP, double sortParam) |
add a new SpacePoint and its according sorting parameter to the track candidate | |
void | setFlightDirection (bool direction) |
set the direction of flight (true is outgoing, false is ingoing). More... | |
void | setTrackStubIndex (int trackStubInd) |
set TrackStub index | |
void | setRefereeStatus (unsigned short int bitmask) |
set referee status (resets the complete to the passed status!) | |
void | addRefereeStatus (unsigned short int bitmask) |
add a referee status | |
void | removeRefereeStatus (unsigned short int bitmask) |
remove a referee status | |
void | clearRefereeStatus () |
clear the referee status. More... | |
void | resetRefereeStatus () |
resets the referee status to the initial value | |
void | removeSpacePoint (int indexInTrackCand) |
remove a SpacePoint (and its sorting parameter) from the SpacePointTrackCand | |
bool | operator< (const SpacePointTrackCand &rhs) const |
Overloading the less operator to compare SPTCs based on their quality index. More... | |
void | addRelationTo (const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const |
Add a relation from this object to another object (with caching). More... | |
void | addRelationTo (const TObject *object, float weight=1.0, const std::string &namedRelation="") const |
Add a relation from this object to another object (no caching, can be quite slow). More... | |
void | copyRelations (const RelationsInterface< BASE > *sourceObj) |
Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights). More... | |
template<class TO > | |
RelationVector< TO > | getRelationsTo (const std::string &name="", const std::string &namedRelation="") const |
Get the relations that point from this object to another store array. More... | |
template<class FROM > | |
RelationVector< FROM > | getRelationsFrom (const std::string &name="", const std::string &namedRelation="") const |
Get the relations that point from another store array to this object. More... | |
template<class T > | |
RelationVector< T > | getRelationsWith (const std::string &name="", const std::string &namedRelation="") const |
Get the relations between this object and another store array. More... | |
template<class TO > | |
TO * | getRelatedTo (const std::string &name="", const std::string &namedRelation="") const |
Get the object to which this object has a relation. More... | |
template<class FROM > | |
FROM * | getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const |
Get the object from which this object has a relation. More... | |
template<class T > | |
T * | getRelated (const std::string &name="", const std::string &namedRelation="") const |
Get the object to or from which this object has a relation. More... | |
template<class TO > | |
std::pair< TO *, float > | getRelatedToWithWeight (const std::string &name="", const std::string &namedRelation="") const |
Get first related object & weight of relation pointing to an array. More... | |
template<class FROM > | |
std::pair< FROM *, float > | getRelatedFromWithWeight (const std::string &name="", const std::string &namedRelation="") const |
Get first related object & weight of relation pointing from an array. More... | |
template<class T > | |
std::pair< T *, float > | getRelatedWithWeight (const std::string &name="", const std::string &namedRelation="") const |
Get first related object & weight of relation pointing from/to an array. More... | |
virtual std::string | getName () const |
Return a short name that describes this object, e.g. More... | |
virtual std::string | getInfoHTML () const |
Return a short summary of this object's contents in HTML format. More... | |
std::string | getInfo () const |
Return a short summary of this object's contents in raw text format. More... | |
std::string | getArrayName () const |
Get name of array this object is stored in, or "" if not found. | |
int | getArrayIndex () const |
Returns this object's array index (in StoreArray), or -1 if not found. | |
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 | |
std::vector< const SpacePoint * > | m_trackSpacePoints |
pointers to SpacePoints in the datastore | |
std::vector< double > | m_sortingParameters |
sorting Parameters, can be used to sort the SpacePoints. | |
short | m_family = -1 |
identifier for tracks that share at least two SpacePoints. | |
int | m_pdg = 0 |
PDG code of particle. | |
int | m_MCTrackID = -1 |
track ID from MC simulation | |
TVectorD | m_state6D = TVectorD(6) |
global momentum plus position state (seed) vector | |
TMatrixDSym | m_cov6D = TMatrixDSym(6) |
global momentum plus position state (seed) covariance matrix | |
double | m_q = 0 |
charge of the particle in units of elementary charge | |
bool | m_flightDirection = true |
direction of flight. More... | |
int | m_iTrackStub = -1 |
Index of TrackStub in a curling Track Candidate. More... | |
unsigned short int | m_refereeStatus = c_isActive |
bit-field to indicate different properties that are checked by the referee module | |
double | m_qualityIndicator = 0.5 |
An estimation for the quality of the track. More... | |
Private Member Functions | |
ClassDef (RelationsInterface, 0) | |
defines interface for accessing relations of objects in StoreArray. | |
Private Attributes | |
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. | |
Storage for (VXD) SpacePoint-based track candidates.
Often abbreviated SPTC in other contexts. Design follows rather closely the one from genfit::TrackCand.
Definition at line 40 of file SpacePointTrackCand.h.
enum RefereeStatusBit |
Status information that can be set to indicate several properties of the SpacePointTrackCand.
NOTE: Some properties are at the moment stored in other members of the SpacePointTrackCand, can be moved here, if memory usage is an issue. NOTE: If you add something here, it should also be added in the 'getRefereeStatusString' method!
Enumerator | |
---|---|
c_checkedByReferee | bit 0: SPTC has been checked by a Referee (all possible tests). |
c_checkedClean | bit 1: SPTC shows no 'problematic' behaviour. |
c_hitsOnSameSensor | bit 2: SPTC has two (or more) SpacePoints on same sensor. |
c_hitsLowDistance | bit 3: SPTC has two (or more) SpacePoints that are not far enough apart. NOTE: distance is judged by referee (and also set there). |
c_removedHits | bit 4: SpacePoints were removed from this SPTC. |
c_checkedTrueHits | bit 5: All SpacePoints of the SPTC have a relation to at least one TrueHit. |
c_checkedSameSensors | bit 6: It has been checked, if two consecutive SpacePoints are on the same sensor for this SPTC. |
c_checkedMinDistance | bit 7: It has been checked if two consecutive SpacePoints are far enough apart. |
c_curlingTrack | bit 8: SPTC is curling (resp. is part of a curling SPTC). |
c_omittedClusters | bit 9: Not all Clusters of the genfit::TrackCand have been used to create this SPTC. |
c_singleClustersSPs | bit 10: SPTC contains single Cluster SpacePoints. |
c_isActive | bit 11: SPTC is active (i.e. if false, some module rejected it for further use. |
c_isReserved | bit 12: SPTC is reserved (i.e. should not be altered and should be treated with high priority). |
c_hasFittedRecoTrack | bit 13: SPTC is related to a RecoTrack which has a successful fit. NOTE: this check is performed on the original SPTC, if the current one is a copy of that the relation may be lost |
c_initialState | This is the initialState, which will always be set in the beginning and at reset. |
Definition at line 67 of file SpacePointTrackCand.h.
|
default |
Empty constructor with default values, including it to be active.
Sets pdg code to zero to make it possible to determine, whether a particle hyptohesis has been asigned to the track candidate or not.MCTrackID is initialized to -1.
Each SPTC is created in c_isActive-state and has to be deactivated manually, if need be.
|
explicit |
Constructor from a vector<SpacePoint*> and some additional information.
spacePoints | list of pointers to the SpacePoint for this track candidate |
pdgCode | Mass hypothesis to be used. |
charge | Charge hypthesis for the tracked particle. |
mcTrackID | ??? sortingParameters are generated from the order of the SpacePoints! Each SPTC is created in c_isActive-state and has to be deactivated manually, if need be. |
< default sorting parameters
Definition at line 21 of file SpacePointTrackCand.cc.
|
inlineinherited |
Add a relation from this object to another object (with caching).
object | The object to which the relation should point. |
weight | The weight of the relation. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 142 of file RelationsObject.h.
|
inlineinherited |
Add a relation from this object to another object (no caching, can be quite slow).
object | The object to which the relation should point. |
weight | The weight of the relation. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 155 of file RelationsObject.h.
|
inline |
returns a const_iterator (begin()) for easily looping over hits of SpacePointTrackCand.
Ignores sortingParameters!
Definition at line 128 of file SpacePointTrackCand.h.
BELLE2_DEFINE_EXCEPTION | ( | UnsupportedDetType | , |
"The Detector Type is not supported by this class. Supported are: PXD and SVD" | |||
) |
|
inline |
clear the referee status.
WARNING this does not set the value to standard, it completely clears all the states stored!
Definition at line 339 of file SpacePointTrackCand.h.
|
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.
|
inline |
returns a const_iterator (end()) for easily looping over hits of SpacePointTrackCand.
Ignores sortingParameters!
Definition at line 131 of file SpacePointTrackCand.h.
|
inline |
const std::vector< const Belle2::SpacePoint * > getHitsInRange | ( | int | firstInd, |
int | lastInd | ||
) | const |
get hits (SpacePoints) in range (indices of SpacePoint inside SpacePointTrackCand) including first index and excluding last index (the SpacePoint on firstInd but not the one on lastIndex wil be returned!).
NOTE: For all hits range is from 0 to getNHits(). throws an exception when trying to access hits outside the allowed range!
Definition at line 66 of file SpacePointTrackCand.cc.
|
inlineinherited |
Return a short summary of this object's contents in raw text format.
Returns the contents of getInfoHTML() while translating line-breaks etc.
Definition at line 370 of file RelationsObject.h.
|
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:
Reimplemented in RecoTrack, TRGSummary, TrackFitResult, Track, SoftwareTriggerResult, PIDLikelihood, MCParticle, Cluster, and Particle.
Definition at line 362 of file RelationsObject.h.
|
inlinevirtualinherited |
Return a short name that describes this object, e.g.
pi+ for an MCParticle.
Reimplemented in SpacePoint, MCParticle, and Particle.
Definition at line 344 of file RelationsObject.h.
|
inline |
Return the refere status code of the SpacePointTrackCand.
bitmask | is an optional bitmask that is compared to the referee status of the SpacePointTrackCand |
Definition at line 201 of file SpacePointTrackCand.h.
std::string getRefereeStatusString | ( | std::string | delimiter = " " | ) | const |
get the refereeStatus as a string (easier to read than an unsigned short int)
delimiter | delimiter to be put inbetween the individual strings, defaults to whitespace (1 character) NOTE: mainly for easier readability of debug output! |
Definition at line 207 of file SpacePointTrackCand.cc.
|
inlineinherited |
Get the object to or from which this object has a relation.
T | The class of objects to or from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 278 of file RelationsObject.h.
|
inlineinherited |
Get the object from which this object has a relation.
FROM | The class of objects from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 263 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing from an array.
FROM | The class of objects from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 314 of file RelationsObject.h.
|
inlineinherited |
Get the object to which this object has a relation.
TO | The class of objects to which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 248 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing to an array.
TO | The class of objects to which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 297 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing from/to an array.
T | The class of objects to or from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 331 of file RelationsObject.h.
|
inlineinherited |
Get the relations that point from another store array to this object.
FROM | The class of objects from which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 212 of file RelationsObject.h.
|
inlineinherited |
Get the relations that point from this object to another store array.
TO | The class of objects to which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 197 of file RelationsObject.h.
|
inlineinherited |
Get the relations between this object and another store array.
Relations in both directions are returned.
T | The class of objects to or from which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 230 of file RelationsObject.h.
const std::vector< double > getSortingParametersInRange | ( | int | firstIndex, |
int | lastIndex | ||
) | const |
get the sorting parameters in range (indices of SpacePoints inside SpacePointTrackCand) including firstIndex and excluding lastIndex NOTE: for all hits range is from zero to getNHits().
throws an exception when trying to access hits outside the allowed range!
Definition at line 83 of file SpacePointTrackCand.cc.
|
inline |
Check if a SpacePointTrackCand has removed hits (i.e.
at some point it contained more hits than it does when this function is called, removal of hits e.g. by a referee module)
Definition at line 239 of file SpacePointTrackCand.h.
|
inline |
get if the TrackCand is curling.
WARNING: does not check if this has actually been assigned!
Definition at line 250 of file SpacePointTrackCand.h.
|
inline |
check if the TrackCand is part of a curling TrackCand.
NOTE: returns false if curling has not been checked
Definition at line 256 of file SpacePointTrackCand.h.
|
inline |
Overloading the less operator to compare SPTCs based on their quality index.
This is used in in SPTCSelectorXBestPerFamily for instance.
Definition at line 349 of file SpacePointTrackCand.h.
void print | ( | int | debuglevel = 25 , |
const Option_t * | option = "" |
||
) | const |
print the Track Candidate in its "full beauty".
NOTE: prints some parts to stdout, since for printing the state seed the print method form TVectorD is invoked!
Definition at line 156 of file SpacePointTrackCand.cc.
|
inline |
set the direction of flight (true is outgoing, false is ingoing).
Initialized to true by default!
Definition at line 324 of file SpacePointTrackCand.h.
|
inline |
sets the new status of the estimated quality of this track candidate.
valid are values in range [0;1] if value < 0, the track candidate is invalid and one should not use it anymore. 0.5 is the standard value if not been set otherwise
Definition at line 310 of file SpacePointTrackCand.h.
|
protected |
direction of flight.
true is outgoing, false is ingoing
Definition at line 396 of file SpacePointTrackCand.h.
|
protected |
Index of TrackStub in a curling Track Candidate.
Definition at line 405 of file SpacePointTrackCand.h.
|
protected |
An estimation for the quality of the track.
Normally defined between 0-1 to describe the propability that this track is real(istic). The quality of the track has to be determined by another function or module.
Definition at line 418 of file SpacePointTrackCand.h.