LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
LArPandoraGeometry.cxx
Go to the documentation of this file.
1 
8 
10 #include "cetlib_except/exception.h"
11 
17 
20 
21 #include <iomanip>
22 #include <set>
23 
24 namespace lar_pandora {
25 
27  const bool useActiveBoundingBox)
28  {
29  // Detector gaps can only be loaded once - throw an exception if the output lists are already filled
30  if (!listOfGaps.empty())
31  throw cet::exception("LArPandora")
32  << " LArPandoraGeometry::LoadDetectorGaps --- the list of gaps already exists ";
33 
34  // Loop over drift volumes and write out the dead regions at their boundaries
35  LArDriftVolumeList driftVolumeList;
36  LArPandoraGeometry::LoadGeometry(driftVolumeList, useActiveBoundingBox);
37 
39 
40  for (LArDriftVolumeList::const_iterator iter1 = driftVolumeList.begin(),
41  iterEnd1 = driftVolumeList.end();
42  iter1 != iterEnd1;
43  ++iter1) {
44  const LArDriftVolume& driftVolume1 = *iter1;
45 
46  for (LArDriftVolumeList::const_iterator iter2 = iter1, iterEnd2 = driftVolumeList.end();
47  iter2 != iterEnd2;
48  ++iter2) {
49  const LArDriftVolume& driftVolume2 = *iter2;
50 
51  if (driftVolume1.GetVolumeID() == driftVolume2.GetVolumeID()) continue;
52 
53  const float maxDisplacement(LArDetectorGap::GetMaxGapSize());
54 
55  const float deltaX(std::fabs(driftVolume1.GetCenterX() - driftVolume2.GetCenterX()));
56  const float deltaY(std::fabs(driftVolume1.GetCenterY() - driftVolume2.GetCenterY()));
57  const float deltaZ(std::fabs(driftVolume1.GetCenterZ() - driftVolume2.GetCenterZ()));
58 
59  const float widthX(0.5f * (driftVolume1.GetWidthX() + driftVolume2.GetWidthX()));
60  const float widthY(0.5f * (driftVolume1.GetWidthY() + driftVolume2.GetWidthY()));
61  const float widthZ(0.5f * (driftVolume1.GetWidthZ() + driftVolume2.GetWidthZ()));
62 
63  const float gapX(deltaX - widthX);
64  const float gapY(deltaY - widthY);
65  const float gapZ(deltaZ - widthZ);
66 
67  const float X1((driftVolume1.GetCenterX() < driftVolume2.GetCenterX()) ?
68  (driftVolume1.GetCenterX() + 0.5f * driftVolume1.GetWidthX()) :
69  (driftVolume2.GetCenterX() + 0.5f * driftVolume2.GetWidthX()));
70  const float X2((driftVolume1.GetCenterX() > driftVolume2.GetCenterX()) ?
71  (driftVolume1.GetCenterX() - 0.5f * driftVolume1.GetWidthX()) :
72  (driftVolume2.GetCenterX() - 0.5f * driftVolume2.GetWidthX()));
73  const float Y1(std::min((driftVolume1.GetCenterY() - 0.5f * driftVolume1.GetWidthY()),
74  (driftVolume2.GetCenterY() - 0.5f * driftVolume2.GetWidthY())));
75  const float Y2(std::max((driftVolume1.GetCenterY() + 0.5f * driftVolume1.GetWidthY()),
76  (driftVolume2.GetCenterY() + 0.5f * driftVolume2.GetWidthY())));
77  const float Z1(std::min((driftVolume1.GetCenterZ() - 0.5f * driftVolume1.GetWidthZ()),
78  (driftVolume2.GetCenterZ() - 0.5f * driftVolume2.GetWidthZ())));
79  const float Z2(std::max((driftVolume1.GetCenterZ() + 0.5f * driftVolume1.GetWidthZ()),
80  (driftVolume2.GetCenterZ() + 0.5f * driftVolume2.GetWidthZ())));
81 
82  geo::Vector_t gaps(gapX, gapY, gapZ), deltas(deltaX, deltaY, deltaZ);
83  if (detType->CheckDetectorGapSize(gaps, deltas, maxDisplacement)) {
84  geo::Point_t point1(X1, Y1, Z1), point2(X2, Y2, Z2);
85  geo::Vector_t widths(widthX, widthY, widthZ);
86  listOfGaps.emplace_back(detType->CreateDetectorGap(point1, point2, widths));
87  }
88  }
89 
90  detType->LoadDaughterDetectorGaps(driftVolume1, LArDetectorGap::GetMaxGapSize(), listOfGaps);
91  }
92  }
93 
94  //------------------------------------------------------------------------------------------------------------------------------------------
95 
97  LArDriftVolumeMap& outputVolumeMap,
98  const bool useActiveBoundingBox)
99  {
100  if (!outputVolumeList.empty())
101  throw cet::exception("LArPandora")
102  << " LArPandoraGeometry::LoadGeometry --- the list of drift volumes already exists ";
103 
104  LArPandoraGeometry::LoadGeometry(outputVolumeList, useActiveBoundingBox);
105 
106  // Create mapping between tpc/cstat labels and drift volumes
107  for (const LArDriftVolume& driftVolume : outputVolumeList) {
108  for (const LArDaughterDriftVolume& tpcVolume : driftVolume.GetTpcVolumeList()) {
109  (void)outputVolumeMap.insert(LArDriftVolumeMap::value_type(
110  LArPandoraGeometry::GetTpcID(tpcVolume.GetCryostat(), tpcVolume.GetTpc()), driftVolume));
111  }
112  }
113  }
114 
115  //------------------------------------------------------------------------------------------------------------------------------------------
116 
117  unsigned int LArPandoraGeometry::GetVolumeID(const LArDriftVolumeMap& driftVolumeMap,
118  const unsigned int cstat,
119  const unsigned int tpc)
120  {
121  if (driftVolumeMap.empty())
122  throw cet::exception("LArPandora")
123  << " LArPandoraGeometry::GetVolumeID --- detector geometry map is empty";
124 
126  driftVolumeMap.find(LArPandoraGeometry::GetTpcID(cstat, tpc));
127 
128  if (driftVolumeMap.end() == iter)
129  throw cet::exception("LArPandora")
130  << " LArPandoraGeometry::GetVolumeID --- found a TPC that doesn't belong to a drift volume";
131 
132  return iter->second.GetVolumeID();
133  }
134 
135  //------------------------------------------------------------------------------------------------------------------------------------------
136 
137  unsigned int LArPandoraGeometry::GetDaughterVolumeID(const LArDriftVolumeMap& driftVolumeMap,
138  const unsigned int cstat,
139  const unsigned int tpc)
140  {
141  if (driftVolumeMap.empty())
142  throw cet::exception("LArPandora")
143  << " LArPandoraGeometry::GetDaughterVolumeID --- detector geometry map is empty";
144 
146  driftVolumeMap.find(LArPandoraGeometry::GetTpcID(cstat, tpc));
147 
148  if (driftVolumeMap.end() == iter)
149  throw cet::exception("LArPandora") << " LArPandoraGeometry::GetDaughterVolumeID --- found a "
150  "TPC volume that doesn't belong to a drift volume";
151 
153  iterDghtr = iter->second.GetTpcVolumeList().begin(),
154  iterDghtrEnd = iter->second.GetTpcVolumeList().end();
155  iterDghtr != iterDghtrEnd;
156  ++iterDghtr) {
157  const LArDaughterDriftVolume& daughterVolume(*iterDghtr);
158  if (cstat == daughterVolume.GetCryostat() && tpc == daughterVolume.GetTpc())
159  return std::distance(iter->second.GetTpcVolumeList().begin(), iterDghtr);
160  }
161  throw cet::exception("LArPandora")
162  << " LArPandoraGeometry::GetDaughterVolumeID --- found a daughter volume that doesn't belong "
163  "to the drift volume ";
164  }
165 
166  //------------------------------------------------------------------------------------------------------------------------------------------
167 
169  const unsigned int tpc,
170  const geo::View_t hit_View)
171  {
172  const bool switchUV(LArPandoraGeometry::ShouldSwitchUV(cstat, tpc));
173 
174  // ATTN This implicitly assumes that there will be u, v and (maybe) one of either w or y views
175  if ((hit_View == geo::kW) || (hit_View == geo::kY)) { return hit_View; }
176  else if (hit_View == geo::kU) {
177  return (switchUV ? geo::kV : geo::kU);
178  }
179  else if (hit_View == geo::kV) {
180  return (switchUV ? geo::kU : geo::kV);
181  }
182 
183  throw cet::exception("LArPandora")
184  << " LArPandoraGeometry::GetGlobalView --- found an unknown plane view (not U, V or W) ";
185  }
186 
187  //------------------------------------------------------------------------------------------------------------------------------------------
188 
189  unsigned int LArPandoraGeometry::GetTpcID(const unsigned int cstat, const unsigned int tpc)
190  {
191  // We assume there will never be more than 10000 TPCs in a cryostat!
192  if (tpc >= 10000)
193  throw cet::exception("LArPandora")
194  << " LArPandoraGeometry::GetTpcID --- found a TPC with an ID greater than 10000 ";
195 
196  return ((10000 * cstat) + tpc);
197  }
198 
199  //------------------------------------------------------------------------------------------------------------------------------------------
200 
201  bool LArPandoraGeometry::ShouldSwitchUV(const unsigned int cstat, const unsigned int tpc)
202  {
203  // We determine whether U and V views should be switched by checking the drift direction
205 
206  const bool isPositiveDrift(theGeometry->TPC({cstat, tpc}).DriftSign() ==
208  return LArPandoraGeometry::ShouldSwitchUV(isPositiveDrift);
209  }
210 
211  //------------------------------------------------------------------------------------------------------------------------------------------
212 
213  bool LArPandoraGeometry::ShouldSwitchUV(const bool isPositiveDrift)
214  {
215  // ATTN: In the dual phase scenario the wire planes pointing along two orthogonal directions and so interchanging U and V is unnecessary
216  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
217  if (wireReadoutGeom.MaxPlanes() == 2) return false;
218 
219  // We assume that all multiple drift volume detectors have the APA - CPA - APA - CPA design
220  return isPositiveDrift;
221  }
222 
223  //------------------------------------------------------------------------------------------------------------------------------------------
224 
226  const bool useActiveBoundingBox)
227  {
228  // This method will group TPCs into "drift volumes" (these are regions of the detector that share a common drift direction,
229  // common range of x coordinates, and common detector parameters such as wire pitch and wire angle).
230  if (!driftVolumeList.empty())
231  throw cet::exception("LArPandora")
232  << " LArPandoraGeometry::LoadGeometry --- detector geometry has already been loaded ";
233 
234  typedef std::set<unsigned int> UIntSet;
235 
236  // Pandora requires three independent images, and ability to correlate features between images (via wire angles and transformation plugin).
239  const float wirePitchU(detType->WirePitchU());
240  const float wirePitchV(detType->WirePitchV());
241  const float wirePitchW(detType->WirePitchW());
242  const float maxDeltaTheta(0.01f); // leave this hard-coded for now
243 
244  // Loop over cryostats
245  for (auto const& cryostat : theGeometry->Iterate<geo::CryostatGeo>()) {
246  auto const icstat = cryostat.ID().Cryostat;
247  UIntSet cstatList;
248 
249  // Loop over TPCs in in this cryostat
250  for (auto const& theTpc1 : theGeometry->Iterate<geo::TPCGeo>(cryostat.ID())) {
251  auto const itpc1 = theTpc1.ID().TPC;
252  if (cstatList.end() != cstatList.find(itpc1)) continue;
253 
254  // Use this TPC to seed a drift volume
255  cstatList.insert(itpc1);
256 
257  const float wireAngleU(detType->WireAngleU(itpc1, icstat));
258  const float wireAngleV(detType->WireAngleV(itpc1, icstat));
259  const float wireAngleW(detType->WireAngleW(itpc1, icstat));
260 
261  auto const worldCoord1 = theTpc1.GetCenter();
262 
263  float driftMinX(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MinX() :
264  (worldCoord1.X() - theTpc1.ActiveHalfWidth()));
265  float driftMaxX(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MaxX() :
266  (worldCoord1.X() + theTpc1.ActiveHalfWidth()));
267  float driftMinY(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MinY() :
268  (worldCoord1.Y() - theTpc1.ActiveHalfHeight()));
269  float driftMaxY(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MaxY() :
270  (worldCoord1.Y() + theTpc1.ActiveHalfHeight()));
271  float driftMinZ(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MinZ() :
272  (worldCoord1.Z() - 0.5f * theTpc1.ActiveLength()));
273  float driftMaxZ(useActiveBoundingBox ? theTpc1.ActiveBoundingBox().MaxZ() :
274  (worldCoord1.Z() + 0.5f * theTpc1.ActiveLength()));
275 
276  const double min1(
277  useActiveBoundingBox ?
278  (0.5 * (driftMinX + driftMaxX) - 0.25 * std::fabs(driftMaxX - driftMinX)) :
279  (worldCoord1.X() - 0.5 * theTpc1.ActiveHalfWidth()));
280  const double max1(
281  useActiveBoundingBox ?
282  (0.5 * (driftMinX + driftMaxX) + 0.25 * std::fabs(driftMaxX - driftMinX)) :
283  (worldCoord1.X() + 0.5 * theTpc1.ActiveHalfWidth()));
284 
285  const bool isPositiveDrift(theTpc1.DriftSign() == geo::DriftSign::Positive);
286 
287  UIntSet tpcList;
288  tpcList.insert(itpc1);
289 
290  LArDaughterDriftVolumeList tpcVolumeList;
291  tpcVolumeList.emplace_back(LArDaughterDriftVolume(icstat,
292  itpc1,
293  0.5f * (driftMaxX + driftMinX),
294  0.5f * (driftMaxY + driftMinY),
295  0.5f * (driftMaxZ + driftMinZ),
296  (driftMaxX - driftMinX),
297  (driftMaxY - driftMinY),
298  (driftMaxZ - driftMinZ)));
299 
300  // Now identify the other TPCs associated with this drift volume
301  for (auto const& theTpc2 : theGeometry->Iterate<geo::TPCGeo>(cryostat.ID())) {
302  auto const itpc2 = theTpc2.ID().TPC;
303  if (cstatList.end() != cstatList.find(itpc2)) continue;
304  if (theTpc1.DriftSign() != theTpc2.DriftSign()) continue;
305 
306  const float dThetaU(detType->WireAngleU(itpc1, icstat) -
307  detType->WireAngleU(itpc2, icstat));
308  const float dThetaV(detType->WireAngleV(itpc1, icstat) -
309  detType->WireAngleV(itpc2, icstat));
310  const float dThetaW(detType->WireAngleW(itpc1, icstat) -
311  detType->WireAngleW(itpc2, icstat));
312  if (dThetaU > maxDeltaTheta || dThetaV > maxDeltaTheta || dThetaW > maxDeltaTheta)
313  continue;
314 
315  auto const worldCoord2 = theTpc2.GetCenter();
316 
317  const float driftMinX2(useActiveBoundingBox ?
318  theTpc2.ActiveBoundingBox().MinX() :
319  (worldCoord2.X() - theTpc2.ActiveHalfWidth()));
320  const float driftMaxX2(useActiveBoundingBox ?
321  theTpc2.ActiveBoundingBox().MaxX() :
322  (worldCoord2.X() + theTpc2.ActiveHalfWidth()));
323 
324  const double min2(
325  useActiveBoundingBox ?
326  (0.5 * (driftMinX2 + driftMaxX2) - 0.25 * std::fabs(driftMaxX2 - driftMinX2)) :
327  (worldCoord2.X() - 0.5 * theTpc2.ActiveHalfWidth()));
328  const double max2(
329  useActiveBoundingBox ?
330  (0.5 * (driftMinX2 + driftMaxX2) + 0.25 * std::fabs(driftMaxX2 - driftMinX2)) :
331  (worldCoord2.X() + 0.5 * theTpc2.ActiveHalfWidth()));
332 
333  if ((min2 > max1) || (min1 > max2)) continue;
334 
335  cstatList.insert(itpc2);
336  tpcList.insert(itpc2);
337 
338  const float driftMinY2(useActiveBoundingBox ?
339  theTpc2.ActiveBoundingBox().MinY() :
340  (worldCoord2.Y() - theTpc2.ActiveHalfHeight()));
341  const float driftMaxY2(useActiveBoundingBox ?
342  theTpc2.ActiveBoundingBox().MaxY() :
343  (worldCoord2.Y() + theTpc2.ActiveHalfHeight()));
344  const float driftMinZ2(useActiveBoundingBox ?
345  theTpc2.ActiveBoundingBox().MinZ() :
346  (worldCoord2.Z() - 0.5f * theTpc2.ActiveLength()));
347  const float driftMaxZ2(useActiveBoundingBox ?
348  theTpc2.ActiveBoundingBox().MaxZ() :
349  (worldCoord2.Z() + 0.5f * theTpc2.ActiveLength()));
350 
351  driftMinX = std::min(driftMinX, driftMinX2);
352  driftMaxX = std::max(driftMaxX, driftMaxX2);
353  driftMinY = std::min(driftMinY, driftMinY2);
354  driftMaxY = std::max(driftMaxY, driftMaxY2);
355  driftMinZ = std::min(driftMinZ, driftMinZ2);
356  driftMaxZ = std::max(driftMaxZ, driftMaxZ2);
357 
358  tpcVolumeList.emplace_back(LArDaughterDriftVolume(icstat,
359  itpc2,
360  0.5f * (driftMaxX2 + driftMinX2),
361  0.5f * (driftMaxY2 + driftMinY2),
362  0.5f * (driftMaxZ2 + driftMinZ2),
363  (driftMaxX2 - driftMinX2),
364  (driftMaxY2 - driftMinY2),
365  (driftMaxZ2 - driftMinZ2)));
366  }
367 
368  // Create new daughter drift volume (volume ID = 0 to N-1)
369  driftVolumeList.emplace_back(driftVolumeList.size(),
370  isPositiveDrift,
371  wirePitchU,
372  wirePitchV,
373  wirePitchW,
374  wireAngleU,
375  wireAngleV,
376  wireAngleW,
377  0.5f * (driftMaxX + driftMinX),
378  0.5f * (driftMaxY + driftMinY),
379  0.5f * (driftMaxZ + driftMinZ),
380  (driftMaxX - driftMinX),
381  (driftMaxY - driftMinY),
382  (driftMaxZ - driftMinZ),
383  (wirePitchU + wirePitchV + wirePitchW + 0.1f),
384  tpcVolumeList);
385  }
386  }
387 
388  if (driftVolumeList.empty())
389  throw cet::exception("LArPandora") << " LArPandoraGeometry::LoadGeometry --- failed to find "
390  "any drift volumes in this detector geometry ";
391  }
392 
393  //------------------------------------------------------------------------------------------------------------------------------------------
394 
396  LArDriftVolumeList& daughterVolumeList)
397  {
398  // This method will create one or more daughter volumes (these share a common drift orientation along the X-axis,
399  // have parallel or near-parallel wire angles, and similar wire pitches)
400  //
401  // ATTN: we assume that the U and V planes have equal and opposite wire orientations
402 
403  if (!daughterVolumeList.empty())
404  throw cet::exception("LArPandora") << " LArPandoraGeometry::LoadGlobalDaughterGeometry --- "
405  "daughter geometry has already been loaded ";
406 
407  if (driftVolumeList.empty())
408  throw cet::exception("LArPandora") << " LArPandoraGeometry::LoadGlobalDaughterGeometry --- "
409  "detector geometry has not yet been loaded ";
410 
411  std::cout << "The size of the drif list is: " << driftVolumeList.size() << std::endl;
412  int count(0);
413  // Create daughter drift volumes
414  for (const LArDriftVolume& driftVolume : driftVolumeList) {
415  std::cout << "Looking at dau vol: " << count++ << std::endl;
416  const bool switchViews(LArPandoraGeometry::ShouldSwitchUV(driftVolume.IsPositiveDrift()));
417 
418  const float daughterWirePitchU(switchViews ? driftVolume.GetWirePitchV() :
419  driftVolume.GetWirePitchU());
420  const float daughterWirePitchV(switchViews ? driftVolume.GetWirePitchU() :
421  driftVolume.GetWirePitchV());
422  const float daughterWirePitchW(driftVolume.GetWirePitchW());
423  const float daughterWireAngleU(switchViews ? driftVolume.GetWireAngleV() :
424  driftVolume.GetWireAngleU());
425  const float daughterWireAngleV(switchViews ? driftVolume.GetWireAngleU() :
426  driftVolume.GetWireAngleV());
427  const float daughterWireAngleW(driftVolume.GetWireAngleW());
428 
429  daughterVolumeList.push_back(LArDriftVolume(driftVolume.GetVolumeID(),
430  driftVolume.IsPositiveDrift(),
431  daughterWirePitchU,
432  daughterWirePitchV,
433  daughterWirePitchW,
434  daughterWireAngleU,
435  daughterWireAngleV,
436  daughterWireAngleW,
437  driftVolume.GetCenterX(),
438  driftVolume.GetCenterY(),
439  driftVolume.GetCenterZ(),
440  driftVolume.GetWidthX(),
441  driftVolume.GetWidthY(),
442  driftVolume.GetWidthZ(),
443  driftVolume.GetSigmaUVZ(),
444  driftVolume.GetTpcVolumeList()));
445  }
446 
447  if (daughterVolumeList.empty())
448  throw cet::exception("LArPandora") << " LArPandoraGeometry::LoadGlobalDaughterGeometry --- "
449  "failed to create daughter geometry list ";
450  }
451 
452  //------------------------------------------------------------------------------------------------------------------------------------------
453  //------------------------------------------------------------------------------------------------------------------------------------------
454 
455  LArDriftVolume::LArDriftVolume(const unsigned int volumeID,
456  const bool isPositiveDrift,
457  const float wirePitchU,
458  const float wirePitchV,
459  const float wirePitchW,
460  const float wireAngleU,
461  const float wireAngleV,
462  const float wireAngleW,
463  const float centerX,
464  const float centerY,
465  const float centerZ,
466  const float widthX,
467  const float widthY,
468  const float widthZ,
469  const float sigmaUVZ,
470  const LArDaughterDriftVolumeList& tpcVolumeList)
471  : m_volumeID(volumeID)
472  , m_isPositiveDrift(isPositiveDrift)
473  , m_wirePitchU(wirePitchU)
474  , m_wirePitchV(wirePitchV)
475  , m_wirePitchW(wirePitchW)
476  , m_wireAngleU(wireAngleU)
477  , m_wireAngleV(wireAngleV)
478  , m_wireAngleW(wireAngleW)
479  , m_centerX(centerX)
480  , m_centerY(centerY)
481  , m_centerZ(centerZ)
482  , m_widthX(widthX)
483  , m_widthY(widthY)
484  , m_widthZ(widthZ)
485  , m_sigmaUVZ(sigmaUVZ)
486  , m_tpcVolumeList(tpcVolumeList)
487  {}
488 
489 } // namespace lar_pandora
float GetWidthZ() const
Return Z span of drift volume.
static geo::View_t GetGlobalView(const unsigned int cstat, const unsigned int tpc, const geo::View_t hit_View)
Convert to global coordinate system.
daughter drift volume class to hold properties of daughter drift volumes
static void LoadGeometry(LArDriftVolumeList &outputVolumeList, LArDriftVolumeMap &outputVolumeMap, const bool useActiveBoundingBox)
Load drift volume geometry.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
virtual float WireAngleV(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped V view.
LArDriftVolume(const unsigned int volumeID, const bool isPositiveDrift, const float wirePitchU, const float wirePitchV, const float wirePitchW, const float wireAngleU, const float wireAngleV, const float wireAngleW, const float centerX, const float centerY, const float centerZ, const float widthX, const float widthY, const float widthZ, const float sigmaUVZ, const LArDaughterDriftVolumeList &tpcVolumeList)
Constructor.
Helper functions for extracting detector geometry for use in reconsruction.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:132
std::map< unsigned int, LArDriftVolume > LArDriftVolumeMap
unsigned int GetCryostat() const
Return cryostat ID.
Empty interface to map pandora to specifics in the LArSoft geometry.
Geometry information for a single TPC.
Definition: TPCGeo.h:33
std::vector< LArDriftVolume > LArDriftVolumeList
static unsigned int GetVolumeID(const LArDriftVolumeMap &driftVolumeMap, const unsigned int cstat, const unsigned int tpc)
Get drift volume ID from a specified cryostat/tpc pair.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
intermediate_table::const_iterator const_iterator
virtual float WirePitchV() const =0
The wire pitch of the mapped V view.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:42
Planes which measure Y direction.
Definition: geo_types.h:135
Double_t X2
Definition: plot.C:263
float GetCenterZ() const
Return Z position at centre of drift volume.
TFile f
Definition: plotHisto.C:6
static unsigned int GetDaughterVolumeID(const LArDriftVolumeMap &driftVolumeMap, const unsigned int cstat, const unsigned int tpc)
Get daughter volume ID from a specified cryostat/tpc pair.
virtual float WireAngleU(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped U view.
Planes which measure U.
Definition: geo_types.h:131
static unsigned int GetTpcID(const unsigned int cstat, const unsigned int tpc)
Generate a unique identifier for each TPC.
virtual float WirePitchU() const =0
The wire pitch of the mapped U view.
virtual bool CheckDetectorGapSize(const geo::Vector_t &gaps, const geo::Vector_t &deltas, const float maxDisplacement) const =0
Check whether a gap size is small enough to be registered as a detector gap.
float GetCenterX() const
Return X position at centre of drift volume.
Double_t X1
Definition: plot.C:263
Double_t Y1
Definition: plot.C:263
unsigned int GetVolumeID() const
Return unique ID.
static bool ShouldSwitchUV(const unsigned int cstat, const unsigned int tpc)
Return whether U/V should be switched in global coordinate system for this cryostat/tpc.
static void LoadGlobalDaughterGeometry(const LArDriftVolumeList &driftVolumeList, LArDriftVolumeList &daughterVolumeList)
This method will create one or more daughter volumes (these share a common drift orientation along th...
virtual void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const =0
Create detector gaps for all daughter volumes in a logical TPC volume.
static void LoadDetectorGaps(LArDetectorGapList &listOfGaps, const bool useActiveBoundingBox)
Load the 2D gaps that go with the chosen geometry.
virtual float WireAngleW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped V view.
geo::DriftSign DriftSign() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.h:79
virtual LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const =0
Create a detector gap.
virtual float WirePitchW() const =0
The wire pitch of the mapped W view.
Double_t Z2
Definition: plot.C:263
Encapsulate the geometry of a wire .
std::vector< LArDaughterDriftVolume > LArDaughterDriftVolumeList
Double_t Z1
Definition: plot.C:263
Drift towards positive values.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
static float GetMaxGapSize() noexcept
Get maximum gap size.
LArPandoraDetectorType * GetDetectorType()
Factory class that returns the correct detector type interface.
Encapsulate the construction of a single detector plane .
std::vector< LArDetectorGap > LArDetectorGapList
float GetWidthY() const
Return Y span of drift volume.
float GetCenterY() const
Return Y position at centre of drift volume.
drift volume class to hold properties of drift volume
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:133
float GetWidthX() const
Return X span of drift volume.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
Helper functions for extracting detector geometry for use in reconsruction.
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Double_t Y2
Definition: plot.C:263
Encapsulate the construction of a single detector plane .
unsigned int GetTpc() const
Return tpc ID.