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