GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
SiPlanesLayerLayout.cc
1 #include "gearimpl/SiPlanesLayerLayoutImpl.h"
2 #include <math.h>
3 
11 namespace gear{
12 
13  void SiPlanesLayerLayoutImpl::addLayer( // old interface method // overloaded to reuse new one with 5 more parameters.
14  // layer
15  int layerID,
16  double layerPositionX, double layerPositionY, double layerPositionZ,
17  // no rotations of the support ladder neither
18  double layerSizeX, double layerSizeY, double layerThickness,
19  double layerRadLength,
20  // sensitive
21  int sensitiveID,
22  double sensitivePositionX, double sensitivePositionY, double sensitivePositionZ,
23  // no sensitive layer Rotations previously, as the sensitive layer was bound to the ladder ("layer" here)
24  double sensitiveSizeX, double sensitiveSizeY, double sensitiveThickness,
25  int sensitiveNpixelX, int sensitiveNpixelY,
26  double sensitivePitchX,double sensitivePitchY,
27  double sensitiveResolution,
28  // no resolution X
29  // and Y
30  double sensitiveRotation1,
31  double sensitiveRotation2,
32  double sensitiveRotation3,
33  double sensitiveRotation4,
34  double sensitiveRadLength )
35  {
36  addLayer( layerID, layerPositionX, layerPositionY, layerPositionZ,
37  0., 0., 0.,
38  layerSizeX, layerSizeY, layerThickness,
39  layerRadLength,
40  // sensitive
41  sensitiveID,
42  sensitivePositionX, sensitivePositionY, sensitivePositionZ,
43  0., 0., 0., // pass zeros as these fields were never present in the old interface
44  sensitiveSizeX, sensitiveSizeY, sensitiveThickness,
45  sensitiveNpixelX, sensitiveNpixelY,
46  sensitivePitchX,sensitivePitchY,
47  sensitiveResolution,
48  0., // pass zeros as X and Y resolution fields
49  0., // were not present in the old interface
50  sensitiveRotation1,
51  sensitiveRotation2,
52  sensitiveRotation3,
53  sensitiveRotation4,
54  sensitiveRadLength );
55 
56  }
57 
59  // layer
60  int layerID,
61  double layerPositionX, double layerPositionY, double layerPositionZ,
62  double layerRotationXY, double layerRotationZX, double layerRotationZY,
63  double layerSizeX, double layerSizeY, double layerThickness,
64  double layerRadLength,
65  // sensitive
66  int sensitiveID,
67  double sensitivePositionX, double sensitivePositionY, double sensitivePositionZ,
68  double sensitiveRotationXY, double sensitiveRotationZX, double sensitiveRotationZY,
69  double sensitiveSizeX, double sensitiveSizeY, double sensitiveThickness,
70  int sensitiveNpixelX, int sensitiveNpixelY,
71  double sensitivePitchX,double sensitivePitchY,
72  double sensitiveResolution,
73  double sensitiveResolutionX,
74  double sensitiveResolutionY,
75  double sensitiveRotation1,
76  double sensitiveRotation2,
77  double sensitiveRotation3,
78  double sensitiveRotation4,
79  double sensitiveRadLength )
80  {
81 
82  Layer lL ;
83  SensLayer sL ;
84  lL.ID = layerID ;
85  lL.PositionX = layerPositionX ;
86  lL.PositionY = layerPositionY ;
87  lL.PositionZ = layerPositionZ ;
88  lL.RotationXY = layerRotationXY;
89  lL.RotationZX = layerRotationZX;
90  lL.RotationZY = layerRotationZY;
91  lL.SizeX = layerSizeX ;
92  lL.SizeY = layerSizeY ;
93  lL.Thickness = layerThickness ;
94  lL.RadLength = layerRadLength ;
95 
96  sL.ID = sensitiveID ;
97  sL.PositionX = sensitivePositionX ;
98  sL.PositionY = sensitivePositionY ;
99  sL.PositionZ = sensitivePositionZ ;
100  sL.RotationXY = sensitiveRotationXY;
101  sL.RotationZX = sensitiveRotationZX;
102  sL.RotationZY = sensitiveRotationZY;
103  sL.SizeX = sensitiveSizeX ;
104  sL.SizeY = sensitiveSizeY ;
105  sL.Thickness = sensitiveThickness ;
106  sL.NpixelX = sensitiveNpixelX;
107  sL.NpixelY = sensitiveNpixelY;
108  sL.PitchX = sensitivePitchX;
109  sL.PitchY = sensitivePitchY;
110  sL.Resolution = sensitiveResolution,
111  sL.ResolutionX = sensitiveResolutionX,
112  sL.ResolutionY = sensitiveResolutionY,
113  sL.Rotation1 = sensitiveRotation1;
114  sL.Rotation2 = sensitiveRotation2;
115  sL.Rotation3 = sensitiveRotation3;
116  sL.Rotation4 = sensitiveRotation4;
117  sL.RadLength = sensitiveRadLength ;
118 
119  _lVec.push_back( lL ) ;
120  _sVec.push_back( sL ) ;
121 
122  }
123 
125  // layer
126  int dutID,
127  double dutPositionX, double dutPositionY, double dutPositionZ,
128  double dutSizeX, double dutSizeY, double dutThickness,
129  double dutRadLength,
130  // sensitive
131  int dutsensitiveID,
132  double dutsensitivePositionX, double dutsensitivePositionY, double dutsensitivePositionZ,
133  double dutsensitiveSizeX, double dutsensitiveSizeY, double dutsensitiveThickness,
134  int dutsensitiveNpixelX, int dutsensitiveNpixelY,
135  double dutsensitivePitchX,double dutsensitivePitchY,
136  double dutsensitiveResolution,
137  double dutsensitiveRotation1,
138  double dutsensitiveRotation2,
139  double dutsensitiveRotation3,
140  double dutsensitiveRotation4,
141  double dutsensitiveRadLength)
142  {
143 
144  Layer lDUT ;
145  SensLayer sDUT ;
146  lDUT.ID = dutID ;
147  lDUT.PositionX = dutPositionX ;
148  lDUT.PositionY = dutPositionY ;
149  lDUT.PositionZ = dutPositionZ ;
150  lDUT.SizeX = dutSizeX ;
151  lDUT.SizeY = dutSizeY ;
152  lDUT.Thickness = dutThickness ;
153  lDUT.RadLength = dutRadLength ;
154 
155  sDUT.ID = dutsensitiveID ;
156  sDUT.PositionX = dutsensitivePositionX ;
157  sDUT.PositionY = dutsensitivePositionY ;
158  sDUT.PositionZ = dutsensitivePositionZ ;
159  sDUT.SizeX = dutsensitiveSizeX ;
160  sDUT.SizeY = dutsensitiveSizeY ;
161  sDUT.Thickness = dutsensitiveThickness ;
162  sDUT.NpixelX = dutsensitiveNpixelX;
163  sDUT.NpixelY = dutsensitiveNpixelY;
164  sDUT.PitchX = dutsensitivePitchX;
165  sDUT.PitchY = dutsensitivePitchY;
166  sDUT.Resolution = dutsensitiveResolution;
167  sDUT.Rotation1 = dutsensitiveRotation1;
168  sDUT.Rotation2 = dutsensitiveRotation2;
169  sDUT.Rotation3 = dutsensitiveRotation3;
170  sDUT.Rotation4 = dutsensitiveRotation4;
171  sDUT.RadLength = dutsensitiveRadLength ;
172 
173  _lDut = lDUT ;
174  _sDut = sDUT ;
175 
176  }
177 
178 } //namespace
virtual void addLayer(int layerID, double layerPositionX, double layerPositionY, double layerPositionZ, double layerRotationXY, double layerRotationZX, double layerRotationZY, double layerSizeX, double layerSizeY, double layerThickness, double layerRadLength, int sensitiveID, double sensitivePositionX, double sensitivePositionY, double sensitivePositionZ, double sensitiveRotationXY, double sensitiveRotationZX, double sensitiveRotationZY, double sensitiveSizeX, double sensitiveSizeY, double sensitiveThickness, int sensitiveNpixelX, int sensitiveNpixelY, double sensitivePitchX, double sensitivePitchY, double sensitiveResolution, double sensitiveResolutionX, double sensitiveResolutionY, double Rotation1, double Rotation2, double Rotation3, double Rotation4, double sensitiveRadLength)
Add a new layer at the given position.
virtual void addDUT(int dutID, double dutPositionX, double dutPositionY, double dutPositionZ, double dutSizeX, double dutSizeY, double dutThickness, double dutRadLength, int dutsensitiveID, double dutsensitivePositionX, double dutsensitivePositionY, double dutsensitivePositionZ, double dutsensitiveSizeX, double dutsensitiveSizeY, double dutsensitiveThickness, int dutsensitiveNpixelX, int dutsensitiveNpixelY, double dutsensitivePitchX, double dutsensitivePitchY, double dutsensitiveResolution, double dutsensitiveRotation1, double dutsensitiveRotation2, double dutsensitiveRotation3, double dutsensitiveRotation4, double dutsensitiveRadLength)
Add a DUT at the given position.
Helper class for layer properties.