All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChannelMapStandardAlg.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ChannelMapStandardAlg.cxx
3 /// \brief Interface to algorithm class for the standar, simplest detector channel mapping
4 ///
5 /// \author brebel@fnal.gov
6 ////////////////////////////////////////////////////////////////////////
7 
15 
16 #include "cetlib_except/exception.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
18 
19 namespace fhicl { class ParameterSet; }
20 
21 namespace geo{
22 
23  //----------------------------------------------------------------------------
24  ChannelMapStandardAlg::ChannelMapStandardAlg(fhicl::ParameterSet const& p)
25  : fSorter(geo::GeoObjectSorterStandard(p))
26  {
27  }
28 
29  //----------------------------------------------------------------------------
31  {
32  // start over:
33  Uninitialize();
34 
35  std::vector<geo::CryostatGeo> const& cgeo = geodata.cryostats;
36 
37  fNcryostat = cgeo.size();
38 
39  mf::LogInfo("ChannelMapStandardAlg") << "Initializing Standard ChannelMap...";
40 
41  fNTPC.resize(fNcryostat);
42  fWireCounts.resize(fNcryostat);
43  fNPlanes.resize(fNcryostat);
44  fFirstWireProj.resize(fNcryostat);
45  fOrthVectorsY.resize(fNcryostat);
46  fOrthVectorsZ.resize(fNcryostat);
48  fWiresPerPlane.resize(fNcryostat);
51  fPlaneIDs.clear();
52  fTopChannel = 0;
53 
54  int RunningTotal = 0;
55 
56  for(unsigned int cs = 0; cs != fNcryostat; ++cs){
57  geo::CryostatGeo const& cryo = cgeo[cs];
58  fNTPC[cs] = cryo.NTPC();
59 
60  // Size up all the vectors
61  fWireCounts[cs] .resize(fNTPC[cs]);
62  fFirstWireProj[cs] .resize(fNTPC[cs]);
63  fOrthVectorsY[cs] .resize(fNTPC[cs]);
64  fOrthVectorsZ[cs] .resize(fNTPC[cs]);
65  fPlaneBaselines[cs] .resize(fNTPC[cs]);
66  fWiresPerPlane[cs] .resize(fNTPC[cs]);
67  fNPlanes[cs] .resize(fNTPC[cs]);
68  fFirstChannelInThisPlane[cs].resize(fNTPC[cs]);
69  fFirstChannelInNextPlane[cs].resize(fNTPC[cs]);
70 
71  for(unsigned int TPCCount = 0; TPCCount != fNTPC[cs]; ++TPCCount){
72  geo::TPCGeo const& TPC = cryo.TPC(TPCCount);
73  unsigned int PlanesThisTPC = TPC.Nplanes();
74  fWireCounts[cs][TPCCount] .resize(PlanesThisTPC);
75  fFirstWireProj[cs][TPCCount].resize(PlanesThisTPC);
76  fOrthVectorsY[cs][TPCCount] .resize(PlanesThisTPC);
77  fOrthVectorsZ[cs][TPCCount] .resize(PlanesThisTPC);
78  fNPlanes[cs][TPCCount]=PlanesThisTPC;
79  for(unsigned int PlaneCount = 0; PlaneCount != PlanesThisTPC; ++PlaneCount){
80  geo::PlaneGeo const& plane = TPC.Plane(PlaneCount);
81 
82  fPlaneIDs.emplace(PlaneID(cs, TPCCount, PlaneCount));
83  double ThisWirePitch = TPC.WirePitch(PlaneCount);
84  fWireCounts[cs][TPCCount][PlaneCount] = plane.Nwires();
85 
86  double WireCentre1[3] = {0.,0.,0.};
87  double WireCentre2[3] = {0.,0.,0.};
88 
89  const geo::WireGeo& firstWire = plane.Wire(0);
90  const double sth = firstWire.SinThetaZ(), cth = firstWire.CosThetaZ();
91 
92  firstWire.GetCenter(WireCentre1,0);
93  plane.Wire(1).GetCenter(WireCentre2,0);
94 
95  // figure out if we need to flip the orthogonal vector
96  // (should point from wire n -> n+1)
97  double OrthY = cth, OrthZ = -sth;
98  if(((WireCentre2[1] - WireCentre1[1])*OrthY
99  + (WireCentre2[2] - WireCentre1[2])*OrthZ) < 0){
100  OrthZ *= -1;
101  OrthY *= -1;
102  }
103 
104  // Overall we are trying to build an expression that looks like
105  // int NearestWireNumber = round((worldPos.OrthVector - FirstWire.OrthVector)/WirePitch);
106  // That runs as fast as humanly possible.
107  // We predivide everything by the wire pitch so we don't do this in the loop.
108  //
109  // Putting this together into the useful constants we will use later per plane and tpc:
110  fOrthVectorsY[cs][TPCCount][PlaneCount] = OrthY / ThisWirePitch;
111  fOrthVectorsZ[cs][TPCCount][PlaneCount] = OrthZ / ThisWirePitch;
112 
113  fFirstWireProj[cs][TPCCount][PlaneCount] = WireCentre1[1]*OrthY + WireCentre1[2]*OrthZ;
114  fFirstWireProj[cs][TPCCount][PlaneCount] /= ThisWirePitch;
115 
116  // now to count up wires in each plane and get first channel in each plane
117  int WiresThisPlane = plane.Nwires();
118  fWiresPerPlane[cs] .at(TPCCount).push_back(WiresThisPlane);
119  fPlaneBaselines[cs].at(TPCCount).push_back(RunningTotal);
120 
121  RunningTotal += WiresThisPlane;
122 
123  fFirstChannelInThisPlane[cs].at(TPCCount).push_back(fTopChannel);
124  fTopChannel += WiresThisPlane;
125  fFirstChannelInNextPlane[cs].at(TPCCount).push_back(fTopChannel);
126 
127  }// end loop over planes
128  }// end loop over TPCs
129  }// end loop over cryostats
130 
131  // calculate the total number of channels in the detector
133 
134  MF_LOG_DEBUG("ChannelMapStandard") << "# of channels is " << fNchannels;
135 
136 
137  return;
138  }
139 
140  //----------------------------------------------------------------------------
142  {
143  }
144 
145  //----------------------------------------------------------------------------
146  std::vector<geo::WireID> ChannelMapStandardAlg::ChannelToWire(raw::ChannelID_t channel) const
147  {
148  std::vector< geo::WireID > AllSegments;
149  unsigned int cstat = 0;
150  unsigned int tpc = 0;
151  unsigned int plane = 0;
152  unsigned int wire = 0;
153 
154  // first check if this channel ID is legal
155  if(channel > fTopChannel)
156  throw cet::exception("Geometry") << "ILLEGAL CHANNEL ID for channel " << channel << "\n";
157 
158  // then go find which plane, tpc and cryostat it is in from the information we stored earlier
159  bool foundWid(false);
160  for(unsigned int csloop = 0; csloop != fNcryostat; ++csloop){
161  for(unsigned int tpcloop = 0; tpcloop != fNTPC[csloop]; ++tpcloop){
162  for(unsigned int planeloop = 0; planeloop != fFirstChannelInNextPlane[csloop][tpcloop].size(); ++planeloop){
163  if(channel < fFirstChannelInNextPlane[csloop][tpcloop][planeloop]){
164  cstat = csloop;
165  tpc = tpcloop;
166  plane = planeloop;
167  wire = channel - fFirstChannelInThisPlane[cstat][tpcloop][planeloop];
168  foundWid = true;
169  break;
170  }
171  if(foundWid) break;
172  }// end plane loop
173  if(foundWid) break;
174  }// end tpc loop
175  if(foundWid) break;
176  }// end cryostat loop
177 
178  geo::WireID CodeWire(cstat, tpc, plane, wire);
179 
180  AllSegments.push_back(CodeWire);
181 
182  return AllSegments;
183  }
184 
185  //----------------------------------------------------------------------------
187  {
188  return fNchannels;
189  }
190 
191  //----------------------------------------------------------------------------
193  (readout::ROPID const& ropid) const
194  {
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  } // ChannelMapStandardAlg::Nchannels(ROPID)
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("ChannelMapStandardAlg")
273  << "NO CHANNEL FOUND for " << std::string(wireID);
274  }
275 
276  // made it here, that shouldn't happen, return raw::InvalidChannelID
277  mf::LogWarning("ChannelMapStandardAlg") << "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 
298  if( (channel >= fFirstChannelInThisPlane[0][tpc][0]) &&
299  (channel < fFirstChannelInNextPlane[0][tpc][PlanesThisTPC-2]) ){ sigt = geo::kInduction; }
300  else if( (channel >= fFirstChannelInThisPlane[0][tpc][PlanesThisTPC-1]) &&
301  (channel < fFirstChannelInNextPlane[0][tpc][PlanesThisTPC-1]) ){ sigt = geo::kCollection; }
302  else
303  mf::LogWarning("BadChannelSignalType") << "Channel " << channel
304  << " not given signal type." << std::endl;
305 
306 
307  return sigt;
308  }
309 
310 
311  //----------------------------------------------------------------------------
312  std::set<PlaneID> const& ChannelMapStandardAlg::PlaneIDs() const
313  {
314  return fPlaneIDs;
315  }
316 
317 
318  //----------------------------------------------------------------------------
320  (readout::CryostatID const& cryoid) const
321  {
322  // return the same number as the number of TPCs
323  return (cryoid.isValid && cryoid.Cryostat < fNTPC.size())?
324  fNTPC[cryoid.Cryostat]: 0;
325  } // ChannelMapStandardAlg::NTPCsets()
326 
327 
328  //----------------------------------------------------------------------------
330  {
331  return MaxTPCs();
332  } // ChannelMapStandardAlg::MaxTPCsets()
333 
334 
335  //----------------------------------------------------------------------------
337  {
338  return tpcsetid.TPCset < NTPCsets(tpcsetid);
339  } // ChannelMapStandardAlg::HasTPCset()
340 
341 
342  //----------------------------------------------------------------------------
344  (geo::TPCID const& tpcid) const
345  {
346  return ConvertTPCtoTPCset(tpcid);
347  } // ChannelMapStandardAlg::TPCtoTPCset()
348 
349 
350  //----------------------------------------------------------------------------
351  std::vector<geo::TPCID> ChannelMapStandardAlg::TPCsetToTPCs
352  (readout::TPCsetID const& tpcsetid) const
353  {
354  std::vector<geo::TPCID> IDs;
355  if (tpcsetid.isValid) IDs.emplace_back(ConvertTPCsetToTPC(tpcsetid));
356  return IDs;
357  } // ChannelMapStandardAlg::TPCsetToTPCs()
358 
359 
360  //----------------------------------------------------------------------------
362  (readout::TPCsetID const& tpcsetid) const
363  {
364  return ConvertTPCsetToTPC(tpcsetid);
365  } // ChannelMapStandardAlg::FirstTPCinTPCset()
366 
367 
368  //----------------------------------------------------------------------------
369  unsigned int ChannelMapStandardAlg::MaxTPCs() const
370  {
371  unsigned int max = 0;
372  for (unsigned int nTPCs: fNTPC) if (nTPCs > max) max = nTPCs;
373  return max;
374  } // ChannelMapStandardAlg::MaxTPCs()
375 
376 
377  //----------------------------------------------------------------------------
378  unsigned int ChannelMapStandardAlg::NROPs
379  (readout::TPCsetID const& tpcsetid) const
380  {
381  if (!HasTPCset(tpcsetid)) return 0;
382  return AccessElement(fNPlanes, FirstTPCinTPCset(tpcsetid));
383  } // ChannelMapStandardAlg::NROPs()
384 
385 
386  //----------------------------------------------------------------------------
387  unsigned int ChannelMapStandardAlg::MaxROPs() const {
388  unsigned int max = 0;
389  for (auto const& cryo_tpc: fNPlanes)
390  for (unsigned int nPlanes: cryo_tpc)
391  if (nPlanes > max) max = nPlanes;
392  return max;
393  } // ChannelMapStandardAlg::MaxROPs()
394 
395 
396  //----------------------------------------------------------------------------
398  return ropid.ROP < NROPs(ropid);
399  } // ChannelMapStandardAlg::HasROP()
400 
401 
402  //----------------------------------------------------------------------------
404  (geo::PlaneID const& planeid) const
405  {
406  return ConvertWirePlaneToROP(planeid);
407  } // ChannelMapStandardAlg::WirePlaneToROP()
408 
409 
410  //----------------------------------------------------------------------------
411  std::vector<geo::PlaneID> ChannelMapStandardAlg::ROPtoWirePlanes
412  (readout::ROPID const& ropid) const
413  {
414  std::vector<geo::PlaneID> IDs;
415  if (ropid.isValid) IDs.emplace_back(FirstWirePlaneInROP(ropid));
416  return IDs;
417  } // ChannelMapStandardAlg::ROPtoWirePlanes()
418 
419 
420  //----------------------------------------------------------------------------
421  std::vector<geo::TPCID> ChannelMapStandardAlg::ROPtoTPCs
422  (readout::ROPID const& ropid) const
423  {
424  std::vector<geo::TPCID> IDs;
425  // we take the TPC set of the ROP and convert it straight into a TPC ID
426  if (ropid.isValid) IDs.emplace_back(ConvertTPCsetToTPC(ropid.asTPCsetID()));
427  return IDs;
428  } // ChannelMapStandardAlg::ROPtoTPCs()
429 
430 
431  //----------------------------------------------------------------------------
433  (raw::ChannelID_t channel) const
434  {
435  if (!raw::isValidChannelID(channel)) return {}; // invalid ROP returned
436 
437  // which wires does the channel cover?
438  std::vector<geo::WireID> wires = ChannelToWire(channel);
439 
440  // - none:
441  if (wires.empty()) return {}; // invalid ROP returned
442 
443  // - one: maps its plane ID into a ROP ID
444  return WirePlaneToROP(wires[0]);
445  } // ChannelMapStandardAlg::ROPtoTPCs()
446 
447 
448  //----------------------------------------------------------------------------
450  (readout::ROPID const& ropid) const
451  {
452  if (!ropid.isValid) return raw::InvalidChannelID;
453  return (raw::ChannelID_t)
454  AccessElement(fPlaneBaselines, ConvertROPtoWirePlane(ropid));
455  } // ChannelMapStandardAlg::FirstChannelInROP()
456 
457 
458  //----------------------------------------------------------------------------
460  (readout::ROPID const& ropid) const
461  {
462  return ConvertROPtoWirePlane(ropid);
463  } // ChannelMapStandardAlg::FirstWirePlaneInROP()
464 
465 
466  //----------------------------------------------------------------------------
468  (geo::TPCID const& tpcid)
469  {
470  if (!tpcid.isValid) return {}; // invalid ID, default-constructed
471  return {
474  };
475  } // ChannelMapStandardAlg::ConvertTPCtoTPCset()
476 
477 
478  //----------------------------------------------------------------------------
480  (readout::TPCsetID const& tpcsetid)
481  {
482  if (!tpcsetid.isValid) return {};
483  return {
485  (geo::TPCID::TPCID_t) tpcsetid.TPCset
486  };
487  } // ChannelMapStandardAlg::ConvertTPCsetToTPC()
488 
489 
490  //----------------------------------------------------------------------------
492  (geo::PlaneID const& planeid)
493  {
494  if (!planeid.isValid) return {}; // invalid ID, default-constructed
495  return {
499  };
500 
501  } // ChannelMapStandardAlg::ConvertWirePlaneToROP()
502 
503 
504  //----------------------------------------------------------------------------
506  (readout::ROPID const& ropid)
507  {
508  if (!ropid.isValid) return {};
509  return {
511  (geo::TPCID::TPCID_t) ropid.TPCset,
513  };
514  } // ChannelMapStandardAlg::ConvertROPtoWirePlane()
515 
516 
517  //----------------------------------------------------------------------------
518 
519 } // 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:65
TPCInfoMap_t< unsigned int > fNPlanes
PlaneInfoMap_t< float > fWireCounts
Who knows?
Definition: geo_types.h:147
Encapsulate the construction of a single cyostat.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
unsigned int ROPID_t
Type for the ID number.
pdgs p
Definition: selectors.fcl:22
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
Geometry information for a single TPC.
Definition: TPCGeo.h:38
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:70
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
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
CryostatList_t cryostats
The detector cryostats.
Definition: GeometryData.h:38
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROPs in the specified TPC set.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
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.
BEGIN_PROLOG TPC
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
virtual std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
virtual unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
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 geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
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.
Collection of exceptions for Geometry system.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
unsigned int MaxTPCs() const
Returns the largest number of TPCs in a single cryostat.
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
static geo::TPCID ConvertTPCsetToTPC(readout::TPCsetID const &tpcsetid)
Converts a TPC set ID into a TPC ID using the same numerical indices.
virtual WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const override
Returns the channel ID a wire is connected to.
enum geo::_plane_sigtype SigType_t
unsigned int fNcryostat
number of cryostats in the detector
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.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
PlaneInfoMap_t< unsigned int > fPlaneBaselines
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Definition: RawTypes.h:37
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
PlaneInfoMap_t< unsigned int > fWiresPerPlane
double WirePitch(unsigned plane=0) const
Definition: TPCGeo.cxx:396
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
PlaneInfoMap_t< float > fFirstWireProj
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::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
Returns the ID of the ROP the channel belongs to (invalid if none)
Class identifying a set of planes sharing readout channels.
unsigned int fNchannels
number of channels in the detector
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
Definition: readout_types.h:90
Encapsulate the geometry of a wire.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
ChannelMapStandardAlg(fhicl::ParameterSet const &p)
virtual 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
Interface to algorithm class for a specific detector channel mapping.
Encapsulate the construction of a single detector plane.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
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:269
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
PlaneInfoMap_t< float > fOrthVectorsY
Unit vectors orthogonal to wires in.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
virtual bool HasROP(readout::ROPID const &ropid) const override
raw::ChannelID_t fTopChannel
book keeping highest channel #
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:561
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:263
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
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
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.
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
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