AuxDetGeo.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file AuxDetGeo.h
3 /// \brief Encapsulate the geometry of an auxiliary detector
4 ///
5 /// \author miceli@fnal.gov
6 ////////////////////////////////////////////////////////////////////////
7 
8 #ifndef GEO_AuxDetGeo_H
9 #define GEO_AuxDetGeo_H
10 #include <vector>
11 #include "TGeoVolume.h"
12 
13 #include "Geometry/AuxDetSensitiveGeo.h"
14 
15 class TGeoNode;
16 class TGeoHMatrix;
17 class TGeoMatrix;
18 
19 namespace gar {
20  namespace geo {
21 
22  class AuxDetGeoObjectSorter;
23 
24  class AuxDetGeo {
25  public:
26  AuxDetGeo(std::vector<const TGeoNode*>& path,
27  int depth);
28  ~AuxDetGeo();
29 
30  void GetCenter(double* xyz,
31  double localz=0.0) const;
32  void GetNormalVector(double* xyzDir) const;
33 
34  //box geometry
35  double Length() const { return fLength; }
36  double HalfWidth1() const { return fHalfWidth1; }
37  double HalfWidth2() const { return fHalfWidth2; }
38  double HalfHeight() const { return fHalfHeight; }
39  const TGeoVolume* TotalVolume() const { return fTotalVolume; }
40 
41  double DistanceToPoint(double * xyz) const;
42 
43  void LocalToWorld (const double* local, double* world) const;
44  void LocalToWorldVect(const double* local, double* world) const;
45  void WorldToLocal (const double* world, double* local) const;
46  void WorldToLocalVect(const double* world, double* local) const;
47 
48  std::string Name() const { return fTotalVolume->GetName(); }
49 
50  // methods for the sensitive volumes in the aux det
51 
52  size_t FindSensitiveVolume (double const worldLoc[3]) const;
53  AuxDetSensitiveGeo const& PositionToSensitiveVolume(double const worldLoc[3],
54  size_t & sv) const;
55  AuxDetSensitiveGeo const& SensitiveVolume(size_t sv) const { return *fSensitive[sv]; }
56  size_t NSensitiveVolume() const { return fSensitive.size(); }
57 
58  void SortSubVolumes(geo::AuxDetGeoObjectSorter const& sorter);
59 
60  private:
61 
62  void FindAuxDetSensitive(std::vector<const TGeoNode*>& path,
63  unsigned int depth);
64  void MakeAuxDetSensitive(std::vector<const TGeoNode*>& path,
65  int depth);
66 
67  const TGeoVolume* fTotalVolume; ///< Total volume of AuxDet, called vol*
68  TGeoHMatrix* fGeoMatrix; ///< Transformation matrix to world frame
69  double fLength; ///< length of volume, along z direction in local
70  double fHalfWidth1; ///< 1st half width of volume, at -z/2 in local coordinates
71  double fHalfWidth2; ///< 2nd half width (width1==width2 for boxes), at +z/2
72  double fHalfHeight; ///< half height of volume
73  std::vector<AuxDetSensitiveGeo*> fSensitive; ///< sensitive volumes in the detector
74  };
75  }
76 
77 } // gar
78 
79 #endif
const TGeoVolume * TotalVolume() const
Definition: AuxDetGeo.h:39
std::string string
Definition: nybbler.cc:12
double Length() const
Definition: AuxDetGeo.h:35
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
Definition: AuxDetGeo.h:67
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
Definition: AuxDetGeo.h:70
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
Definition: AuxDetGeo.h:73
double HalfHeight() const
Definition: AuxDetGeo.h:38
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:55
double fHalfHeight
half height of volume
Definition: AuxDetGeo.h:72
void LocalToWorldVect(const double *local, double *world) const
Definition: AuxDetGeo.cxx:136
void GetNormalVector(double *xyzDir) const
Definition: AuxDetGeo.cxx:172
std::string Name() const
Definition: AuxDetGeo.h:48
TGeoHMatrix * fGeoMatrix
Transformation matrix to world frame.
Definition: AuxDetGeo.h:68
double HalfWidth2() const
Definition: AuxDetGeo.h:37
double DistanceToPoint(double *xyz) const
Definition: AuxDetGeo.cxx:181
size_t FindSensitiveVolume(double const worldLoc[3]) const
Definition: AuxDetGeo.cxx:191
void LocalToWorld(const double *local, double *world) const
Definition: AuxDetGeo.cxx:127
void FindAuxDetSensitive(std::vector< const TGeoNode * > &path, unsigned int depth)
Definition: AuxDetGeo.cxx:93
General GArSoft Utilities.
void SortSubVolumes(geo::AuxDetGeoObjectSorter const &sorter)
Definition: AuxDetGeo.cxx:227
void WorldToLocalVect(const double *world, double *local) const
Definition: AuxDetGeo.cxx:154
double HalfWidth1() const
Definition: AuxDetGeo.h:36
void WorldToLocal(const double *world, double *local) const
Definition: AuxDetGeo.cxx:145
AuxDetSensitiveGeo const & PositionToSensitiveVolume(double const worldLoc[3], size_t &sv) const
Definition: AuxDetGeo.cxx:219
AuxDetGeo(std::vector< const TGeoNode * > &path, int depth)
Definition: AuxDetGeo.cxx:30
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void MakeAuxDetSensitive(std::vector< const TGeoNode * > &path, int depth)
Definition: AuxDetGeo.cxx:118
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:56
double fLength
length of volume, along z direction in local
Definition: AuxDetGeo.h:69
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
Definition: AuxDetGeo.h:71
void GetCenter(double *xyz, double localz=0.0) const
Definition: AuxDetGeo.cxx:164