#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... | |
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... | |
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 | CosThetaFromNormal (double const *xyz) const |
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 |
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... | |
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 43 of file OpDetGeo.h.
Type of points in the local GDML TPC frame.
Definition at line 62 of file OpDetGeo.h.
|
private |
Definition at line 244 of file OpDetGeo.h.
Type of displacement vectors in the local GDML TPC frame.
Definition at line 65 of file OpDetGeo.h.
geo::OpDetGeo::OpDetGeo | ( | TGeoNode const & | node, |
geo::TransformationMatrix && | trans | ||
) |
Definition at line 26 of file OpDetGeo.cxx.
|
inlineprivate |
Returns the geometry object as TGeoBBox
, nullptr
if not box-derived.
Definition at line 261 of file OpDetGeo.h.
|
inlineprivate |
Returns the geometry object as TGeoSphere
, nullptr
if not a sphere.
Definition at line 257 of file OpDetGeo.h.
|
inlineprivate |
Returns the geometry object as TGeoTube
, nullptr
if not a tube.
Definition at line 253 of file OpDetGeo.h.
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 138 of file OpDetGeo.cxx.
double geo::OpDetGeo::CosThetaFromNormal | ( | double const * | xyz | ) | const |
Definition at line 142 of file OpDetGeo.cxx.
double geo::OpDetGeo::DistanceToPoint | ( | geo::Point_t const & | point | ) | const |
Returns the distance of the specified point from detector center [cm].
Definition at line 123 of file OpDetGeo.cxx.
double geo::OpDetGeo::DistanceToPoint | ( | double const * | xyz | ) | const |
Definition at line 125 of file OpDetGeo.cxx.
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 40 of file OpDetGeo.cxx.
|
inline |
Definition at line 75 of file OpDetGeo.h.
double geo::OpDetGeo::HalfH | ( | ) | const |
Definition at line 79 of file OpDetGeo.cxx.
double geo::OpDetGeo::HalfL | ( | ) | const |
Definition at line 63 of file OpDetGeo.cxx.
double geo::OpDetGeo::HalfW | ( | ) | const |
Definition at line 71 of file OpDetGeo.cxx.
|
inline |
Definition at line 83 of file OpDetGeo.h.
|
inline |
|
inline |
Returns whether the detector shape is a bar (TGeoBBox
).
Definition at line 195 of file OpDetGeo.h.
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()
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 274 of file OpDetGeo.h.
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()
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 285 of file OpDetGeo.h.
|
inline |
Returns whether the detector shape is a hemisphere (TGeoSphere
).
Definition at line 198 of file OpDetGeo.h.
|
inline |
Returns whether the detector shape is a cylinder (TGeoTube
).
Definition at line 192 of file OpDetGeo.h.
|
inline |
Definition at line 81 of file OpDetGeo.h.
|
inline |
Transform point from local optical detector frame to world frame.
Definition at line 112 of file OpDetGeo.h.
|
inline |
Transform direction vector from local to world.
Definition at line 120 of file OpDetGeo.h.
|
inline |
Returns the ROOT object describing the detector geometry.
Definition at line 146 of file OpDetGeo.h.
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 130 of file OpDetGeo.cxx.
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 296 of file OpDetGeo.h.
double geo::OpDetGeo::RMax | ( | ) | const |
Definition at line 48 of file OpDetGeo.cxx.
double geo::OpDetGeo::RMin | ( | ) | const |
Definition at line 87 of file OpDetGeo.cxx.
|
inline |
Returns the geometry object as TGeoShape
.
Definition at line 154 of file OpDetGeo.h.
double geo::OpDetGeo::ThetaZ | ( | ) | const |
returns angle of detector with respect to z axis in the Y-Z plane, in radians
Definition at line 101 of file OpDetGeo.cxx.
double geo::OpDetGeo::ThetaZ | ( | bool | degrees | ) | const |
returns angle of detector with respect to z axis in the Y-Z plane
Definition at line 117 of file OpDetGeo.cxx.
|
inline |
Transform point from world frame to local optical detector frame.
Definition at line 132 of file OpDetGeo.h.
|
inline |
Transform direction vector from world to local.
Definition at line 140 of file OpDetGeo.h.
|
inline |
Transform point from local optical detector frame to world frame.
Definition at line 116 of file OpDetGeo.h.
|
inline |
Transform direction vector from local to world.
Definition at line 124 of file OpDetGeo.h.
void geo::OpDetGeo::UpdateAfterSorting | ( | geo::OpDetID | opdetid | ) |
Performs all updates after cryostat has sorted the optical detectors.
Definition at line 146 of file OpDetGeo.cxx.
|
inline |
Definition at line 82 of file OpDetGeo.h.
|
inline |
Transform point from world frame to local optical detector frame.
Definition at line 128 of file OpDetGeo.h.
|
inline |
Transform direction vector from world to local.
Definition at line 136 of file OpDetGeo.h.
|
private |
Stored geometric center of the optical detector.
Definition at line 248 of file OpDetGeo.h.
|
private |
Identifier of this optical detector.
Definition at line 250 of file OpDetGeo.h.
|
private |
Pointer to theopdet node.
Definition at line 247 of file OpDetGeo.h.
|
private |
Optical-detector-to-world transformation.
Definition at line 246 of file OpDetGeo.h.
|
static |
Maximum verbosity supported by PrintOpDetInfo()
.
Definition at line 240 of file OpDetGeo.h.