LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ChannelMapStandardAlg.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
8 #define LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
9 
13 #include "larcoreobj/SimpleTypesAndConstants/readout_types.h" // readout::TPCsetID, ...
14 
15 #include "fhiclcpp/fwd.h"
16 
17 #include <set>
18 #include <vector>
19 
20 namespace geo {
21 
23  public:
25 
26  void Initialize(GeometryData_t const& geodata) override;
27  void Uninitialize() override;
28  std::vector<WireID> ChannelToWire(raw::ChannelID_t channel) const override;
29  unsigned int Nchannels() const override;
30 
33  unsigned int Nchannels(readout::ROPID const& ropid) const override;
34 
36  double WireCoordinate(double YPos, double ZPos, PlaneID const& planeID) const override;
38 
40  WireID NearestWireID(Point_t const& worldPos, PlaneID const& planeID) const override;
42 
44  raw::ChannelID_t PlaneWireToChannel(WireID const& wireID) const override;
46 
47  std::set<PlaneID> const& PlaneIDs() const override;
48 
49  //
50  // TPC set interface
51  //
54 
62  unsigned int NTPCsets(readout::CryostatID const& cryoid) const override;
63 
65  unsigned int MaxTPCsets() const override;
66 
69  bool HasTPCset(readout::TPCsetID const& tpcsetid) const override;
70 
83  readout::TPCsetID TPCtoTPCset(TPCID const& tpcid) const override;
84 
98  std::vector<TPCID> TPCsetToTPCs(readout::TPCsetID const& tpcsetid) const override;
99 
101  TPCID FirstTPCinTPCset(readout::TPCsetID const& tpcsetid) const override;
102 
104 
105  //
106  // Readout plane interface
107  //
110 
121  unsigned int NROPs(readout::TPCsetID const& tpcsetid) const override;
122 
124  unsigned int MaxROPs() const override;
125 
128  bool HasROP(readout::ROPID const& ropid) const override;
129 
142  readout::ROPID WirePlaneToROP(PlaneID const& planeid) const override;
143 
156  std::vector<PlaneID> ROPtoWirePlanes(readout::ROPID const& ropid) const override;
157 
171  std::vector<TPCID> ROPtoTPCs(readout::ROPID const& ropid) const override;
172 
174  readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override;
175 
186  raw::ChannelID_t FirstChannelInROP(readout::ROPID const& ropid) const override;
187 
189  PlaneID FirstWirePlaneInROP(readout::ROPID const& ropid) const override;
190 
192 
194  GeoObjectSorter const& Sorter() const override { return fSorter; }
195 
196  private:
197  unsigned int fNcryostat;
198  unsigned int fNchannels;
200  std::vector<unsigned int> fNTPC;
201  std::set<View_t> fViews;
202  std::set<PlaneID> fPlaneIDs;
203  PlaneInfoMap_t<float> fFirstWireProj;
204  PlaneInfoMap_t<float> fOrthVectorsY;
206  PlaneInfoMap_t<float> fOrthVectorsZ;
207  PlaneInfoMap_t<float> fWireCounts;
210  TPCInfoMap_t<unsigned int> fNPlanes;
212  PlaneInfoMap_t<unsigned int> fPlaneBaselines;
214  PlaneInfoMap_t<unsigned int> fWiresPerPlane;
217 
220 
221  SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override;
222 
224  unsigned int WireCount(PlaneID const& id) const { return AccessElement(fWireCounts, id); }
225 
227  unsigned int MaxTPCs() const;
228 
230  static readout::TPCsetID ConvertTPCtoTPCset(TPCID const& tpcid);
231 
233  static TPCID ConvertTPCsetToTPC(readout::TPCsetID const& tpcsetid);
234 
236  static readout::ROPID ConvertWirePlaneToROP(PlaneID const& planeid);
237 
239  static PlaneID ConvertROPtoWirePlane(readout::ROPID const& ropid);
240  };
241 
242 }
243 #endif // LARCOREALG_GEOMETRY_CHANNELSTANDARDMAPALG_H
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
std::vector< TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const override
Returns a list of ID of TPCs belonging to the specified TPC set.
Interface for a class providing readout channel mapping to geometry.
Definition: ChannelMapAlg.h:48
WireID NearestWireID(Point_t const &worldPos, PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
TPCInfoMap_t< unsigned int > fNPlanes
PlaneInfoMap_t< float > fWireCounts
raw::ChannelID_t PlaneWireToChannel(WireID const &wireID) const override
Returns the channel ID a wire is connected to.
TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
static TPCID ConvertTPCsetToTPC(readout::TPCsetID const &tpcsetid)
Converts a TPC set ID into a TPC ID using the same numerical indices.
Classes identifying readout-related concepts.
double WireCoordinate(double YPos, double ZPos, PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
T const & AccessElement(TPCInfoMap_t< T > const &map, TPCID const &id) const
Returns the specified element of the TPC map.
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:463
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:72
std::vector< PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
unsigned int MaxTPCsets() const override
Returns the largest number of TPC sets any cryostat in the detector has.
PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
GeoObjectSorter const & Sorter() const override
Return the sorter.
PlaneInfoMap_t< float > fOrthVectorsZ
std::set< View_t > fViews
vector of the views present in the detector
Interface to algorithm class for standard sorting of geo::XXXGeo objects.
readout::ROPID WirePlaneToROP(PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
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.
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
unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
PlaneInfoMap_t< float > fFirstWireProj
bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
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:381
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
Definition of data types for geometry description.
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
static PlaneID ConvertROPtoWirePlane(readout::ROPID const &ropid)
Converts a wire plane ID into a ROP ID using the same numerical indices.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
unsigned int WireCount(PlaneID const &id) const
Retrieved the wire cound for the specified plane ID.
ChannelMapStandardAlg(fhicl::ParameterSet const &p)
std::vector< TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
GeoObjectSorterStandard fSorter
class to sort geo objects
static readout::TPCsetID ConvertTPCtoTPCset(TPCID const &tpcid)
Converts a TPC ID into a TPC set ID using the same numerical indices.
unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
PlaneInfoMap_t< float > fOrthVectorsY
Unit vectors orthogonal to wires in.
raw::ChannelID_t fTopChannel
book keeping highest channel #
raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
Interface to algorithm class for a specific detector channel mapping.
Data in the geometry description.
Definition: GeometryData.h:30
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
static readout::ROPID ConvertWirePlaneToROP(PlaneID const &planeid)
Converts a ROP ID into a wire plane ID using the same numerical indices.
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.
readout::TPCsetID TPCtoTPCset(TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
The data type to uniquely identify a cryostat.
Definition: geo_types.h:192