ChannelMapAPAAlg.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ChannelMapAPAAlg.cxx
3 /// \brief Interface to algorithm class for a specific detector channel mapping
4 ///
5 /// \version $Id: $
6 /// \author tylerdalion@gmail.com
7 ////////////////////////////////////////////////////////////////////////
8 
16 
19 
20 namespace geo{
21 
22  //----------------------------------------------------------------------------
24  : fSorter(geo::GeoObjectSorterAPA(p))
25  {
26  fChannelsPerOpDet = p.get< unsigned int >("ChannelsPerOpDet" );
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("ChannelMapAPAAlg") << "Initializing channel map...";
40 
41  fNTPC.resize(fNcryostat);
42  fFirstChannelInNextPlane.resize(1); // Change 1 to Ncryostat if you want
43  fFirstChannelInThisPlane.resize(1); // to treat each APA uniquely,and do
44  // the same with the other resizes.
45  fPlanesPerAPA = cgeo[0].TPC(0).Nplanes();
48  fFirstChannelInThisPlane[0].resize(1); // remember FirstChannel vectors
49  fFirstChannelInNextPlane[0].resize(1); // for first APA only.
50  fFirstChannelInThisPlane[0][0].resize(fPlanesPerAPA); // Make room for info
51  fFirstChannelInNextPlane[0][0].resize(fPlanesPerAPA); // on each plane.
52  fViews.clear();
53  fPlaneIDs.clear();
54  fTopChannel = 0;
55 
56  // Size some vectors and initialize the FirstChannel vectors.
57  // If making FirstChannel's for every APA uniquely, they also
58  // need to be sized here. Not necessary for now
59  for(unsigned int cs = 0; cs != fNcryostat; ++cs){
60 
61  fNTPC[cs] = cgeo[cs].NTPC();
62 
63  }// end sizing loop over cryostats
64 
65  // Find the number of wires anchored to the frame
66  for(unsigned int p=0; p!=fPlanesPerAPA; ++p){
67 
68  fWiresInPlane[p] = cgeo[0].TPC(0).Plane(p).Nwires();
69  double xyz[3] = {0.};
70  double xyz_next[3] = {0.};
71 
72  fViews.emplace(cgeo[0].TPC(0).Plane(p).View());
73 
74  for(unsigned int w = 0; w != fWiresInPlane[p]; ++w){
75 
76  // for vertical planes
77  if(cgeo[0].TPC(0).Plane(p).View()==geo::kZ) {
79  break;
80  }
81 
82  cgeo[0].TPC(0).Plane(p).Wire(w).GetCenter(xyz);
83  cgeo[0].TPC(0).Plane(p).Wire(w+1).GetCenter(xyz_next);
84 
85  if(xyz[2]==xyz_next[2]){
86  nAnchoredWires[p] = w;
87  break;
88  }
89 
90  }// end wire loop
91 
92  }// end plane loop
93 
94  raw::ChannelID_t CurrentChannel = 0;
95 
96  for(unsigned int PCount = 0; PCount != fPlanesPerAPA; ++PCount){
97 
98  fFirstChannelInThisPlane[0][0][PCount] = CurrentChannel;
99  CurrentChannel = CurrentChannel + 2*nAnchoredWires[PCount];
100  fFirstChannelInNextPlane[0][0][PCount] = CurrentChannel;
101 
102  }// end build loop over planes
103 
104  // Save the number of channels
106 
107  fNchannels = 0;
108  for(size_t cs = 0; cs < fNcryostat; ++cs){
110  }
111 
112  //save data into fFirstWireCenterY and fFirstWireCenterZ
113  fPlaneData.resize(fNcryostat);
114  for (unsigned int cs=0; cs<fNcryostat; ++cs){
115  fPlaneData[cs].resize(cgeo[cs].NTPC());
116  for (unsigned int tpc=0; tpc<cgeo[cs].NTPC(); ++tpc){
117  fPlaneData[cs][tpc].resize(cgeo[cs].TPC(tpc).Nplanes());
118  for (unsigned int plane=0; plane<cgeo[cs].TPC(tpc).Nplanes(); ++plane){
119  PlaneData_t& PlaneData = fPlaneData[cs][tpc][plane];
120  const geo::PlaneGeo& thePlane = cgeo[cs].TPC(tpc).Plane(plane);
121  double xyz[3];
122  fPlaneIDs.emplace(cs, tpc, plane);
123  thePlane.Wire(0).GetCenter(xyz);
124  PlaneData.fFirstWireCenterY = xyz[1];
125  PlaneData.fFirstWireCenterZ = xyz[2];
126  // we are interested in the ordering of wire numbers: we find that a
127  // point is N wires left of a wire W: is that wire W + N or W - N?
128  // In fact, for TPC #0 it is W + N for V and Z planes, W - N for U
129  // plane; for TPC #0 it is W + N for V and Z planes, W - N for U
130  PlaneData.fWireSortingInZ = thePlane.WireIDincreasesWithZ()? +1.: -1.;
131 
132  // find boundaries of the outside APAs for this plane by looking at endpoints of wires
133 
134  double endpoint[3];
135  thePlane.Wire(0).GetStart(endpoint);
136  PlaneData.fYmax = endpoint[1];
137  PlaneData.fYmin = endpoint[1];
138  PlaneData.fZmax = endpoint[2];
139  PlaneData.fZmin = endpoint[2];
140  unsigned int nwires = thePlane.Nwires();
141  for (unsigned int iwire=0;iwire<nwires;iwire++){
142  thePlane.Wire(iwire).GetStart(endpoint);
143  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
144  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
145  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
146  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
147  thePlane.Wire(iwire).GetEnd(endpoint);
148  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
149  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
150  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
151  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
152  } // loop on wire
153 
154  } // for plane
155  } // for TPC
156  } // for cryostat
157 
158  //initialize fWirePitch and fOrientation
159  fWirePitch.resize(cgeo[0].TPC(0).Nplanes());
160  fOrientation.resize(cgeo[0].TPC(0).Nplanes());
161  fSinOrientation.resize(cgeo[0].TPC(0).Nplanes());
162  fCosOrientation.resize(cgeo[0].TPC(0).Nplanes());
163 
164  for (unsigned int plane=0; plane<cgeo[0].TPC(0).Nplanes(); plane++){
165  fWirePitch[plane]=cgeo[0].TPC(0).WirePitch(plane);
166  fOrientation[plane]=cgeo[0].TPC(0).Plane(plane).Wire(0).ThetaZ();
167  fSinOrientation[plane] = sin(fOrientation[plane]);
168  fCosOrientation[plane] = cos(fOrientation[plane]);
169  }
170 
171 
172  for(unsigned int c=0; c<fNcryostat; c++){
173 
174  mf::LogVerbatim("ChannelMapAPAAlg") << "Cryostat " << c << ":";
175 
176  mf::LogVerbatim("ChannelMapAPAAlg") << " " << fNchannels << " total channels";
177  mf::LogVerbatim("ChannelMapAPAAlg") << " " << fNTPC[c]/2 << " APAs";
178  mf::LogVerbatim("ChannelMapAPAAlg") << " For all identical APA:" ;
179  mf::LogVerbatim("ChannelMapAPAAlg") << " Number of channels per APA = " << fChannelsPerAPA ;
180 
181  mf::LogVerbatim("ChannelMapAPAAlg") << " U channels per APA = " << 2*nAnchoredWires[0] ;
182  mf::LogVerbatim("ChannelMapAPAAlg") << " V channels per APA = " << 2*nAnchoredWires[1] ;
183  mf::LogVerbatim("ChannelMapAPAAlg") << " Z channels per APA = " << 2*nAnchoredWires[2] ;
184 
185  mf::LogVerbatim("ChannelMapAPAAlg") << " Pitch in U Plane = " << fWirePitch[0] ;
186  mf::LogVerbatim("ChannelMapAPAAlg") << " Pitch in V Plane = " << fWirePitch[1] ;
187  mf::LogVerbatim("ChannelMapAPAAlg") << " Pitch in Z Plane = " << fWirePitch[2] ;
188 
189  }
190 
191  return;
192 
193  }
194 
195  //----------------------------------------------------------------------------
197  {
198 
201 
202  }
203 
204  //----------------------------------------------------------------------------
206  {
207 
208  // first check if this channel ID is legal
209  if(channel >= fNchannels )
210  throw cet::exception("Geometry") << "ILLEGAL CHANNEL ID for channel " << channel << "\n";
211 
212  std::vector< WireID > AllSegments;
213 
214  static unsigned int cstat;
215  static unsigned int tpc;
216  static unsigned int plane;
217  static unsigned int wireThisPlane;
218  static unsigned int NextPlane;
219  static unsigned int ThisPlane;
220 
221  raw::ChannelID_t chan = channel%fChannelsPerAPA;
222  raw::ChannelID_t pureAPAnum = std::floor( channel/fChannelsPerAPA );
223 
224  bool breakVariable = false;
225  for(unsigned int planeloop = 0; planeloop != fPlanesPerAPA; ++planeloop){
226 
227  NextPlane = fFirstChannelInNextPlane[0][0][planeloop];
228  ThisPlane = fFirstChannelInThisPlane[0][0][planeloop];
229 
230  if(chan < NextPlane){
231 
232  // fNTPC[0] works for now since there are the same number of TPCs per crostat
233  cstat = std::floor( channel / ((fNTPC[0]/2)*fChannelsPerAPA) );
234  tpc = (2*pureAPAnum) % fNTPC[0];
235  plane = planeloop;
236  wireThisPlane = chan - ThisPlane;
237 
238  breakVariable = true;
239  break;
240  }
241  if(breakVariable) break;
242  }// end plane loop
243 
244 
245 
246  int WrapDirection = 1; // go from tpc to (tpc+1) or tpc to (tpc-1)
247 
248  // find the lowest wire
249  raw::ChannelID_t ChannelGroup = std::floor( wireThisPlane/nAnchoredWires[plane] );
250  unsigned int bottomwire = wireThisPlane-ChannelGroup*nAnchoredWires[plane];
251 
252  if(ChannelGroup%2==1){
253  tpc += 1;
254  WrapDirection = -1;
255  }
256 
257  for(unsigned int SegCount = 0; SegCount != 50; ++SegCount){
258 
259  tpc += WrapDirection*(SegCount%2);
260  geo::WireID CodeWire(cstat, tpc, plane, bottomwire + SegCount*nAnchoredWires[plane]);
261  AllSegments.push_back(CodeWire);
262 
263  // reset the tcp variable so it doesnt "accumulate value"
264  tpc -= WrapDirection*(SegCount%2);
265 
266  if( bottomwire + (SegCount+1)*nAnchoredWires[plane] > fWiresInPlane[plane]-1) break;
267  }
268 
269  return AllSegments;
270  }
271 
272 
273  //----------------------------------------------------------------------------
274  unsigned int ChannelMapAPAAlg::Nchannels() const
275  {
276  return fNchannels;
277  }
278 
279 
280  //----------------------------------------------------------------------------
281  unsigned int ChannelMapAPAAlg::Nchannels
282  (readout::ROPID const& ropid) const
283  {
284  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
285  } // ChannelMapAPAAlg::Nchannels(ROPID)
286 
287 
288  //----------------------------------------------------------------------------
290  (double YPos, double ZPos, geo::PlaneID const& planeid) const
291  {
292  // Returns the wire number corresponding to a (Y,Z) position in the plane
293  // with float precision.
294  // Core code ripped from original NearestWireID() implementation
295 
296  const PlaneData_t& PlaneData = AccessElement(fPlaneData, planeid);
297 
298  //get the orientation angle of a given plane and calculate the distance between first wire
299  //and a point projected in the plane
300 // const double rotate = (planeid.TPC % 2 == 1)? -1.: +1.;
301 
302  // the formula used here is geometric:
303  // distance = delta_y cos(theta_z) + delta_z sin(theta_z)
304  // with a correction for the orientation of the TPC:
305  // odd TPCs have supplementary wire angle (pi-theta_z), changing cosine sign
306 
307  const bool bSuppl = (planeid.TPC % 2) == 1;
308  float distance =
309  -(YPos - PlaneData.fFirstWireCenterY) * (bSuppl? -1.: +1.) * fCosOrientation[planeid.Plane]
310  +(ZPos - PlaneData.fFirstWireCenterZ) * fSinOrientation[planeid.Plane]
311  ;
312 
313  // The sign of this formula is correct if the wire with larger ID is on the
314  // "right" (intuitively, larger z; rigorously, smaller intercept)
315  // than this one.
316  // Of course, we are not always that lucky. fWireSortingInZ fixes our luck.
317 
318  return PlaneData.fWireSortingInZ * distance/fWirePitch[planeid.Plane];
319  } // ChannelMapAPAAlg::WireCoordinate()
320 
321  //----------------------------------------------------------------------------
323  (const TVector3& xyz, geo::PlaneID const& planeid) const
324  {
325 
326  // cap the position to be within the boundaries of the wire endpoints.
327  // This simulates charge drifting in from outside of the wire frames inwards towards
328  // the first and last collection wires on the side, and towards the right endpoints
329 
330  const PlaneData_t& PlaneData = AccessElement(fPlaneData, planeid);
331  double ycap = std::max(PlaneData.fYmin,std::min(PlaneData.fYmax,xyz.Y()));
332  double zcap = std::max(PlaneData.fZmin,std::min(PlaneData.fZmax,xyz.Z()));
333 
334  // add 0.5 to have the correct rounding
335  int NearestWireNumber
336  = int (0.5 + WireCoordinate(ycap, zcap, planeid));
337 
338  // If we are outside of the wireplane range, throw an exception
339  // (this response maintains consistency with the previous
340  // implementation based on geometry lookup)
341  if(NearestWireNumber < 0 ||
342  NearestWireNumber >= (int) fWiresInPlane[planeid.Plane])
343  {
344  const int wireNumber = NearestWireNumber; // save for the output
345 
346  if(wireNumber < 0 ) NearestWireNumber = 0;
347  else NearestWireNumber = fWiresInPlane[planeid.Plane] - 1;
348 
349  /*
350  // comment in the following statement to throw an exception instead
351  throw InvalidWireIDError("Geometry", wireNumber, NearestWireNumber)
352  << "ChannelMapAPAAlg::NearestWireID(): can't Find Nearest Wire for position ("
353  << xyz.X() << "," << xyz.Y() << "," << xyz.Z() << ")"
354  << " approx wire number # " << wireNumber
355  << " (capped from " << NearestWireNumber << ")\n";
356  */
357  } // if invalid wire
358 
359  return { planeid, (geo::WireID::WireID_t) NearestWireNumber };
360  } // ChannelMapAPAAlg::NearestWireID()
361 
362 
363  //----------------------------------------------------------------------------
365  (geo::WireID const& wireid) const
366  {
367  unsigned int OtherSideWires = 0;
368 
369  // start in very first APA:
370  raw::ChannelID_t Channel = fFirstChannelInThisPlane[0][0][wireid.Plane];
371  // move channel to proper cryostat:
372  Channel += wireid.Cryostat*(fNTPC[wireid.Cryostat]/2)*fChannelsPerAPA;
373  // move channel to proper APA:
374  Channel += std::floor( wireid.TPC/2 )*fChannelsPerAPA;
375  // get number of wires on the first side of the APA if starting on the other side TPC:
376  OtherSideWires += (wireid.TPC%2)*nAnchoredWires[wireid.Plane];
377 
378 
379  // Lastly, account for the fact that channel number while moving up wire number in one
380  // plane resets after 2 times the number of wires anchored -- one for each APA side.
381  // At the same time, OtherSideWires accounts for the fact that if a channel starts on
382  // the other side, it is offset by the number of wires on the first side.
383  Channel += (OtherSideWires + wireid.Wire)%(2*nAnchoredWires[wireid.Plane]);
384 
385  return Channel;
386 
387  }
388 
389  //----------------------------------------------------------------------------
391  {
392  raw::ChannelID_t chan = channel % fChannelsPerAPA;
393  SigType_t sigt = kInduction;
394 
395  // instead of calling channel to wire, we can make use of the way we
396  // up channels among APAs;
397  // the first two planes are induction, and the last one is collection
398  if( chan < fFirstChannelInThisPlane[0][0][2] ){ sigt = kInduction; }
399  else if( (chan >= fFirstChannelInThisPlane[0][0][2]) &&
400  (chan < fFirstChannelInNextPlane[0][0][2]) ){ sigt = kCollection; }
401  else{ mf::LogWarning("BadChannelSignalType") << "Channel " << channel
402  << " (" << chan << ") not given signal type." << std::endl; }
403 
404  return sigt;
405  }
406 
407  //----------------------------------------------------------------------------
409  {
410  raw::ChannelID_t chan = channel % fChannelsPerAPA;
411  View_t view = geo::kU;
412 
413  // instead of calling channel to wire, we can make use of the way we
414  // up channels among APAs;
415  // Plane 0: U, Plane 1: V, Plane 2: W
416  if( chan < fFirstChannelInNextPlane[0][0][0] ){ view = geo::kU; }
417  else if( (chan >= fFirstChannelInThisPlane[0][0][1]) &&
418  (chan < fFirstChannelInNextPlane[0][0][1]) ){ view = geo::kV; }
419  else if( (chan >= fFirstChannelInThisPlane[0][0][2]) &&
420  (chan < fFirstChannelInNextPlane[0][0][2]) ){ view = geo::kZ; }
421  else{ mf::LogWarning("BadChannelViewType") << "Channel " << channel
422  << " (" << chan << ") not given view type."; }
423 
424  return view;
425  }
426 
427  //----------------------------------------------------------------------------
428  std::set<View_t> const& ChannelMapAPAAlg::Views() const
429  {
430  return fViews;
431  }
432 
433  //----------------------------------------------------------------------------
434  std::set<PlaneID> const& ChannelMapAPAAlg::PlaneIDs() const
435  {
436  return fPlaneIDs;
437  }
438 
439  //----------------------------------------------------------------------------
440  unsigned int ChannelMapAPAAlg::NOpChannels(unsigned int NOpDets) const
441  {
442  return fChannelsPerOpDet*NOpDets;
443  }
444 
445  //----------------------------------------------------------------------------
446  unsigned int ChannelMapAPAAlg::NOpHardwareChannels(unsigned int opDet) const
447  {
448  return fChannelsPerOpDet;
449  }
450 
451  //----------------------------------------------------------------------------
452  unsigned int ChannelMapAPAAlg::OpChannel(unsigned int detNum, unsigned int channel) const
453  {
454  unsigned int uniqueChannel = (detNum * fChannelsPerOpDet) + channel;
455  return uniqueChannel;
456  }
457 
458  //----------------------------------------------------------------------------
459  unsigned int ChannelMapAPAAlg::OpDetFromOpChannel(unsigned int opChannel) const
460  {
461  unsigned int detectorNum = (unsigned int) opChannel / fChannelsPerOpDet;
462  return detectorNum;
463  }
464 
465  //----------------------------------------------------------------------------
466  unsigned int ChannelMapAPAAlg::HardwareChannelFromOpChannel(unsigned int opChannel) const
467  {
468  unsigned int channel = opChannel % fChannelsPerOpDet;
469  return channel;
470  }
471 
472  //----------------------------------------------------------------------------
473  unsigned int ChannelMapAPAAlg::NTPCsets
474  (readout::CryostatID const& cryoid) const
475  {
476  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
477  } // ChannelMapAPAAlg::NTPCsets()
478 
479 
480  //----------------------------------------------------------------------------
481  unsigned int ChannelMapAPAAlg::MaxTPCsets() const
482  {
483  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
484  } // ChannelMapAPAAlg::MaxTPCsets()
485 
486 
487  //----------------------------------------------------------------------------
488  bool ChannelMapAPAAlg::HasTPCset(readout::TPCsetID const& tpcsetid) const
489  {
490  return tpcsetid.TPCset < NTPCsets(tpcsetid);
491  } // ChannelMapAPAAlg::HasTPCset()
492 
493 
494  //----------------------------------------------------------------------------
496  (geo::TPCID const& tpcid) const
497  {
498  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
499  } // ChannelMapAPAAlg::TPCtoTPCset()
500 
501 
502  //----------------------------------------------------------------------------
503  std::vector<geo::TPCID> ChannelMapAPAAlg::TPCsetToTPCs
504  (readout::TPCsetID const& tpcsetid) const
505  {
506  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
507  } // ChannelMapAPAAlg::TPCsetToTPCs()
508 
509 
510  //----------------------------------------------------------------------------
512  (readout::TPCsetID const& tpcsetid) const
513  {
514  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
515  } // ChannelMapAPAAlg::FirstTPCinTPCset()
516 
517 
518  //----------------------------------------------------------------------------
519  unsigned int ChannelMapAPAAlg::NROPs
520  (readout::TPCsetID const& tpcsetid) const
521  {
522  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
523  } // ChannelMapAPAAlg::NROPs()
524 
525 
526  //----------------------------------------------------------------------------
527  unsigned int ChannelMapAPAAlg::MaxROPs() const {
528  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
529  } // ChannelMapAPAAlg::MaxROPs()
530 
531 
532  //----------------------------------------------------------------------------
533  bool ChannelMapAPAAlg::HasROP(readout::ROPID const& ropid) const {
534  return ropid.ROP < NROPs(ropid);
535  } // ChannelMapAPAAlg::HasROP()
536 
537 
538  //----------------------------------------------------------------------------
540  (geo::PlaneID const& planeid) const
541  {
542  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
543  } // ChannelMapAPAAlg::WirePlaneToROP()
544 
545 
546  //----------------------------------------------------------------------------
547  std::vector<geo::PlaneID> ChannelMapAPAAlg::ROPtoWirePlanes
548  (readout::ROPID const& ropid) const
549  {
550  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
551  } // ChannelMapAPAAlg::ROPtoWirePlanes()
552 
553 
554  //----------------------------------------------------------------------------
555  std::vector<geo::TPCID> ChannelMapAPAAlg::ROPtoTPCs
556  (readout::ROPID const& ropid) const
557  {
558  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
559  } // ChannelMapAPAAlg::ROPtoTPCs()
560 
561 
562  //----------------------------------------------------------------------------
565  {
566  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
567  } // ChannelMapAPAAlg::ROPtoTPCs()
568 
569 
570  //----------------------------------------------------------------------------
572  (readout::ROPID const& ropid) const
573  {
574  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
575  } // ChannelMapAPAAlg::FirstChannelInROP()
576 
577 
578  //----------------------------------------------------------------------------
580  (readout::ROPID const& ropid) const
581  {
582  throw cet::exception("ChannelMapAPAAlg") << __func__ << " not implemented!\n";
583  } // ChannelMapAPAAlg::FirstWirePlaneInROP()
584 
585 
586 } // namespace
unsigned int fNchannels
number of channels in the detector
float fWireSortingInZ
+1 if the wire ID order follow z (larger z, or smaller intercept => larger wire ID); -1 otherwise ...
std::set< View_t > fViews
vector of the views present in the detector
void GetStart(double *xyz) const
Definition: WireGeo.h:157
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< unsigned int > fWiresInPlane
std::vector< unsigned int > nAnchoredWires
Encapsulate the construction of a single cyostat.
virtual bool HasROP(readout::ROPID const &ropid) const override
SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Planes which measure V.
Definition: geo_types.h:130
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.
std::vector< double > fSinOrientation
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.
virtual 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.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
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
Planes which measure Z direction.
Definition: geo_types.h:132
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 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< raw::ChannelID_t > fFirstChannelInThisPlane
std::set< View_t > const & Views() const
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
raw::ChannelID_t fTopChannel
book keeping highest channel #
unsigned int fChannelsPerAPA
PlaneInfoMap_t< PlaneData_t > fPlaneData
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
Planes which measure U.
Definition: geo_types.h:129
unsigned int OpChannel(unsigned int detNum, unsigned int channel=0) const override
Returns the channel ID of the specified hardware channel.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
ROPID_t ROP
Index of the readout plane within its TPC set.
Signal from induction planes.
Definition: geo_types.h:145
void swap(Handle< T > &a, Handle< T > &b)
std::vector< double > fOrientation
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
virtual unsigned int MaxROPs() const override
enum geo::_plane_sigtype SigType_t
T get(std::string const &key) const
Definition: ParameterSet.h:271
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
unsigned int NOpHardwareChannels(unsigned int opDet) const override
Returns the number of channels in the specified optical detectors.
p
Definition: test.py:223
Encapsulate the geometry of an auxiliary detector.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
std::vector< double > fWirePitch
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
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
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
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
std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
Encapsulate the geometry of a wire.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
virtual unsigned int MaxTPCsets() const override
unsigned int OpDetFromOpChannel(unsigned int opChannel) const override
Returns the optical detector the specified optical channel belongs.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Encapsulate the construction of a single detector plane.
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.
unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const override
Returns the hardware channel number of specified optical channel.
void GetEnd(double *xyz) const
Definition: WireGeo.h:163
unsigned int NOpChannels(unsigned int NOpDets) const override
Returns the number of optical channels contained in some detectors.
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool WireIDincreasesWithZ() const
Returns whether the higher z wires have higher wire ID.
Definition: PlaneGeo.cxx:525
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
all data we need for each APA
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:561
ChannelMapAPAAlg(fhicl::ParameterSet const &p)
Access the description of detector geometry.
unsigned int fChannelsPerOpDet
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
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
recob::tracking::Plane Plane
Definition: TrackState.h:17
LArSoft geometry interface.
Definition: ChannelGeo.h:16
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
View_t View(raw::ChannelID_t const channel) const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
Encapsulate the construction of a single detector plane.
Interface to algorithm class for a specific detector channel mapping.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
Signal from collection planes.
Definition: geo_types.h:146
std::vector< double > fCosOrientation