LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::AuxDetGeo Class Reference

#include "AuxDetGeo.h"

Classes

struct  AuxDetGeoCoordinatesTag
 

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::AuxDetGeo have the same type but are not compatible.

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

Public Member Functions

 AuxDetGeo (std::vector< const TGeoNode * > &path, int depth)
 
 ~AuxDetGeo ()
 
void GetCenter (double *xyz, double localz=0.0) const
 Return the center position of an AuxDet. More...
 
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...
 
void GetNormalVector (double *xyzDir) const
 Fills the unit normal vector to the detector. More...
 
std::string Name () const
 
AuxDetSensitiveGeo const & SensitiveVolume (size_t sv) const
 
size_t NSensitiveVolume () const
 
void SortSubVolumes (geo::GeoObjectSorter const &sorter)
 
template<typename Stream >
void PrintAuxDetInfo (Stream &&out, std::string indent="", unsigned int verbosity=1) const
 Prints information about this auxiliary detector. More...
 
Box geometry
double Length () const
 Returns the distance of point from the center of the detector. More...
 
double HalfWidth1 () const
 Returns the distance of point from the center of the detector. More...
 
double HalfWidth2 () const
 Returns the distance of point from the center of the detector. More...
 
double HalfHeight () const
 Returns the distance of point from the center of the detector. More...
 
const TGeoVolume * TotalVolume () const
 Returns the distance of point from the center of the detector. 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
void LocalToWorld (const double *auxdet, double *world) const
 Transform point from local auxiliary detector frame to world frame. More...
 
geo::Point_t toWorldCoords (LocalPoint_t const &local) const
 Transform point from local auxiliary detector frame to world frame. More...
 
void LocalToWorldVect (const double *auxdet, double *world) const
 Transform direction vector from local to world. More...
 
geo::Vector_t toWorldCoords (LocalVector_t const &local) const
 Transform direction vector from local to world. More...
 
void WorldToLocal (const double *world, double *auxdet) const
 Transform point from world frame to local auxiliary detector frame. More...
 
LocalPoint_t toLocalCoords (geo::Point_t const &world) const
 Transform point from world frame to local auxiliary detector frame. More...
 
void WorldToLocalVect (const double *world, double *auxdet) const
 Transform direction vector from world to local. More...
 
LocalVector_t toLocalCoords (geo::Vector_t const &world) const
 Transform direction vector from world to local. More...
 
Access to the sensitive volumes in the detector
std::size_t FindSensitiveVolume (geo::Point_t const &point) const
 
std::size_t FindSensitiveVolume (double const worldLoc[3]) const
 
AuxDetSensitiveGeo const & PositionToSensitiveVolume (geo::Point_t const &point, size_t &sv) const
 
AuxDetSensitiveGeo const & PositionToSensitiveVolume (double const worldLoc[3], size_t &sv) const
 

Static Public Attributes

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

Private Types

using LocalTransformation_t = geo::LocalTransformationGeo< TGeoHMatrix, LocalPoint_t, LocalVector_t >
 

Private Member Functions

void FindAuxDetSensitive (std::vector< const TGeoNode * > &path, unsigned int depth)
 
void MakeAuxDetSensitive (std::vector< const TGeoNode * > &path, int depth)
 
void InitShapeSize ()
 Extracts the size of the detector from the geometry information. More...
 

Private Attributes

const TGeoVolume * fTotalVolume
 Total volume of AuxDet, called vol*. More...
 
LocalTransformation_t fTrans
 Auxiliary detector-to-world transformation. 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...
 
std::vector< AuxDetSensitiveGeo * > fSensitive
 sensitive volumes in the detector More...
 

Detailed Description

Definition at line 31 of file AuxDetGeo.h.

Member Typedef Documentation

Type of points in the local GDML auxiliary detector frame.

Definition at line 53 of file AuxDetGeo.h.

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

Definition at line 56 of file AuxDetGeo.h.

Constructor & Destructor Documentation

geo::AuxDetGeo::AuxDetGeo ( std::vector< const TGeoNode * > &  path,
int  depth 
)

Definition at line 28 of file AuxDetGeo.cxx.

