LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geo::AuxDetSensitiveGeo Class Reference

#include "AuxDetSensitiveGeo.h"

Classes

struct  AuxDetSensitiveGeoCoordinatesTag
 

Public Types

Types for geometry-local reference vectors.

These types represents points and displacement vectors in the reference frame defined in the auxiliary detector geometry box from the GDML geometry description.

No alias is explicitly defined for the LArSoft global vector types, geo::Point_t and geo::Vector_t.

Remember the LocalPoint_t and LocalVector_t vectors from different instances of geo::AuxDetSensitiveGeo have the same type but are not compatible.

using LocalPoint_t = geo::Point3DBase_t< AuxDetSensitiveGeoCoordinatesTag >
 Type of points in the local GDML auxiliary detector frame. More...
 
using LocalVector_t = geo::Vector3DBase_t< AuxDetSensitiveGeoCoordinatesTag >
 Type of displacement vectors in the local GDML auxiliary detector frame. More...
 

Public Member Functions

 AuxDetSensitiveGeo (TGeoNode const &node, geo::TransformationMatrix &&trans)
 
geo::Point_t GetCenter (double localz=0.0) const
 Returns the geometric center of the sensitive volume. More...
 
geo::Vector_t GetNormalVector () const
 Returns the unit normal vector to the detector. More...
 
double Length () const
 
double HalfLength () const
 
double HalfWidth1 () const
 
double HalfWidth2 () const
 
double HalfCenterWidth () const
 
double HalfHeight () const
 
const TGeoVolume * TotalVolume () const
 
template<typename Stream >
void PrintAuxDetInfo (Stream &&out, std::string indent="", unsigned int verbosity=0) const
 Prints information about this auxiliary sensitive detector. More...
 
std::string AuxDetInfo (std::string indent="", unsigned int verbosity=1) const
 Returns a string with auxiliary sensitive detector information. More...
 
geo::Length_t DistanceToPoint (geo::Point_t const &point) const
 Returns the distance of point from the center of the detector. More...
 
geo::Length_t DistanceToPoint (double const *point) const
 Returns the distance of point from the center of the detector. More...
 
Coordinate transformation
geo::Point_t toWorldCoords (LocalPoint_t const &local) const
 Transform point from local auxiliary detector frame to world frame. More...
 
geo::Vector_t toWorldCoords (LocalVector_t const &local) const
 Transform direction vector from local to world. More...
 
LocalPoint_t toLocalCoords (geo::Point_t const &world) const
 Transform point from world frame to local auxiliary detector frame. More...
 
LocalVector_t toLocalCoords (geo::Vector_t const &world) const
 Transform direction vector from world to local. More...
 

Static Public Attributes

static constexpr unsigned int MaxVerbosity = 2
 Maximum verbosity supported by PrintAuxDetInfo(). More...
 

Private Types

using LocalTransformation_t = geo::LocalTransformationGeo< ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t >
 

Private Member Functions

void InitShapeSize ()
 Extracts the size of the detector from the geometry information. More...
 

Private Attributes

LocalTransformation_t fTrans
 Auxiliary detector-to-world transformation. More...
 
const TGeoVolume * fTotalVolume
 Total volume of AuxDet, called vol*. More...
 
double fLength
 length of volume, along z direction in local More...
 
double fHalfWidth1
 1st half width of volume, at -z/2 in local coordinates More...
 
double fHalfWidth2
 2nd half width (width1==width2 for boxes), at +z/2 More...
 
double fHalfHeight
 half height of volume More...
 

Detailed Description

Definition at line 34 of file AuxDetSensitiveGeo.h.

Member Typedef Documentation

Type of points in the local GDML auxiliary detector frame.

Definition at line 57 of file AuxDetSensitiveGeo.h.

Type of displacement vectors in the local GDML auxiliary detector frame.

Definition at line 60 of file AuxDetSensitiveGeo.h.

Constructor & Destructor Documentation

