ColdBoxChannelMapAlg.h
Go to the documentation of this file.
1 /*!
2  * \file ColdBoxChannelMapAlg.h
3  * \brief Channel mapping algorithms for VD ColdBox CRP.
4  * \details Adapted from ICARUSChannelMapAlg by G. Petrillo
5  * \date October 25, 2021
6  * \warning Only one CRP is currently supported with 48 deg ind1
7  *
8  * vgalymov@ipnl.in2p3.fr
9  */
10 
11 #ifndef DUNE_COLDBOXCHANNELMAPALG_H
12 #define DUNE_COLDBOXCHANNELMAPALG_H
13 
14 // LArSoft libraries
21 
22 // framework libraries
24 #include "fhiclcpp/types/Atom.h"
25 #include "fhiclcpp/types/Table.h"
26 #include "fhiclcpp/ParameterSet.h"
27 
28 // dune specific
30 
31 // C/C++ standard libraries
32 #include <vector>
33 #include <cassert>
34 #include <utility>
35 
36 
37 // -----------------------------------------------------------------------------
38 // forward declarations
39 namespace geo {
40 
41  class ColdBoxChannelMapAlg;
42 
43 } // namespace dune
44 
45 // -----------------------------------------------------------------------------
46 namespace geo { namespace dune{ namespace vd {
47 
49  {
50 
51  public:
52 
54  {
56  unsigned int nChannels = 0U;
57  readout::ROPID ropid; ///< ID of the ROP we cover.
58  ChannelsInROPStruct() = default;
60  raw::ChannelID_t firstChannel,
61  unsigned int nChannels,
62  readout::ROPID const& ropid )
63  : firstChannel(firstChannel), nChannels(nChannels), ropid(ropid)
64  {}
65  };
66 
67 
68  /// Returns data of the ROP including `channel`, `nullptr` if none.
70  {
71  auto const dend = fROPfirstChannel.end();
72  auto const iNextData = fROPfirstChannel.upper_bound( channel );
73  assert(iNextData != fROPfirstChannel.begin());
74  return ((iNextData == dend) && (channel >= endChannel()))
75  ? nullptr: &(std::prev(iNextData)->second);
76  }
77 
78 
79  /// Returns data of the ROP `ropid`, `nullptr` if none.
81  {
82  auto const dbegin = fROPfirstChannel.begin(), dend = fROPfirstChannel.end();
83  for( auto it = dbegin; it != dend; ++it ){
84  if (it->second.ropid == ropid) return &(it->second);
85  }
86  return nullptr;
87  }
88 
89  /// Returns the ID of the first invalid channel (the last channel, plus 1).
91 
92  /// Returns the number of mapped channels.
93  unsigned int nChannels() const
94  { return endChannel(); }
95 
96  /// Sets the ID of the channels after the last valid one.
98 
99  /// Resets the data of the map to like just constructed.
100  void clear(){
101  fROPfirstChannel.clear();
103  }
104 
105  void addROP( readout::ROPID const& rid,
106  raw::ChannelID_t firstROPchannel, unsigned int nChannels )
107  {
108  assert( fROPfirstChannel.find( firstROPchannel ) != fROPfirstChannel.end() );
109  fROPfirstChannel[ firstROPchannel ] = {firstROPchannel, nChannels, rid};
110  }
111 
112  private:
113 
114  std::map<raw::ChannelID_t, ChannelsInROPStruct> fROPfirstChannel;
116  };
117  }}} //namespaces
118 
119 // -----------------------------------------------------------------------------
120 
122 
123  // import definitions
124  using TPCColl_t = std::vector<geo::TPCID>;
125  using PlaneColl_t = std::vector<geo::PlaneID>;
126 
127  public:
128 
130 
131  /// Prepares the algorithm extracting information from the geometry.
132  virtual void Initialize(geo::GeometryData_t const& geodata) override;
133 
134 
135  /// Frees the resources of this algorithm.
136  virtual void Uninitialize() override;
137 
138 
139  // --- BEGIN -- Channel mapping ----------------------------------------------
140  /**
141  * @brief Returns a collection of ID of wires connected to the `channel`.
142  * @param channel TPC readout channel number
143  * @return collection of the wire IDs associated with `channel`
144  * @throws cet::exception (category: "Geometry") if non-existent channel
145  *
146  * If the TPC readout `channel` is invalid or non-existing, an exception is
147  * thrown.
148  * Channels are expected to be associated with at least one wire.
149  */
150  virtual std::vector<geo::WireID> ChannelToWire(raw::ChannelID_t channel) const
151  override;
152 
153  /// Returns the number of readout channels (ID's go `0` to `Nchannels()`).
154  virtual unsigned int Nchannels() const override;
155 
156  /// @brief Returns the number of channels in the specified ROP
157  /// @return number of channels in the specified ROP, 0 if non-existent
158  virtual unsigned int Nchannels(readout::ROPID const& ropid) const override;
159 
160  //@{
161  virtual raw::ChannelID_t PlaneWireToChannel
162  (geo::WireID const& wireID) const override;
163  virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane,
164  unsigned int wire,
165  unsigned int tpc,
166  unsigned int cstat) const override
167  { return PlaneWireToChannel(geo::WireID(cstat, tpc, plane, wire)); }
168  //@}
169 
170  /// @}
171  // --- END -- Channel mapping ------------------------------------------------
172 
173 
174  /**
175  * @name Deprecated functions.
176  *
177  * These methods are legacy and might be replaced by `geo::GeometryCore`
178  * calls.
179  */
180  /// @{
181  //@{
182  virtual double WireCoordinate
183  (double YPos, double ZPos, geo::PlaneID const& planeID) const override;
184  virtual double WireCoordinate(double YPos, double ZPos,
185  unsigned int PlaneNo,
186  unsigned int TPCNo,
187  unsigned int cstat) const override
188  { return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
189  //@}
190 
191  //@{
192  virtual geo::WireID NearestWireID
193  (const TVector3& worldPos, geo::PlaneID const& planeID) const override;
194  virtual geo::WireID NearestWireID(const TVector3& worldPos,
195  unsigned int PlaneNo,
196  unsigned int TPCNo,
197  unsigned int cstat) const override
198  { return NearestWireID(worldPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
199  //@}
200 
201  virtual std::set<geo::PlaneID> const& PlaneIDs() const override;
202 
203  /// @}
204 
205 
206  //
207  // TPC set interface
208  //
209  /// @name TPC set mapping
210  /// @{
211  /**
212  * @brief Returns the total number of TPC sets in the specified cryostat.
213  * @param cryoid cryostat ID
214  * @return number of TPC sets in the cryostat, or 0 if no cryostat found
215  */
216  virtual unsigned int NTPCsets
217  (readout::CryostatID const& cryoid) const override;
218 
219  /// Returns the largest number of TPC sets any cryostat in the detector has.
220  virtual unsigned int MaxTPCsets() const override;
221 
222  /// Returns whether we have the specified TPC set.
223  /// @return whether the TPC set is valid and exists
224  virtual bool HasTPCset(readout::TPCsetID const& tpcsetid) const override;
225 
226  /**
227  * @brief Returns the ID of the TPC set the specified TPC belongs to
228  * @param tpcid ID of the TPC
229  * @return the ID of the corresponding TPC set, or invalid ID when tpcid is
230  *
231  * If the TPC ID is not valid, an invalid TPC set ID is returned.
232  * Note that this check is performed on the validity of the TPC ID, that
233  * does not necessarily imply that the TPC specified by the ID actually
234  * exists.
235  */
236  virtual readout::TPCsetID TPCtoTPCset
237  (geo::TPCID const& tpcid) const override;
238 
239  /**
240  * @brief Returns a list of ID of TPCs belonging to the specified TPC set
241  * @param tpcsetid ID of the TPC set to convert into TPC IDs
242  * @return the list of TPCs, empty if TPC set is invalid
243  *
244  * Each TPC set contains one TPC if on first induction plane, where wires are
245  * split, or two in the second induction and collection planes, which have
246  * shared channels.
247  */
248  virtual std::vector<geo::TPCID> TPCsetToTPCs
249  (readout::TPCsetID const& tpcsetid) const override;
250 
251  /// Returns the ID of the first TPC belonging to the specified TPC set
252  virtual geo::TPCID FirstTPCinTPCset
253  (readout::TPCsetID const& tpcsetid) const override;
254 
255  /// @} TPC set mapping
256 
257 
258 
259  // --- BEGIN -- Readout plane interface --------------------------------------
260  /// @name Readout plane mapping
261  /// @{
262 
263  /**
264  * @brief Returns the total number of readout planes in the specified TPC set.
265  * @param tpcsetid TPC set ID
266  * @return number of readout planes in the TPC sets, or `0` if ID is invalid
267  *
268  * The validity of the requested TPC set is performed like in `HasTPCset()`.
269  */
270  virtual unsigned int NROPs
271  (readout::TPCsetID const& tpcsetid) const override;
272 
273  /// Returns the largest number of ROPs a TPC set in the detector has.
274  virtual unsigned int MaxROPs() const override;
275 
276  /// Returns whether we have the specified ROP
277  /// @return whether the readout plane is valid and exists
278  virtual bool HasROP(readout::ROPID const& ropid) const override;
279 
280  /**
281  * @brief Returns the ID of the ROP planeid belongs to, or invalid if none.
282  * @param planeid ID of the plane
283  * @return the ID of the corresponding ROP, or invalid ID when `planeid` is
284  *
285  * If the plane ID is not valid, an invalid readout plane ID is returned.
286  * Note that this check is performed on the validity of the plane ID, that
287  * does not necessarily imply that the plane specified by the ID actually
288  * exists.
289  */
290  virtual readout::ROPID WirePlaneToROP
291  (geo::PlaneID const& planeid) const override;
292 
293  /**
294  * @brief Returns a list of ID of wire planes belonging to the specified ROP.
295  * @param ropid ID of the readout plane to convert into wire planes
296  * @return the list of wire plane IDs, empty if readout plane ID is invalid
297  *
298  * Note that this check is performed on the validity of the readout plane
299  * ID, that does not necessarily imply that the readout plane specified by
300  * the ID actually exists.
301  *
302  * In this mapping, readout planes contain one or two wire planes each,
303  * depending on the view.
304  */
305  virtual std::vector<geo::PlaneID> ROPtoWirePlanes
306  (readout::ROPID const& ropid) const override;
307 
308  /**
309  * @brief Returns a list of ID of TPCs the specified ROP spans
310  * @param ropid ID of the readout plane
311  * @return the list of TPC IDs, empty if readout plane ID is invalid
312  *
313  * In this mapping, readout planes and wire planes are mapped one-to-one.
314  * The returned list contains always one entry, unless the specified readout
315  * plane ID is invalid, in which case the list is empty.
316  * Note that this check is performed on the validity of the readout plane
317  * ID, that does not necessarily imply that the readout plane specified by
318  * the ID actually exists. Check if the ROP exists with HasROP().
319  * The behaviour on non-existing readout planes is undefined.
320  */
321  virtual std::vector<geo::TPCID> ROPtoTPCs
322  (readout::ROPID const& ropid) const override;
323 
324  /// Returns the ID of the ROP the channel belongs to (invalid if none).
325  virtual readout::ROPID ChannelToROP
326  (raw::ChannelID_t channel) const override;
327 
328  /**
329  * @brief Returns the ID of the first channel in the specified readout plane.
330  * @param ropid ID of the readout plane
331  * @return ID of first channel, or raw::InvalidChannelID if ID is invalid
332  *
333  * Note that this check is performed on the validity of the readout plane
334  * ID, that does not necessarily imply that the readout plane specified by
335  * the ID actually exists. Check if the ROP exists with HasROP().
336  * The behaviour for non-existing readout planes is undefined.
337  */
338  virtual raw::ChannelID_t FirstChannelInROP
339  (readout::ROPID const& ropid) const override;
340 
341  /**
342  * @brief Returns the ID of the first plane belonging to the specified ROP.
343  *
344  * The wire planes within a readout plane are supposed to be sorted by beam
345  * (_z_) coordinate, so that the first one should be the closest to the
346  * beam entrance point.
347  */
348  virtual geo::PlaneID FirstWirePlaneInROP
349  (readout::ROPID const& ropid) const override;
350 
351  /// @}
352  // --- END -- Readout plane interface ----------------------------------------
353 
354 
355  /// Return the sorter.
356  virtual geo::GeoObjectSorter const& Sorter() const override
357  { return fSorter; }
358 
359  private:
360 
361  /// Type for counts of wireless channels: per TPC set (even/odd), then per
362  /// plane starting from the closest to the cathode; `first` is the number of
363  /// wireless channels before the regular ones, `second` is the one after them.
364  //using WirelessChannelCounts_t
365  //= std::array<std::array<std::pair<unsigned int, unsigned int>, 3U>, 2U>;
366 
367 
368 
369  // --- BEGIN -- Readout element information ----------------------------------
370  /**
371  * @name Readout element information
372  *
373  * The geometry and readout data containers have currently no support for
374  * resizing and their size is assigned on construction.
375  *
376  * Access should happen via the corresponding member functions.
377  *
378  */
379  /// @{
380 
382  : std::pair<raw::ChannelID_t, raw::ChannelID_t>
383  {
384 
385  using std::pair<raw::ChannelID_t, raw::ChannelID_t>::pair;
386 
387  /// Returns the ID of the first channel in the range.
388  constexpr raw::ChannelID_t begin() const { return first; }
389 
390  /// Returns the ID of the channel after the last one in the range.
391  constexpr raw::ChannelID_t end() const { return second; }
392 
393  /// Returns whether this range includes the specified `channel`.
394  constexpr bool contains(raw::ChannelID_t channel) const
395  { return (channel >= begin()) && (channel < end()); }
396  };
397 
398 
399  /// Collected information about TPC sets and readout planes in the geometry.
401  /// Number of TPC sets in each cryostat.
402  std::vector<unsigned int> fTPCsetCount;
403 
404  /// All `geo::TPCGeo` objects in each TPC set.
406 
407  /// Number of readout planes in each TPC set.
409 
410  /// All `geo::PlaneGeo` objects in each readout plane.
412 
413  /// The TPC set each TPC belongs to.
415 
416  /// The ROP each wire plane belongs to.
418 
419  ReadoutMappingInfo_t() = default;
420 
421  void set(
422  std::vector<unsigned int>&& TPCsetCount,
428  )
429  {
430  fTPCsetCount = std::move(TPCsetCount);
431  fTPCsetTPCs = std::move(TPCsetTPCs );
432  fROPcount = std::move(ROPcount );
433  fROPplanes = std::move(ROPplanes );
434  fTPCtoTPCset = std::move(TPCtoTPCset);
435  fPlaneToROP = std::move(PlaneToROP );
436  assert(fTPCsetCount.size() == fTPCsetTPCs.dimSize<0U>());
437  assert(fTPCsetCount.size() == fROPcount.dimSize<0U>());
438  assert(fTPCsetCount.size() == fROPplanes.dimSize<0U>());
439  assert(fTPCsetCount.size() == fTPCtoTPCset.dimSize<0U>());
440  assert(fTPCsetCount.size() == fPlaneToROP.dimSize<0U>());
441  assert(fTPCsetTPCs.dimSize<1U>() == fROPcount.dimSize<1U>());
442  assert(fTPCsetTPCs.dimSize<1U>() == fROPplanes.dimSize<1U>());
443  assert(fTPCtoTPCset.dimSize<1U>() == fPlaneToROP.dimSize<1U>());
444  } // set()
445 
446  unsigned int NCryostats() const
447  { return fROPplanes.dimSize<0U>(); }
448  unsigned int MaxTPCsets() const { return fROPplanes.dimSize<1U>(); }
449  unsigned int MaxROPs() const { return fROPplanes.dimSize<2U>(); }
450 
451  /// Frees the memory and leaves the object unusable until next `set()`.
452  void clear()
453  {
454  fTPCsetCount.clear(); fTPCsetTPCs.clear();
455  fROPcount.clear(); fROPplanes.clear();
456  fTPCtoTPCset.clear(); fPlaneToROP.clear();
457  }
458 
459  /// Returns whether all the data containers are initialized.
460  operator bool() const
461  {
462  return !fTPCsetCount.empty() && !fTPCsetTPCs.empty()
463  && !fROPcount.empty() && !fROPplanes.empty()
464  && !fTPCtoTPCset.empty() && !fPlaneToROP.empty();
465  }
466 
467  }; // ReadoutMappingInfo_t
468 
469  /// Collection of information on one plane.
470  struct PlaneInfo_t {
471 
472  ChannelRange_t fChannelRange; ///< Range of channels covered by the plane.
473  readout::ROPID fROPID; ///< Which readout plane this wire plane belongs to.
474 
475  /// Returns the range of channels covered by the wire plane.
476  constexpr ChannelRange_t const& channelRange() const
477  { return fChannelRange; }
478 
479  /// Returns the ID of the last channel in the range.
480  constexpr raw::ChannelID_t firstChannel() const
481  { return fChannelRange.begin(); }
482 
483  /// Returns the ID of the last channel in the range.
484  constexpr raw::ChannelID_t lastChannel() const
485  { return fChannelRange.end() - 1; }
486 
487  /// Returns the ID of the channel after the last in the range.
488  constexpr raw::ChannelID_t endChannel() const
489  { return fChannelRange.end(); }
490 
491  /// Returns the ID of the readout plane this wire plane belongs to.
492  constexpr readout::ROPID ROP() const { return fROPID; }
493 
494  }; // struct PlaneInfo_t
495 
496 
497  /// Information about TPC sets and readout planes in the geometry.
499 
500  /// Mapping of channels and ROP's.
502 
503  /// Range of channels covered by each of the wire planes.
505 
506  geo::GeoObjectSorterCRU fSorter; ///< class to sort geo objects
507 
508 
509  using PlaneType_t = std::size_t; ///< Type for plane type identifier.
510 
511  /// Identifier for first induction plane type.
512  static constexpr PlaneType_t kFirstInductionType = 0U;
513  /// Identifier for second induction plane type.
514  static constexpr PlaneType_t kSecondInductionType = 1U;
515  /// Identifier for collection plane type.
516  static constexpr PlaneType_t kCollectionType = 2U;
517  /// Identifier for unknown plane type.
518  static constexpr PlaneType_t kUnknownType
520 
521 
522  // --- BEGIN -- Readout element information access ---------------------------
523  /// @name Readout element information access
524  /// @{
525 
526  /// Returns the number of TPC sets in each cryostat.
527  std::vector<unsigned int> const& TPCsetCount() const
528  { assert(fReadoutMapInfo); return fReadoutMapInfo.fTPCsetCount; }
529 
530  /// Returns the number of TPC sets in the specified cryostat `cid`.
531  unsigned int TPCsetCount(readout::CryostatID const& cid) const
532  { return TPCsetCount()[cid.Cryostat]; }
533 
534  /// All `geo::TPCGeo` objects in each TPC set
536  { assert(fReadoutMapInfo); return fReadoutMapInfo.fTPCsetTPCs; }
537 
538  /// All `geo::TPCID` objects in the specified TPC set `sid`.
539  TPCColl_t const& TPCsetTPCs(readout::TPCsetID const& sid) const
540  { return TPCsetTPCs()[sid]; }
541 
542  /// Number of readout planes in each TPC set.
544  { assert(fReadoutMapInfo); return fReadoutMapInfo.fROPcount; }
545 
546  /// Number of readout planes in the specified TPC set `sid`.
547  unsigned int ROPcount(readout::TPCsetID const& sid) const
548  { return ROPcount()[sid]; }
549 
550  /// All `geo::PlaneGeo` objects in each readout plane
552  { assert(fReadoutMapInfo); return fReadoutMapInfo.fROPplanes; }
553 
554  /// All `geo::PlaneId` objects in the specified readout plane `rid`.
555  PlaneColl_t const& ROPplanes(readout::ROPID const& rid) const
556  { return ROPplanes()[rid]; }
557 
558  /// The TPC set including each TPC.
560  { assert(fReadoutMapInfo); return fReadoutMapInfo.fTPCtoTPCset; }
561 
562  /// The readout plane including each wire plane.
564  { assert(fReadoutMapInfo); return fReadoutMapInfo.fPlaneToROP; }
565 
566  /// The readout plane the specified wire plane `pid` belongs to.
568  { return PlaneToROP()[pid]; }
569 
570  /// @}
571  // --- END -- Readout element information access -----------------------------
572 
573 
574  /// Returns whether the specified cryostat is known to the mapping.
575  bool HasCryostat(readout::CryostatID const& cryoid) const;
576 
577 
578  /**
579  * @brief Fills the information about readout channel mapping.
580  * @param Cryostats the sorted list of cryostats in the detector
581  *
582  *
583  *
584  * The readout information must have been already filled
585  * (`buildReadoutPlanes()`).
586  *
587  */
588  void fillChannelToWireMap
589  (geo::GeometryData_t::CryostatList_t const& Cryostats);
590 
591 
592  /**
593  * @brief Fills information about the TPC set and readout plane structure.
594  * @param Cryostats the sorted list of cryostats in the detector
595  *
596  */
597  void buildReadoutPlanes(geo::GeometryData_t::CryostatList_t const& Cryostats);
598 
599 
600  /**
601  * @brief Returns the "type" of readout plane.
602  * @param ropid ID of the readout plane to query
603  *
604  * Here the "type" refers to the position of the plane in the TPC and as a
605  * consequence to its signal type.
606  * The type of the readout plane is deduced from the type of the planes it
607  * contains.
608  *
609  * The returned value is `kFirstInductionType`, `kSecondInductionType`,
610  * `kCollectionType` or `kUnknownType`.
611  */
612  PlaneType_t findPlaneType(readout::ROPID const& ropid) const;
613 
614 
615  /// Returns the type of signal on the specified `channel`.
616  virtual geo::SigType_t SignalTypeForChannelImpl
617  (raw::ChannelID_t const channel) const override;
618 
619  /// Returns the name of the specified plane type.
620  static std::string PlaneTypeName(PlaneType_t planeType);
621 
622  //
623  std::string fLogCategory = "ColdBoxChannelMapAlg";
624 
625 }; // class geo::ColdBoxChannelMapAlg
626 
627 
628 #endif //
629 
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
ChannelRange_t fChannelRange
Range of channels covered by the plane.
readout::TPCsetDataContainer< TPCColl_t > const & TPCsetTPCs() const
All geo::TPCGeo objects in each TPC set.
Interface for a class providing readout channel mapping to geometry.
Definition: ChannelMapAlg.h:48
void addROP(readout::ROPID const &rid, raw::ChannelID_t firstROPchannel, unsigned int nChannels)
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.
void clear()
Frees the memory and leaves the object unusable until next set().
unsigned int nChannels() const
Returns the number of mapped channels.
Classes identifying readout-related concepts.
readout::ROPID ropid
ID of the ROP we cover.
std::string string
Definition: nybbler.cc:12
void clear()
Resets the data of the map to like just constructed.
geo::GeoObjectSorterCRU fSorter
class to sort geo objects
readout::ROPID const & PlaneToROP(geo::PlaneID const &pid) const
The readout plane the specified wire plane pid belongs to.
Simple data structure holding the data of the geometry.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
raw::ChannelID_t endChannel() const
Returns the ID of the first invalid channel (the last channel, plus 1).
constexpr raw::ChannelID_t end() const
Returns the ID of the channel after the last one in the range.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:70
std::vector< unsigned int > const & TPCsetCount() const
Returns the number of TPC sets in each cryostat.
std::vector< geo::CryostatGeo > CryostatList_t
Type of list of cryostats.
Definition: GeometryData.h:34
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
geo::PlaneDataContainer< PlaneInfo_t > fPlaneInfo
Range of channels covered by each of the wire planes.
PlaneColl_t const & ROPplanes(readout::ROPID const &rid) const
All geo::PlaneId objects in the specified readout plane rid.
uint8_t channel
Definition: CRTFragment.hh:201
readout::ROPDataContainer< PlaneColl_t > fROPplanes
All geo::PlaneGeo objects in each readout plane.
Container with one element per geometry wire plane.
virtual geo::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.
unsigned int ROPcount(readout::TPCsetID const &sid) const
Number of readout planes in the specified TPC set sid.
unsigned int TPCsetCount(readout::CryostatID const &cid) const
Returns the number of TPC sets in the specified cryostat cid.
constexpr bool contains(raw::ChannelID_t channel) const
Returns whether this range includes the specified channel.
constexpr raw::ChannelID_t endChannel() const
Returns the ID of the channel after the last in the range.
geo::dune::vd::ChannelToWireMap fChannelToWireMap
Mapping of channels and ROP&#39;s.
constexpr readout::ROPID ROP() const
Returns the ID of the readout plane this wire plane belongs to.
Containers to hold one datum per TPC or plane.
ChannelsInROPStruct const * find(readout::ROPID const &ropid) const
Returns data of the ROP ropid, nullptr if none.
std::vector< unsigned int > fTPCsetCount
Number of TPC sets in each cryostat.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
geo::TPCDataContainer< readout::TPCsetID > fTPCtoTPCset
The TPC set each TPC belongs to.
Collected information about TPC sets and readout planes in the geometry.
readout::TPCsetDataContainer< unsigned int > fROPcount
Number of readout planes in each TPC set.
enum geo::_plane_sigtype SigType_t
std::vector< geo::PlaneID > PlaneColl_t
constexpr raw::ChannelID_t firstChannel() const
Returns the ID of the last channel in the range.
def move(depos, offset)
Definition: depos.py:107
ChannelsInROPStruct(raw::ChannelID_t firstChannel, unsigned int nChannels, readout::ROPID const &ropid)
readout::ROPID fROPID
Which readout plane this wire plane belongs to.
void setEndChannel(raw::ChannelID_t channel)
Sets the ID of the channels after the last valid one.
p
Definition: test.py:223
void Initialize(void)
geo::PlaneDataContainer< readout::ROPID > const & PlaneToROP() const
The readout plane including each wire plane.
ReadoutMappingInfo_t fReadoutMapInfo
Information about TPC sets and readout planes in the geometry.
readout::TPCsetDataContainer< unsigned int > const & ROPcount() const
Number of readout planes in each TPC set.
static int max(int a, int b)
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Definition of data types for geometry description.
Class identifying a set of planes sharing readout channels.
Interface to algorithm class for sorting VD CRUs of geo::XXXGeo objects.
readout::ROPDataContainer< PlaneColl_t > const & ROPplanes() const
All geo::PlaneGeo objects in each readout plane.
constexpr raw::ChannelID_t begin() const
Returns the ID of the first channel in the range.
TPCColl_t const & TPCsetTPCs(readout::TPCsetID const &sid) const
All geo::TPCID objects in the specified TPC set sid.
readout::TPCsetDataContainer< TPCColl_t > fTPCsetTPCs
All geo::TPCGeo objects in each TPC set.
void clear()
Makes the container empty, with no usable storage space.
Collection of information on one plane.
geo::PlaneDataContainer< readout::ROPID > fPlaneToROP
The ROP each wire plane belongs to.
virtual geo::GeoObjectSorter const & Sorter() const override
Return the sorter.
geo::TPCDataContainer< readout::TPCsetID > const & TPCtoTPCset() const
The TPC set including each TPC.
constexpr raw::ChannelID_t lastChannel() const
Returns the ID of the last channel in the range.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
bool empty() const
Returns whether the container has no elements (false by assumptions).
Data in the geometry description.
Definition: GeometryData.h:31
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
constexpr ChannelRange_t const & channelRange() const
Returns the range of channels covered by the wire plane.
std::map< raw::ChannelID_t, ChannelsInROPStruct > fROPfirstChannel
Interface to algorithm class for a specific detector channel mapping.
Containers to hold one datum per TPC set or readout plane.
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
LArSoft geometry interface.
Definition: ChannelGeo.h:16
unsigned int dimSize() const
Dimensions of the Level dimension of this container.
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.
int bool
Definition: qglobal.h:345
std::size_t PlaneType_t
Type for plane type identifier.
std::vector< geo::TPCID > TPCColl_t
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
ChannelsInROPStruct const * find(raw::ChannelID_t channel) const
Returns data of the ROP including channel, nullptr if none.