References FindAuxDetSensitive(), fSensitive, fTotalVolume, fTrans, InitShapeSize(), LOG_DEBUG, and geo::LocalTransformation< StoredMatrix >::Matrix().

29  : fTotalVolume(nullptr)
30  , fTrans(path, depth)
31  {
32 
33  TGeoVolume *vc = path[depth]->GetVolume();
34  if(vc){
35  fTotalVolume = vc;
36  if(!fTotalVolume)
37  throw cet::exception("AuxDetGeo") << "cannot find AuxDet volume\n";
38 
39  }// end if found volume
40 
41  LOG_DEBUG("Geometry") << "detector total volume is " << fTotalVolume->GetName();
42 
43  // look for sensitive volumes - if there are none then this aux det
44  // could be from an older gdml file than the introduction of AuxDetSensitiveGeo
45  // in that case assume the full AuxDetGeo is sensitive and copy its information
46  // into a single AuxDetSensitive
47  this->FindAuxDetSensitive(path, depth);
48  if (fSensitive.empty())
49  fSensitive.push_back(new AuxDetSensitiveGeo(fTotalVolume, fTrans.Matrix()));
50 
51  InitShapeSize();
52 
53  }
void FindAuxDetSensitive(std::vector< const TGeoNode * > &path, unsigned int depth)
Definition: AuxDetGeo.cxx:62
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
TransformationMatrix_t const & Matrix() const
Direct access to the transformation matrix.
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
Definition: AuxDetGeo.h:207
#define LOG_DEBUG(id)
void InitShapeSize()
Extracts the size of the detector from the geometry information.
Definition: AuxDetGeo.cxx:186
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::AuxDetGeo::~AuxDetGeo ( )

Definition at line 56 of file AuxDetGeo.cxx.

References fSensitive.

56  {
57  for (auto const* sdet: fSensitive) delete sdet;
58  }
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213

Member Function Documentation

geo::Length_t geo::AuxDetGeo::DistanceToPoint ( geo::Point_t const &  point) const
inline

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

Definition at line 99 of file AuxDetGeo.h.

Referenced by DistanceToPoint(), and TotalVolume().

100  { return (point - GetCenter()).R(); }
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.
Definition: AuxDetGeo.cxx:97
geo::Length_t geo::AuxDetGeo::DistanceToPoint ( double const *  point) const

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

Definition at line 122 of file AuxDetGeo.cxx.

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

geo::Length_t DistanceToPoint(geo::Point_t const &point) const
Returns the distance of point from the center of the detector.
Definition: AuxDetGeo.h:99
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
void geo::AuxDetGeo::FindAuxDetSensitive ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private

Definition at line 62 of file AuxDetGeo.cxx.

References MakeAuxDetSensitive().

Referenced by AuxDetGeo().

64  {
65  // Check if the current node is a senstive volume - we already know
66  // we are in an Auxiliary detector
67  std::string pathName(path[depth]->GetName());
68  if( pathName.find("Sensitive") != std::string::npos){
69  this->MakeAuxDetSensitive(path, depth);
70  return;
71  }
72 
73  // Explore the next layer down
74  unsigned int deeper = depth+1;
75  if (deeper>=path.size()) {
76  throw cet::exception("ExceededMaxDepth") << "Exceeded maximum depth\n";
77  }
78  const TGeoVolume* v = path[depth]->GetVolume();
79  int nd = v->GetNdaughters();
80  for (int i=0; i<nd; ++i) {
81  path[deeper] = v->GetNode(i);
82  this->FindAuxDetSensitive(path, deeper);
83  }
84  }
void FindAuxDetSensitive(std::vector< const TGeoNode * > &path, unsigned int depth)
Definition: AuxDetGeo.cxx:62
void MakeAuxDetSensitive(std::vector< const TGeoNode * > &path, int depth)
Definition: AuxDetGeo.cxx:87
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::size_t geo::AuxDetGeo::FindSensitiveVolume ( geo::Point_t const &  point) const
Deprecated:
Use the version with geo::Point_t argument instead

Definition at line 126 of file AuxDetGeo.cxx.

References fSensitive, max, and SensitiveVolume().

Referenced by FindSensitiveVolume(), Name(), and PositionToSensitiveVolume().

