"MarlinReco"  1.32.0
VXDGeometry.h
1 #ifndef VXDGeometry_h
2 #define VXDGeometry_h 1
3 
4 //#include "lcio.h"
5 #include <map>
6 #include <vector>
7 //#include <gsl/gsl_rng.h>
8 
9 #include <gear/GearMgr.h>
10 #include "CLHEP/Vector/TwoVector.h"
11 
13 struct VXDLadder{
14  double phi{}; // phi of ladder - rotation araound z-axis
15  gear::Vector3D trans{}; // translation after rotation
16 // CLHEP::Hep2Vector p0 ; // 'left' end of ladder in r-phi
17 // CLHEP::Hep2Vector p1 ; // 'right' end of ladder in r-phi
18 // CLHEP::Hep2Vector u ; // unit vector along ladder in r-phi
19 };
20 typedef std::vector< std::vector< VXDLadder > > VXDLadders ;
21 
23 struct VXDLayer{
24  double rMin{};
25  double rMax{};
26  double length{};
27  double width{};
28  double thickness{};
29  double gap{};
30  double ladderArea{};
31  int nLadders{};
32 };
33 
34 typedef std::vector< VXDLayer > VXDLayers ;
35 
36 
37 
49 class VXDGeometry {
50 
51 public:
52 
53  VXDGeometry(const VXDGeometry&) = delete;
54  VXDGeometry& operator=(const VXDGeometry&) = delete;
55 
56  VXDGeometry(gear::GearMgr* gearMgr) ;
57 
58 
62  std::pair<int,int> getLadderID( gear::Vector3D labPos, int layerID=-1 ) ;
63 
67  gear::Vector3D lab2LadderPos( gear::Vector3D labPos, int layerID, int ladderID) ;
68 
72  gear::Vector3D ladder2LabPos( gear::Vector3D ladderPos, int layerID, int ladderID) ;
73 
77  gear::Vector3D lab2LadderDir( gear::Vector3D labPos, int layerID, int ladderID) ;
78 
82  gear::Vector3D ladder2LabDir( gear::Vector3D ladderPos, int layerID, int ladderID) ;
83 
84  void test() ;
85 
86 
87 protected:
88 
89  void init() ;
90  VXDGeometry(){}
91 
92  gear::GearMgr* _gearMgr{};
93  VXDLadders _vxdLadders{};
94  VXDLayers _vxdLayers{};
95 
96 } ;
97 
98 #endif
gear::Vector3D ladder2LabPos(gear::Vector3D ladderPos, int layerID, int ladderID)
Convert a position in local ladder coordinates (x_ladder==0 is the middle of the sensitive) to the la...
======= VXDGeometry ========== Helper class for VXD geomtry transformations: from lab frame to ladd...
Definition: VXDGeometry.h:49
gear::Vector3D lab2LadderDir(gear::Vector3D labPos, int layerID, int ladderID)
Convert a direction in the lab frame to local ladder coordinates (x_ladder==0 is the middle of the se...
Helper struct for VXD layer geometry.
Definition: VXDGeometry.h:23
Helper struct for VXD ladder geometry.
Definition: VXDGeometry.h:13
gear::Vector3D lab2LadderPos(gear::Vector3D labPos, int layerID, int ladderID)
Convert a position in the lab frame to local ladder coordinates (x_ladder==0 is the middle of the sen...
gear::Vector3D ladder2LabDir(gear::Vector3D ladderPos, int layerID, int ladderID)
Convert a direction in local ladder coordinates (x_ladder==0 is the middle of the sensitive) to the l...
std::pair< int, int > getLadderID(gear::Vector3D labPos, int layerID=-1)
Return the pair (layerID, ladderID) for the given position, (-1,-1) if not in sensitive volume (in th...