LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
geo::InvalidWireError Class Reference

Exception thrown on invalid wire number. More...

#include "Exceptions.h"

Inheritance diagram for geo::InvalidWireError:

Public Member Functions

 InvalidWireError (std::string cat)
 
 InvalidWireError (std::string cat, geo::PlaneID const &planeID, int badWireNo, int betterWireNo)
 Constructor with the complete information. More...
 
 InvalidWireError (std::string cat, geo::PlaneID const &planeID, int badWireNo)
 Constructor: no wire suggestions. More...
 
 InvalidWireError (std::string cat, int badWireNo, int betterWireNo)
 Constructor: no plane information. More...
 
 InvalidWireError (std::string cat, int badWireNo)
 Constructor: no plane information and no suggestion. More...
 
Access to bad wire
bool hasBadWire () const
 Returns whether we known the bad wire number. More...
 
int badWire () const
 Returns the bad wire number. More...
 
geo::WireID badWireID () const
 Returns the bad wire ID. More...
 
Access to suggested wire
bool hasSuggestedWire () const
 Returns whether we known a better wire number. More...
 
int suggestedWire () const
 Returns a better wire number. More...
 
geo::WireID suggestedWireID () const
 Returns a better wire ID. More...
 
Plane access
bool hasPlane () const
 Return whether a plane is recorded with the exception. More...
 
geo::PlaneID const & planeID () const
 Return the plane ID recorded with the exception. More...
 

Static Public Attributes

static constexpr int InvalidWireNo = std::numeric_limits<int>::max()
 Value used to represent an invalid wire number. More...
 

Private Member Functions

geo::WireID makeWireID (int wireNo) const
 Transform a wire number into wire ID. More...
 

Private Attributes

geo::PlaneID fPlaneID
 plane the wire belongs to More...
 
int fWireNumber = InvalidWireNo
 the invalid wire number More...
 
int fBetterWireNo = InvalidWireNo
 a suggestion for a good wire number More...
 

Detailed Description

Exception thrown on invalid wire number.


This class is thrown, e.g., by Geometry::NearestWireID(). It contains the erroneous wire number, a suggestion of which one might be the right one, and a plane ID.

The wire numbers are signed.

Definition at line 42 of file Exceptions.h.

Constructor & Destructor Documentation

geo::InvalidWireError::InvalidWireError ( std::string  cat)
inline

Constructor: we don't have any information

Deprecated:
Specify at least the wrong wire number!

Definition at line 51 of file Exceptions.h.

Referenced by InvalidWireError().

51 : cet::exception(cat) {}
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
geo::PlaneID const &  planeID,
int  badWireNo,
int  betterWireNo 
)
inline

Constructor with the complete information.

Definition at line 54 of file Exceptions.h.

References InvalidWireError().

60  : cet::exception(cat)
61  , fPlaneID(planeID)
62  , fWireNumber(badWireNo)
63  , fBetterWireNo(betterWireNo)
64  {}
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:143
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:137
geo::PlaneID const & planeID() const
Return the plane ID recorded with the exception.
Definition: Exceptions.h:132
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
geo::PlaneID const &  planeID,
int  badWireNo 
)
inline

Constructor: no wire suggestions.

Definition at line 68 of file Exceptions.h.

69  : cet::exception(cat)
70  , fPlaneID(planeID)
71  , fWireNumber(badWireNo)
72  {}
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:137
geo::PlaneID const & planeID() const
Return the plane ID recorded with the exception.
Definition: Exceptions.h:132
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
int  badWireNo,
int  betterWireNo 
)
inline

Constructor: no plane information.

Definition at line 75 of file Exceptions.h.

80  : cet::exception(cat)
81  , fWireNumber(badWireNo)
82  , fBetterWireNo(betterWireNo)
83  {}
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:143
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
int  badWireNo 
)
inline

Constructor: no plane information and no suggestion.

Definition at line 86 of file Exceptions.h.

90  : cet::exception(cat)
91  , fWireNumber(badWireNo)
92  {}
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

int geo::InvalidWireError::badWire ( ) const
inline

Returns the bad wire number.