127  {
128  for(std::size_t a = 0; a < fSensitive.size(); ++a) {
129  auto const& sensVol = SensitiveVolume(a);
130 
131  auto const local = sensVol.toLocalCoords(point);
132 
133  double const HalfCenterWidth = sensVol.HalfCenterWidth();
134 
135  double const deltaWidth
136  = local.Z()*(HalfCenterWidth-sensVol.HalfWidth2())/sensVol.HalfLength();
137 
138  if (local.Z() >= - sensVol.HalfLength() &&
139  local.Z() <= sensVol.HalfLength() &&
140  local.Y() >= - sensVol.HalfHeight() &&
141  local.Y() <= sensVol.HalfHeight() &&
142  // if SensitiveVolume a is a box, then HalfSmallWidth = HalfWidth
143  local.X() >= - HalfCenterWidth + deltaWidth &&
144  local.X() <= HalfCenterWidth - deltaWidth
145  ) return a;
146 
147  }// for loop over AuxDetSensitive a
148 
149  throw cet::exception("AuxDetGeo")
150  << "Can't find AuxDetSensitive for position " << point << "\n";
151  // the following is not very useful right now...
153  } // AuxDetGeo::FindSensitiveVolume(geo::Point_t)
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213
Int_t max
Definition: plot.C:27
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::size_t geo::AuxDetGeo::FindSensitiveVolume ( double const  worldLoc[3]) const
Deprecated:
Use the version with geo::Point_t argument instead

Definition at line 156 of file AuxDetGeo.cxx.

References FindSensitiveVolume(), geo::vect::makePointFromCoords(), and PositionToSensitiveVolume().

std::size_t FindSensitiveVolume(geo::Point_t const &point) const
Definition: AuxDetGeo.cxx:126
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
void geo::AuxDetGeo::GetCenter ( double *  xyz,
double  localz = 0.0 
) const

Return the center position of an AuxDet.

Parameters
xyz_(output)_ the returned location: { x, y, z } [cm]
localz(default: 0) distance along the length of the volume (z) [cm]

Definition at line 97 of file AuxDetGeo.cxx.

Referenced by PrintAuxDetInfo(), and TotalVolume().

97  {
98  auto const& center = GetCenter(localz);
99  xyz[0] = center.X();
100  xyz[1] = center.Y();
101  xyz[2] = center.Z();
102  } // AuxDetGeo::GetCenter(double*)
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.
Definition: AuxDetGeo.cxx:97
geo::Point_t geo::AuxDetGeo::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 93 of file AuxDetGeo.cxx.

References toWorldCoords().

94  { return toWorldCoords(LocalPoint_t{ 0.0, 0.0, localz }); }
geo::Point3DBase_t< AuxDetGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML auxiliary detector frame.
Definition: AuxDetGeo.h:53
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
Definition: AuxDetGeo.h:112
geo::Vector_t geo::AuxDetGeo::GetNormalVector ( ) const

Returns the unit normal vector to the detector.

Definition at line 107 of file AuxDetGeo.cxx.

References toWorldCoords().

Referenced by GetNormalVector(), and PrintAuxDetInfo().

108  { return toWorldCoords(geo::Zaxis<LocalVector_t>()); }
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
Definition: AuxDetGeo.h:112
void geo::AuxDetGeo::GetNormalVector ( double *  xyzDir) const

Fills the unit normal vector to the detector.

Definition at line 113 of file AuxDetGeo.cxx.

References GetNormalVector(), and norm.

113  {
114  auto const& norm = GetNormalVector();
115  xyzDir[0] = norm.X();
116  xyzDir[1] = norm.Y();
117  xyzDir[2] = norm.Z();
118  } // AuxDetGeo::GetNormalVector(double*)
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
Definition: AuxDetGeo.cxx:107
Float_t norm
double geo::AuxDetGeo::HalfHeight ( ) const
inline

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

Definition at line 93 of file AuxDetGeo.h.

References fHalfHeight.

Referenced by PrintAuxDetInfo().

93 { return fHalfHeight; }
double fHalfHeight
half height of volume
Definition: AuxDetGeo.h:212
double geo::AuxDetGeo::HalfWidth1 ( ) const
inline

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

