GEMC  2.3
Geant4 Monte-Carlo Framework
bmt_strip.h
Go to the documentation of this file.
1 #ifndef bmt_strip_H
2 #define bmt_strip_H 1
3 
4 // geant4
5 #include "G4ThreeVector.hh"
6 
7 // CLHEP units
8 #include "CLHEP/Units/PhysicalConstants.h"
9 using namespace CLHEP;
10 
11 // c++
12 #include <vector>
13 #include <string>
14 using namespace std;
15 
19 
20 // constants to be used in the digitization routine
21 // warning: since fieldScale is also used by processID, the plugin loading
22 // has to happen before the first event is processed.
24 {
25  public:
26 
27  // database
28  int runNo;
29  string variation;
30  string date;
31  string connection;
32 
33  double SigmaDrift; // Max transverse diffusion value (GEMC value)
34  double hDrift; // Size of the drift gap
35  double hStrip2Det; // Distance between strips and the middle of the conversion gap (~half the drift gap)
36  double ThetaL; // Lorentz angle
37  double fieldScale; // Scaling of the field - 1 means a 5 Tesla field along z
38 
39  // THE GEOMETRY CONSTANTS
40  const static int NREGIONS = 3 ; // 3 regions of MM
41 
42  // Z detector characteristics
43  double CRZRADIUS[NREGIONS] ; // the radius of the Z detector in mm
44  int CRZNSTRIPS[NREGIONS] ; // the number of strips
45  double CRZSPACING[NREGIONS] ; // the strip spacing in mm
46  double CRZWIDTH[NREGIONS] ; // the strip width in mm
47  double CRZLENGTH[NREGIONS] ; // the strip length in mm
48  double CRZZMIN[NREGIONS] ; // PCB upstream extremity mm
49  double CRZZMAX[NREGIONS] ; // PCB downstream extremity mm
50  double CRZOFFSET[NREGIONS] ; // Beginning of strips in mm
51  double CRZXPOS[NREGIONS]; // Distance on the PCB between the PCB first edge and the edge of the first strip in mm
52  double CRZEDGE1[NREGIONS][NREGIONS]; // the angle of the first edge of each PCB detector A, B, C
53  double CRZEDGE2[NREGIONS][NREGIONS]; // the angle of the second edge of each PCB detector A, B, C
54 
55  // C detector characteristics
56  double CRCRADIUS[NREGIONS]; // the radius of the Z detector in mm
57  int CRCNSTRIPS[NREGIONS]; // the number of strips
58  double CRCSPACING[NREGIONS]; // the strip spacing in mm
59  double CRCLENGTH[NREGIONS]; // the strip length in mm
60  double CRCZMIN[NREGIONS]; // PCB upstream extremity mm
61  double CRCZMAX[NREGIONS]; // PCB downstream extremity mm
62  double CRCOFFSET[NREGIONS]; // Beginning of strips in mm
63  double CRCXPOS[NREGIONS]; // Distance on the PCB between the PCB first edge and the edge of the first strip in mm
64  double CRCEDGE1[NREGIONS][NREGIONS]; // the angle of the first edge of each PCB detector A, B, C
65  double CRCEDGE2[NREGIONS][NREGIONS]; // the angle of the second edge of each PCB detector A, B, C
66  vector<vector<int> > CRCGROUP; // Number of strips with same width
67  vector<vector<double> > CRCWIDTH; // the width of the corresponding group of strips
68 
69  void changeFieldScale(double newFieldScale)
70  {
71  fieldScale = newFieldScale;
72  ThetaL = fieldScale*20.*degree;
73  }
74 
75 };
76 
77 
78 class bmt_strip
79 {
80  public:
81 
82 
83 
84  vector<double> FindStrip( int layer, int sector, G4ThreeVector xyz, double Edep, bmtConstants bmtc); // Strip Finding Routine
85 
86 
87  double getEnergyFraction(double z0, double z, double sigma); // gaussian pdf
88  int getDetectorIndex(int sector); // index of the detector (0...2): sector 1 corresponds to detector B, 2 to A, 3 to C in the geometry created by GEMC
89 
90  double getSigmaLongit( int layer, double x, double y, bmtConstants bmtc); // sigma for C-detector
91  double getSigmaAzimuth(int layer, double x, double y, bmtConstants bmtc); // sigma for Z-detectors
92  int getZStrip(int layer, double angle, bmtConstants bmtc); // the Z strip as a function of azimuthal angle
93  int getCStrip(int layer, double trk_z, bmtConstants bmtc); // the Z strip as a function of z
94  double CRCStrip_GetZ(int layer, int strip, bmtConstants bmtc); // the z position of a given C strip. Not used?
95  double CRZStrip_GetPhi(int sector, int layer, int strip, bmtConstants bmtc); // the phi angle of a given Z strip. Not used?
96  int isInSector(int layer, double angle, bmtConstants bmtc); // the sector according to this geometry defined in fillinfos()
97 
98 
99 };
100 
101 #endif
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
double fieldScale
Definition: bmt_strip.h:37
string connection
Definition: bmt_strip.h:31
vector< vector< int > > CRCGROUP
Definition: bmt_strip.h:66
STL namespace.
string date
Definition: bmt_strip.h:30
double SigmaDrift
Definition: bmt_strip.h:33
void changeFieldScale(double newFieldScale)
Definition: bmt_strip.h:69
vector< vector< double > > CRCWIDTH
Definition: bmt_strip.h:67
double ThetaL
Definition: bmt_strip.h:36
string variation
Definition: bmt_strip.h:29
double hStrip2Det
Definition: bmt_strip.h:35
double hDrift
Definition: bmt_strip.h:34