Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DFDCGeometry.h
Go to the documentation of this file.
1 //***************************************************
2 // DFDCGeometry - temporary geometry class for FDC.
3 // Author: Craig Bookwalter (craigb at jlab.org)
4 // Date: March 2006
5 //***************************************************
6 
7 #ifndef DFDCGEOMETRY_H
8 #define DFDCGEOMETRY_H
9 
10 #include "HDGEOMETRY/DGeometry.h"
11 
12 #define FDC_NUM_LAYERS 24
13 #define FDC_NUM_PLANES 72
14 #define FDC_ACTIVE_RADIUS 48.5
15 
16 //----- These were cut from HDGeant/hitFDC.c -----
17 #define DRIFT_SPEED .0055
18 #define CATHODE_ROT_ANGLE 1.309 // 75 degrees
19 //#define CATHODE_ROT_ANGLE 0.7854 // 45 degrees
20 #define WIRE_DEAD_ZONE_RADIUS 3.2
21 #define ANODE_CATHODE_SPACING 0.5
22 #define TWO_HIT_RESOL 250.
23 #define WIRES_PER_PLANE 96
24 #define WIRE_SPACING 1.0
25 #define U_OF_WIRE_ZERO (-((WIRES_PER_PLANE-1)*WIRE_SPACING)/2)
26 #define STRIPS_PER_PLANE 192
27 #define STRIP_SPACING 0.500
28 #define U_OF_STRIP_ZERO (-((STRIPS_PER_PLANE-1)*STRIP_SPACING)/2)
29 #define STRIP_ZERO_OFFSET -95.5
30 #define STRIP_GAP 0.1
31 #define MAX_HITS 100
32 //#define K2 1.15
33 #define STRIP_NODES 3
34 #define THRESH_KEV 1.
35 #define THRESH_STRIPS 5. /* mV */
36 #define ELECTRON_CHARGE 1.6022e-4 /* fC */
37 //------------------------------------------------
38 
39 #include <math.h>
40 
41 #include <JANA/JObject.h>
42 #include "DFDCHit.h"
43 #include "DFDCWire.h"
44 #include "DFDCCathode.h"
45 
46 ///
47 /// class DFDCGeometry: definition of a class providing basic geometry
48 /// methods for FDC reconstruction.
49 ///
50 class DFDCGeometry : public JObject {
51  public:
54 
55  ///
56  /// DFDCGeometry::gLayer():
57  /// Compute the global layer (detection layer 1-24) number based on module and layer
58  ///
59  static inline int gLayer(const DFDCHit* h) {
60  return 3*(h->module - 1) + (h->layer - 1) + 1;
61  }
62 
63  ///
64  /// DFDCGeometry::gPlane():
65  /// Compute the global plane (1-74) number based on module, layer, and plane
66  ///
67  static inline int gPlane(const DFDCHit* h) {
68  return 9*(h->module-1) + 3*(h->layer-1) + (h->plane-1) + 1;
69  }
70 
71  ///
72  /// DFDCGeometry::getWireR():
73  /// Return X coordinate of a wire
74  ///
75  static inline float getWireR(const DFDCHit* h) {
76  return WIRE_SPACING*(h->element-1)+U_OF_WIRE_ZERO;
77 
78  }
79 
80  ///
81  /// DFDCGeometry::getStripR():
82  /// Return coordinate in U or V space of a strip
83  ///
84  static inline float getStripR(const DFDCHit* h) {
86  }
87 
88  ///
89  /// DFDCGeometry::getXLocalStrips()
90  /// Compute the x-coordinate in the layer coordinate system
91  /// from the strip data.
92  ///
93  static inline float getXLocalStrips(float u, float v){
94  return STRIP_SPACING*(u-1 + v-1 - (STRIPS_PER_PLANE-1))
95  /2./cos(CATHODE_ROT_ANGLE);
96  }
97  static inline float getXLocalStrips(float u, float phi_u,float v, float phi_v){
98  float cosPhiU=cos(phi_u);
99  float cosPhiV=cos(phi_v);
100  float sinPhiU=sin(phi_u);
101  float sinPhiV=sin(phi_v);
102  return (u*sinPhiV-v*sinPhiU)/(cosPhiV*sinPhiU-cosPhiU*sinPhiV);
103  }
104 
105 
106  ///
107  /// DFDCGeometry::getYLocalStrips()
108  /// Compute the y-coordinate in the layer coordinate system
109  /// from the strip data
110  ///
111  static inline float getYLocalStrips(float u, float v){
112  return STRIP_SPACING*(u-v)/2./sin(CATHODE_ROT_ANGLE);
113  }
114  static inline float getYLocalStrips(float u, float phi_u,float v, float phi_v){
115  float cosPhiU=cos(phi_u);
116  float cosPhiV=cos(phi_v);
117  float sinPhiU=sin(phi_u);
118  float sinPhiV=sin(phi_v);
119  return (u*cosPhiV-v*cosPhiU)/(cosPhiU*sinPhiV-cosPhiV*sinPhiU);
120  }
121 
122 
123 
124 };
125 
126 #endif // DFDCGEOMETRY_H
static float getXLocalStrips(float u, float phi_u, float v, float phi_v)
Definition: DFDCGeometry.h:97
static float getYLocalStrips(float u, float phi_u, float v, float phi_v)
Definition: DFDCGeometry.h:114
static int gPlane(const DFDCHit *h)
DFDCGeometry::gPlane(): Compute the global plane (1-74) number based on module, layer, and plane.
Definition: DFDCGeometry.h:67
int layer
Definition: DFDCHit.h:23
#define STRIP_SPACING
Definition: DFDCGeometry.h:27
#define U_OF_STRIP_ZERO
Definition: DFDCGeometry.h:28
static int gLayer(const DFDCHit *h)
DFDCGeometry::gLayer(): Compute the global layer (detection layer 1-24) number based on module and la...
Definition: DFDCGeometry.h:59
static float getStripR(const DFDCHit *h)
DFDCGeometry::getStripR(): Return coordinate in U or V space of a strip.
Definition: DFDCGeometry.h:84
int plane
Definition: DFDCHit.h:26
static float getYLocalStrips(float u, float v)
DFDCGeometry::getYLocalStrips() Compute the y-coordinate in the layer coordinate system from the stri...
Definition: DFDCGeometry.h:111
#define U_OF_WIRE_ZERO
Definition: DFDCGeometry.h:25
int element
Definition: DFDCHit.h:25
double sin(double)
#define STRIPS_PER_PLANE
Definition: DFDCGeometry.h:26
class DFDCGeometry: definition of a class providing basic geometry methods for FDC reconstruction...
Definition: DFDCGeometry.h:50
int module
Definition: DFDCHit.h:24
static float getXLocalStrips(float u, float v)
DFDCGeometry::getXLocalStrips() Compute the x-coordinate in the layer coordinate system from the stri...
Definition: DFDCGeometry.h:93
static float getWireR(const DFDCHit *h)
DFDCGeometry::getWireR(): Return X coordinate of a wire.
Definition: DFDCGeometry.h:75
#define CATHODE_ROT_ANGLE
Definition: DFDCGeometry.h:18
union @6::@8 u
#define WIRE_SPACING
Definition: DFDCGeometry.h:24
class DFDCHit: definition for a basic FDC hit data type.
Definition: DFDCHit.h:20