Definition at line 91 of file AuxDetGeo.h.

References fHalfWidth1.

Referenced by PrintAuxDetInfo().

91 { return fHalfWidth1; }
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
Definition: AuxDetGeo.h:210
double geo::AuxDetGeo::HalfWidth2 ( ) const
inline

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

Definition at line 92 of file AuxDetGeo.h.

References fHalfWidth2.

Referenced by PrintAuxDetInfo().

92 { return fHalfWidth2; }
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
Definition: AuxDetGeo.h:211
void geo::AuxDetGeo::InitShapeSize ( )
private

Extracts the size of the detector from the geometry information.

Definition at line 186 of file AuxDetGeo.cxx.

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

Referenced by AuxDetGeo().

186  {
187  // set the ends depending on whether the shape is a box or trapezoid
188  std::string volName(fTotalVolume->GetName());
189  if( volName.find("Trap") != std::string::npos ) {
190 
191  // Small Width
192  // ____ Height is the thickness
193  // / \ T of the trapezoid
194  // / \ |
195  // / \ | Length
196  // /__________\ _
197  // Width
198  fHalfHeight = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDy1(); // same as Dy2()
199  fLength = 2.0*((TGeoTrd2*)fTotalVolume->GetShape())->GetDz();
200  fHalfWidth1 = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDx1(); // at -Dz
201  fHalfWidth2 = ((TGeoTrd2*)fTotalVolume->GetShape())->GetDx2(); // at +Dz
202  }
203  else {
204  fHalfWidth1 = ((TGeoBBox*)fTotalVolume->GetShape())->GetDX();
205  fHalfHeight = ((TGeoBBox*)fTotalVolume->GetShape())->GetDY();
206  fLength = 2.0*((TGeoBBox*)fTotalVolume->GetShape())->GetDZ();
208  }
209  } // AuxDetGeo::InitShapeSize()
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
Definition: AuxDetGeo.h:211
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
Definition: AuxDetGeo.h:210
double fLength
length of volume, along z direction in local
Definition: AuxDetGeo.h:209
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
Definition: AuxDetGeo.h:207
double fHalfHeight
half height of volume
Definition: AuxDetGeo.h:212
double geo::AuxDetGeo::Length ( ) const
inline

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

Definition at line 90 of file AuxDetGeo.h.

References fLength.

Referenced by PrintAuxDetInfo().

90 { return fLength; }
double fLength
length of volume, along z direction in local
Definition: AuxDetGeo.h:209
void geo::AuxDetGeo::LocalToWorld ( const double *  auxdet,
double *  world 
) const
inline

Transform point from local auxiliary detector frame to world frame.

Definition at line 108 of file AuxDetGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorld().

