LArSoft  v09_07_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::CryostatID Struct Reference

The data type to uniquely identify a cryostat. More...

#include "geo_types.h"

Inheritance diagram for geo::CryostatID:
geo::OpDetID geo::TPCID readout::TPCsetID geo::PlaneID readout::ROPID geo::WireID

Public Types

using CryostatID_t = unsigned int
 Type for the ID number. More...
 
using ThisID_t = CryostatID
 Type of this ID. More...
 
using ParentID_t = void
 Type of the parent ID (none!). More...
 
template<std::size_t L>
using ID_t = details::AbsIDtype< L, ThisID_t >
 Type of the ID with the specified level L. More...
 
template<std::size_t A>
using UpperID_t = details::RelIDtype< A, ThisID_t >
 Type of the ID A levels above this one. More...
 

Public Member Functions

constexpr CryostatID ()=default
 Default constructor: an invalid cryostat. More...
 
constexpr CryostatID (CryostatID_t c)
 Constructor: valid ID of cryostat with index c. More...
 
constexpr CryostatID (CryostatID_t c, bool valid)
 Constructor: valid ID of cryostat with index c. More...
 
constexpr auto const & deepestIndex () const
 Returns the value of the deepest ID available (cryostat's). More...
 
auto & deepestIndex ()
 Returns the deepest ID available (cryostat's). More...
 
constexpr ParentID_t parentID () const
 Return the parent ID of this one (void). More...
 
ParentID_t parentID ()
 Return the parent ID of this one (void). More...
 
template<std::size_t Index = 0U>
constexpr auto getIndex () const
 Returns the index level Index of this type. More...
 
template<std::size_t Index = 0U>
auto & writeIndex ()
 Returns the index level Index of this type. More...
 
template<std::size_t Above>
constexpr auto getRelIndex () const
 Returns the index Above levels higher than Level. More...
 
constexpr int cmp (CryostatID const &other) const
 Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger. More...
 
constexpr CryostatID const & asCryostatID () const
 Conversion to CryostatID (for convenience of notation). More...
 
CryostatIDasCryostatID ()
 Conversion to CryostatID (for convenience of notation). More...
 
constexpr CryostatID const & asConstCryostatID ()
 Conversion to CryostatID (for convenience of notation). More...
 
ID validity
constexpr operator bool () const
 Returns true if the ID is valid. More...
 
constexpr bool operator! () const
 Returns true if the ID is not valid. More...
 
void setValidity (bool valid)
 Sets the validity of the ID. More...
 
void markValid ()
 Sets the ID as valid. More...
 
void markInvalid ()
 Sets the ID as invalid. More...
 
std::string toString () const
 Human-readable representation of the cryostat ID. More...
 
 operator std::string () const
 Human-readable representation of the cryostat ID. More...
 

Static Public Member Functions

static constexpr CryostatID_t getInvalidID ()
 Return the value of the invalid ID as a r-value. More...
 
template<typename T >
static constexpr int ThreeWayComparison (T a, T b)
 Returns < 0 if a < b, 0 if a == b, > 0 if a > b. More...
 

Public Attributes

bool isValid = false
 Whether this ID points to a valid element. More...
 
CryostatID_t Cryostat = InvalidID
 Index of cryostat. More...
 

Static Public Attributes

static constexpr CryostatID_t InvalidID = std::numeric_limits<CryostatID_t>::max()
 Special code for an invalid ID. More...
 
static constexpr auto Level = geo::ElementLevel::Cryostat
 Level of this element. More...
 

Detailed Description

The data type to uniquely identify a cryostat.

Definition at line 190 of file geo_types.h.

Member Typedef Documentation

using geo::CryostatID::CryostatID_t = unsigned int

Type for the ID number.

Definition at line 191 of file geo_types.h.

template<std::size_t L>
using geo::CryostatID::ID_t = details::AbsIDtype<L, ThisID_t>

Type of the ID with the specified level L.

Definition at line 198 of file geo_types.h.

Type of the parent ID (none!).

Definition at line 194 of file geo_types.h.

Type of this ID.

Definition at line 193 of file geo_types.h.

template<std::size_t A>
using geo::CryostatID::UpperID_t = details::RelIDtype<A, ThisID_t>

Type of the ID A levels above this one.

Definition at line 202 of file geo_types.h.

Constructor & Destructor Documentation

constexpr geo::CryostatID::CryostatID ( )
default

Default constructor: an invalid cryostat.

constexpr geo::CryostatID::CryostatID ( CryostatID_t  c)
inlineexplicit

Constructor: valid ID of cryostat with index c.

Definition at line 218 of file geo_types.h.

218 : isValid(true), Cryostat(c) {}
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
constexpr geo::CryostatID::CryostatID ( CryostatID_t  c,
bool  valid 
)
inline

Constructor: valid ID of cryostat with index c.

Definition at line 221 of file geo_types.h.

222  : isValid(valid), Cryostat(c) {}
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212

Member Function Documentation

constexpr CryostatID const& geo::CryostatID::asConstCryostatID ( )
inline

Conversion to CryostatID (for convenience of notation).

Definition at line 279 of file geo_types.h.

279 { return *this; }
constexpr CryostatID const& geo::CryostatID::asCryostatID ( ) const
inline

Conversion to CryostatID (for convenience of notation).

Definition at line 275 of file geo_types.h.

Referenced by readout::operator!=(), geo::operator!=(), readout::operator<(), geo::operator<(), readout::operator<<(), geo::operator<<(), readout::operator==(), and geo::operator==().

275 { return *this; }
CryostatID& geo::CryostatID::asCryostatID ( )
inline

Conversion to CryostatID (for convenience of notation).

Definition at line 277 of file geo_types.h.

277 { return *this; }
constexpr int geo::CryostatID::cmp ( CryostatID const &  other) const
inline

Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.

Definition at line 271 of file geo_types.h.

References deepestIndex().

Referenced by readout::TPCsetID::cmp(), geo::OpDetID::cmp(), geo::TPCID::cmp(), readout::operator<(), and geo::operator<().

272  { return ThreeWayComparison(deepestIndex(), other.deepestIndex()); }
static constexpr int ThreeWayComparison(T a, T b)
Returns < 0 if a < b, 0 if a == b, > 0 if a > b.
Definition: geo_types.h:290
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (cryostat&#39;s).
Definition: geo_types.h:253
constexpr auto const& geo::CryostatID::deepestIndex ( ) const
inline

Returns the value of the deepest ID available (cryostat's).

Definition at line 253 of file geo_types.h.

Referenced by cmp().

253 { return Cryostat; }
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
auto& geo::CryostatID::deepestIndex ( )
inline

Returns the deepest ID available (cryostat's).

Definition at line 255 of file geo_types.h.

255 { return Cryostat; }
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
template<std::size_t Index>
constexpr auto geo::CryostatID::getIndex ( ) const

Returns the index level Index of this type.

Definition at line 881 of file geo_types.h.

881  {
882  static_assert
883  (Index <= Level, "This ID type does not have the requested Index level.");
884  return details::getAbsIDindex<Index>(*this);
885 } // geo::CryostatID::getIndex() const
static constexpr auto Level
Level of this element.
Definition: geo_types.h:282
static constexpr CryostatID_t geo::CryostatID::getInvalidID ( )
inlinestatic

Return the value of the invalid ID as a r-value.

Definition at line 285 of file geo_types.h.

References InvalidID.

286  { return CryostatID::InvalidID; }
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
template<std::size_t Above>
constexpr auto geo::CryostatID::getRelIndex ( ) const

Returns the index Above levels higher than Level.

Definition at line 895 of file geo_types.h.

895  {
896  static_assert
897  (Above <= Level, "This ID type does not have the requested Index level.");
898  return getIndex<Level - Above>();
899 } // geo::CryostatID::getRelIndex()
static constexpr auto Level
Level of this element.
Definition: geo_types.h:282
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:881
void geo::CryostatID::markInvalid ( )
inline

Sets the ID as invalid.

Definition at line 240 of file geo_types.h.

References geo::details::writeToString().

Referenced by geo::PlaneGeo::ClosestWireID(), and geo::GeometryCore::FindTPCAtPosition().

240 { setValidity(false); }
void setValidity(bool valid)
Sets the validity of the ID.
Definition: geo_types.h:234
void geo::CryostatID::markValid ( )
inline

Sets the ID as valid.

Definition at line 237 of file geo_types.h.

237 { setValidity(true); }
void setValidity(bool valid)
Sets the validity of the ID.
Definition: geo_types.h:234
constexpr geo::CryostatID::operator bool ( ) const
inlineexplicit

Returns true if the ID is valid.

Definition at line 228 of file geo_types.h.

228 { return isValid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
geo::CryostatID::operator std::string ( ) const
inlineexplicit

Human-readable representation of the cryostat ID.

Definition at line 248 of file geo_types.h.

248 { return toString(); }
std::string toString() const
Human-readable representation of the cryostat ID.
Definition: geo_types.h:247
constexpr bool geo::CryostatID::operator! ( ) const
inline

Returns true if the ID is not valid.

Definition at line 231 of file geo_types.h.

231 { return !isValid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
constexpr ParentID_t geo::CryostatID::parentID ( ) const
inline

Return the parent ID of this one (void).

Definition at line 257 of file geo_types.h.

257 {}
ParentID_t geo::CryostatID::parentID ( )
inline

Return the parent ID of this one (void).

Definition at line 259 of file geo_types.h.

259 {}
void geo::CryostatID::setValidity ( bool  valid)
inline

Sets the validity of the ID.

Definition at line 234 of file geo_types.h.

234 { isValid = valid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
template<typename T >
static constexpr int geo::CryostatID::ThreeWayComparison ( a,
b 
)
inlinestatic

Returns < 0 if a < b, 0 if a == b, > 0 if a > b.

Definition at line 290 of file geo_types.h.

291  { return (a == b)? 0: ((a < b)? -1: +1); }
std::string geo::CryostatID::toString ( ) const
inline

Human-readable representation of the cryostat ID.

Definition at line 247 of file geo_types.h.

247 { return details::writeToString(*this); }
std::string writeToString(T const &value)
Write the argument into a string.
Definition: geo_types.h:864
template<std::size_t Index>
auto & geo::CryostatID::writeIndex ( )

Returns the index level Index of this type.

Definition at line 888 of file geo_types.h.

888  {
889  static_assert
890  (Index <= Level, "This ID type does not have the requested Index level.");
891  return details::getAbsIDindex<Index>(*this);
892 } // geo::CryostatID::writeIndex()
static constexpr auto Level
Level of this element.
Definition: geo_types.h:282

Member Data Documentation

CryostatID_t geo::CryostatID::Cryostat = InvalidID

Index of cryostat.

Definition at line 212 of file geo_types.h.

Referenced by detsim::WienerFilterAna::analyze(), hit::GausHitFinderAna::analyze(), trkf::SpacePointAna::analyze(), mvapid::MVAAlg::CalcSegmentdEdxDist(), tca::ChgFracBetween(), tca::ChgFracNearEnd(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), trkf::SpacePointAlg::compatible(), tca::CompleteIncomplete3DVerticesInGaps(), geo::ChannelMapStandardAlg::ConvertROPtoWirePlane(), detinfo::DetectorPropertiesData::ConvertTicksToX(), geo::ChannelMapStandardAlg::ConvertTPCsetToTPC(), geo::ChannelMapStandardAlg::ConvertTPCtoTPCset(), geo::ChannelMapStandardAlg::ConvertWirePlaneToROP(), detinfo::DetectorPropertiesData::ConvertXToTicks(), trkf::SpacePointAlg::correctedTime(), geo::GeometryCore::Cryostat(), geo::GeometryCore::CryostatPtr(), cluster::ClusterCrawlerAlg::EncodeCTP(), tca::EncodeCTP(), cluster::EndPointAlg::EndPoint(), ems::EndPoint::EndPoint(), trkf::SpacePointAlg::fillComplexSpacePoint(), tca::FillmAllTraj(), lar_pandora::PFParticleHitDumper::FillRecoWires(), trkf::SpacePointAlg::fillSpacePoint(), tca::FillWireHitRange(), tca::FillWireIntersections(), tca::Find3DVertices(), apa::DisambigAlg::FindChanTimeEndPts(), geo::GeometryCore::FindCryostatAtPosition(), hit::HitCheater::FindHitsOnChannel(), tca::FindParent(), tca::FindShowers3D(), geo::GeometryCore::FindTPCAtPosition(), tca::FitTP3Ds(), cluster::ClusterCrawlerAlg::FitVtx(), ems::EMShower3D::GetCloseHits(), geo::GeometryCore::GetClosestOpDet(), geo::GeometryCore::GetEndTPCID(), geo::GeometryCore::GetEndTPCsetID(), cluster::ClusterCrawlerAlg::GetHitRange(), calo::Calorimetry::GetPitch(), calo::GnocchiCalorimetry::GetPitch(), nnet::TrainingDataAlg::getProjection(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), pma::Track3D::GetUnconstrainedProj3D(), lar_pandora::PFParticleHitDumper::GetUVW(), detinfo::DetectorPropertiesData::GetXTicksOffset(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire_(), geo::GeometryCore::HasCryostat(), tss::Hit2D::Hit2D(), ems::Hit2D::Hit2D(), pma::Hit3D::Hit3D(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), hit::DisambigCheater::InitHitToWids(), trkf::KHitWireLine::KHitWireLine(), trkf::KHitWireX::KHitWireX(), lar_cluster3d::PCASeedFinderAlg::LineFit2DHits(), lar_cluster3d::HoughSeedFinderAlg::LineFit2DHits(), geo::details::cryostat_id_iterator_base< GEOID >::localID(), apa::DisambigAlg::MakeCloseHits(), lar_cluster3d::StandardHit3DBuilder::makeDeadChannelPair(), lar_cluster3d::StandardHit3DBuilder::makeHitPair(), lar_cluster3d::StandardHit3DBuilder::makeHitTriplet(), tca::MakePFPTjs(), trkf::SpacePointAlg::makeSpacePoints(), trkf::CosmicTrackerAlg::MakeSPT(), tca::Match2Planes(), tca::NearbySrcHit(), geo::ChannelMapAlg::NearestWireID(), geo::ChannelMapStandardAlg::NTPCsets(), geo::operator!=(), geo::operator<(), anab::operator<<(), recob::operator<<(), geo::operator<<(), geo::operator==(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_2D(), geo::ChannelMapAlg::PlaneWireToChannel(), tca::PosInPlane(), geo::GeometryCore::PositionToCryostat(), geo::GeometryCore::PositionToTPC(), tca::Print3S(), tca::Print3V(), tca::PrintAllTraj(), tca::PrintTP3Ds(), cluster::LineCluster::produce(), cluster::ClusterCheater::produce(), cluster::TrajCluster::produce(), cluster::SmallClusterFinder::produce(), hit::DPRawHitFinder::produce(), evd::GraphCluster::produce(), calo::Calorimetry::produce(), calo::GnocchiCalorimetry::produce(), ICARUS::CTreeGeometry::saveChannelWireMap(), trkf::SpacePointAlg::separation(), tca::SignalAtTp(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), apa::DisambigAlg::TrivialDisambig(), tca::ValidTwoPlaneMatch(), cluster::ClusterCrawlerAlg::Vtx3ClusterMatch(), cluster::ClusterCrawlerAlg::Vtx3ClusterSplit(), cluster::ClusterCrawlerAlg::VtxMatch(), geo::ChannelMapAlg::WireCoordinate(), and tca::WireHitRangeOK().

constexpr CryostatID_t geo::CryostatID::InvalidID = std::numeric_limits<CryostatID_t>::max()
static

Special code for an invalid ID.

Definition at line 208 of file geo_types.h.

Referenced by geo::GeometryCore::FindCryostatAtPosition(), getInvalidID(), and geo::GeometryCore::PositionToCryostat().

constexpr auto geo::CryostatID::Level = geo::ElementLevel::Cryostat
static

Level of this element.

Definition at line 282 of file geo_types.h.


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