All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CryostatGeo.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file larcorealg/Geometry/CryostatGeo.h
3 /// \brief Encapsulate the construction of a single cyostat
4 /// \ingroup Geometry
5 ///
6 /// \author brebel@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef LARCOREALG_GEOMETRY_CRYOSTATGEO_H
9 #define LARCOREALG_GEOMETRY_CRYOSTATGEO_H
10 
11 // LArSoft libraries
16 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect
18 #include "larcorealg/Geometry/LocalTransformationGeo.h" // for LocalT...
19 #include "larcorealg/Geometry/WireGeo.h" // for WireGeo
21 #include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" // geo::Point_t
22 
23 // ROOT libraries
24 #include "Math/GenVector/DisplacementVector3D.h"
25 #include "Math/GenVector/PositionVector3D.h"
26 #include "Math/GenVector/Transform3D.h"
27 #include "TGeoVolume.h"
28 
29 // C/C++ standard libraries
30 #include <vector>
31 #include <string>
32 
33 // forward declarations
34 class TGeoNode;
35 
36 namespace geo {
37 
38  class GeoObjectSorter;
39 
40  //......................................................................
41  /// @brief Geometry information for a single cryostat.
42  /// @ingroup Geometry
44 
45  public:
46 
47  /// Type used internally to store the TPCs.
48  using TPCList_t = std::vector<geo::TPCGeo>;
49 
50  /// Type used internally to store the optical detectors.
51  using OpDetList_t = std::vector<geo::OpDetGeo>;
52 
54 
55  /// Type returned by `IterateElements()`.
56  using ElementIteratorBox = TPCList_t const&;
57 
58  /// @{
59  /**
60  * @name Types for geometry-local reference vectors.
61  *
62  * These types represents points and displacement vectors in the reference
63  * frame defined in the cryostat geometry box from the GDML geometry
64  * description.
65  *
66  * No alias is explicitly defined for the LArSoft global vector types,
67  * `geo::Point_t` and `geo::Vector_t`.
68  *
69  * Remember the `LocalPoint_t` and `LocalVector_t` vectors from different
70  * instances of `geo::CryostatGeo` have the same type but are not
71  * compatible.
72  */
73 
74  /// Tag for vectors in the "local" GDML coordinate frame of the cryostat.
76 
77  /// Type of points in the local GDML cryostat frame.
79 
80  /// Type of displacement vectors in the local GDML cryostat frame.
82 
83  ///@}
84 
85 
86  /// Construct a representation of a single cryostat of the detector.
88  TGeoNode const& node, geo::TransformationMatrix&& trans,
89  TPCList_t&& TPCs, OpDetList_t&& OpDets
90  );
91 
92 
93  /// @{
94  /// @name Cryostat geometry information
95 
96  /// Half width of the cryostat [cm]
97  double HalfWidth() const;
98  /// Half height of the cryostat [cm]
99  double HalfHeight() const;
100  /// Half height of the cryostat [cm]
101  double HalfLength() const;
102  /// Full width of the cryostat [cm]
103  double Width() const { return 2. * HalfWidth(); }
104  /// Full height of the cryostat [cm]
105  double Height() const { return 2. * HalfHeight(); }
106  /// Length of the cryostat [cm]
107  double Length() const { return 2. * HalfLength(); }
108  /// Mass of the cryostat
109  double Mass() const { return fVolume->Weight(); }
110  /// Pointer to ROOT's volume descriptor
111  const TGeoVolume* Volume() const { return fVolume; }
112 
113  /// @brief Returns boundaries of the cryostat (in centimetres).
114  /// @return boundaries in a geo::BoxBoundedGeo
116  { return BoundingBox(); }
117 
118  /// @brief Fills boundaries of the cryostat (in centimetres).
119  /// @param boundaries filled as: [0] -x [1] +x [2] -y [3] +y [4] -z [5] +z
120  void Boundaries(double* boundaries) const;
121 
122 
123  /// Returns the geometrical center of the cryostat.
125  { return Boundaries().Center(); }
126 
127  /// Returns the bounding box of this cryostat.
129  { return static_cast<geo::BoxBoundedGeo const&>(*this); }
130 
131  /// Returns the identifier of this cryostat.
132  geo::CryostatID const& ID() const { return fID; }
133 
134 
135  /**
136  * @brief Prints information about this cryostat.
137  * @tparam Stream type of output stream to use
138  * @param out stream to send the information to
139  * @param indent prepend each line with this string
140  * @param verbosity amount of information printed
141  *
142  * Note that the first line out the output is _not_ indented.
143  *
144  * Verbosity levels
145  * -----------------
146  *
147  * * 0: only cryostat ID
148  * * 1 _(default)_: also center and size
149  * * 2: also number of TPCs, optical detectors, and maximum wires per plane
150  * * and of planes for TPC
151  * * 3: also information on bounding box
152  *
153  * The constant `MaxVerbosity` is set to the highest supported verbosity
154  * level.
155  */
156  template <typename Stream>
157  void PrintCryostatInfo
158  (Stream&& out, std::string indent = "", unsigned int verbosity = 1) const;
159 
160  /**
161  * @brief Returns a string with cryostat information.
162  * @see `PrintCryostatInfo()`
163  *
164  * The arguments and provided information are the same as in
165  * `PrintCryostatInfo()`.
166  */
167  std::string CryostatInfo
168  (std::string indent = "", unsigned int verbosity = 1) const;
169 
170  /// Maximum verbosity supported by `PrintCryostatInfo()`.
171  static constexpr unsigned int MaxVerbosity = 3;
172 
173  /// @}
174 
175 
176  // BEGIN TPC access --------------------------------------------------------
177  /// @{
178  /// @name TPC access
179 
180  /// Number of TPCs in this cryostat.
181  unsigned int NTPC() const { return fTPCs.size(); }
182  /// Alias for `NTPC()`.
183  unsigned int NElements() const { return fTPCs.size(); }
184 
185  /**
186  * @brief Returns whether a TPC with index itpc is present in this cryostat.
187  * @param itpc index of TPC in this cryostat
188  * @return whether the TPC with index itpc is present in this cryostat
189  */
190  bool HasTPC(unsigned int itpc) const { return itpc < NTPC(); }
191 
192  /// Alias for `HasTPC()`.
193  bool HasElement(unsigned int itpc) const { return HasTPC(itpc); }
194 
195  /**
196  * @brief Returns whether the TPC in tpcid is present in this cryostat
197  * @param tpcid full TPC ID
198  * @return whether the TPC in tpcid is present in this cryostat
199  *
200  * The cryostat number in tpcid is ignored, as it is ignored whether tpcid
201  * is invalid.
202  */
203  bool HasTPC(geo::TPCID const& tpcid) const { return HasTPC(tpcid.TPC); }
204  /// Alias for `HasTPC(geo::TPCID const&)`
205  bool HasElement(geo::TPCID const& tpcid) const { return HasTPC(tpcid); }
206 
207  /// @brief Return the itpc'th TPC in the cryostat.
208  /// @throws cet::exception (category "TPCOutOfRange") if no such TPC
209  const TPCGeo& TPC(unsigned int itpc) const;
210 
211  /**
212  * @brief Returns the TPC in tpcid from this cryostat
213  * @param tpcid full TPC ID
214  * @return a constant reference to the TPC in tpcid
215  * @throws cet::exception (category "TPCOutOfRange") if no such TPC
216  *
217  * The cryostat number in tpcid is ignored, as it is ignored whether tpcid
218  * is invalid.
219  */
220  const TPCGeo& TPC(TPCID const& tpcid) const
221  { return TPC(tpcid.TPC); }
222  /// Alias for `TPC()`.
223  const TPCGeo& GetElement(TPCID const& tpcid) const
224  { return TPC(tpcid); }
225 
226 
227  /**
228  * @brief Returns an object suitable for iterating through all TPCs.
229  * @see `IterateTPCs()`
230  *
231  * The returned value can be used in a range-for loop like:
232  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
233  * for (geo::TPCGeo const& tpc: cryo.IterateElements()) { ... }
234  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235  * The resulting sequence exposes the TPCs within the cryostat in their
236  * ID order, from TPC `0` to `NTPC() - 1`.
237  *
238  * This method is designed for templated code, where the object
239  * `obj.IterateElements()` may be a `geo::CryostatGeo` or some other one.
240  * For non-template code, prefer `IterateTPCs()` for clarity.
241  */
243 
244  /**
245  * @brief Returns an object suitable for iterating through all TPCs.
246  * @see `IterateElements()`
247  *
248  * The returned value can be used in a range-for loop like:
249  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
250  * for (geo::TPCGeo const& tpc: cryo.IterateTPCs()) { ... }
251  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252  * The resulting sequence exposes the TPCs within the cryostat in their
253  * ID order, from TPC `0` to `NTPC() - 1`.
254  *
255  * A version of this functionality designed for template code is provided
256  * under the generic name `IterateElements()`.
257  */
259 
260  /**
261  * @brief Returns an object suitable for iterating through all TPCs.
262  * @see `IterateTPCs()`, `IterateElements()`
263  *
264  * The returned value can be used in a range-for loop like:
265  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
266  * for (geo::TPCGeo const& tpc: cryo.TPCs()) { ... }
267  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
268  * The resulting sequence exposes the TPCs within the cryostat in their
269  * ID order, from TPC `0` to `NTPC() - 1`.
270  *
271  * @deprecated `TPCs()` is informally deprecated because it used to return
272  * a collection of `geo::TPCGeo` and it might soon be unable to
273  * do so. For iterations, `IterateTPCs()` is just as good.
274  */
275  auto const& TPCs() const { return fTPCs; }
276 
277 
278  /**
279  * @brief Returns the TPC number itpc from this cryostat.
280  * @param itpc the number of local TPC
281  * @return a constant pointer to the TPC, or nullptr if it does not exist
282  */
283  TPCGeo const* TPCPtr(unsigned int itpc) const
284  { return HasTPC(itpc)? &(fTPCs[itpc]): nullptr; }
285 
286  /**
287  * @brief Returns the TPC in tpcid from this cryostat.
288  * @param tpcid full TPC ID
289  * @return a constant pointer to the TPC, or nullptr if it does not exist
290  *
291  * The cryostat number in tpcid is ignored, as it is ignored whether tpcid
292  * is invalid.
293  */
294  TPCGeo const* TPCPtr(TPCID const& tpcid) const
295  { return TPCPtr(tpcid.TPC); }
296  /// Alias for `TPCPtr()`.
297  TPCGeo const* GetElementPtr(TPCID const& tpcid) const
298  { return TPCPtr(tpcid); }
299 
300  /**
301  * @brief Returns the index of the TPC at specified location
302  * @param worldLoc 3D coordinates of the point (world reference frame)
303  * @param wiggle a small factor (like 1+epsilon) to avoid rounding errors
304  * @return the TPC index, or `geo::TPCID::InvalidID` if no TPC is there
305  * @deprecated Use `PositionToTPCID()` instead
306  */
308  (double const worldLoc[3], double const wiggle) const;
309 
310  /**
311  * @brief Returns the ID of the TPC at specified location.
312  * @param point 3D coordinates of the point (world reference frame)
313  * @param wiggle a small factor (like 1+epsilon) to avoid rounding errors
314  * @return the ID of the TPC at the specified point (invalid ID if none)
315  */
317  (geo::Point_t const& point, double wiggle) const;
318 
319  /**
320  * @brief Returns the ID of the TPC at specified location.
321  * @param point the location (world reference frame)
322  * @param wiggle a small factor (like 1+epsilon) to avoid rounding errors
323  * @return the ID of the TPC at the specified point (invalid ID if none)
324  */
325  TPCGeo const& PositionToTPC
326  (geo::Point_t const& point, double wiggle) const;
327  /**
328  * @brief Returns the ID of the TPC at specified location.
329  * @param worldLoc 3D coordinates of the point (world reference frame)
330  * @param wiggle a small factor (like 1+epsilon) to avoid rounding errors
331  * @return the ID of the TPC at the specified point (invalid ID if none)
332  */
333  TPCGeo const& PositionToTPC
334  (double const worldLoc[3], double wiggle) const
335  { return PositionToTPC(geo::vect::makePointFromCoords(worldLoc), wiggle); }
336 
337  /**
338  * @brief Returns a pointer to the TPC at specified location.
339  * @param point position in space [cm]
340  * @param wiggle a small factor (like 1+&epsilon;) to avoid rounding errors
341  * @return a pointer to the `geo::TPCGeo` at `point` (`nullptr` if none)
342  */
344  (geo::Point_t const& point, double wiggle) const;
345 
346  /// Returns the largest number of planes among the TPCs in this cryostat
347  unsigned int MaxPlanes() const;
348 
349  /// Returns the largest number of wires among the TPCs in this cryostat
350  unsigned int MaxWires() const;
351 
352  /// @}
353  // END TPC access ----------------------------------------------------------
354 
355 
356  // BEGIN Optical detector access -------------------------------------------
357  /// @{
358  /// @name Optical detector access
359 
360  /// Number of optical detectors in this TPC
361  unsigned int NOpDet() const { return fOpDets.size(); }
362 
363  /// Return the iopdet'th optical detector in the cryostat
364  const OpDetGeo& OpDet(unsigned int iopdet) const;
365 
366  /// Returns the index of the optical detector in this cryostat closest to
367  /// `point`.
368  unsigned int GetClosestOpDet(geo::Point_t const& point) const;
369  /// @see `GetClosestOpDet(geo::Point_t const&) const`
370  unsigned int GetClosestOpDet(double const* point) const;
371 
372  /// Returns the optical detector det in this cryostat nearest to `point`.
373  /// If there are no optical detectors, `nullptr` is returned.
374  geo::OpDetGeo const* GetClosestOpDetPtr(geo::Point_t const& point) const;
375 
376  /// Get name of opdet geometry element
377  std::string OpDetGeoName() const { return fOpDetGeoName; }
378 
379  /// @}
380  // END Optical detector access ---------------------------------------------
381 
382  // BEGIN Coordinate transformation -----------------------------------------
383  /// @{
384  /// @name Coordinate transformation
385 
386  /// Transform point from local cryostat frame to world frame.
387  void LocalToWorld(const double* cryo, double* world) const
388  { fTrans.LocalToWorld(cryo, world); }
389 
390  /// Transform point from local cryostat frame to world frame.
391  /// @deprecated This method breaks the distinction between local and global
392  /// vectors, since input and output vectors share the same type;
393  /// use the "official" vector types `geo::Point_t`,
394  /// `geo::CryostatGeo::LocalPoint_t`, `geo::Vector_t` and
395  /// `geo::CryostatGeo::LocalVector_t`, and then use the method
396  /// `geo::CryostatGeo::toWorldCoords()` instead.
397  template <typename Point>
398  [[deprecated("use toWorldCoords() instead")]]
400  { return fTrans.LocalToWorld(local); }
401 
402  /// Transform point from local cryostat frame to world frame.
404  { return fTrans.toWorldCoords(local); }
405 
406  /// Transform direction vector from local to world.
407  void LocalToWorldVect(const double* cryo, double* world) const
408  { fTrans.LocalToWorldVect(cryo, world); }
409 
410  /// Transform direction vector from local to world.
412  { return fTrans.toWorldCoords(local); }
413 
414  /// Transform point from world frame to local cryostat frame.
415  void WorldToLocal(const double* world, double* cryo) const
416  { fTrans.WorldToLocal(world, cryo); }
417 
418  /// Transform point from world frame to local cryostat frame.
419  /// @deprecated This method breaks the distinction between local and global
420  /// vectors, since input and output vectors share the same type;
421  /// use the "official" vector types `geo::Point_t`,
422  /// `geo::CryostatGeo::LocalPoint_t`, `geo::Vector_t` and
423  /// `geo::CryostatGeo::LocalVector_t`, and then use the method
424  /// `geo::CryostatGeo::toLocalCoords()` instead.
425  template <typename Point>
426  [[deprecated("use toLocalCoords() instead")]]
427  Point WorldToLocal(Point const& world) const
428  { return fTrans.WorldToLocal(world); }
429 
430  /// Transform point from world frame to local cryostat frame.
432  { return fTrans.toLocalCoords(world); }
433 
434  /// Transform direction vector from world to local.
435  void WorldToLocalVect(const double* world, double* cryo) const
436  { fTrans.WorldToLocalVect(world, cryo); }
437 
438  /// Transform direction vector from world to local.
440  { return fTrans.toLocalCoords(world); }
441 
442  /// @}
443  // END Coordinate transformation -------------------------------------------
444 
445 
446  /// Method to sort TPCGeo objects
447  void SortSubVolumes(geo::GeoObjectSorter const& sorter);
448 
449 
450  /// Performs all needed updates after geometry has sorted the cryostats
451  void UpdateAfterSorting(geo::CryostatID cryoid);
452 
453  private:
454 
455  void FindTPC(std::vector<const TGeoNode*>& path,
456  unsigned int depth);
457  void MakeTPC(std::vector<const TGeoNode*>& path,
458  int depth);
459 
460  void FindOpDet(std::vector<const TGeoNode*>& path,
461  unsigned int depth);
462  void MakeOpDet(std::vector<const TGeoNode*>& path,
463  int depth);
464 
465  /// Fill the boundary information of the cryostat
466  void InitCryoBoundaries();
467 
468 
469  private:
470 
472  <ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t>;
473 
474  LocalTransformation_t fTrans; ///< Cryostat-to-world transformation.
475  TPCList_t fTPCs; ///< List of tpcs in this cryostat
476  OpDetList_t fOpDets; ///< List of opdets in this cryostat
477  TGeoVolume* fVolume; ///< Total volume of cryostat, called volCryostat in GDML file
478  std::string fOpDetGeoName; ///< Name of opdet geometry elements in gdml
479  geo::CryostatID fID; ///< ID of this cryostat
480 
481  };
482 }
483 
484 
485 //------------------------------------------------------------------------------
486 //--- template implementation
487 //---
488 template <typename Stream>
490  Stream&& out,
491  std::string indent /* = "" */,
492  unsigned int verbosity /* = 1 */
493 ) const {
494 
495  //----------------------------------------------------------------------------
496  out << "Cryostat " << std::string(ID());
497 
498  if (verbosity-- <= 0) return; // 0
499 
500  //----------------------------------------------------------------------------
501  out
502  << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at "
503  << GetCenter();
504 
505  if (verbosity-- <= 0) return; // 1
506 
507  //----------------------------------------------------------------------------
508 
509  out << "\n" << indent
510  << "hosts " << NTPC() << " TPCs (largest number of planes: " << MaxPlanes()
511  << ", of wires: " << MaxWires() << ") and "
512  << NOpDet() << " optical detectors"
513  ;
514 
515  if (verbosity-- <= 0) return; // 2
516 
517  //----------------------------------------------------------------------------
518  // print also the containing box
519  geo::BoxBoundedGeo const& box = BoundingBox();
520  out << "\n" << indent
521  << "bounding box: " << box.Min() << " -- " << box.Max();
522 
523 // if (verbosity-- <= 0) return; // 3
524 
525  //----------------------------------------------------------------------------
526 } // geo::CryostatGeo::PrintCryostatInfo()
527 
528 
529 //------------------------------------------------------------------------------
530 
531 
532 #endif // LARCOREALG_GEOMETRY_CRYOSTATGEO_H
533 ////////////////////////////////////////////////////////////////////////
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local cryostat frame.
Definition: CryostatGeo.h:431
void InitCryoBoundaries()
Fill the boundary information of the cryostat.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
unsigned int GetClosestOpDet(geo::Point_t const &point) const
geo::Point_t GetCenter() const
Returns the geometrical center of the cryostat.
Definition: CryostatGeo.h:124
double HalfLength() const
Half height of the cryostat [cm].
std::vector< geo::OpDetGeo > OpDetList_t
Type used internally to store the optical detectors.
Definition: CryostatGeo.h:51
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the TPC in tpcid from this cryostat.
Definition: CryostatGeo.h:294
geo::Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
Definition: CryostatGeo.h:411
unsigned int MaxPlanes() const
Returns the largest number of planes among the TPCs in this cryostat.
double Mass() const
Mass of the cryostat.
Definition: CryostatGeo.h:109
TGeoVolume * fVolume
Total volume of cryostat, called volCryostat in GDML file.
Definition: CryostatGeo.h:477
LocalVector_t toLocalCoords(geo::Vector_t const &world) const
Transform direction vector from world to local.
Definition: CryostatGeo.h:439
Geometry information for a single TPC.
Definition: TPCGeo.h:38
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
ElementIteratorBox IterateTPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:258
Class to transform between world and local coordinates.
std::vector< geo::TPCGeo > TPCList_t
Type used internally to store the TPCs.
Definition: CryostatGeo.h:48
OpDetList_t fOpDets
List of opdets in this cryostat.
Definition: CryostatGeo.h:476
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
CryostatGeo(TGeoNode const &node, geo::TransformationMatrix &&trans, TPCList_t &&TPCs, OpDetList_t &&OpDets)
Construct a representation of a single cryostat of the detector.
Definition: CryostatGeo.cxx:33
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this cryostat.
Definition: CryostatGeo.h:128
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
Point LocalToWorld(Point const &local) const
Definition: CryostatGeo.h:399
TPCGeo const * GetElementPtr(TPCID const &tpcid) const
Alias for TPCPtr().
Definition: CryostatGeo.h:297
std::string fOpDetGeoName
Name of opdet geometry elements in gdml.
Definition: CryostatGeo.h:478
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
then local
void SortSubVolumes(geo::GeoObjectSorter const &sorter)
Method to sort TPCGeo objects.
Definition: CryostatGeo.cxx:63
std::string OpDetGeoName() const
Get name of opdet geometry element.
Definition: CryostatGeo.h:377
Tag for vectors in the &quot;local&quot; GDML coordinate frame of the cryostat.
Definition: CryostatGeo.h:75
bool HasElement(unsigned int itpc) const
Alias for HasTPC().
Definition: CryostatGeo.h:193
void PrintCryostatInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this cryostat.
Definition: CryostatGeo.h:489
geo::OpDetGeo const * GetClosestOpDetPtr(geo::Point_t const &point) const
const TGeoVolume * Volume() const
Pointer to ROOT&#39;s volume descriptor.
Definition: CryostatGeo.h:111
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
Local-to-world transformations with LArSoft geometry vectors.
Definitions of geometry vector data types.
double Height() const
Full height of the cryostat [cm].
Definition: CryostatGeo.h:105
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:44
geo::Point3DBase_t< CryostatGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML cryostat frame.
Definition: CryostatGeo.h:78
double HalfWidth() const
Half width of the cryostat [cm].
unsigned int NElements() const
Alias for NTPC().
Definition: CryostatGeo.h:183
Utilities to extend the interface of geometry vectors.
double Width() const
Full width of the cryostat [cm].
Definition: CryostatGeo.h:103
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
Definition: CryostatGeo.h:283
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
geo::CryostatID fID
ID of this cryostat.
Definition: CryostatGeo.h:479
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
void WorldToLocal(const double *world, double *cryo) const
Transform point from world frame to local cryostat frame.
Definition: CryostatGeo.h:415
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
void FindOpDet(std::vector< const TGeoNode * > &path, unsigned int depth)
Definition of data types for geometry description.
unsigned int MaxWires() const
Returns the largest number of wires among the TPCs in this cryostat.
void UpdateAfterSorting(geo::CryostatID cryoid)
Performs all needed updates after geometry has sorted the cryostats.
Definition: CryostatGeo.cxx:76
Provides a base class aware of world box coordinates.
Encapsulate the geometry of a wire.
double HalfHeight() const
Half height of the cryostat [cm].
TPCList_t const & ElementIteratorBox
Type returned by IterateElements().
Definition: CryostatGeo.h:56
Encapsulate the geometry of an optical detector.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintCryostatInfo().
Definition: CryostatGeo.h:171
std::string CryostatInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with cryostat information.
geo::TPCID::TPCID_t FindTPCAtPosition(double const worldLoc[3], double const wiggle) const
Returns the index of the TPC at specified location.
void LocalToWorld(const double *cryo, double *world) const
Transform point from local cryostat frame to world frame.
Definition: CryostatGeo.h:387
auto const & TPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:275
void FindTPC(std::vector< const TGeoNode * > &path, unsigned int depth)
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
Selection of the type of transformation matrix used in geometry.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
std::vector< TGeoNode const * > GeoNodePath_t
Definition: WireGeo.h:72
TPCList_t fTPCs
List of tpcs in this cryostat.
Definition: CryostatGeo.h:475
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
void MakeOpDet(std::vector< const TGeoNode * > &path, int depth)
geo::Vector3DBase_t< CryostatGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML cryostat frame.
Definition: CryostatGeo.h:81
bool HasElement(geo::TPCID const &tpcid) const
Alias for HasTPC(geo::TPCID const&amp;)
Definition: CryostatGeo.h:205
const TPCGeo & TPC(TPCID const &tpcid) const
Returns the TPC in tpcid from this cryostat.
Definition: CryostatGeo.h:220
bool HasTPC(geo::TPCID const &tpcid) const
Returns whether the TPC in tpcid is present in this cryostat.
Definition: CryostatGeo.h:203
LocalTransformation_t fTrans
Cryostat-to-world transformation.
Definition: CryostatGeo.h:474
GenPoint3DBase_t< double, C > Point3DBase_t
Type of 3D point with representation in double precision.
Definition: geo_vectors.h:92
geo::BoxBoundedGeo const & Boundaries() const
Returns boundaries of the cryostat (in centimetres).
Definition: CryostatGeo.h:115
GenVector3DBase_t< double, C > Vector3DBase_t
Definition: geo_vectors.h:87
geo::LocalTransformationGeo< ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t > LocalTransformation_t
Definition: CryostatGeo.h:472
void LocalToWorldVect(const double *cryo, double *world) const
Transform direction vector from local to world.
Definition: CryostatGeo.h:407
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
Definition: CryostatGeo.h:190
geo::WireGeo::GeoNodePath_t GeoNodePath_t
Definition: CryostatGeo.h:53
TPCGeo const & PositionToTPC(geo::Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
void WorldToLocalVect(const double *world, double *cryo) const
Transform direction vector from world to local.
Definition: CryostatGeo.h:435
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
void MakeTPC(std::vector< const TGeoNode * > &path, int depth)
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:184
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local cryostat frame to world frame.
Definition: CryostatGeo.h:403
geo::TPCID PositionToTPCID(geo::Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
bnb BNB Stream
Specialization of local-to-world transformations for ROOT GenVector.
double Length() const
Length of the cryostat [cm].
Definition: CryostatGeo.h:107
Encapsulate the construction of a single detector plane.
Point WorldToLocal(Point const &world) const
Definition: CryostatGeo.h:427
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
const TPCGeo & GetElement(TPCID const &tpcid) const
Alias for TPC().
Definition: CryostatGeo.h:223
geo::Point_t Center() const
Returns the center point of the box.
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:132
ElementIteratorBox IterateElements() const
Returns an object suitable for iterating through all TPCs.