Definition at line 102 of file Exceptions.h.

References fWireNumber.

102 { return fWireNumber; }
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
geo::WireID geo::InvalidWireError::badWireID ( ) const
inline

Returns the bad wire ID.

Definition at line 105 of file Exceptions.h.

References fWireNumber, and makeWireID().

105 { return makeWireID(fWireNumber); }
geo::WireID makeWireID(int wireNo) const
Transform a wire number into wire ID.
Definition: Exceptions.h:146
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
bool geo::InvalidWireError::hasBadWire ( ) const
inline

Returns whether we known the bad wire number.

Definition at line 99 of file Exceptions.h.

References fWireNumber, and InvalidWireNo.

99 { return fWireNumber != InvalidWireNo; }
static constexpr int InvalidWireNo
Value used to represent an invalid wire number.
Definition: Exceptions.h:46
int fWireNumber
the invalid wire number
Definition: Exceptions.h:140
bool geo::InvalidWireError::hasPlane ( ) const
inline

Return whether a plane is recorded with the exception.

Definition at line 129 of file Exceptions.h.

References fPlaneID, and geo::CryostatID::isValid.

129 { return fPlaneID.isValid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:129
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:137
bool geo::InvalidWireError::hasSuggestedWire ( ) const
inline

Returns whether we known a better wire number.

Definition at line 114 of file Exceptions.h.

References fBetterWireNo, and InvalidWireNo.

Referenced by hit::DisambigCheater::InitHitToWids().

114 { return fBetterWireNo != InvalidWireNo; }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:143
static constexpr int InvalidWireNo
Value used to represent an invalid wire number.
Definition: Exceptions.h:46
geo::WireID geo::InvalidWireError::makeWireID ( int  wireNo) const
inlineprivate

Transform a wire number into wire ID.

Definition at line 146 of file Exceptions.h.

References fPlaneID.

Referenced by badWireID(), and suggestedWireID().

147  { return { fPlaneID, (geo::WireID::WireID_t) wireNo }; }
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:137
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:306
geo::PlaneID const& geo::InvalidWireError::planeID ( ) const
inline

Return the plane ID recorded with the exception.

Definition at line 132 of file Exceptions.h.

References fPlaneID.

132 { return fPlaneID; }
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:137
int geo::InvalidWireError::suggestedWire ( ) const
inline

Returns a better wire number.

Definition at line 117 of file Exceptions.h.

References fBetterWireNo.

117 { return fBetterWireNo; }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:143
geo::WireID geo::InvalidWireError::suggestedWireID ( ) const
inline

Returns a better wire ID.

Definition at line 120 of file Exceptions.h.

References fBetterWireNo, and makeWireID().

Referenced by cluster::ClusterCrawlerAlg::FindHammerClusters(), hit::DisambigCheater::InitHitToWids(), evd::RecoBaseDrawer::OpFlash2D(), shower::EMShowerAlg::Project3DPointOntoPlane(), and cluster::ClusterCrawlerAlg::VtxMatch().

120 { return makeWireID(fBetterWireNo); }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:143
geo::WireID makeWireID(int wireNo) const
Transform a wire number into wire ID.
Definition: Exceptions.h:146

Member Data Documentation

int geo::InvalidWireError::fBetterWireNo = InvalidWireNo
private

a suggestion for a good wire number

Definition at line 143 of file Exceptions.h.

Referenced by hasSuggestedWire(), suggestedWire(), and suggestedWireID().

geo::PlaneID geo::InvalidWireError::fPlaneID
private

plane the wire belongs to

Definition at line 137 of file Exceptions.h.

Referenced by hasPlane(), makeWireID(), and planeID().

int geo::InvalidWireError::fWireNumber = InvalidWireNo
private

the invalid wire number

Definition at line 140 of file Exceptions.h.

Referenced by badWire(), badWireID(), and hasBadWire().

constexpr int geo::InvalidWireError::InvalidWireNo = std::numeric_limits<int>::max()
static

Value used to represent an invalid wire number.

Definition at line 46 of file Exceptions.h.

Referenced by hasBadWire(), and hasSuggestedWire().


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