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