geo::AuxDetSensitiveGeo::AuxDetSensitiveGeo ( TGeoNode const &  node,
geo::TransformationMatrix &&  trans 
)

Definition at line 29 of file AuxDetSensitiveGeo.cxx.

References fTotalVolume, InitShapeSize(), and MF_LOG_DEBUG.

30  : fTrans(std::move(trans)), fTotalVolume(node.GetVolume())
31  {
32 
33  MF_LOG_DEBUG("Geometry") << "detector sensitive total volume is " << fTotalVolume->GetName();
34 
35  InitShapeSize();
36  }
void InitShapeSize()
Extracts the size of the detector from the geometry information.
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
#define MF_LOG_DEBUG(id)
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.

Member Function Documentation

std::string geo::AuxDetSensitiveGeo::AuxDetInfo ( std::string  indent = "",
unsigned int  verbosity = 1 
) const

Returns a string with auxiliary sensitive detector information.

See also
PrintAuxDetInfo()

The arguments and provided information are the same as in PrintAuxDetInfo().

Definition at line 59 of file AuxDetSensitiveGeo.cxx.

References PrintAuxDetInfo().

Referenced by toLocalCoords().

61  {
62  std::ostringstream sstr;
63  PrintAuxDetInfo(sstr, indent, verbosity);
64  return sstr.str();
65  } // AuxDetSensitiveGeo::AuxDetInfo()
std::string indent(std::size_t const i)
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this auxiliary sensitive detector.
geo::Length_t geo::AuxDetSensitiveGeo::DistanceToPoint ( geo::Point_t const &  point) const
inline

Returns the distance of point from the center of the detector.

Definition at line 88 of file AuxDetSensitiveGeo.h.

Referenced by DistanceToPoint(), and TotalVolume().

89  {
90  return (point - GetCenter()).R();
91  }
geo::Point_t GetCenter(double localz=0.0) const
Returns the geometric center of the sensitive volume.
geo::Length_t geo::AuxDetSensitiveGeo::DistanceToPoint ( double const *  point) const

Returns the distance of point from the center of the detector.

Definition at line 53 of file AuxDetSensitiveGeo.cxx.

References DistanceToPoint(), and geo::vect::makePointFromCoords().

54  {
56  }
geo::Length_t DistanceToPoint(geo::Point_t const &point) const
Returns the distance of point from the center of the detector.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::Point_t geo::AuxDetSensitiveGeo::GetCenter ( double  localz = 0.0) const

Returns the geometric center of the sensitive volume.

Parameters
localz(default: 0) distance from the center along the length of the volume (z) [cm]
Returns
the geometric center of the sensitive volume [cm]

Definition at line 39 of file AuxDetSensitiveGeo.cxx.

References toWorldCoords().

Referenced by PrintAuxDetInfo(), and TotalVolume().

40  {
41  return toWorldCoords(LocalPoint_t{0.0, 0.0, localz});
42  }
geo::Point3DBase_t< AuxDetSensitiveGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML auxiliary detector frame.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
geo::Vector_t geo::AuxDetSensitiveGeo::GetNormalVector ( ) const

Returns the unit normal vector to the detector.

Definition at line 47 of file AuxDetSensitiveGeo.cxx.

References toWorldCoords().

Referenced by PrintAuxDetInfo().

48  {
49  return toWorldCoords(geo::Zaxis<LocalVector_t>());
50  }
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
double geo::AuxDetSensitiveGeo::HalfCenterWidth ( ) const
inline

Definition at line 82 of file AuxDetSensitiveGeo.h.

References HalfWidth1(), and HalfWidth2().

82 { return (HalfWidth1() + HalfWidth2()) / 2.0; }
double geo::AuxDetSensitiveGeo::HalfHeight ( ) const
inline
double geo::AuxDetSensitiveGeo::HalfLength ( ) const
inline

Definition at line 79 of file AuxDetSensitiveGeo.h.

References Length().

79 { return Length() / 2.0; }
double geo::AuxDetSensitiveGeo::HalfWidth1 ( ) const
inline

