ChannelMapCRUAlg.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ChannelMapCRUAlg.cxx
3 /// \brief Interface to channel algorithm class for a vertical drift TPC
4 ///
5 /// \version $Id: $
6 /// \author vgalymov@ipnl.in2p3.fr
7 ////////////////////////////////////////////////////////////////////////
8 
17 
19 
20 namespace geo{
21 
22  //----------------------------------------------------------------------------
24  : fSorter(geo::GeoObjectSorterCRU(p))
25  {
26  }
27 
28  //----------------------------------------------------------------------------
30  {
31  // start over:
32  Uninitialize();
33 
34  std::vector<geo::CryostatGeo> const& cgeo = geodata.cryostats;
35 
36  fNcryostat = cgeo.size();
37 
38  mf::LogInfo("ChannelMapCRUAlg") << "Initializing CRM ChannelMap...";
39 
40  fNTPC.resize(fNcryostat);
41  fWireCounts.resize(fNcryostat);
42  fNPlanes.resize(fNcryostat);
43  fFirstWireProj.resize(fNcryostat);
44  fOrthVectorsY.resize(fNcryostat);
45  fOrthVectorsZ.resize(fNcryostat);
47  fWiresPerPlane.resize(fNcryostat);
50  fPlaneIDs.clear();
51  fTopChannel = 0;
52 
53  int RunningTotal = 0;
54 
55  for(unsigned int cs = 0; cs != fNcryostat; ++cs){
56 
57  fNTPC[cs] = cgeo[cs].NTPC();
58 
59  // Size up all the vectors
60  fWireCounts[cs] .resize(fNTPC[cs]);
61  fFirstWireProj[cs] .resize(fNTPC[cs]);
62  fOrthVectorsY[cs] .resize(fNTPC[cs]);
63  fOrthVectorsZ[cs] .resize(fNTPC[cs]);
64  fPlaneBaselines[cs] .resize(fNTPC[cs]);
65  fWiresPerPlane[cs] .resize(fNTPC[cs]);
66  fNPlanes[cs] .resize(fNTPC[cs]);
67  fFirstChannelInThisPlane[cs].resize(fNTPC[cs]);
68  fFirstChannelInNextPlane[cs].resize(fNTPC[cs]);
69 
70  for(unsigned int TPCCount = 0; TPCCount != fNTPC[cs]; ++TPCCount)
71  {
72  unsigned int PlanesThisTPC = cgeo[cs].TPC(TPCCount).Nplanes();
73  fWireCounts[cs][TPCCount] .resize(PlanesThisTPC);
74  fFirstWireProj[cs][TPCCount].resize(PlanesThisTPC);
75  fOrthVectorsY[cs][TPCCount] .resize(PlanesThisTPC);
76  fOrthVectorsZ[cs][TPCCount] .resize(PlanesThisTPC);
77  fNPlanes[cs][TPCCount]=PlanesThisTPC;
78 
79  for(unsigned int PlaneCount = 0; PlaneCount != PlanesThisTPC; ++PlaneCount){
80 
81  fPlaneIDs.emplace(PlaneID(cs, TPCCount, PlaneCount));
82  double ThisWirePitch = cgeo[cs].TPC(TPCCount).WirePitch(PlaneCount);
83  fWireCounts[cs][TPCCount][PlaneCount] = cgeo[cs].TPC(TPCCount).Plane(PlaneCount).Nwires();
84 
85  double WireCentre1[3] = {0.,0.,0.};
86  double WireCentre2[3] = {0.,0.,0.};
87 
88  const geo::WireGeo& firstWire = cgeo[cs].TPC(TPCCount).Plane(PlaneCount).Wire(0);
89  const double sth = firstWire.SinThetaZ(), cth = firstWire.CosThetaZ();
90 
91  firstWire.GetCenter(WireCentre1,0);
92  cgeo[cs].TPC(TPCCount).Plane(PlaneCount).Wire(1).GetCenter(WireCentre2,0);
93 
94  // figure out if we need to flip the orthogonal vector
95  // (should point from wire n -> n+1)
96  double OrthY = cth, OrthZ = -sth;
97  if(((WireCentre2[1] - WireCentre1[1])*OrthY
98  + (WireCentre2[2] - WireCentre1[2])*OrthZ) < 0){
99  OrthZ *= -1;
100  OrthY *= -1;
101  }
102 
103  // Overall we are trying to build an expression that looks like
104  // int NearestWireNumber = round((worldPos.OrthVector - FirstWire.OrthVector)/WirePitch);
105  // That runs as fast as humanly possible.
106  // We predivide everything by the wire pitch so we don't do this in the loop.
107  //
108  // Putting this together into the useful constants we will use later per plane and tpc:
109  fOrthVectorsY[cs][TPCCount][PlaneCount] = OrthY / ThisWirePitch;
110  fOrthVectorsZ[cs][TPCCount][PlaneCount] = OrthZ / ThisWirePitch;
111 
112  fFirstWireProj[cs][TPCCount][PlaneCount] = WireCentre1[1]*OrthY + WireCentre1[2]*OrthZ;
113  fFirstWireProj[cs][TPCCount][PlaneCount] /= ThisWirePitch;
114 
115  // now to count up wires in each plane and get first channel in each plane
116  int WiresThisPlane = cgeo[cs].TPC(TPCCount).Plane(PlaneCount).Nwires();
117  fWiresPerPlane[cs] .at(TPCCount).push_back(WiresThisPlane);
118  fPlaneBaselines[cs].at(TPCCount).push_back(RunningTotal);
119 
120  RunningTotal += WiresThisPlane;
121 
122  fFirstChannelInThisPlane[cs].at(TPCCount).push_back(fTopChannel);
123  fTopChannel += WiresThisPlane;
124  fFirstChannelInNextPlane[cs].at(TPCCount).push_back(fTopChannel);
125 
126  }// end loop over planes
127  }// end loop over TPCs
128  }// end loop over cryostats
129 
130  // calculate the total number of channels in the detector
132 
133  MF_LOG_DEBUG("ChannelMapCRU") << "# of channels is " << fNchannels;
134 
135 
136  return;
137  }
138 
139  //----------------------------------------------------------------------------
141  {
142  }
143 
144  //----------------------------------------------------------------------------
146  {
147  std::vector< geo::WireID > AllSegments;
148  unsigned int cstat = 0;
149  unsigned int tpc = 0;
150  unsigned int plane = 0;
151  unsigned int wire = 0;
152 
153  // first check if this channel ID is legal
154  if(channel > fTopChannel)
155  throw cet::exception("Geometry") << "ILLEGAL CHANNEL ID for channel " << channel << "\n";
156 
157  // then go find which plane, tpc and cryostat it is in from the information we stored earlier
158  bool foundWid(false);
159  for(unsigned int csloop = 0; csloop != fNcryostat; ++csloop){
160  for(unsigned int tpcloop = 0; tpcloop != fNTPC[csloop]; ++tpcloop){
161  for(unsigned int planeloop = 0;
162  planeloop!=fFirstChannelInNextPlane[csloop][tpcloop].size();
163  ++planeloop)
164  {
165  if(channel < fFirstChannelInNextPlane[csloop][tpcloop][planeloop]){
166  cstat = csloop;
167  tpc = tpcloop;
168  plane = planeloop;
169  wire = channel - fFirstChannelInThisPlane[cstat][tpcloop][planeloop];
170  foundWid = true;
171  break;
172  }
173  if(foundWid) break;
174  }// end plane loop
175  if(foundWid) break;
176  }// end tpc loop
177  if(foundWid) break;
178  }// end cryostat loop
179 
180  geo::WireID CodeWire(cstat, tpc, plane, wire);
181 
182  AllSegments.push_back(CodeWire);
183 
184  return AllSegments;
185  }
186 
187  //----------------------------------------------------------------------------
189  {
190  return fNchannels;
191  }
192 
193  //----------------------------------------------------------------------------
194  unsigned int ChannelMapCRUAlg::Nchannels(readout::ROPID const& ropid) const {
195  if (!HasROP(ropid)) return 0;
196  // The number of channels matches the number of wires. Life is easy.
197  return WireCount(FirstWirePlaneInROP(ropid));
198  } // ChannelMapCRUAlg::Nchannels()
199 
200 
201  //----------------------------------------------------------------------------
203  (double YPos, double ZPos, geo::PlaneID const& planeID) const
204  {
205  // Returns the wire number corresponding to a (Y,Z) position in PlaneNo
206  // with float precision.
207  // B. Baller August 2014
208  return YPos*AccessElement(fOrthVectorsY, planeID)
209  + ZPos*AccessElement(fOrthVectorsZ, planeID)
210  - AccessElement(fFirstWireProj, planeID);
211  }
212 
213 
214  //----------------------------------------------------------------------------
216  (const TVector3& worldPos, geo::PlaneID const& planeID) const
217  {
218 
219  // This part is the actual calculation of the nearest wire number, where we assume
220  // uniform wire pitch and angle within a wireplane
221 
222  // add 0.5 to have the correct rounding
223  int NearestWireNumber = int
224  (0.5 + WireCoordinate(worldPos.Y(), worldPos.Z(), planeID));
225 
226  // If we are outside of the wireplane range, throw an exception
227  // (this response maintains consistency with the previous
228  // implementation based on geometry lookup)
229  if(NearestWireNumber < 0 ||
230  (unsigned int) NearestWireNumber >= WireCount(planeID))
231  {
232  int wireNumber = NearestWireNumber; // save for the output
233 
234  if(NearestWireNumber < 0 ) NearestWireNumber = 0;
235  else NearestWireNumber = WireCount(planeID) - 1;
236 
237  throw InvalidWireIDError("Geometry", wireNumber, NearestWireNumber)
238  << "Can't Find Nearest Wire for position ("
239  << worldPos[0] << "," << worldPos[1] << "," << worldPos[2] << ")"
240  << " in plane " << std::string(planeID) << " approx wire number # "
241  << wireNumber << " (capped from " << NearestWireNumber << ")\n";
242  }
243 
244  return geo::WireID(planeID, (geo::WireID::WireID_t) NearestWireNumber);
245  }
246 
247  //----------------------------------------------------------------------------
248  // This method returns the channel number, assuming the numbering scheme
249  // is heirachical - that is, channel numbers run in order, for example:
250  // (Ben J Oct 2011)
251  // Wire1 | 0
252  // Plane1 { Wire2 | 1
253  // TPC1 { Wire3 | 2
254  // Plane2 { Wire1 | 3 increasing channel number
255  // Wire2 | 4 (with no gaps)
256  // TPC2 { Plane1 { Wire1 | 5
257  // Plane2 { Wire1 | 6
258  // Wire2 v 7
259  //
261  (geo::WireID const& wireID) const
262  {
263  unsigned int const* pBaseLine = GetElementPtr(fPlaneBaselines, wireID);
264  // This is the actual lookup part - first make sure coordinates are legal
265  if (pBaseLine) {
266  // if the channel has legal coordinates, its ID is given by the wire
267  // number above the number of wires in lower planes, tpcs and cryostats
268  return *pBaseLine + wireID.Wire;
269  }
270  else{
271  // if the coordinates were bad, throw an exception
272  throw cet::exception("ChannelMapCRUAlg")
273  << "NO CHANNEL FOUND for " << std::string(wireID);
274  }
275 
276  // made it here, that shouldn't happen, return raw::InvalidChannelID
277  mf::LogWarning("ChannelMapCRUAlg") << "should not be at the point in the function, returning "
278  << "invalid channel";
279  return raw::InvalidChannelID;
280 
281  }
282 
283 
284  //----------------------------------------------------------------------------
286  {
287 
288  // still assume one cryostat for now -- faster
289  unsigned int nChanPerTPC = fNchannels/fNTPC[0];
290  // casting wil trunc towards 0 -- faster than floor
291  unsigned int tpc = channel / nChanPerTPC;
292  //need number of planes to know Collection
293  unsigned int PlanesThisTPC = fNPlanes[0][tpc];
294 
295 
296  //for VD last view is collection and first views are induction
297  SigType_t sigt = geo::kInduction;
298  if( channel < fFirstChannelInThisPlane[0][tpc][PlanesThisTPC-1] )
299  { sigt = geo::kInduction; }
300  else if( (channel >= fFirstChannelInThisPlane[0][tpc][PlanesThisTPC-1]) &&
301  (channel < fFirstChannelInNextPlane[0][tpc][PlanesThisTPC-1]) )
302  { sigt = geo::kCollection; }
303  else
304  mf::LogWarning("BadChannelSignalType") << "Channel " << channel
305  << " not given signal type." << std::endl;
306 
307  return sigt;
308  }
309 
310 
311  //----------------------------------------------------------------------------
312  std::set<PlaneID> const& ChannelMapCRUAlg::PlaneIDs() const
313  {
314  return fPlaneIDs;
315  }
316 
317 
318  //----------------------------------------------------------------------------
319  /**
320  * @brief Returns the total number of TPC sets in the specified cryostat
321  * @param cryoid cryostat ID
322  * @return number of TPC sets in the cryostat, or 0 if no cryostat found
323  */
324  unsigned int ChannelMapCRUAlg::NTPCsets
325  (readout::CryostatID const& cryoid) const
326  {
327  // return the same number as the number of TPCs
328  return (cryoid.isValid && cryoid.Cryostat < fNTPC.size())?
329  fNTPC[cryoid.Cryostat]: 0;
330  } // ChannelMapCRUAlg::NTPCsets()
331 
332 
333  //----------------------------------------------------------------------------
334  /// Returns the largest number of TPC sets any cryostat in the detector has
335  unsigned int ChannelMapCRUAlg::MaxTPCsets() const {
336  return MaxTPCs();
337  } // ChannelMapCRUAlg::MaxTPCsets()
338 
339 
340  //----------------------------------------------------------------------------
341  /// Returns whether we have the specified TPC set
342  /// @return whether the TPC set is valid and exists
343  bool ChannelMapCRUAlg::HasTPCset(readout::TPCsetID const& tpcsetid) const {
344  return tpcsetid.TPCset < NTPCsets(tpcsetid);
345  } // ChannelMapCRUAlg::HasTPCset()
346 
347 
348  //----------------------------------------------------------------------------
349  /// Returns the ID of the TPC set tpcid belongs to
351  (geo::TPCID const& tpcid) const
352  {
353  return ConvertTPCtoTPCset(tpcid);
354  } // ChannelMapCRUAlg::TPCtoTPCset()
355 
356 
357  //----------------------------------------------------------------------------
358  /**
359  * @brief Returns a list of ID of TPCs belonging to the specified TPC set
360  * @param tpcsetid ID of the TPC set to convert into TPC IDs
361  * @return the list of TPCs, empty if TPC set is invalid
362  *
363  * Note that the check is performed on the validity of the TPC set ID, that
364  * does not necessarily imply that the TPC set specified by the ID actually
365  * exists. Check the existence of the TPC set first (HasTPCset()).
366  * Behaviour on valid, non-existent TPC set IDs is undefined.
367  */
368  std::vector<geo::TPCID> ChannelMapCRUAlg::TPCsetToTPCs
369  (readout::TPCsetID const& tpcsetid) const
370  {
371  std::vector<geo::TPCID> IDs;
372  if (tpcsetid.isValid) IDs.emplace_back(ConvertTPCsetToTPC(tpcsetid));
373  return IDs;
374  } // ChannelMapCRUAlg::TPCsetToTPCs()
375 
376 
377  //----------------------------------------------------------------------------
378  /// Returns the ID of the first TPC belonging to the specified TPC set
380  (readout::TPCsetID const& tpcsetid) const
381  {
382  return ConvertTPCsetToTPC(tpcsetid);
383  } // ChannelMapCRUAlg::FirstTPCinTPCset()
384 
385 
386  //----------------------------------------------------------------------------
387  unsigned int ChannelMapCRUAlg::MaxTPCs() const
388  {
389  unsigned int max = 0;
390  for (unsigned int nTPCs: fNTPC) if (nTPCs > max) max = nTPCs;
391  return max;
392  } // ChannelMapCRUAlg::MaxTPCs()
393 
394 
395  //----------------------------------------------------------------------------
396  /**
397  * @brief Returns the total number of ROP in the specified TPC set
398  * @param tpcsetid TPC set ID
399  * @return number of readout planes in the TPC set, or 0 if no TPC set found
400  *
401  * Note that this methods explicitly check the existence of the TPC set.
402  */
403  unsigned int ChannelMapCRUAlg::NROPs(readout::TPCsetID const& tpcsetid) const
404  {
405  if (!HasTPCset(tpcsetid)) return 0;
406  return AccessElement(fNPlanes, FirstTPCinTPCset(tpcsetid));
407  } // ChannelMapCRUAlg::NROPs()
408 
409 
410  //----------------------------------------------------------------------------
411  /// Returns the largest number of ROPs a TPC set in the detector has
412  unsigned int ChannelMapCRUAlg::MaxROPs() const {
413  unsigned int max = 0;
414  for (auto const& cryo_tpc: fNPlanes)
415  for (unsigned int nPlanes: cryo_tpc)
416  if (nPlanes > max) max = nPlanes;
417  return max;
418  } // ChannelMapCRUAlg::MaxROPs()
419 
420 
421  //----------------------------------------------------------------------------
422  /// Returns whether we have the specified ROP
423  /// @return whether the readout plane is valid and exists
424  bool ChannelMapCRUAlg::HasROP(readout::ROPID const& ropid) const {
425  return ropid.ROP < NROPs(ropid);
426  } // ChannelMapCRUAlg::HasROP()
427 
428 
429  //----------------------------------------------------------------------------
430  /// Returns the ID of the ROP planeid belongs to
432  (geo::PlaneID const& planeid) const
433  {
434  return ConvertWirePlaneToROP(planeid);
435  } // ChannelMapCRUAlg::WirePlaneToROP()
436 
437 
438  //----------------------------------------------------------------------------
439  /// Returns a list of ID of planes belonging to the specified ROP
440  std::vector<geo::PlaneID> ChannelMapCRUAlg::ROPtoWirePlanes
441  (readout::ROPID const& ropid) const
442  {
443  std::vector<geo::PlaneID> IDs;
444  if (ropid.isValid) IDs.emplace_back(FirstWirePlaneInROP(ropid));
445  return IDs;
446  } // ChannelMapCRUAlg::ROPtoWirePlanes()
447 
448 
449  //----------------------------------------------------------------------------
450  /// Returns the ID of the first plane belonging to the specified ROP
452  (readout::ROPID const& ropid) const
453  {
454  return ConvertROPtoWirePlane(ropid);
455  } // ChannelMapCRUAlg::FirstWirePlaneInROP()
456 
457 
458  //----------------------------------------------------------------------------
459  /**
460  * @brief Returns a list of ID of TPCs the specified ROP spans
461  * @param ropid ID of the readout plane
462  * @return the list of TPC IDs, empty if readout plane ID is invalid
463  *
464  * Note that this check is performed on the validity of the readout plane
465  * ID, that does not necessarily imply that the readout plane specified by
466  * the ID actually exists. Check if the ROP exists with HasROP().
467  * The behaviour on non-existing readout planes is undefined.
468  */
469  std::vector<geo::TPCID> ChannelMapCRUAlg::ROPtoTPCs
470  (readout::ROPID const& ropid) const
471  {
472  std::vector<geo::TPCID> IDs;
473  // we take the TPC set of the ROP and convert it straight into a TPC ID
474  if (ropid.isValid) IDs.emplace_back(ConvertTPCsetToTPC(ropid.asTPCsetID()));
475  return IDs;
476  } // ChannelMapCRUAlg::ROPtoTPCs()
477 
478 
479  //----------------------------------------------------------------------------
480  /// Returns the ID of the ROP the channel belongs to
481  /// @throws cet::exception (category: "Geometry") if non-existent channel
483  {
484  if (!raw::isValidChannelID(channel)) return {}; // invalid ROP returned
485 
486  // which wires does the channel cover?
487  std::vector<geo::WireID> wires = ChannelToWire(channel);
488 
489  // - none:
490  if (wires.empty()) return {}; // default-constructed ID, invalid
491 
492  // - one: maps its plane ID into a ROP ID
493  return WirePlaneToROP(wires[0]);
494  } // ChannelMapCRUAlg::ChannelToROP()
495 
496 
497  //----------------------------------------------------------------------------
498  /**
499  * @brief Returns the ID of the first channel in the specified readout plane
500  * @param ropid ID of the readout plane
501  * @return ID of first channel, or raw::InvalidChannelID if ID is invalid
502  *
503  * Note that this check is performed on the validity of the readout plane
504  * ID, that does not necessarily imply that the readout plane specified by
505  * the ID actually exists. Check if the ROP exists with HasROP().
506  * The behaviour for non-existing readout planes is undefined.
507  */
509  (readout::ROPID const& ropid) const
510  {
511  if (!ropid.isValid) return raw::InvalidChannelID;
512  return (raw::ChannelID_t)
514  } // ChannelMapCRUAlg::FirstChannelInROP()
515 
516 
517  //----------------------------------------------------------------------------
519  (geo::TPCID const& tpcid)
520  {
521  if (!tpcid.isValid) return {}; // invalid ID, default-constructed
522  return {
525  };
526  } // ChannelMapCRUAlg::ConvertTPCtoTPCset()
527 
528 
529  //----------------------------------------------------------------------------
531  (readout::TPCsetID const& tpcsetid)
532  {
533  if (!tpcsetid.isValid) return {};
534  return {
536  (geo::TPCID::TPCID_t) tpcsetid.TPCset
537  };
538  } // ChannelMapCRUAlg::ConvertTPCsetToTPC()
539 
540 
541  //----------------------------------------------------------------------------
543  (geo::PlaneID const& planeid)
544  {
545  if (!planeid.isValid) return {}; // invalid ID, default-constructed
546  return {
550  };
551 
552  } // ChannelMapCRUAlg::ConvertWirePlaneToROP()
553 
554 
555  //----------------------------------------------------------------------------
557  (readout::ROPID const& ropid)
558  {
559  if (!ropid.isValid) return {};
560  return {
562  (geo::TPCID::TPCID_t) ropid.TPCset,
564  };
565  } // ChannelMapCRUAlg::ConvertROPtoWirePlane()
566 
567 
568  //----------------------------------------------------------------------------
569 
570 } // namespace
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const override
Returns the channel ID a wire is connected to.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
PlaneInfoMap_t< unsigned int > fWiresPerPlane
TPCInfoMap_t< unsigned int > fNPlanes
Encapsulate the construction of a single cyostat.
PlaneInfoMap_t< float > fWireCounts
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
ChannelMapCRUAlg(fhicl::ParameterSet const &p)
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
unsigned int ROPID_t
Type for the ID number.
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.
unsigned short TPCsetID_t
Type for the ID number.
Definition: readout_types.h:71
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:473
double SinThetaZ() const
Definition: WireGeo.h:265
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
virtual WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:70
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
CryostatList_t cryostats
The detector cryostats.
Definition: GeometryData.h:38
uint8_t channel
Definition: CRTFragment.hh:201
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to.
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
raw::ChannelID_t fTopChannel
book keeping highest channel #
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
PlaneInfoMap_t< float > fOrthVectorsZ
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
unsigned int fNcryostat
number of cryostats in the detector
ROPID_t ROP
Index of the readout plane within its TPC set.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Signal from induction planes.
Definition: geo_types.h:145
unsigned int MaxTPCs() const
Returns the largest number of TPCs in a single cryostat.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
Collection of exceptions for Geometry system.
enum geo::_plane_sigtype SigType_t
PlaneInfoMap_t< float > fOrthVectorsY
Unit vectors orthogonal to wires in.
p
Definition: test.py:223
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Definition: RawTypes.h:37
Encapsulate the geometry of an auxiliary detector.
PlaneInfoMap_t< unsigned int > fPlaneBaselines
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set tpcid belongs to.
PlaneInfoMap_t< float > fFirstWireProj
virtual std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
static int max(int a, int b)
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
Class identifying a set of planes sharing readout channels.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
Definition: readout_types.h:90
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
Encapsulate the geometry of a wire.
unsigned int fNchannels
number of channels in the detector
T const * GetElementPtr(PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
Returns a pointer to the specified element, or nullptr if invalid.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
virtual bool HasROP(readout::ROPID const &ropid) const override
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
Encapsulate the construction of a single detector plane.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
static geo::PlaneID ConvertROPtoWirePlane(readout::ROPID const &ropid)
Converts a wire plane ID into a ROP ID using the same numerical indices.
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of planes belonging to the specified ROP.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define MF_LOG_DEBUG(id)
static readout::TPCsetID ConvertTPCtoTPCset(geo::TPCID const &tpcid)
Converts a TPC ID into a TPC set ID using the same numerical indices.
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:561
Access the description of detector geometry.
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
Exception thrown on invalid wire number (e.g. NearestWireID())
Definition: Exceptions.h:158
Interface to channel algorithm class for a vertical drift TPC.
virtual unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
Data in the geometry description.
Definition: GeometryData.h:31
double CosThetaZ() const
Returns trigonometric operations on ThetaZ()
Definition: WireGeo.h:264
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
const char * cs
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
virtual unsigned int MaxTPCsets() const override
Returns the largest number of TPC sets any cryostat in the detector has.
static geo::TPCID ConvertTPCsetToTPC(readout::TPCsetID const &tpcsetid)
Converts a TPC set ID into a TPC ID using the same numerical indices.
static readout::ROPID ConvertWirePlaneToROP(geo::PlaneID const &planeid)
Converts a ROP ID into a wire plane ID using the same numerical indices.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
unsigned int WireCount(geo::PlaneID const &id) const
Retrieved the wire cound for the specified plane ID.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
constexpr TPCsetID const & asTPCsetID() const
Conversion to TPCsetID (for convenience of notation).
Encapsulate the construction of a single detector plane.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
Signal from collection planes.
Definition: geo_types.h:146