10 #ifndef LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_H
11 #define LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_H
260 "Too many trajectory flags");
262 "Too many track flags");
265 "Too many experiment-defined flags"
268 "Too many user-defined flags");
336 = std::numeric_limits<HitIndex_t>::max();
396 template <
typename... Flags>
398 : TrajectoryPointFlags(fromHit,
makeMask(flags...))
675 template <
typename Stream>
678 unsigned int verbosity,
679 std::string indent, std::string indentFirst
693 template <
typename Stream>
695 (
Stream&& out,
unsigned int verbosity = 1, std::string indent = {})
697 {
dump(std::forward<Stream>(out), verbosity, indent, indent); }
712 template <
typename... Flags>
739 std::ostream&
operator<<
749 template <
typename... Flags>
752 {
return Mask_t(flags...); }
758 {
return (flags() == other.
flags()) && (fromHit() == other.
fromHit()); }
760 inline constexpr
bool recob::TrajectoryPointFlags::operator==
762 {
return sameAs(other); }
764 inline constexpr
bool recob::TrajectoryPointFlags::operator!=
766 {
return !sameAs(other); }
772 return flag::NoPoint + flag::HitIgnored
774 + flag::Merged + flag::DeltaRay + flag::DetectorIssue + flag::Shared
780 {
return flag::Merged + flag::DeltaRay + flag::Shared; }
784 {
return flag::ExcludedFromFit + flag::Rejected; }
798 #include "TrajectoryPointFlags.tcc"
802 #endif // LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_H
bool test(Flag_t flag) const
Returns whether the specified flag is set.
bool isHitIgnored() const
Returns whether the associated hit is considered ignored.
constexpr bool isFlag(FlagIndex_t flagIndex) const
static constexpr FlagIndex_t EndUserReservedFlags
After-the-last flag reserved to users.
static constexpr FlagIndex_t maxFlags()
Number of flags allocated (may be unused and unassigned).
static constexpr Flag_t Merged
The hit might have contribution from particles other than this.
Flags_t::Mask_t Mask_t
Type holding the flags.
constexpr bool isSet(Flag_t flag) const
Returns if the specified flag is set.
constexpr bool operator!=(TrajectoryPointFlags const &other) const
Returns whether other has content different than this one.
static constexpr Flag_t Suspicious
The point reconstruction is somehow questionable.
bool isIncludedInFit() const
TrajectoryPointFlagTraits flag
Type of flag traits (indices and meaning of flags).
static constexpr Mask_t makeMask(Flags...flags)
Returns a bit mask with only the specified bit set.
static constexpr Flag_t NoPoint
The trajectory point is not defined.
constexpr bool match(Mask_t const &mask) const
Returns whether all bits defined in the mask are equal to ours.
static constexpr Flag_t TrackReserved3
Reserved for a future track flag.
bool belongsToTrack() const
Returns whether the point has the Rejected flag set.
static constexpr FlagIndex_t EndTrajectoryFlags
After-the-last trajectory flag index.
then echo unknown compiler flag
bool isSet(Flag_t flag) const
Returns true if the flag exists and is set.
static constexpr Mask_t DefaultFlagsMask()
Flags used in default construction.
constexpr bool anySet(Mask_t const &mask) const
Returns whether any of the bits set in the mask are set.
static constexpr bool isFlag(Flag_t flag)
Returns whether the specified index represents a valid flag.
static constexpr FlagIndex_t BeginTrackFlags
First track flag index.
static NameMap_t initNames()
Returns a map of flag names.
static constexpr size_t capacity()
Returns the number of flags the set has room for.
Flags_t::Flag_t Flag_t
Type of single flag.
bool isOtherwiseSuspicious() const
Returns whether the point has the Suspicious flag set.
constexpr TrajectoryPointFlags(HitIndex_t fromHit)
Constructor: specified hit index, default flags.
Namespace for the trajectory point flags.
constexpr Mask_t const & mask() const
Returns the entire set of bits as a bit mask.
bool isPointFlawed() const
Returns whether the trajectory point has any problem flagged.
static void setFlagNames(NameMap_t &flagNames)
Sets the names of the flags after default initialization.
static constexpr Flag_t TrackReserved1
Reserved for a future track flag.
static constexpr Flag_t Reinterpreted
The hit content has been elaborated before being used in the fit.
static constexpr FlagIndex_t BeginExperimentReservedFlags
First flag reserved to experiment.
A class containing a set of flags.
constexpr Mask_t const & mask() const
Returns all the flags in the form of a mask.
bool test(FlagIndex_t index) const
Returns whether the specified flag is set.
unsigned int HitIndex_t
Type for hit index.
static void initDefaultFlagRangeNames(NameMap_t &flagNames, FlagIndex_t BeginFlags, FlagIndex_t EndFlags, std::string baseName)
Initializes a range of flag names with default (decorated) names.
Flags_t::FlagIndex_t FlagIndex_t
Type of index of a single flag.
constexpr HitIndex_t fromHit() const
A class containing a set of flags.
bool isPointValid() const
Returns whether the associated point is valid.
static constexpr unsigned int MaxFlags
Number of flags allocated (may be unused and unassigned).
bool test(Flag_t flag) const
Returns if the specified flag is set.
constexpr bool isUnset(Flag_t flag) const
Returns if the specified flag is unset.
constexpr bool noneSet(Mask_t const &mask) const
Returns whether none of the bits set in the mask is set.
static std::string decorateFlagName(std::string baseName, Flag_t flag)
Combines a base name and an index into a flag name.
bool isShared() const
Returns whether the point has the Shared flag set.
static std::string invalidFlagName(Flag_t flag)
Returns the name of an invalid flag with the specified index.
void dump(Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const
Prints the flags content into a stream.
constexpr bool hasOriginalHitIndex() const
static constexpr Mask_t ExcludedFromTrackFitMask()
Flags to define a hit that is not included in the track fit.
constexpr Flags_t const & flags() const
Returns the entire set of bits.
constexpr bool operator==(TrajectoryPointFlags const &other) const
Returns whether other has the same content as this one.
bool noneSet(Mask_t mask) const
Returns whether none of the bits set in the mask is set.
typename Mask_t::Flag_t Flag_t
Type identifying a single flag.
static void initDefaultFlagsNames(NameMap_t &flagNames)
Initialises all flag names with a default name.
static constexpr Mask_t ImperfectPointMask()
Flags to define a non-perfect trajectory point.
static constexpr Mask_t SomehowSharedMask()
Flags to define a hit that is in some way shared.
constexpr bool sameAs(TrajectoryPointFlags const &other) const
Implementation detail of operator==()
bool isDeltaRay() const
Returns whether the point has the DeltaRay flag set.
static constexpr Flag_t TrackReserved4
Reserved for a future track flag.
static constexpr FlagIndex_t EndTrackFlags
After-the-last track flag index.
static constexpr FlagIndex_t EndExperimentReservedFlags
After-the-last flag reserved to experiment.
static constexpr Flag_t HitIgnored
Hit was not included for the computation of the trajectory.
typename Mask_t::FlagIndex_t FlagIndex_t
Type of index of flag.
static constexpr HitIndex_t InvalidHitIndex
Value marking an invalid hit index.
Flags_t::Flag_t Flag_t
Type of single flag.
static std::string name(Flag_t flag)
Returns a string with the name of the specified flag.
static constexpr Flag_t Rejected
The hit is extraneous to this track.
static constexpr Flag_t ExcludedFromFit
constexpr bool get(Flag_t flag) const
Returns if the specified flag is on ("set").
constexpr BitMask< Storage > makeMask(Bits_t< Storage > bits)
Constructs a mask from bits.
bool match(Mask_t mask) const
Returns true if the specified mask is matched.
bool hasDetectorIssues() const
Returns whether the point has the DetectorIssue flag set.
bool isUnset(Flag_t flag) const
Returns true if the flag exists and is not set.
bool isPointFlawless() const
Returns whether the trajectory point has no flagged problem.
bool anySet(Mask_t mask) const
Returns whether any of the bits set in the mask are set.
constexpr bool isFlag(Flag_t flag) const
static constexpr Flag_t TrackReserved5
Reserved for a future track flag.
constexpr bool isFlag(FlagIndex_t flagIndex) const
Returns whether the flag index is valid.
static constexpr FlagIndex_t BeginTrajectoryFlags
First trajectory flag index.
std::array< std::string, MaxFlags > NameMap_t
Type storing flag names.
static constexpr Flag_t TrajReserved1
Reserved for a future trajectory flag.
Flags_t fFlags
Set of flags.
bool isHitReinterpreted() const
Returns whether the point has the Reinterpreted flag set.
static constexpr FlagIndex_t BeginUserReservedFlags
First flag reserved to users.
static constexpr Flag_t DetectorIssue
The hit is associated to a problematic channel.
bool isExcludedFromFit() const
Returns whether the point has the ExcludedFromFit flag set.
constexpr bool isAllocated(FlagIndex_t flagIndex) const
Returns whether there is room for a flag with the specified index.
static constexpr Flag_t DeltaRay
The hit might have contribution from a δ ray.
bool isDefined(Flag_t flag) const
Returns true if the flag has been assigned a value.
constexpr bool isDefined(Flag_t flag) const
Returns whether the flag is defined.
Flags_t::FlagIndex_t FlagIndex_t
Type of index of single flag.
static constexpr Flag_t TrackReserved2
Reserved for a future track flag.
bool isMerged() const
Returns whether the point has the Merged flag set.
static const NameMap_t names
Names of the flags.
static constexpr Flag_t Shared
The hit is known to be associated also to another trajectory.
constexpr TrajectoryPointFlags(HitIndex_t fromHit, Flags...flags)
Constructor: activates only the specified flags.
constexpr TrajectoryPointFlags()=default
Set of flags pertaining a point of the track.
BitMask< Storage > Mask_t
Type of bit mask for this flag set.
HitIndex_t fFromHit
Index of the original hit.
constexpr FlagIndex_t nFlags() const
Returns the number of defined flags.
util::flags::FlagSet< MaxFlags > Flags_t
Type of mask of bits.