109  { fTrans.LocalToWorld(auxdet, world); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
void geo::AuxDetGeo::LocalToWorldVect ( const double *  auxdet,
double *  world 
) const
inline

Transform direction vector from local to world.

Definition at line 116 of file AuxDetGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorldVect().

117  { fTrans.LocalToWorldVect(auxdet, world); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
void geo::AuxDetGeo::MakeAuxDetSensitive ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private

Definition at line 87 of file AuxDetGeo.cxx.

References fSensitive.

Referenced by FindAuxDetSensitive().

88  {
89  fSensitive.push_back(new AuxDetSensitiveGeo(path, depth));
90  }
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213
std::string geo::AuxDetGeo::Name ( ) const
inline

Definition at line 142 of file AuxDetGeo.h.

References FindSensitiveVolume(), fTotalVolume, and PositionToSensitiveVolume().

Referenced by PrintAuxDetInfo().

142 { return fTotalVolume->GetName(); }
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
Definition: AuxDetGeo.h:207
size_t geo::AuxDetGeo::NSensitiveVolume ( ) const
inline

Definition at line 160 of file AuxDetGeo.h.

References fSensitive, art::detail::indent(), PrintAuxDetInfo(), and SortSubVolumes().

Referenced by geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet(), geo::ChannelMapAlg::NearestSensitiveAuxDet(), geo::GeometryCore::Print(), PrintAuxDetInfo(), and larg4::LArG4::produce().

160 { return fSensitive.size(); }
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213
AuxDetSensitiveGeo const & geo::AuxDetGeo::PositionToSensitiveVolume ( geo::Point_t const &  point,
size_t &  sv 
) const
Deprecated:
Use the version with geo::Point_t argument instead

Definition at line 162 of file AuxDetGeo.cxx.

References FindSensitiveVolume(), max, and SensitiveVolume().

Referenced by FindSensitiveVolume(), Name(), and PositionToSensitiveVolume().

163  {
164  sv = FindSensitiveVolume(point);
166  throw cet::exception("AuxDetGeo")
167  << "Can't find AuxDetSensitiveGeo for position " << point << "\n";
168  }
169  return SensitiveVolume(sv);
170  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
Int_t max
Definition: plot.C:27
std::size_t FindSensitiveVolume(geo::Point_t const &point) const
Definition: AuxDetGeo.cxx:126
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
AuxDetSensitiveGeo const & geo::AuxDetGeo::PositionToSensitiveVolume ( double const  worldLoc[3],
size_t &  sv 
) const
Deprecated:
Use the version with geo::Point_t argument instead

Definition at line 174 of file AuxDetGeo.cxx.

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

AuxDetSensitiveGeo const & PositionToSensitiveVolume(geo::Point_t const &point, size_t &sv) const
Definition: AuxDetGeo.cxx:162
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
template<typename Stream >
void geo::AuxDetGeo::PrintAuxDetInfo ( Stream &&  out,
std::string  indent = "",
unsigned int  verbosity = 1 
) const

Prints information about this auxiliary 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: only detector name
  • 1 _(default)_: also center
  • 2: also size
  • 3: also number of sensitive detectors
  • 4: also normal direction

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

Definition at line 225 of file AuxDetGeo.h.

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

Referenced by NSensitiveVolume(), and geo::GeometryCore::Print().

229  {
230 
231  //----------------------------------------------------------------------------
232  out << "\"" << Name() << "\"";
233 
234  if (verbosity-- <= 0) return; // 0
235 
236  //----------------------------------------------------------------------------
237  out << " centered at " << GetCenter() << " cm";
238 
239  if (verbosity-- <= 0) return; // 1
240 
241  //----------------------------------------------------------------------------
243  out << ", size ( " << (2.0 * HalfWidth1());
244  if (coordIs.nonEqual(HalfWidth1(), HalfWidth2()))
245  out << "/" << (2.0 * HalfWidth2());
246  out << " x " << (2.0 * HalfHeight()) << " x " << Length() << " ) cm";
247 
248  if (verbosity-- <= 0) return; // 2
249 
250  //----------------------------------------------------------------------------
251  out << "\n" << indent
252  << "with ";
253  switch (NSensitiveVolume()) {
254  case 0: out << "no sensitive volume"; break;
255  case 1: out << "1 sensitive volume"; break;
256  default: out << NSensitiveVolume() << " sensitive volumes"; break;
257  } // switch
258 
259  if (verbosity-- <= 0) return; // 3
260 
261  //----------------------------------------------------------------------------
262  out << ", normal facing " << GetNormalVector();
263 
264 // if (verbosity-- <= 0) return; // 4
265 
266  //----------------------------------------------------------------------------
267 
268 } // geo::AuxDetGeo::PrintAuxDetInfo()
Provides simple real number checks.
double HalfWidth2() const
Returns the distance of point from the center of the detector.
Definition: AuxDetGeo.h:92
double HalfHeight() const
Returns the distance of point from the center of the detector.
Definition: AuxDetGeo.h:93
std::string indent(std::size_t const i)
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:160
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
Definition: AuxDetGeo.cxx:107
double Length() const
Returns the distance of point from the center of the detector.
Definition: AuxDetGeo.h:90
std::string Name() const
Definition: AuxDetGeo.h:142
double HalfWidth1() const
Returns the distance of point from the center of the detector.
Definition: AuxDetGeo.h:91
Float_t e
Definition: plot.C:34
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.
Definition: AuxDetGeo.cxx:97
void geo::AuxDetGeo::SortSubVolumes ( geo::GeoObjectSorter const &  sorter)

Definition at line 178 of file AuxDetGeo.cxx.

References fSensitive, and geo::GeoObjectSorter::SortAuxDetSensitive().

Referenced by NSensitiveVolume().

179  {
180  sorter.SortAuxDetSensitive(fSensitive);
181 
182  return;
183  }
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:213
LocalPoint_t geo::AuxDetGeo::toLocalCoords ( geo::Point_t const &  world) const
inline

Transform point from world frame to local auxiliary detector frame.

Definition at line 128 of file AuxDetGeo.h.

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

129  { return fTrans.toLocalCoords(world); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
LocalVector_t geo::AuxDetGeo::toLocalCoords ( geo::Vector_t const &  world) const
inline

Transform direction vector from world to local.

Definition at line 136 of file AuxDetGeo.h.

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

137  { return fTrans.toLocalCoords(world); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
const TGeoVolume* geo::AuxDetGeo::TotalVolume ( ) const
inline

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

Definition at line 94 of file AuxDetGeo.h.

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

Referenced by geo::sortAuxDetStandard().

94 { return fTotalVolume; }
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
Definition: AuxDetGeo.h:207
geo::Point_t geo::AuxDetGeo::toWorldCoords ( LocalPoint_t const &  local) const
inline

Transform point from local auxiliary detector frame to world frame.

Definition at line 112 of file AuxDetGeo.h.

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

Referenced by GetCenter(), and GetNormalVector().

113  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
geo::Vector_t geo::AuxDetGeo::toWorldCoords ( LocalVector_t const &  local) const
inline

Transform direction vector from local to world.

Definition at line 120 of file AuxDetGeo.h.

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

121  { return fTrans.toWorldCoords(local); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
void geo::AuxDetGeo::WorldToLocal ( const double *  world,
double *  auxdet 
) const
inline

Transform point from world frame to local auxiliary detector frame.

Definition at line 124 of file AuxDetGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocal().

125  { fTrans.WorldToLocal(world, auxdet); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
void geo::AuxDetGeo::WorldToLocalVect ( const double *  world,
double *  auxdet 
) const
inline

Transform direction vector from world to local.

Definition at line 132 of file AuxDetGeo.h.

References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocalVect().

133  { fTrans.WorldToLocalVect(world, auxdet); }
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
Definition: AuxDetGeo.h:208
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.

Member Data Documentation

double geo::AuxDetGeo::fHalfHeight
private

half height of volume

Definition at line 212 of file AuxDetGeo.h.

Referenced by HalfHeight(), and InitShapeSize().

double geo::AuxDetGeo::fHalfWidth1
private

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

Definition at line 210 of file AuxDetGeo.h.

Referenced by HalfWidth1(), and InitShapeSize().

double geo::AuxDetGeo::fHalfWidth2
private

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

Definition at line 211 of file AuxDetGeo.h.

Referenced by HalfWidth2(), and InitShapeSize().

double geo::AuxDetGeo::fLength
private

length of volume, along z direction in local

Definition at line 209 of file AuxDetGeo.h.

Referenced by InitShapeSize(), and Length().

std::vector<AuxDetSensitiveGeo*> geo::AuxDetGeo::fSensitive
private

sensitive volumes in the detector

Definition at line 213 of file AuxDetGeo.h.

Referenced by AuxDetGeo(), FindSensitiveVolume(), MakeAuxDetSensitive(), NSensitiveVolume(), SensitiveVolume(), SortSubVolumes(), and ~AuxDetGeo().

const TGeoVolume* geo::AuxDetGeo::fTotalVolume
private

Total volume of AuxDet, called vol*.

Definition at line 207 of file AuxDetGeo.h.

Referenced by AuxDetGeo(), InitShapeSize(), Name(), and TotalVolume().

LocalTransformation_t geo::AuxDetGeo::fTrans
private

Auxiliary detector-to-world transformation.

Definition at line 208 of file AuxDetGeo.h.

Referenced by AuxDetGeo(), LocalToWorld(), LocalToWorldVect(), toLocalCoords(), toWorldCoords(), WorldToLocal(), and WorldToLocalVect().

constexpr unsigned int geo::AuxDetGeo::MaxVerbosity = 4
static

Maximum verbosity supported by PrintAuxDetInfo().

Definition at line 193 of file AuxDetGeo.h.

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


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