Public Member Functions | Protected Attributes | List of all members
geo::GeometryGeoIDTestAlg Class Reference

#include <GeometryGeoIDTestAlg.h>

Public Member Functions

 GeometryGeoIDTestAlg (fhicl::ParameterSet const &)
 Constructor: reads configuration, does nothing. More...
 
void Setup (geo::GeometryCore const &new_geo)
 Algorithm set up. More...
 
unsigned int Run () const
 Executes the test. More...
 
All the ID iterator tests
void CryostatGeoIDTest () const
 
void TPCGeoIDTest () const
 
void PlaneGeoIDTest () const
 
void WireGeoIDTest () const
 

Protected Attributes

GeometryCore const * geom = nullptr
 pointer to the geometry description More...
 

Detailed Description

Definition at line 22 of file GeometryGeoIDTestAlg.h.

Constructor & Destructor Documentation

geo::GeometryGeoIDTestAlg::GeometryGeoIDTestAlg ( fhicl::ParameterSet const &  )
inline

Constructor: reads configuration, does nothing.

Definition at line 26 of file GeometryGeoIDTestAlg.h.

26 {}

Member Function Documentation

void geo::GeometryGeoIDTestAlg::CryostatGeoIDTest ( ) const

Definition at line 38 of file GeometryGeoIDTestAlg.cxx.

38  {
39 
40  auto iCryo = geom->begin_cryostat_id();
41  for (geo::CryostatGeo const& cryostat: geom->IterateCryostats()) {
42 
43  geo::CryostatID const& ID = cryostat.ID();
44 
45  // the ID of this CryostatGeo is the expected one in a sequential scheme:
46  BOOST_TEST(ID == *iCryo);
47 
48  // the ID of this CryostatGeo is associated to the CryostatGeo itself
49  auto const& cryostatFromID = geom->Cryostat(ID);
50  BOOST_TEST(&cryostat == &cryostatFromID);
51 
52 
53  ++iCryo;
54  } // for cryostat
55 
56 } // GeometryGeoIDTestAlg::CryostatGeoIDTest()
GeometryCore const * geom
pointer to the geometry description
unsigned int ID
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
cryostat_id_iterator begin_cryostat_id() const
Returns an iterator pointing to the first cryostat ID.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
void geo::GeometryGeoIDTestAlg::PlaneGeoIDTest ( ) const

Definition at line 84 of file GeometryGeoIDTestAlg.cxx.

84  {
85 
86  auto iPlane = geom->begin_plane_id();
87  for (geo::PlaneGeo const& plane: geom->IteratePlanes()) {
88 
89  geo::PlaneID const& ID = plane.ID();
90 
91  // the ID of this PlaneGeo is the expected one in a sequential scheme:
92  BOOST_TEST(ID == *iPlane);
93 
94  // the ID of this PlaneGeo is associated to the PlaneGeo itself
95  auto const& planeFromID = geom->Plane(ID);
96  BOOST_TEST(&plane == &planeFromID);
97 
98 
99  ++iPlane;
100  } // for plane
101 
102 } // GeometryGeoIDTestAlg::PlaneGeoIDTest()
GeometryCore const * geom
pointer to the geometry description
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
IteratorBox< plane_iterator,&GeometryCore::begin_plane,&GeometryCore::end_plane > IteratePlanes() const
Enables ranged-for loops on all planes of the detector.
unsigned int ID
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
plane_id_iterator begin_plane_id() const
Returns an iterator pointing to the first plane ID in the detector.
unsigned int geo::GeometryGeoIDTestAlg::Run ( ) const

Executes the test.

Definition at line 24 of file GeometryGeoIDTestAlg.cxx.

24  {
25  // All the tests
26 
28  TPCGeoIDTest();
30  WireGeoIDTest();
31 
32  return 0;
33 } // GeometryGeoIDTestAlg::Run()
void geo::GeometryGeoIDTestAlg::Setup ( geo::GeometryCore const &  new_geo)
inline

Algorithm set up.

Definition at line 29 of file GeometryGeoIDTestAlg.h.

29 { geom = &new_geo; }
GeometryCore const * geom
pointer to the geometry description
void geo::GeometryGeoIDTestAlg::TPCGeoIDTest ( ) const

Definition at line 61 of file GeometryGeoIDTestAlg.cxx.

61  {
62 
63  auto iTPC = geom->begin_TPC_id();
64  for (geo::TPCGeo const& tpc: geom->IterateTPCs()) {
65 
66  geo::TPCID const& ID = tpc.ID();
67 
68  // the ID of this TPCGeo is the expected one in a sequential scheme:
69  BOOST_TEST(ID == *iTPC);
70 
71  // the ID of this TPCGeo is associated to the TPCGeo itself
72  auto const& TPCFromID = geom->TPC(ID);
73  BOOST_TEST(&tpc == &TPCFromID);
74 
75 
76  ++iTPC;
77  } // for TPC
78 
79 } // GeometryGeoIDTestAlg::TPCGeoIDTest()
GeometryCore const * geom
pointer to the geometry description
TPC_id_iterator begin_TPC_id() const
Returns an iterator pointing to the first TPC ID in the detector.
unsigned int ID
Geometry information for a single TPC.
Definition: TPCGeo.h:38
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs() const
Enables ranged-for loops on all TPCs of the detector.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
void geo::GeometryGeoIDTestAlg::WireGeoIDTest ( ) const

Definition at line 107 of file GeometryGeoIDTestAlg.cxx.

107  {
108 
109  auto iWire = geom->begin_wire_id();
110  for (geo::WireGeo const& wire [[gnu::unused]]: geom->IterateWires()) {
111 
112  // this test is disabled since geo::WireID does not support ID()
113  // (as of LArSoft 6.13)
114  /*
115  geo::WireID const& ID = wire.ID();
116 
117  // the ID of this WireGeo is the expected one in a sequential scheme:
118  BOOST_TEST(ID == *iWire);
119 
120  // the ID of this WireGeo is associated to the WireGeo itself
121  auto const& wireFromID = geom->Wire(ID);
122  BOOST_TEST(&wire == &wireFromID);
123  */
124 
125  ++iWire;
126  } // for wire
127 
128 } // GeometryGeoIDTestAlg::WireGeoIDTest()
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
GeometryCore const * geom
pointer to the geometry description
IteratorBox< wire_iterator,&GeometryCore::begin_wire,&GeometryCore::end_wire > IterateWires() const
Enables ranged-for loops on all wires of the detector.
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.

Member Data Documentation

GeometryCore const* geo::GeometryGeoIDTestAlg::geom = nullptr
protected

pointer to the geometry description

Definition at line 44 of file GeometryGeoIDTestAlg.h.


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