LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "OpDetGeo.h"
Public Types | |
Types for geometry-local reference vectors. | |
These types represents points and displacement vectors in the reference frame defined in the optical detector geometry box from the GDML geometry description. No alias is explicitly defined for the LArSoft global vector types, Remember the | |
using | LocalPoint_t = geo::OpticalPoint_t |
Type of points in the local GDML TPC frame. More... | |
using | LocalVector_t = geo::OpticalVector_t |
Type of displacement vectors in the local GDML TPC frame. More... | |
Public Member Functions | |
OpDetGeo (TGeoNode const &node, geo::TransformationMatrix &&trans) | |
geo::OpDetID const & | ID () const |
Returns the geometry ID of this optical detector. More... | |
geo::Point_t const & | GetCenter () const |
double | RMin () const |
double | RMax () const |
double | HalfL () const |
double | HalfW () const |
double | HalfH () const |
double | Length () const |
double | Width () const |
double | Height () const |
double | ThetaZ () const |
double | ThetaZ (bool degrees) const |
const TGeoNode * | Node () const |
Returns the ROOT object describing the detector geometry. More... | |
void | UpdateAfterSorting (geo::OpDetID opdetid) |
Performs all updates after cryostat has sorted the optical detectors. More... | |
template<typename Stream > | |
void | PrintOpDetInfo (Stream &&out, std::string indent="", unsigned int verbosity=0) const |
Prints information about this optical detector. More... | |
std::string | OpDetInfo (std::string indent="", unsigned int verbosity=0) const |
Returns a string with optical detector information. More... | |
double | CosThetaFromNormal (geo::Point_t const &point) const |
Get cos(angle) to normal of this detector - used for solid angle calcs. More... | |
double | DistanceToPoint (geo::Point_t const &point) const |
Returns the distance of the specified point from detector center [cm]. More... | |
Coordinate transformation | |
Local points and displacement vectors are described by the types | |
geo::Point_t | toWorldCoords (LocalPoint_t const &local) const |
Transform point from local optical 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 optical detector frame. More... | |
LocalVector_t | toLocalCoords (geo::Vector_t const &world) const |
Transform direction vector from world to local. More... | |
Detector shape | |
TGeoShape const * | Shape () const |
Returns the geometry object as TGeoShape . More... | |
template<typename ShapeObj > | |
bool | isShape () const |
Returns whether the detector has the specified shape. More... | |
template<typename ShapeObj > | |
bool | isShapeLike () const |
Returns whether the detector inherits from the specified shape. More... | |
bool | isTube () const |
Returns whether the detector shape is a cylinder (TGeoTube ). More... | |
bool | isBar () const |
Returns whether the detector shape is a bar (TGeoBBox ). More... | |
bool | isSphere () const |
Returns whether the detector shape is a hemisphere (TGeoSphere ). More... | |
Static Public Attributes | |
static constexpr unsigned int | MaxVerbosity = 2 |
Maximum verbosity supported by PrintOpDetInfo() . More... | |
Private Types | |
using | LocalTransformation_t = geo::LocalTransformationGeo< ROOT::Math::Transform3D, LocalPoint_t, LocalVector_t > |
Private Member Functions | |
TGeoTube const * | asTube () const |
Returns the geometry object as TGeoTube , nullptr if not a tube. More... | |
TGeoSphere const * | asSphere () const |
Returns the geometry object as TGeoSphere , nullptr if not a sphere. More... | |
TGeoBBox const * | asBox () const |
Returns the geometry object as TGeoBBox , nullptr if not box-derived. More... | |
Private Attributes | |
LocalTransformation_t | fTrans |
Optical-detector-to-world transformation. More... | |
const TGeoNode * | fOpDetNode |
Pointer to theopdet node. More... | |
geo::Point_t | fCenter |
Stored geometric center of the optical detector. More... | |
geo::OpDetID | fID |
Identifier of this optical detector. More... | |
Definition at line 42 of file OpDetGeo.h.
Type of points in the local GDML TPC frame.
Definition at line 60 of file OpDetGeo.h.
|
private |
Definition at line 226 of file OpDetGeo.h.
Type of displacement vectors in the local GDML TPC frame.
Definition at line 63 of file OpDetGeo.h.
geo::OpDetGeo::OpDetGeo | ( | TGeoNode const & | node, |
geo::TransformationMatrix && | trans | ||
) |
Definition at line 26 of file OpDetGeo.cxx.
References fCenter, fOpDetNode, and toWorldCoords().
|
inlineprivate |
Returns the geometry object as TGeoBBox
, nullptr
if not box-derived.
Definition at line 241 of file OpDetGeo.h.
References Shape().
Referenced by HalfH(), HalfL(), and HalfW().
|
inlineprivate |
Returns the geometry object as TGeoSphere
, nullptr
if not a sphere.
Definition at line 238 of file OpDetGeo.h.
References Shape().
Referenced by PrintOpDetInfo(), RMax(), and RMin().
|
inlineprivate |
Returns the geometry object as TGeoTube
, nullptr
if not a tube.
Definition at line 235 of file OpDetGeo.h.
References Shape().
Referenced by RMax(), and RMin().
double geo::OpDetGeo::CosThetaFromNormal | ( | geo::Point_t const & | point | ) | const |
Get cos(angle) to normal of this detector - used for solid angle calcs.
Definition at line 113 of file OpDetGeo.cxx.
References toLocalCoords().
Referenced by Height(), and phot::PhotonVisibilityService::SolidAngleFactorImpl().
double geo::OpDetGeo::DistanceToPoint | ( | geo::Point_t const & | point | ) | const |
Returns the distance of the specified point from detector center [cm].
Definition at line 98 of file OpDetGeo.cxx.
References GetCenter().
Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), phot::PhotonVisibilityService::DistanceToOpDetImpl(), geo::CryostatGeo::GetClosestOpDet(), phot::PhotonLibraryHybrid::GetCount(), and Height().
|
inline |
Definition at line 72 of file OpDetGeo.h.
References fCenter, HalfH(), HalfL(), HalfW(), RMax(), and RMin().
Referenced by opdet::SimPhotonCounter::beginJob(), geo::DumpChannelMap::beginRun(), phot::CreateHybridLibrary::CreateHybridLibrary(), DistanceToPoint(), evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), larg4::OpDetLookup::FindClosestOpDet(), phot::PropagationTimeModel::opDetCenters(), phot::PDFastSimPAR::opDetCenters(), larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), PrintOpDetInfo(), and ThetaZ().
double geo::OpDetGeo::HalfH | ( | ) | const |
Definition at line 60 of file OpDetGeo.cxx.
References asBox().
Referenced by evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), GetCenter(), and Height().
double geo::OpDetGeo::HalfL | ( | ) | const |
Definition at line 44 of file OpDetGeo.cxx.
References asBox().
Referenced by GetCenter(), Length(), and ThetaZ().
double geo::OpDetGeo::HalfW | ( | ) | const |
Definition at line 52 of file OpDetGeo.cxx.
References asBox().
Referenced by evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), GetCenter(), and Width().
|
inline |
Definition at line 80 of file OpDetGeo.h.
References CosThetaFromNormal(), DistanceToPoint(), fTrans, HalfH(), ThetaZ(), geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords(), and toWorldCoords().
Referenced by phot::PropagationTimeModel::opDetOrientations(), larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), and PrintOpDetInfo().
|
inline |
Returns the geometry ID of this optical detector.
Definition at line 70 of file OpDetGeo.h.
References fID.
Referenced by geo::DumpChannelMap::beginRun(), and PrintOpDetInfo().
|
inline |
Returns whether the detector shape is a bar (TGeoBBox
).
Definition at line 180 of file OpDetGeo.h.
Referenced by phot::PropagationTimeModel::opDetOrientations(), larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), and PrintOpDetInfo().
bool geo::OpDetGeo::isShape | ( | ) | const |
Returns whether the detector has the specified shape.
ShapeObj | type of ROOT geometry object representing the shape |
isShapeLike()
, isBox()
, isSphere()
, isTube()
Example:
will have isSphere
true
only if the shape of this object is a sphere (TGeoSphere
), and isBox
true
only if the shape of this object is a box (TGeoBBox
).
Definition at line 252 of file OpDetGeo.h.
References Shape().
Referenced by Shape().
bool geo::OpDetGeo::isShapeLike | ( | ) | const |
Returns whether the detector inherits from the specified shape.
ShapeObj | type of ROOT geometry object representing the shape |
isShape()
, isBox()
, isSphere()
, isTube()
Example:
isTubeLike
will be true
if its shape is either a box (TGeoTube
) or any other whose shape object is derived from TGeoTube
(including for example a C-shape, half-cylinder).
Definition at line 264 of file OpDetGeo.h.
References Shape().
Referenced by Shape().
|
inline |
Returns whether the detector shape is a hemisphere (TGeoSphere
).
Definition at line 183 of file OpDetGeo.h.
References art::detail::indent(), OpDetInfo(), PrintOpDetInfo(), and UpdateAfterSorting().
Referenced by phot::PropagationTimeModel::opDetOrientations(), phot::SemiAnalyticalModel::opticalDetectors(), and PrintOpDetInfo().
|
inline |
Returns whether the detector shape is a cylinder (TGeoTube
).
Definition at line 177 of file OpDetGeo.h.
Referenced by PrintOpDetInfo().
|
inline |
Definition at line 78 of file OpDetGeo.h.
References HalfL().
Referenced by larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), and PrintOpDetInfo().
|
inline |
Returns the ROOT object describing the detector geometry.
Definition at line 132 of file OpDetGeo.h.
References fOpDetNode.
Referenced by Shape().
std::string geo::OpDetGeo::OpDetInfo | ( | std::string | indent = "" , |
unsigned int | verbosity = 0 |
||
) | const |
Returns a string with optical detector information.
PrintOpDetInfo()
Arguments and provided information are the same as in PrintOpDetInfo()
.
Definition at line 104 of file OpDetGeo.cxx.
References PrintOpDetInfo().
Referenced by isSphere().
void geo::OpDetGeo::PrintOpDetInfo | ( | Stream && | out, |
std::string | indent = "" , |
||
unsigned int | verbosity = 0 |
||
) | const |
Prints information about this optical detector.
Stream | type of output stream to use |
out | stream to send the information to |
indent | prepend each line with this string |
verbosity | amount of information printed |
Note that the first line out the output is not indented.
The constant MaxVerbosity
is set to the highest supported verbosity level.
Definition at line 275 of file OpDetGeo.h.
References asSphere(), e, lar::util::RealComparisons< RealType >::equal(), GetCenter(), Height(), ID(), isBar(), isSphere(), isTube(), Length(), lar_content::minmax(), lar::util::RealComparisons< RealType >::nonZero(), RMax(), RMin(), Shape(), ThetaZ(), Width(), and lar::util::RealComparisons< RealType >::zero().
Referenced by isSphere(), OpDetInfo(), and geo::GeometryCore::Print().
double geo::OpDetGeo::RMax | ( | ) | const |
Definition at line 35 of file OpDetGeo.cxx.
References asSphere(), and asTube().
Referenced by GetCenter(), and PrintOpDetInfo().
double geo::OpDetGeo::RMin | ( | ) | const |
Definition at line 68 of file OpDetGeo.cxx.
References asSphere(), and asTube().
Referenced by GetCenter(), and PrintOpDetInfo().
|
inline |
Returns the geometry object as TGeoShape
.
Definition at line 139 of file OpDetGeo.h.
References isShape(), isShapeLike(), and Node().
Referenced by asBox(), asSphere(), asTube(), isShape(), isShapeLike(), larg4::OpFastScintillation::OpFastScintillation(), and PrintOpDetInfo().
double geo::OpDetGeo::ThetaZ | ( | ) | const |
returns angle of detector with respect to z axis in the Y-Z plane, in radians
Definition at line 76 of file OpDetGeo.cxx.
References util::abs(), util::end(), GetCenter(), HalfL(), util::pi(), and toWorldCoords().
Referenced by Height(), PrintOpDetInfo(), and ThetaZ().
double geo::OpDetGeo::ThetaZ | ( | bool | degrees | ) | const |
returns angle of detector with respect to z axis in the Y-Z plane
Definition at line 92 of file OpDetGeo.cxx.
References util::RadiansToDegrees(), and ThetaZ().
|
inline |
Transform point from world frame to local optical detector frame.
Definition at line 118 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().
Referenced by CosThetaFromNormal().
|
inline |
Transform direction vector from world to local.
Definition at line 124 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().
|
inline |
Transform point from local optical detector frame to world frame.
Definition at line 106 of file OpDetGeo.h.
Referenced by Height(), OpDetGeo(), and ThetaZ().
|
inline |
Transform direction vector from local to world.
Definition at line 112 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().
void geo::OpDetGeo::UpdateAfterSorting | ( | geo::OpDetID | opdetid | ) |
Performs all updates after cryostat has sorted the optical detectors.
Definition at line 120 of file OpDetGeo.cxx.
References fID.
Referenced by isSphere().
|
inline |
Definition at line 79 of file OpDetGeo.h.
References HalfW().
Referenced by phot::PropagationTimeModel::opDetOrientations(), phot::SemiAnalyticalModel::opticalDetectors(), and PrintOpDetInfo().
|
private |
Stored geometric center of the optical detector.
Definition at line 230 of file OpDetGeo.h.
Referenced by GetCenter(), and OpDetGeo().
|
private |
Identifier of this optical detector.
Definition at line 232 of file OpDetGeo.h.
Referenced by ID(), and UpdateAfterSorting().
|
private |
Pointer to theopdet node.
Definition at line 229 of file OpDetGeo.h.
Referenced by Node(), and OpDetGeo().
|
private |
Optical-detector-to-world transformation.
Definition at line 228 of file OpDetGeo.h.
Referenced by Height(), toLocalCoords(), and toWorldCoords().
|
static |
Maximum verbosity supported by PrintOpDetInfo()
.
Definition at line 222 of file OpDetGeo.h.
Referenced by geo::GeometryCore::Print().