Definition at line 80 of file AuxDetSensitiveGeo.h.

References fHalfWidth1.

Referenced by HalfCenterWidth(), geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet(), geo::ChannelMapAlg::NearestSensitiveAuxDet(), and PrintAuxDetInfo().

80 { return fHalfWidth1; }
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
double geo::AuxDetSensitiveGeo::HalfWidth2 ( ) const
inline

Definition at line 81 of file AuxDetSensitiveGeo.h.

References fHalfWidth2.

Referenced by HalfCenterWidth(), geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet(), geo::ChannelMapAlg::NearestSensitiveAuxDet(), and PrintAuxDetInfo().

81 { return fHalfWidth2; }
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
void geo::AuxDetSensitiveGeo::InitShapeSize ( )
private

Extracts the size of the detector from the geometry information.

Definition at line 68 of file AuxDetSensitiveGeo.cxx.

References fHalfHeight, fHalfWidth1, fHalfWidth2, fLength, and fTotalVolume.

Referenced by AuxDetSensitiveGeo().

69  {
70  // set the ends depending on whether the shape is a box or trapezoid
71  std::string volName(fTotalVolume->GetName());
72  if (volName.find("Trap") != std::string::npos) {
73 
74  // Small Width
75  // ____ Height is the thickness
76  // / \ T of the trapezoid
77  // / \ |
78  // / \ | Length
79  // /__________\ _
80  // Width
81  fHalfHeight = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDy1(); // same as Dy2()
82  fLength = 2.0 * ((TGeoTrd2*)fTotalVolume->GetShape())->GetDz();
83  fHalfWidth1 = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDx1(); // at -Dz
84  fHalfWidth2 = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDx2(); // at +Dz
85  }
86  else {
87  fHalfWidth1 = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
88  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
89  fLength = 2.0 * ((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
91  }
92  } // AuxDetSensitiveGeo::InitShapeSize()
double fLength
length of volume, along z direction in local
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
double fHalfHeight
half height of volume
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
double geo::AuxDetSensitiveGeo::Length ( ) const
inline

Definition at line 78 of file AuxDetSensitiveGeo.h.

References fLength.

Referenced by HalfLength(), geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet(), geo::ChannelMapAlg::NearestSensitiveAuxDet(), and PrintAuxDetInfo().

78 { return fLength; }
double fLength
length of volume, along z direction in local
template<typename Stream >
void geo::AuxDetSensitiveGeo::PrintAuxDetInfo ( Stream &&  out,
std::string  indent = "",
unsigned int  verbosity = 0 
) const

Prints information about this auxiliary sensitive detector.

Template Parameters
Streamtype of output stream to use
Parameters
outstream to send the information to
indentprepend each line with this string
verbosityamount of information printed

Note that the first line out the output is not indented.

Verbosity levels

  • 0 _(default)_: only center
  • 1: also size
  • 2: also normal direction

The constant MaxVerbosity is set to the highest supported verbosity level.

Definition at line 183 of file AuxDetSensitiveGeo.h.

References e, GetCenter(), GetNormalVector(), HalfHeight(), HalfWidth1(), HalfWidth2(), Length(), and lar::util::RealComparisons< RealType >::nonEqual().

Referenced by AuxDetInfo(), geo::GeometryCore::Print(), and toLocalCoords().

187 {
188 
189  //----------------------------------------------------------------------------
190  out << "centered at " << GetCenter() << " cm";
191 
192  if (verbosity-- <= 0) return; // 0
193 
194  //----------------------------------------------------------------------------
196  out << ", size ( " << (2.0 * HalfWidth1());
197  if (coordIs.nonEqual(HalfWidth1(), HalfWidth2())) out << "/" << (2.0 * HalfWidth2());
198  out << " x " << (2.0 * HalfHeight()) << " x " << Length() << " ) cm";
199 
200  if (verbosity-- <= 0) return; // 1
201 
202  //----------------------------------------------------------------------------
203  out << ", normal facing " << GetNormalVector();
204 
205  // if (verbosity-- <= 0) return; // 2
206 
207  //----------------------------------------------------------------------------
208 
209 } // geo::AuxDetSensitiveGeo::PrintAuxDetInfo()
geo::Point_t GetCenter(double localz=0.0) const
Returns the geometric center of the sensitive volume.
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
Provides simple real number checks.
Float_t e
Definition: plot.C:35
LocalPoint_t geo::AuxDetSensitiveGeo::toLocalCoords ( geo::Point_t const &  world) const
inline

Transform point from world frame to local auxiliary detector frame.

Definition at line 111 of file AuxDetSensitiveGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().

Referenced by geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet(), and geo::ChannelMapAlg::NearestSensitiveAuxDet().

112  {
113  return fTrans.toLocalCoords(world);
114  }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
LocalVector_t geo::AuxDetSensitiveGeo::toLocalCoords ( geo::Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 117 of file AuxDetSensitiveGeo.h.

References AuxDetInfo(), fTrans, art::detail::indent(), PrintAuxDetInfo(), and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().

118  {
119  return fTrans.toLocalCoords(world);
120  }
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
const TGeoVolume* geo::AuxDetSensitiveGeo::TotalVolume ( ) const
inline

Definition at line 84 of file AuxDetSensitiveGeo.h.

References DistanceToPoint(), fTotalVolume, and GetCenter().

Referenced by geo::sortAuxDetSensitiveStandard().

84 { return fTotalVolume; }
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
geo::Point_t geo::AuxDetSensitiveGeo::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transform point from local auxiliary detector frame to world frame.

Definition at line 99 of file AuxDetSensitiveGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().

Referenced by GetCenter(), and GetNormalVector().

100  {
101  return fTrans.toWorldCoords(local);
102  }
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
geo::Vector_t geo::AuxDetSensitiveGeo::toWorldCoords ( LocalVector_t const &  local) const
inline

Transform direction vector from local to world.

Definition at line 105 of file AuxDetSensitiveGeo.h.

References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().

106  {
107  return fTrans.toWorldCoords(local);
108  }
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.

Member Data Documentation

double geo::AuxDetSensitiveGeo::fHalfHeight
private

half height of volume

Definition at line 167 of file AuxDetSensitiveGeo.h.

Referenced by HalfHeight(), and InitShapeSize().

double geo::AuxDetSensitiveGeo::fHalfWidth1
private

1st half width of volume, at -z/2 in local coordinates

Definition at line 165 of file AuxDetSensitiveGeo.h.

Referenced by HalfWidth1(), and InitShapeSize().

double geo::AuxDetSensitiveGeo::fHalfWidth2
private

2nd half width (width1==width2 for boxes), at +z/2

Definition at line 166 of file AuxDetSensitiveGeo.h.

Referenced by HalfWidth2(), and InitShapeSize().

double geo::AuxDetSensitiveGeo::fLength
private

length of volume, along z direction in local

Definition at line 164 of file AuxDetSensitiveGeo.h.

Referenced by InitShapeSize(), and Length().

const TGeoVolume* geo::AuxDetSensitiveGeo::fTotalVolume
private

Total volume of AuxDet, called vol*.

Definition at line 163 of file AuxDetSensitiveGeo.h.

Referenced by AuxDetSensitiveGeo(), InitShapeSize(), and TotalVolume().

LocalTransformation_t geo::AuxDetSensitiveGeo::fTrans
private

Auxiliary detector-to-world transformation.

Definition at line 162 of file AuxDetSensitiveGeo.h.

Referenced by toLocalCoords(), and toWorldCoords().

constexpr unsigned int geo::AuxDetSensitiveGeo::MaxVerbosity = 2
static

Maximum verbosity supported by PrintAuxDetInfo().

Definition at line 156 of file AuxDetSensitiveGeo.h.

Referenced by geo::GeometryCore::Print().


The documentation for this class was generated from the following files: