LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "OpDetGeo.h"
Classes | |
struct | OpDetGeoCoordinatesTag |
Tag for vectors in the "local" GDML coordinate frame of the TPC. More... | |
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::Point3DBase_t< OpDetGeoCoordinatesTag > |
Type of points in the local GDML TPC frame. More... | |
using | LocalVector_t = geo::Vector3DBase_t< OpDetGeoCoordinatesTag > |
Type of displacement vectors in the local GDML TPC frame. More... | |
Public Member Functions | |
OpDetGeo (std::vector< const TGeoNode * > &path, int depth) | |
void | GetCenter (double *xyz, double localz=0.0) const |
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... | |
TGeoShape const * | Shape () const |
Returns the geometry object as TGeoShape . More... | |
bool | isTube () const |
Returns whether the detector shape is a cilynder (TGeoTube ). More... | |
bool | isBar () const |
Returns whether the detector shape is a bar (TGeoBBox ). More... | |
template<typename Stream > | |
void | PrintOpDetInfo (Stream &&out, std::string indent="", unsigned int verbosity=0) const |
Prints information about this optical detector. More... | |
double | CosThetaFromNormal (geo::Point_t const &point) const |
Get cos(angle) to normal of this detector - used for solid angle calcs. More... | |
double | CosThetaFromNormal (double const *xyz) 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... | |
double | DistanceToPoint (double const *xyz) 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 | |
void | LocalToWorld (const double *opdet, double *world) const |
Transform point from local optical detector frame to world frame. More... | |
geo::Point_t | toWorldCoords (LocalPoint_t const &local) const |
Transform point from local optical detector frame to world frame. More... | |
void | LocalToWorldVect (const double *opdet, 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 *opdet) const |
Transform point from world frame to local optical detector frame. More... | |
LocalPoint_t | toLocalCoords (geo::Point_t const &world) const |
Transform point from world frame to local optical detector frame. More... | |
void | WorldToLocalVect (const double *world, double *opdet) 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... | |
Static Public Attributes | |
static constexpr unsigned int | MaxVerbosity = 2 |
Maximum verbosity supported by PrintOpDetInfo() . More... | |
Private Types | |
using | LocalTransformation_t = geo::LocalTransformationGeo< TGeoHMatrix, LocalPoint_t, LocalVector_t > |
Private Member Functions | |
TGeoTube const * | asTube () const |
Returns the geometry object as TGeoTube , nullptr if not a tube. More... | |
TGeoBBox const * | asBox () const |
Returns the geometry object as TGeoBBox , nullptr if not a tube. 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... | |
Definition at line 33 of file OpDetGeo.h.
Type of points in the local GDML TPC frame.
Definition at line 55 of file OpDetGeo.h.
|
private |
Definition at line 176 of file OpDetGeo.h.
Type of displacement vectors in the local GDML TPC frame.
Definition at line 58 of file OpDetGeo.h.
geo::OpDetGeo::OpDetGeo | ( | std::vector< const TGeoNode * > & | path, |
int | depth | ||
) |
Definition at line 32 of file OpDetGeo.cxx.
References fCenter, fOpDetNode, and toWorldCoords().
|
inlineprivate |
Returns the geometry object as TGeoBBox
, nullptr
if not a tube.
Definition at line 187 of file OpDetGeo.h.
References Shape().
Referenced by HalfH(), HalfL(), HalfW(), and isBar().
|
inlineprivate |
Returns the geometry object as TGeoTube
, nullptr
if not a tube.
Definition at line 183 of file OpDetGeo.h.
References Shape().
Referenced by isTube(), 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 121 of file OpDetGeo.cxx.
References toLocalCoords().
Referenced by CosThetaFromNormal(), Height(), and phot::PhotonVisibilityService::SolidAngleFactor().
double geo::OpDetGeo::CosThetaFromNormal | ( | double const * | xyz | ) | const |
Get cos(angle) to normal of this detector - used for solid angle calcs.
Definition at line 125 of file OpDetGeo.cxx.
References CosThetaFromNormal().
double geo::OpDetGeo::DistanceToPoint | ( | geo::Point_t const & | point | ) | const |
Returns the distance of the specified point from detector center [cm].
Definition at line 114 of file OpDetGeo.cxx.
References GetCenter().
Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), phot::PhotonVisibilityService::DistanceToOpDet(), DistanceToPoint(), geo::CryostatGeo::GetClosestOpDet(), phot::PhotonLibraryHybrid::GetCount(), and Height().
double geo::OpDetGeo::DistanceToPoint | ( | double const * | xyz | ) | const |
Returns the distance of the specified point from detector center [cm].
Definition at line 116 of file OpDetGeo.cxx.
References DistanceToPoint().
void geo::OpDetGeo::GetCenter | ( | double * | xyz, |
double | localz = 0.0 |
||
) | const |
Return the center position of an opdet
xyz | : 3-D array. The returned location. |
localz | : Distance along the length of the volume (cm). Default is center of wire |
Definition at line 47 of file OpDetGeo.cxx.
References LocalToWorld().
Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), larg4::OpDetLookup::FindClosestOpDet(), and larg4::OpFastScintillation::propagation_time().
|
inline |
Definition at line 66 of file OpDetGeo.h.
References fCenter, HalfH(), HalfL(), HalfW(), RMax(), and RMin().
Referenced by DistanceToPoint(), PrintOpDetInfo(), and ThetaZ().
double geo::OpDetGeo::HalfH | ( | ) | const |
Definition at line 78 of file OpDetGeo.cxx.
References asBox().
Referenced by GetCenter(), and Height().
double geo::OpDetGeo::HalfL | ( | ) | const |
Definition at line 62 of file OpDetGeo.cxx.
References asBox().
Referenced by GetCenter(), Length(), and ThetaZ().
double geo::OpDetGeo::HalfW | ( | ) | const |
Definition at line 70 of file OpDetGeo.cxx.
References asBox().
Referenced by GetCenter(), and Width().
|
inline |
Definition at line 74 of file OpDetGeo.h.
References CosThetaFromNormal(), DistanceToPoint(), fTrans, HalfH(), geo::LocalTransformation< StoredMatrix >::LocalToWorld(), LocalToWorld(), and ThetaZ().
Referenced by PrintOpDetInfo().
|
inline |
Returns whether the detector shape is a bar (TGeoBBox
).
Definition at line 146 of file OpDetGeo.h.
References asBox(), art::detail::indent(), isTube(), and PrintOpDetInfo().
Referenced by PrintOpDetInfo().
|
inline |
Returns whether the detector shape is a cilynder (TGeoTube
).
Definition at line 143 of file OpDetGeo.h.
References asTube().
Referenced by isBar(), and PrintOpDetInfo().
|
inline |
|
inline |
Transform point from local optical detector frame to world frame.
Definition at line 103 of file OpDetGeo.h.
Referenced by geo::DUNE_opdet_sort(), GetCenter(), Height(), and geo::opdet_sort().
|
inline |
Transform direction vector from local to world.
Definition at line 111 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorldVect().
|
inline |
Returns the ROOT object describing the detector geometry.
Definition at line 137 of file OpDetGeo.h.
References fOpDetNode.
Referenced by Shape().
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 199 of file OpDetGeo.h.
References GetCenter(), Height(), isBar(), isTube(), Length(), RMax(), RMin(), Shape(), ThetaZ(), and Width().
Referenced by isBar(), and geo::GeometryCore::Print().
double geo::OpDetGeo::RMax | ( | ) | const |
Definition at line 55 of file OpDetGeo.cxx.
References asTube().
Referenced by GetCenter(), and PrintOpDetInfo().
double geo::OpDetGeo::RMin | ( | ) | const |
Definition at line 86 of file OpDetGeo.cxx.
References asTube().
Referenced by GetCenter(), and PrintOpDetInfo().
|
inline |
Returns the geometry object as TGeoShape
.
Definition at line 140 of file OpDetGeo.h.
References Node().
Referenced by asBox(), asTube(), 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 92 of file OpDetGeo.cxx.
References evd::details::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 108 of file OpDetGeo.cxx.
References util::RadiansToDegrees(), and ThetaZ().
|
inline |
Transform point from world frame to local optical detector frame.
Definition at line 123 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 131 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 107 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().
Referenced by OpDetGeo(), and ThetaZ().
|
inline |
Transform direction vector from local to world.
Definition at line 115 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().
|
inline |
|
inline |
Transform point from world frame to local optical detector frame.
Definition at line 119 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocal().
|
inline |
Transform direction vector from world to local.
Definition at line 127 of file OpDetGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocalVect().
|
private |
Stored geometric center of the optical detector.
Definition at line 180 of file OpDetGeo.h.
Referenced by GetCenter(), and OpDetGeo().
|
private |
Pointer to theopdet node.
Definition at line 179 of file OpDetGeo.h.
Referenced by Node(), and OpDetGeo().
|
private |
Optical-detector-to-world transformation.
Definition at line 178 of file OpDetGeo.h.
Referenced by Height(), LocalToWorldVect(), toLocalCoords(), toWorldCoords(), WorldToLocal(), and WorldToLocalVect().
|
static |
Maximum verbosity supported by PrintOpDetInfo()
.
Definition at line 172 of file OpDetGeo.h.
Referenced by geo::GeometryCore::Print().