@@ -85,15 +85,16 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
8585 double numWires ;
8686 double R_layer = 32.0d ;
8787 double DR_layer = 4.0d ;
88+ double thster ; // stereo angle in deg, will be convert to radian later
8889
89- double zoff1 = -150 .0d ;
90- double zoff2 = 150.0d ;
91- Point3D p1 = new Point3D (R_layer , 0 , zoff1 );
90+ double z_origin = -188 .0d ;
91+ double z_end = + 162.5d ;
92+ Point3D p1 = new Point3D (R_layer , 0 , z_origin );
9293 Vector3D n1 = new Vector3D (0 , 0 , 1 );
9394
9495 Plane3D lPlane = new Plane3D (p1 , n1 );
9596
96- Point3D p2 = new Point3D (R_layer , 0 , zoff2 );
97+ Point3D p2 = new Point3D (R_layer , 0 , z_end );
9798 Vector3D n2 = new Vector3D (0 , 0 , 1 );
9899 Plane3D rPlane = new Plane3D (p2 , n2 );
99100
@@ -105,46 +106,52 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
105106 if (superlayerId == 0 ) {
106107 numWires = 47.0d ; //47
107108 R_layer = 32.0d ;
109+ thster = -19.1489d ;
108110 } else if (superlayerId == 1 ) {
109111 numWires = 56.0d ; //56
110112 R_layer = 38.0d ;
113+ thster = -19.2857d ;
111114 } else if (superlayerId == 2 ) {
112115 numWires = 72.0d ; //72
113116 R_layer = 48.0d ;
117+ thster = -20.0d ;
114118 } else if (superlayerId == 3 ) {
115119 numWires = 87.0d ;
116120 R_layer = 58.0d ;
121+ thster = -20.6897d ;
117122 } else {
118123 numWires = 99.0d ;
119124 R_layer = 68.0d ;
125+ thster = -20.0d ;
120126 }
121127
122128 // Calculate the radius for the layers of sense wires
123129 R_layer = R_layer + DR_layer * layerId ;
124130
125131 double alphaW_layer = Math .toRadians (round / (numWires ));
126132
127- // shift the wire end point +-20deg in XY plan
128- double thster = Math .toRadians (-20.0d );
129- double zl = 300.0d ;
133+ // shift the wire end point by almost +-20deg in XY plan
134+ // convert stereo angle from degrees to radians
135+ thster = Math .toRadians (thster );
136+
130137
131138 // Create AHDC sense wires
132139 for (int wireId = 0 ; wireId < numWires ; wireId ++) {
133140
134- // start at phi=0
135- // in each layer the first wire is the first at phi>=0, i.e.
136- // 0.5 0 0.5 0 0.5 0.5 0 0.5 for layer 1 to 8
137- double wirePhiIndex = wireId + 0.5 *(numWires %2 ) + 0.5 *layerId *(1 -2 *(numWires %2 ));
141+ // start at phi=0
142+ // in each layer the first wire is the first at phi>=0, i.e.
143+ // 0.5 0 0.5 0 0.5 0.5 0 0.5 for layer 1 to 8
144+ double wirePhiIndex = wireId + 0.5 *(numWires %2 ) + 0.5 *layerId *(1 -2 *(numWires %2 ));
138145
139- // The point given by (wx, wy, wz) is the origin of the current wire.
146+ // The point given by (wx, wy, wz) is the origin of the current wire.
140147 double wx = R_layer * Math .cos (alphaW_layer * wirePhiIndex );
141148 double wy = R_layer * Math .sin (alphaW_layer * wirePhiIndex );
142149
143150 // Find the interesection of the current wire with the end-plate
144151 // planes by construciting a long line that passes through the midpoint
145152 double wx_end = R_layer * Math .cos (alphaW_layer * wirePhiIndex + thster * (Math .pow (-1 , superlayerId )));
146153 double wy_end = R_layer * Math .sin (alphaW_layer * wirePhiIndex + thster * (Math .pow (-1 , superlayerId )));
147- Line3D line = new Line3D (wx , wy , - zl / 2 , wx_end , wy_end , zl / 2 );
154+ Line3D line = new Line3D (wx , wy , z_origin , wx_end , wy_end , z_end );
148155
149156 Point3D lPoint = new Point3D ();
150157 Point3D rPoint = new Point3D ();
@@ -185,19 +192,19 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
185192 List <Point3D > firstF = new ArrayList <>();
186193 List <Point3D > secondF = new ArrayList <>();
187194 // first Face
188- Point3D p_0 = new Point3D (px_0 , py_0 , - zl / 2 );
189- Point3D p_1 = new Point3D (px_1 , py_1 , - zl / 2 );
190- Point3D p_2 = new Point3D (px_2 , py_2 , - zl / 2 );
191- Point3D p_3 = new Point3D (px_3 , py_3 , - zl / 2 );
192- Point3D p_4 = new Point3D (px_4 , py_4 , - zl / 2 );
193- Point3D p_5 = new Point3D (px_5 , py_5 , - zl / 2 );
195+ Point3D p_0 = new Point3D (px_0 , py_0 , z_origin );
196+ Point3D p_1 = new Point3D (px_1 , py_1 , z_origin );
197+ Point3D p_2 = new Point3D (px_2 , py_2 , z_origin );
198+ Point3D p_3 = new Point3D (px_3 , py_3 , z_origin );
199+ Point3D p_4 = new Point3D (px_4 , py_4 , z_origin );
200+ Point3D p_5 = new Point3D (px_5 , py_5 , z_origin );
194201 // second Face
195- Point3D p_6 = new Point3D (px_6 , py_6 , zl / 2 );
196- Point3D p_7 = new Point3D (px_7 , py_7 , zl / 2 );
197- Point3D p_8 = new Point3D (px_8 , py_8 , zl / 2 );
198- Point3D p_9 = new Point3D (px_9 , py_9 , zl / 2 );
199- Point3D p_10 = new Point3D (px_10 , py_10 , zl / 2 );
200- Point3D p_11 = new Point3D (px_11 , py_11 , zl / 2 );
202+ Point3D p_6 = new Point3D (px_6 , py_6 , z_end );
203+ Point3D p_7 = new Point3D (px_7 , py_7 , z_end );
204+ Point3D p_8 = new Point3D (px_8 , py_8 , z_end );
205+ Point3D p_9 = new Point3D (px_9 , py_9 , z_end );
206+ Point3D p_10 = new Point3D (px_10 , py_10 , z_end );
207+ Point3D p_11 = new Point3D (px_11 , py_11 , z_end );
201208 // defining a cell around a wireLine, must be counter-clockwise!
202209 firstF .add (p_0 );
203210 firstF .add (p_5 );
0 commit comments