LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ChannelMapStandardAlg.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
8 #define LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
9 
10 #include <vector>
11 #include <set>
12 
13 #include "larcoreobj/SimpleTypesAndConstants/readout_types.h" // readout::TPCsetID, ...
17 #include "fhiclcpp/ParameterSet.h"
18 
19 namespace geo{
20 
22 
23  public:
24 
26 
27  virtual void Initialize( GeometryData_t const& geodata ) override;
28  virtual void Uninitialize() override;
29  virtual std::vector<WireID> ChannelToWire(raw::ChannelID_t channel) const override;
30  virtual unsigned int Nchannels() const override;
31 
34  virtual unsigned int Nchannels(readout::ROPID const& ropid) const override;
35 
37  virtual double WireCoordinate
38  (double YPos, double ZPos, geo::PlaneID const& planeID) const override;
39  virtual double WireCoordinate(double YPos, double ZPos,
40  unsigned int PlaneNo,
41  unsigned int TPCNo,
42  unsigned int cstat) const override
43  { return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
45 
47  virtual WireID NearestWireID
48  (const TVector3& worldPos, geo::PlaneID const& planeID) const override;
49  virtual WireID NearestWireID(const TVector3& worldPos,
50  unsigned int PlaneNo,
51  unsigned int TPCNo,
52  unsigned int cstat) const override
53  { return NearestWireID(worldPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
55 
58  (geo::WireID const& wireID) const override;
59  virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane,
60  unsigned int wire,
61  unsigned int tpc,
62  unsigned int cstat) const override
63  { return PlaneWireToChannel(geo::WireID(cstat, tpc, plane, wire)); }
65 
66  virtual std::set<PlaneID> const& PlaneIDs() const override;
67 
68 
69  //
70  // TPC set interface
71  //
74 
82  virtual unsigned int NTPCsets
83  (readout::CryostatID const& cryoid) const override;
84 
86  virtual unsigned int MaxTPCsets() const override;
87 
90  virtual bool HasTPCset(readout::TPCsetID const& tpcsetid) const override;
91 
105  (geo::TPCID const& tpcid) const override;
106 
120  virtual std::vector<geo::TPCID> TPCsetToTPCs
121  (readout::TPCsetID const& tpcsetid) const override;
122 
125  (readout::TPCsetID const& tpcsetid) const override;
126 
128 
129 
130 
131  //
132  // Readout plane interface
133  //
136 
147  virtual unsigned int NROPs
148  (readout::TPCsetID const& tpcsetid) const override;
149 
151  virtual unsigned int MaxROPs() const override;
152 
155  virtual bool HasROP(readout::ROPID const& ropid) const override;
156 
170  (geo::PlaneID const& planeid) const override;
171 
184  virtual std::vector<geo::PlaneID> ROPtoWirePlanes
185  (readout::ROPID const& ropid) const override;
186 
200  virtual std::vector<geo::TPCID> ROPtoTPCs
201  (readout::ROPID const& ropid) const override;
202 
205  (raw::ChannelID_t channel) const override;
206 
218  (readout::ROPID const& ropid) const override;
219 
222  (readout::ROPID const& ropid) const override;
223 
225 
227  virtual geo::GeoObjectSorter const& Sorter() const override
228  { return fSorter; }
229 
230  private:
231 
232  unsigned int fNcryostat;
233  unsigned int fNchannels;
235  std::vector<unsigned int> fNTPC;
236  std::set<View_t> fViews;
237  std::set<PlaneID> fPlaneIDs;
252 
255 
256 
257  virtual SigType_t SignalTypeForChannelImpl( raw::ChannelID_t const channel ) const override;
258 
260  unsigned int WireCount(geo::PlaneID const& id) const
261  { return AccessElement(fWireCounts, id); }
262 
264  unsigned int MaxTPCs() const;
265 
267  static readout::TPCsetID ConvertTPCtoTPCset(geo::TPCID const& tpcid);
268 
270  static geo::TPCID ConvertTPCsetToTPC(readout::TPCsetID const& tpcsetid);
271 
273  static readout::ROPID ConvertWirePlaneToROP(geo::PlaneID const& planeid);
274 
277 
278  };
279 
280 
281 }
282 #endif // LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
283 
virtual void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
Interface for a class providing readout channel mapping to geometry.
Definition: ChannelMapAlg.h:55
TPCInfoMap_t< unsigned int > fNPlanes
PlaneInfoMap_t< float > fWireCounts
virtual WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
Classes identifying readout-related concepts.
virtual geo::GeoObjectSorter const & Sorter() const override
Return the sorter.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
static geo::PlaneID ConvertROPtoWirePlane(readout::ROPID const &ropid)
Converts a wire plane ID into a ROP ID using the same numerical indices.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:41
virtual unsigned int MaxTPCsets() const override
Returns the largest number of TPC sets any cryostat in the detector has.
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
PlaneInfoMap_t< float > fOrthVectorsZ
static readout::TPCsetID ConvertTPCtoTPCset(geo::TPCID const &tpcid)
Converts a TPC ID into a TPC set ID using the same numerical indices.
std::set< View_t > fViews
vector of the views present in the detector
Interface to algorithm class for standard sorting of geo::XXXGeo objects.
std::vector< std::vector< T >> TPCInfoMap_t
Data type for per-TPC information.
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const override
Returns the channel ID a wire is connected to.
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
unsigned int WireCount(geo::PlaneID const &id) const
Retrieved the wire cound for the specified plane ID.
static readout::ROPID ConvertWirePlaneToROP(geo::PlaneID const &planeid)
Converts a ROP ID into a wire plane ID using the same numerical indices.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
Returns the ID of the ROP the channel belongs to (invalid if none)
unsigned int MaxTPCs() const
Returns the largest number of TPCs in a single cryostat.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
static geo::TPCID ConvertTPCsetToTPC(readout::TPCsetID const &tpcsetid)
Converts a TPC set ID into a TPC ID using the same numerical indices.
virtual bool HasROP(readout::ROPID const &ropid) const override
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
unsigned int fNcryostat
number of cryostats in the detector
PlaneInfoMap_t< unsigned int > fPlaneBaselines
PlaneInfoMap_t< unsigned int > fWiresPerPlane
virtual unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
virtual std::vector< geo::TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const override
Returns a list of ID of TPCs belonging to the specified TPC set.
PlaneInfoMap_t< float > fFirstWireProj
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
virtual std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
Definition of data types for geometry description.
virtual unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
Class identifying a set of planes sharing readout channels.
unsigned int fNchannels
number of channels in the detector
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
ChannelMapStandardAlg(fhicl::ParameterSet const &p)
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
virtual void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
virtual WireID NearestWireID(const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the ID of the wire nearest to the specified position.
PlaneInfoMap_t< float > fOrthVectorsY
Unit vectors orthogonal to wires in.
geo::GeoObjectSorterStandard fSorter
class to sort geo objects
raw::ChannelID_t fTopChannel
book keeping highest channel #
virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane, unsigned int wire, unsigned int tpc, unsigned int cstat) const override
Returns the channel ID a wire is connected to.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
Interface to algorithm class for a specific detector channel mapping.
Data in the geometry description.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROPs in the specified TPC set.
Namespace collecting geometry-related classes utilities.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120