LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Set of flags pertaining a point of the track. More...
#include "TrajectoryPointFlags.h"
Public Types | |
using | flag = TrajectoryPointFlagTraits |
Type of flag traits (indices and meaning of flags). More... | |
using | Flags_t = flag::Flags_t |
Type holding the flags. More... | |
using | Mask_t = Flags_t::Mask_t |
Type holding the flags. More... | |
using | Flag_t = Flags_t::Flag_t |
Type of single flag. More... | |
using | FlagIndex_t = Flags_t::FlagIndex_t |
Type of index of single flag. More... | |
using | HitIndex_t = unsigned int |
Type for hit index. More... | |
Public Member Functions | |
constexpr | TrajectoryPointFlags ()=default |
constexpr | TrajectoryPointFlags (HitIndex_t fromHit) |
Constructor: specified hit index, default flags. More... | |
constexpr | TrajectoryPointFlags (HitIndex_t fromHit, Mask_t flags) |
Constructor: copies all the flags. More... | |
template<typename... Flags> | |
constexpr | TrajectoryPointFlags (HitIndex_t fromHit, Flags...flags) |
Constructor: activates only the specified flags. More... | |
constexpr Mask_t const & | mask () const |
Returns the entire set of bits as a bit mask. More... | |
constexpr Flags_t const & | flags () const |
Returns the entire set of bits. More... | |
constexpr bool | operator== (TrajectoryPointFlags const &other) const |
Returns whether other has the same content as this one. More... | |
constexpr bool | operator!= (TrajectoryPointFlags const &other) const |
Returns whether other has content different than this one. More... | |
template<typename Stream > | |
void | dump (Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const |
Prints the flags content into a stream. More... | |
template<typename Stream > | |
void | dump (Stream &&out, unsigned int verbosity=1, std::string indent={}) const |
Prints flag content into a stream. More... | |
template<typename... Flags> | |
constexpr recob::TrajectoryPointFlags::Mask_t | makeMask (Flags...flags) |
Access to flags by index | |
constexpr bool | isAllocated (FlagIndex_t flagIndex) const |
Returns whether there is room for a flag with the specified index. More... | |
constexpr FlagIndex_t | nFlags () const |
Returns the number of defined flags. More... | |
constexpr bool | isFlag (FlagIndex_t flagIndex) const |
constexpr bool | isFlag (Flag_t flag) const |
bool | test (FlagIndex_t index) const |
Returns whether the specified flag is set. More... | |
bool | test (Flag_t flag) const |
Returns whether the specified flag is set. More... | |
bool | get (Flag_t flag) const |
Returns whether the specified flag is set. More... | |
bool | isDefined (Flag_t flag) const |
Returns true if the flag has been assigned a value. More... | |
bool | isSet (Flag_t flag) const |
Returns true if the flag exists and is set. More... | |
bool | isUnset (Flag_t flag) const |
Returns true if the flag exists and is not set. More... | |
bool | match (Mask_t mask) const |
Returns true if the specified mask is matched. More... | |
Multiple flag access | |
| |
bool | anySet (Mask_t mask) const |
Returns whether any of the bits set in the mask are set. More... | |
bool | noneSet (Mask_t mask) const |
Returns whether none of the bits set in the mask is set. More... | |
Access to flags by meaning | |
bool | isHitIgnored () const |
Returns whether the associated hit is considered ignored. More... | |
bool | isPointValid () const |
Returns whether the associated point is valid. More... | |
bool | isMerged () const |
Returns whether the point has the Merged flag set. More... | |
bool | isShared () const |
Returns whether the point has the Shared flag set. More... | |
bool | isDeltaRay () const |
Returns whether the point has the DeltaRay flag set. More... | |
bool | hasDetectorIssues () const |
Returns whether the point has the DetectorIssue flag set. More... | |
bool | isOtherwiseSuspicious () const |
Returns whether the point has the Suspicious flag set. More... | |
bool | isExclusive () const |
bool | isExcludedFromFit () const |
Returns whether the point has the ExcludedFromFit flag set. More... | |
bool | belongsToTrack () const |
Returns whether the point has the Rejected flag set. More... | |
bool | isHitReinterpreted () const |
Returns whether the point has the Reinterpreted flag set. More... | |
bool | isIncludedInFit () const |
bool | isPointFlawed () const |
Returns whether the trajectory point has any problem flagged. More... | |
bool | isPointFlawless () const |
Returns whether the trajectory point has no flagged problem. More... | |
Access to hit index | |
constexpr bool | hasOriginalHitIndex () const |
constexpr HitIndex_t | fromHit () const |
Static Public Member Functions | |
template<typename... Flags> | |
static constexpr Mask_t | makeMask (Flags...flags) |
Returns a bit mask with only the specified bit set. More... | |
static constexpr Mask_t | DefaultFlagsMask () |
Flags used in default construction. More... | |
Static Public Attributes | |
static constexpr HitIndex_t | InvalidHitIndex = std::numeric_limits<HitIndex_t>::max() |
Value marking an invalid hit index. More... | |
Private Member Functions | |
constexpr bool | sameAs (TrajectoryPointFlags const &other) const |
Implementation detail of operator==() More... | |
Static Private Member Functions | |
static constexpr Mask_t | ImperfectPointMask () |
Flags to define a non-perfect trajectory point. More... | |
static constexpr Mask_t | SomehowSharedMask () |
Flags to define a hit that is in some way shared. More... | |
static constexpr Mask_t | ExcludedFromTrackFitMask () |
Flags to define a hit that is not included in the track fit. More... | |
Private Attributes | |
HitIndex_t | fFromHit = InvalidHitIndex |
Index of the original hit. More... | |
Flags_t | fFlags {DefaultFlagsMask()} |
Set of flags. More... | |
Set of flags pertaining a point of the track.
FlagTraits | type with the definition of the flag values |
The "flags" contain metadata pertaining a single point in a trajectory or track.
The metadata includes:
recob::TrackTrajectory
)The meaning of the flags is described in the FlagTraits type. This type needs to provide a maxFlags()
static constexpr method to express how many flags should be stored, d
Definition at line 304 of file TrajectoryPointFlags.h.
Type of flag traits (indices and meaning of flags).
Definition at line 308 of file TrajectoryPointFlags.h.
Type of single flag.
Definition at line 314 of file TrajectoryPointFlags.h.
Type of index of single flag.
Definition at line 316 of file TrajectoryPointFlags.h.
Type holding the flags.
Definition at line 310 of file TrajectoryPointFlags.h.
using recob::TrajectoryPointFlags::HitIndex_t = unsigned int |
Type for hit index.
Definition at line 318 of file TrajectoryPointFlags.h.
Type holding the flags.
Definition at line 312 of file TrajectoryPointFlags.h.
|
default |
Default constructor: invalid hit index, default flags (DefaultFlagsMask()
).
|
inline |
Constructor: specified hit index, default flags.
fromHit | the original hit index |
This constructor can be used in constexpr flag definitions:
Definition at line 337 of file TrajectoryPointFlags.h.
|
inline |
Constructor: copies all the flags.
fromHit | the original hit index |
flags | all the flags to set, as a bit mask |
This constructor can be used in constexpr flag definitions:
Definition at line 356 of file TrajectoryPointFlags.h.
|
inline |
Constructor: activates only the specified flags.
Flags | the type of flags to be set |
fromHit | the original hit index |
flags | all the flags to set |
This constructor can be used in constexpr flag definitions:
Definition at line 377 of file TrajectoryPointFlags.h.
|
inline |
Returns whether any of the bits set in the mask are set.
mask | mask with the bits to be checked defined and set (isSet() ) |
The method returns true if of all the flags that are set (Mask_t::isSet()
) in mask, at least one is set. Flags of mask that are unset or undefined are ignored.
Definition at line 504 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the Rejected
flag set.
Definition at line 550 of file TrajectoryPointFlags.h.
|
inlinestatic |
Flags used in default construction.
Definition at line 731 of file TrajectoryPointFlags.h.
References util::flags::makeMask().
Referenced by trkf::TrackKalmanFitter::setupInputStates().
void recob::TrajectoryPointFlags::dump | ( | Stream && | out, |
unsigned int | verbosity, | ||
std::string | indent, | ||
std::string | indentFirst | ||
) | const |
Prints the flags content into a stream.
Stream | type of the output stream |
out | stream to output the information into |
verbosity | verbosity level (default: 1 ) |
indent | indentation string (default: none) |
indentFirst | indentation for first output line (default: as indent) |
Prints on a single line all the flags that are set.
Currently indent
is not used since the output is single line.
verbosity
argument) 0
: number of the flags set, and index1
: name of the flags set, and index Referenced by recob::operator<<().
|
inline |
Prints flag content into a stream.
Stream | type of the output stream |
out | stream to output the information into |
verbosity | verbosity level (default: 1 ) |
indent | indentation string (default: none) |
Implementation detail for Dump(Stream&&, unsigned int, std::string, std::string).
Definition at line 634 of file TrajectoryPointFlags.h.
References util::flags::makeMask().
|
inlinestaticprivate |
Flags to define a hit that is not included in the track fit.
Definition at line 724 of file TrajectoryPointFlags.h.
|
inline |
Returns the entire set of bits.
Definition at line 485 of file TrajectoryPointFlags.h.
Referenced by sameAs().
|
inline |
Returns the original index of the hit.
InvalidHitIndex
if not set) Definition at line 587 of file TrajectoryPointFlags.h.
References art::detail::indent(), util::details::operator!=(), util::details::operator==(), and fhicl::other.
Referenced by trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints(), and sameAs().
|
inline |
Returns whether the specified flag is set.
flag | index of the flag to be tested |
A single flag is tested. If the flag is not defined (invalid index), the result is undefined.
Definition at line 439 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the DetectorIssue
flag set.
Definition at line 537 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the original hit index is valid.
Definition at line 582 of file TrajectoryPointFlags.h.
|
inlinestaticprivate |
Flags to define a non-perfect trajectory point.
Definition at line 711 of file TrajectoryPointFlags.h.
|
inline |
Returns whether there is room for a flag with the specified index.
flagIndex | index of the flag |
The flag may still be not present, in the sense that the allocated bit has no meaning associated to it and that flag is "unknown".
Definition at line 393 of file TrajectoryPointFlags.h.
|
inline |
Returns true if the flag has been assigned a value.
flag | the flag index |
Definition at line 447 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the DeltaRay
flag set.
Definition at line 534 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the ExcludedFromFit
flag set.
Definition at line 547 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has no flag set among Shared
, DeltaRay
and Merged
.
Definition at line 544 of file TrajectoryPointFlags.h.
|
inline |
Returns whether a flag with the specified index is known. (all allocated flags are)
Definition at line 403 of file TrajectoryPointFlags.h.
|
inline |
Returns whether a flag with the specified index is known. (all allocated flags are)
Definition at line 407 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the associated hit is considered ignored.
Definition at line 522 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the Reinterpreted
flag set.
Definition at line 553 of file TrajectoryPointFlags.h.
|
inline |
Returns false if the point has the ExcludedFromFit
or Rejected
flag set.
Definition at line 557 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the Merged
flag set.
Definition at line 528 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the point has the Suspicious
flag set.
Definition at line 540 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the trajectory point has any problem flagged.
A problematic point is basically one with any of the defined trajectory point flags set.
Definition at line 565 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the trajectory point has no flagged problem.
A problematic point is basically one with any of the defined trajectory point flags set.
Definition at line 573 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the associated point is valid.
Definition at line 525 of file TrajectoryPointFlags.h.
|
inline |
Returns true if the flag exists and is set.
flag | the flag index |
Definition at line 455 of file TrajectoryPointFlags.h.
Referenced by recob::TrackTrajectory::HasValidPoint().
|
inline |
Returns whether the point has the Shared
flag set.
Definition at line 531 of file TrajectoryPointFlags.h.
|
inline |
Returns true if the flag exists and is not set.
flag | the flag index |
Definition at line 463 of file TrajectoryPointFlags.h.
|
static |
Returns a bit mask with only the specified bit set.
Flags | the type of flags to be set |
flags | all the flags to set |
This method can be used in constexpr flag definitions:
Referenced by pma::convertFrom(), and trkf::KGTrack::fillTrack().
|
inline |
Definition at line 685 of file TrajectoryPointFlags.h.
|
inline |
Returns the entire set of bits as a bit mask.
Definition at line 482 of file TrajectoryPointFlags.h.
Referenced by trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints().
|
inline |
Returns true if the specified mask is matched.
mask | the mask of flags to be tested |
util::flags::BitMask::match()
The current flags are tested against the specified mask. The flags that in mask
are undefined are not tested at all. For this method to return true, all the remaining flags (that is, all the flags defined in mask
) must be defined, and their value must match the one in mask
.
Definition at line 477 of file TrajectoryPointFlags.h.
|
inline |
Returns the number of defined flags.
Definition at line 399 of file TrajectoryPointFlags.h.
|
inline |
Returns whether none of the bits set in the mask is set.
mask | mask with the bits to be checked defined and set (isSet() ) |
This is the logical negation of anySet()
.
Definition at line 514 of file TrajectoryPointFlags.h.
|
inline |
Returns whether other has content different than this one.
Definition at line 703 of file TrajectoryPointFlags.h.
|
inline |
Returns whether other has the same content as this one.
Definition at line 697 of file TrajectoryPointFlags.h.
|
inlineprivate |
Implementation detail of operator==()
Definition at line 692 of file TrajectoryPointFlags.h.
References flags(), and fromHit().
|
inlinestaticprivate |
Flags to define a hit that is in some way shared.
Definition at line 718 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the specified flag is set.
index | index of the flag to be tested |
Flags_t::OutOfRangeError | if the flag is not known (invalid index) |
Flags_t::FlagNotDefinedError | if the flag is not defined |
A single flag is tested.
Definition at line 418 of file TrajectoryPointFlags.h.
|
inline |
Returns whether the specified flag is set.
flag | flag to be tested |
Flags_t::OutOfRangeError | if the flag is not known (invalid index) |
Flags_t::FlagNotDefinedError | if the flag is not defined |
A single flag is tested.
Definition at line 429 of file TrajectoryPointFlags.h.
|
private |
Set of flags.
Definition at line 672 of file TrajectoryPointFlags.h.
|
private |
Index of the original hit.
Definition at line 658 of file TrajectoryPointFlags.h.
|
static |
Value marking an invalid hit index.
Definition at line 321 of file TrajectoryPointFlags.h.
Referenced by lar_pandora::LArPandoraTrackCreation::BuildTrack(), ShowerRecoTools::ShowerTrackDirection::CalculateElement(), and ShowerRecoTools::ShowerPandoraSlidingFitTrackFinder::CalculateElement().