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