BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SiliconConfigCalculate_Run8_3stations.C
Go to the documentation of this file.
1/*
2 * Description:
3 * Macro for calculating parameters of SILICON detector and writing them
4 * into the XML-file needed for simulation and reconstruction procedures.
5 * The obtained XML-file should be moved into the 'parameters/silicon/XMLConfigs' directory
6 *
7 * SILICON configuration: Run8_3stations (3 SI-stations (10-14-18 mods))
8 *
9 * Created: 29.01.2020
10 * Updated: 25.05.2021 (Z-distance from the target to the first plane has been increased)
11 * Updated: 19.10.2021 (configuration renamed)
12 * Author: D. Baranov
13 */
14
15#include "Rtypes.h"
16
17R__ADD_INCLUDE_PATH($VMCWORKDIR)
18R__LOAD_LIBRARY(libBmnData.so)
19
20#include "TString.h"
21
22#include <fstream>
23
24using namespace TMath;
25using namespace std;
26
27// Configuration of the module
28
29// Module 63x126 mm -------------------------------------------------------------
30
31Double_t YGapBetweenPartsOfModule = 0.0035; // Mrs. Slit
32
38
39Double_t XBevelSize = 3.82; // x-bevel for a angled cut
40Double_t YBevelSize = XBevelSize; // y-bevel for a angled cut
41
44
45// 0 - inclined strips (front side), 1 - straight strips (back side)
46Double_t XLeftBorder[2] = {0.1145, 0.10995};
47Double_t XRightBorder[2] = {0.1118, 0.11005};
48
49Double_t YTopBorder[2] = {0.1143, 0.1143};
50Double_t YMiddleBorderUpperPart[2] = {0.1121, 0.1055};
51Double_t YMiddleBorderLowerPart[2] = {0.1147, 0.1055};
52
53Double_t YBottomBorder[2] = {0.1148, 0.1055};
54
55Double_t XYBevelBorder[2] = {0.1146, 0.1076};
56
57// layers parameters
58
60 0.00795, 0.0}; // distance between the beginning of the first strip and the inner border of the frame
62
64 0.00675, 0.0}; // distance between the end of the last strip and the inner border of the frame
66
69
72
73//----------
74
77
81
86
91
96
101
106
109
116
117Double_t PitchValue[2] = {0.01029019668, 0.0095};
118Double_t StripAngle[2] = {+2.5, +0.0}; // plus - clockwise, minus - anticlockwise
121
122// dead zone (if you need)
123
124// find x and y projections of the bevel border thickness
127
128// find shifts of the sensitive zone from module borders via the equation of the straight line for the inner bevel
133
138
141
144//------------------------------------------------------------------------------
145
146// Configuration of the SI-stations ---------------------------------------------
147
148// Set Parameters of SILICON detector -------------------------------------------
149const Int_t NStations = 3; // stations in the detector
150const Int_t NMaxModules = 18; // max. number of modules in a station
151
152const Int_t NModulesInStations[NStations] = {10, 14, 18};
153
154//(X-Y-Z)Positions of stations (sensitive volumes)
155const Double_t XStationPositions[NStations] = {0.0, 0.0, 0.0};
156const Double_t YStationPositions[NStations] = {0.0, 0.0, 0.0};
157// const Double_t ZStationPositions[NStations] = { +12.37, +12.37+8.64, +12.37+8.64+8.64 };
158const Double_t ZStationPositions[NStations] = {+15.7, +15.7 + 8.64, +15.7 + 8.64 + 8.64};
159
160//(X-Y-Z)Shifts of modules in each station
162 {+15.15 /*0*/, +9.15 /*1*/, +3.15 /*2*/, -9.15 /*3*/, -15.15 /*4*/, +15.15 /*5*/, +9.15 /*6*/, +3.15 /*7*/,
163 -9.15 /*8*/, -15.15 /*9*/},
164 {+21.15 /*0*/, +15.15 /*1*/, +9.15 /*2*/, +3.15 /*3*/, -9.15 /*4*/, -15.15 /*5*/, -21.15 /*6*/, +21.15 /*7*/,
165 +15.15 /*8*/, +9.15 /*9*/, +3.15 /*10*/, -9.15 /*11*/, -15.15 /*12*/, -21.15 /*13*/},
166 {+27.15 /*0*/, +21.15 /*1*/, +15.15 /*2*/, +9.15 /*3*/, +3.15 /*4*/, -9.15 /*5*/, -15.15 /*6*/, -21.15 /*7*/,
167 -27.15 /*8*/, +27.15 /*9*/, +21.15 /*10*/, +15.15 /*11*/, +9.15 /*12*/, +3.15 /*13*/, -9.15 /*14*/, -15.15 /*15*/,
168 -21.15 /*16*/, -27.15 /*17*/}};
170 {-0.15 /*0*/, -0.15 /*1*/, +2.85 /*2*/, -0.15 /*3*/, -0.15 /*4*/, +0.15 /*5*/, +0.15 /*6*/, -2.85 /*7*/,
171 +0.15 /*8*/, +0.15 /*9*/},
172 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, +2.85 /*3*/, -0.15 /*4*/, -0.15 /*5*/, -0.15 /*6*/, +0.15 /*7*/,
173 +0.15 /*8*/, +0.15 /*9*/, -2.85 /*10*/, +0.15 /*11*/, +0.15 /*12*/, +0.15 /*13*/},
174 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, -0.15 /*3*/, +2.85 /*4*/, -0.15 /*5*/, -0.15 /*6*/, -0.15 /*7*/,
175 -0.15 /*8*/, +0.15 /*9*/, +0.15 /*10*/, +0.15 /*11*/, +0.15 /*12*/, -2.85 /*13*/, +0.15 /*14*/, +0.15 /*15*/,
176 +0.15 /*16*/, +0.15 /*17*/}};
178 {+1.36 + 4.31 /*0*/, +0.14 + 4.31 /*1*/, +1.36 + 4.31 /*2*/, +0.0 + 4.31 /*3*/, +1.22 + 4.31 /*4*/, +0.0 /*5*/,
179 +1.22 /*6*/, 0.0 /*7*/, +1.36 /*8*/, +0.14 /*9*/},
180 {+0.14 + 4.31 /*0*/, +1.36 + 4.31 /*1*/, +0.14 + 4.31 /*2*/, +1.36 + 4.31 /*3*/, +0.0 + 4.31 /*4*/,
181 +1.22 + 4.31 /*5*/, +0.0 + 4.31 /*6*/, +1.22 /*7*/, +0.0 /*8*/, +1.22 /*9*/, +0.0 /*10*/, +1.36 /*11*/,
182 +0.14 /*12*/, +1.36 /*13*/},
183 {+1.36 + 4.31 /*0*/, +0.14 + 4.31 /*1*/, +1.36 + 4.31 /*2*/, +0.14 + 4.31 /*3*/, +1.36 + 4.31 /*4*/,
184 +0.0 + 4.31 /*5*/, +1.22 + 4.31 /*6*/, +0.0 + 4.31 /*7*/, +1.22 + 4.31 /*8*/, +0.0 /*9*/, +1.22 /*10*/,
185 +0.0 /*11*/, +1.22 /*12*/, +0.0 /*13*/, +1.36 /*14*/, +0.14 /*15*/, +1.36 /*16*/, +0.14 /*17*/}};
186
187// Geometry parameters of modules
195
206
207// rotations of modules around y-axis by 180 deg.
209 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
210 false /*9*/},
211 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
212 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
213 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
214 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
215 false /*17*/}};
216
217// rotations of modules around x-axis by 180 deg.
219 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
220 true /*9*/},
221 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
222 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
223 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
224 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
225 true /*17*/}};
226
227//------------------------------------------------------------------------------
228
229// Function declarations
230void PrintInfo();
231void CalculateParameters(TString xml_file_name);
232//------------------------------------------------------------------------------
233
235{
236
237 PrintInfo();
238 CalculateParameters("SiliconRun8_3stations.xml");
239
240 cout << "It's the end" << "\n";
241 // gApplication->Terminate();
242}
243
244//------------------------------------------------------------------------------
245
247{
248
249 cout << "----------------------------------------------------------------\n";
250 cout << "Parameters of the standard module 63x126 mm:\n";
251 cout << "\n";
252 cout << " Upper layer (inclined strips):\n";
253 cout << " orig(x:y) = ( " << XOrigUpLayer[0] << " : " << YOrigUpLayer[0] << " )\n";
254 cout << " size(dx:dy) = ( " << XSizeUpLayer[0] << " : " << YSizeUpLayer[0] << " )\n";
255 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[0] << " : " << YLeftBorderUpperlayer[0] << " )\n";
256 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[0] << " : " << YRightBorderUpperlayer[0] << " )\n";
257 cout << " strip_direction = ";
258 if (StripDirection[0] == LeftToRight)
259 cout << "LeftToRight\n";
260 else
261 cout << "RightToLeft\n";
262 cout << " pitch = " << PitchValue[0] << "\n";
263 cout << " angle = " << StripAngle[0] << " deg\n";
264 cout << " first_strip_number = " << FirstStripNumberUpLayer[0] << "\n";
265 cout << "\n";
266
267 cout << " Lower layer (inclined strips):\n";
268 cout << " orig(x:y) = ( " << XOrigLowLayer[0] << " : " << YOrigLowLayer[0] << " )\n";
269 cout << " size(dx:dy) = ( " << XSizeLowLayer[0] << " : " << YSizeLowLayer[0] << " )\n";
270 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[0] << " : " << YLeftBorderLowerlayer[0] << " )\n";
271 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[0] << " : " << YRightBorderLowerlayer[0] << " )\n";
272 cout << " strip_direction = ";
273 if (StripDirection[0] == LeftToRight)
274 cout << "LeftToRight\n";
275 else
276 cout << "RightToLeft\n";
277 cout << " pitch = " << PitchValue[0] << "\n";
278 cout << " angle = " << StripAngle[0] << " deg\n";
279 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
280 cout << " dead_zone(3 points):\n";
281 cout << " p0(x:y) = ( " << XDeadZone[0][0] << " : " << YDeadZone[0][0] << " )\n";
282 cout << " p1(x:y) = ( " << XDeadZone[0][1] << " : " << YDeadZone[0][1] << " )\n";
283 cout << " p2(x:y) = ( " << XDeadZone[0][2] << " : " << YDeadZone[0][2] << " )\n";
284 cout << "\n";
285
286 cout << " Upper layer (straight strips):\n";
287 cout << " orig(x:y) = ( " << XOrigUpLayer[1] << " : " << YOrigUpLayer[1] << " )\n";
288 cout << " size(dx:dy) = ( " << XSizeUpLayer[1] << " : " << YSizeUpLayer[1] << " )\n";
289 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[1] << " : " << YLeftBorderUpperlayer[1] << " )\n";
290 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[1] << " : " << YRightBorderUpperlayer[1] << " )\n";
291 cout << " strip_direction = ";
292 if (StripDirection[1] == LeftToRight)
293 cout << "LeftToRight\n";
294 else
295 cout << "RightToLeft\n";
296 cout << " pitch = " << PitchValue[1] << "\n";
297 cout << " angle = " << StripAngle[1] << " deg\n";
298 cout << " first_strip_number = " << FirstStripNumberUpLayer[1] << "\n";
299 cout << "\n";
300
301 cout << " Lower layer (straight strips):\n";
302 cout << " orig(x:y) = ( " << XOrigLowLayer[1] << " : " << YOrigLowLayer[1] << " )\n";
303 cout << " size(dx:dy) = ( " << XSizeLowLayer[1] << " : " << YSizeLowLayer[1] << " )\n";
304 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[1] << " : " << YLeftBorderLowerlayer[1] << " )\n";
305 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[1] << " : " << YRightBorderLowerlayer[1] << " )\n";
306 cout << " strip_direction = ";
307 if (StripDirection[1] == LeftToRight)
308 cout << "LeftToRight\n";
309 else
310 cout << "RightToLeft\n";
311 cout << " pitch = " << PitchValue[1] << "\n";
312 cout << " angle = " << StripAngle[1] << " deg\n";
313 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
314 cout << " dead_zone(3 points):\n";
315 cout << " p0(x:y) = ( " << XDeadZone[1][0] << " : " << YDeadZone[1][0] << " )\n";
316 cout << " p1(x:y) = ( " << XDeadZone[1][1] << " : " << YDeadZone[1][1] << " )\n";
317 cout << " p2(x:y) = ( " << XDeadZone[1][2] << " : " << YDeadZone[1][2] << " )\n";
318 cout << "\n";
319
320 cout << "----------------------------------------------------------------\n";
321}
322//------------------------------------------------------------------------------
323
324void CalculateParameters(TString xml_file_name)
325{
326
327 ofstream SiFileOut(xml_file_name.Data(), ios::out);
328
329 SiFileOut << "<StationSet>\n";
330 SiFileOut << "\n";
331
332 for (Int_t istation = 0; istation < NStations; ++istation) {
333
334 cout << "istation = " << istation << ": -----------------------------\n";
335
336 SiFileOut << "<!-- Station " << istation << " -->\n";
337
338 SiFileOut << "\t<Station";
339 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
340 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
341 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
342 SiFileOut << " rotAngleDeg=\"" << "0.0" << "\"";
343 SiFileOut << " rotCenterX=\"" << "0.0" << "\"";
344 SiFileOut << " rotCenterY=\"" << "0.0" << "\"";
345 SiFileOut << ">\n";
346 SiFileOut << "\n";
347
348 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
349
350 cout << " imodule = " << imodule << "\n";
351
352 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
353
354 SiFileOut << "\t\t<Module";
355 // SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
356 // SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
357 SiFileOut << " xShift=\"" << 0.0 << "\"";
358 SiFileOut << " yShift=\"" << 0.0 << "\"";
359 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
360 SiFileOut << ">\n";
361
362 // Notice!!!: here:
363 // index "0" is a layer with inclined strips (the front side of the module)
364 // index "1" is a layer with straight strips (the back side of the module)
365 // "UpLayer" is the upper part of the module
366 // "LowLayer" is the lower part of the module
367
368 Double_t xOrig_UpLayer[2];
369 Double_t yOrig_UpLayer[2];
370 Double_t xOrig_LowLayer[2];
371 Double_t yOrig_LowLayer[2];
372
373 Double_t xSize_UpLayer[2];
374 Double_t ySize_UpLayer[2];
375 Double_t xSize_LowLayer[2];
376 Double_t ySize_LowLayer[2];
377
378 Double_t xLBorder_UpLayer[2];
379 Double_t yLBorder_UpLayer[2];
380 Double_t xLBorder_LowLayer[2];
381 Double_t yLBorder_LowLayer[2];
382 Double_t xRBorder_UpLayer[2];
383 Double_t yRBorder_UpLayer[2];
384 Double_t xRBorder_LowLayer[2];
385 Double_t yRBorder_LowLayer[2];
386
387 Double_t xDeadZone[2][3];
388 Double_t yDeadZone[2][3];
389
390 Bool_t isDeadZone_UpLayer = false;
391 Bool_t isDeadZone_LowLayer = false;
392
393 StripNumberingDirection stripDirection[2];
394 Double_t pitchValue[2] = {PitchValue[0], PitchValue[1]};
395 Double_t stripAngle[2];
396 Int_t firstStripNumber_UpLayer[2];
397 Int_t firstStripNumber_LowLayer[2];
398
399 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
400
401 xOrig_UpLayer[0] = XOrigUpLayer[0] + XModuleShifts[istation][imodule];
402 yOrig_UpLayer[0] = YOrigUpLayer[0] + YModuleShifts[istation][imodule];
403 xOrig_LowLayer[0] = XOrigLowLayer[0] + XModuleShifts[istation][imodule];
404 yOrig_LowLayer[0] = YOrigLowLayer[0] + YModuleShifts[istation][imodule];
405
406 xOrig_UpLayer[1] = XOrigUpLayer[1] + XModuleShifts[istation][imodule];
407 yOrig_UpLayer[1] = YOrigUpLayer[1] + YModuleShifts[istation][imodule];
408 xOrig_LowLayer[1] = XOrigLowLayer[1] + XModuleShifts[istation][imodule];
409 yOrig_LowLayer[1] = YOrigLowLayer[1] + YModuleShifts[istation][imodule];
410
411 xSize_UpLayer[0] = XSizeUpLayer[0];
412 ySize_UpLayer[0] = YSizeUpLayer[0];
413 xSize_LowLayer[0] = XSizeLowLayer[0];
414 ySize_LowLayer[0] = YSizeLowLayer[0];
415
416 xSize_UpLayer[1] = XSizeUpLayer[1];
417 ySize_UpLayer[1] = YSizeUpLayer[1];
418 xSize_LowLayer[1] = XSizeLowLayer[1];
419 ySize_LowLayer[1] = YSizeLowLayer[1];
420
421 xLBorder_UpLayer[0] = XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
422 xLBorder_UpLayer[1] = XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
423 yLBorder_UpLayer[0] = YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
424 yLBorder_UpLayer[1] = YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
425 xLBorder_LowLayer[0] = XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
426 xLBorder_LowLayer[1] = XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
427 yLBorder_LowLayer[0] = YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
428 yLBorder_LowLayer[1] = YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
429
430 xRBorder_UpLayer[0] = XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
431 xRBorder_UpLayer[1] = XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
432 yRBorder_UpLayer[0] = YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
433 yRBorder_UpLayer[1] = YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
434 xRBorder_LowLayer[0] = XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
435 xRBorder_LowLayer[1] = XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
436 yRBorder_LowLayer[0] = YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
437 yRBorder_LowLayer[1] = YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
438
439 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
440 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
441 xDeadZone[ilayer][ipoint] = XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
442 yDeadZone[ilayer][ipoint] = YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
443 }
444 }
445
446 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
447 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
448 {
449 isDeadZone_UpLayer = false;
450 isDeadZone_LowLayer = true;
451 }
452
453 if (StripDirection[0] == LeftToRight)
454 stripDirection[0] = LeftToRight;
455 else
456 stripDirection[0] = RightToLeft;
457 if (StripDirection[1] == LeftToRight)
458 stripDirection[1] = LeftToRight;
459 else
460 stripDirection[1] = RightToLeft;
461
462 stripAngle[0] = StripAngle[0];
463 stripAngle[1] = StripAngle[1];
464
465 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[0];
466 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[1];
467 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[0];
468 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[1];
469 }
470
471 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
472
473 xOrig_UpLayer[0] = -XOrigUpLayer[0] + XSizeUpLayer[0] + XModuleShifts[istation][imodule];
474 yOrig_UpLayer[0] = YOrigUpLayer[0] + YModuleShifts[istation][imodule];
475 xOrig_LowLayer[0] = -XOrigLowLayer[0] + XSizeLowLayer[0] + XModuleShifts[istation][imodule];
476 yOrig_LowLayer[0] = YOrigLowLayer[0] + YModuleShifts[istation][imodule];
477
478 xOrig_UpLayer[1] = -XOrigUpLayer[1] + XSizeUpLayer[1] + XModuleShifts[istation][imodule];
479 yOrig_UpLayer[1] = YOrigUpLayer[1] + YModuleShifts[istation][imodule];
480 xOrig_LowLayer[1] = -XOrigLowLayer[1] + XSizeLowLayer[1] + XModuleShifts[istation][imodule];
481 yOrig_LowLayer[1] = YOrigLowLayer[1] + YModuleShifts[istation][imodule];
482
483 xSize_UpLayer[0] = XSizeUpLayer[0];
484 ySize_UpLayer[0] = YSizeUpLayer[0];
485 xSize_LowLayer[0] = XSizeLowLayer[0];
486 ySize_LowLayer[0] = YSizeLowLayer[0];
487
488 xSize_UpLayer[1] = XSizeUpLayer[1];
489 ySize_UpLayer[1] = YSizeUpLayer[1];
490 xSize_LowLayer[1] = XSizeLowLayer[1];
491 ySize_LowLayer[1] = YSizeLowLayer[1];
492
493 xLBorder_UpLayer[0] = -XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
494 xLBorder_UpLayer[1] = -XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
495 yLBorder_UpLayer[0] = YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
496 yLBorder_UpLayer[1] = YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
497 xLBorder_LowLayer[0] = -XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
498 xLBorder_LowLayer[1] = -XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
499 yLBorder_LowLayer[0] = YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
500 yLBorder_LowLayer[1] = YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
501
502 xRBorder_UpLayer[0] = -XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
503 xRBorder_UpLayer[1] = -XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
504 yRBorder_UpLayer[0] = YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
505 yRBorder_UpLayer[1] = YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
506 xRBorder_LowLayer[0] = -XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
507 xRBorder_LowLayer[1] = -XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
508 yRBorder_LowLayer[0] = YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
509 yRBorder_LowLayer[1] = YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
510
511 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
512 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
513 xDeadZone[ilayer][ipoint] = -XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
514 yDeadZone[ilayer][ipoint] = YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
515 }
516 }
517
518 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
519 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
520 {
521 isDeadZone_UpLayer = false;
522 isDeadZone_LowLayer = true;
523 }
524
525 if (StripDirection[0] == LeftToRight)
526 stripDirection[0] = RightToLeft;
527 else
528 stripDirection[0] = LeftToRight;
529 if (StripDirection[1] == LeftToRight)
530 stripDirection[1] = RightToLeft;
531 else
532 stripDirection[1] = LeftToRight;
533
534 stripAngle[0] = -StripAngle[0];
535 stripAngle[1] = -StripAngle[1];
536
537 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[0];
538 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[1];
539 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[0];
540 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[1];
541 }
542
543 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
544
545 xOrig_UpLayer[0] = XOrigUpLayer[0] + XModuleShifts[istation][imodule];
546 yOrig_UpLayer[0] = -YOrigUpLayer[0] + YMiddleBorderLowerPart[0] + YMiddleBorderUpperPart[0]
547 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
548 xOrig_LowLayer[0] = XOrigLowLayer[0] + XModuleShifts[istation][imodule];
549 yOrig_LowLayer[0] = -YOrigLowLayer[0] - YSizeLowLayer[0] - YMiddleBorderLowerPart[0]
551 + YModuleShifts[istation][imodule];
552
553 xOrig_UpLayer[1] = XOrigUpLayer[1] + XModuleShifts[istation][imodule];
554 yOrig_UpLayer[1] = -YOrigUpLayer[1] + YMiddleBorderLowerPart[1] + YMiddleBorderUpperPart[1]
555 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
556 xOrig_LowLayer[1] = XOrigLowLayer[1] + XModuleShifts[istation][imodule];
557 yOrig_LowLayer[1] = -YOrigLowLayer[1] - YSizeLowLayer[1] - YMiddleBorderLowerPart[1]
559 + YModuleShifts[istation][imodule];
560
561 xSize_UpLayer[0] = XSizeLowLayer[0];
562 ySize_UpLayer[0] = YSizeLowLayer[0];
563 xSize_LowLayer[0] = XSizeUpLayer[0];
564 ySize_LowLayer[0] = YSizeUpLayer[0];
565
566 xSize_UpLayer[1] = XSizeLowLayer[1];
567 ySize_UpLayer[1] = YSizeLowLayer[1];
568 xSize_LowLayer[1] = XSizeUpLayer[1];
569 ySize_LowLayer[1] = YSizeUpLayer[1];
570
571 xLBorder_UpLayer[0] = XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
572 xLBorder_UpLayer[1] = XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
573 yLBorder_UpLayer[0] = -YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
574 yLBorder_UpLayer[1] = -YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
575 xLBorder_LowLayer[0] = XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
576 xLBorder_LowLayer[1] = XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
577 yLBorder_LowLayer[0] = -YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
578 yLBorder_LowLayer[1] = -YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
579
580 xRBorder_UpLayer[0] = XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
581 xRBorder_UpLayer[1] = XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
582 yRBorder_UpLayer[0] = -YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
583 yRBorder_UpLayer[1] = -YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
584 xRBorder_LowLayer[0] = XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
585 xRBorder_LowLayer[1] = XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
586 yRBorder_LowLayer[0] = -YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
587 yRBorder_LowLayer[1] = -YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
588
589 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
590 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
591 xDeadZone[ilayer][ipoint] = XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
592 yDeadZone[ilayer][ipoint] = -YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
593 }
594 }
595
596 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
597 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
598 {
599 isDeadZone_UpLayer = true;
600 isDeadZone_LowLayer = false;
601 }
602
603 if (StripDirection[0] == LeftToRight)
604 stripDirection[0] = LeftToRight;
605 else
606 stripDirection[0] = RightToLeft;
607 if (StripDirection[1] == LeftToRight)
608 stripDirection[1] = LeftToRight;
609 else
610 stripDirection[1] = RightToLeft;
611
612 stripAngle[0] = -StripAngle[0];
613 stripAngle[1] = -StripAngle[1];
614
615 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[0];
616 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[1];
617 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[0];
618 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[1];
619 }
620
621 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
622
623 xOrig_UpLayer[0] = -XOrigUpLayer[0] + XSizeUpLayer[0] + XModuleShifts[istation][imodule];
624 yOrig_UpLayer[0] = -YOrigUpLayer[0] + YMiddleBorderLowerPart[0] + YMiddleBorderUpperPart[0]
625 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
626 xOrig_LowLayer[0] = -XOrigLowLayer[0] + XSizeLowLayer[0] + XModuleShifts[istation][imodule];
627 yOrig_LowLayer[0] = -YOrigLowLayer[0] - YSizeLowLayer[0] - YMiddleBorderLowerPart[0]
629 + YModuleShifts[istation][imodule];
630
631 xOrig_UpLayer[1] = -XOrigUpLayer[1] + XSizeUpLayer[1] + XModuleShifts[istation][imodule];
632 yOrig_UpLayer[1] = -YOrigUpLayer[1] + YMiddleBorderLowerPart[1] + YMiddleBorderUpperPart[1]
633 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
634 xOrig_LowLayer[1] = -XOrigLowLayer[1] + XSizeLowLayer[1] + XModuleShifts[istation][imodule];
635 yOrig_LowLayer[1] = -YOrigLowLayer[1] - YSizeLowLayer[1] - YMiddleBorderLowerPart[1]
637 + YModuleShifts[istation][imodule];
638
639 xSize_UpLayer[0] = XSizeLowLayer[0];
640 ySize_UpLayer[0] = YSizeLowLayer[0];
641 xSize_LowLayer[0] = XSizeUpLayer[0];
642 ySize_LowLayer[0] = YSizeUpLayer[0];
643
644 xSize_UpLayer[1] = XSizeLowLayer[1];
645 ySize_UpLayer[1] = YSizeLowLayer[1];
646 xSize_LowLayer[1] = XSizeUpLayer[1];
647 ySize_LowLayer[1] = YSizeUpLayer[1];
648
649 xLBorder_UpLayer[0] = -XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
650 xLBorder_UpLayer[1] = -XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
651 yLBorder_UpLayer[0] = -YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
652 yLBorder_UpLayer[1] = -YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
653 xLBorder_LowLayer[0] = -XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
654 xLBorder_LowLayer[1] = -XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
655 yLBorder_LowLayer[0] = -YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
656 yLBorder_LowLayer[1] = -YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
657
658 xRBorder_UpLayer[0] = -XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
659 xRBorder_UpLayer[1] = -XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
660 yRBorder_UpLayer[0] = -YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
661 yRBorder_UpLayer[1] = -YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
662 xRBorder_LowLayer[0] = -XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
663 xRBorder_LowLayer[1] = -XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
664 yRBorder_LowLayer[0] = -YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
665 yRBorder_LowLayer[1] = -YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
666
667 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
668 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
669 xDeadZone[ilayer][ipoint] = -XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
670 yDeadZone[ilayer][ipoint] = -YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
671 }
672 }
673
674 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
675 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
676 {
677 isDeadZone_UpLayer = true;
678 isDeadZone_LowLayer = false;
679 }
680
681 if (StripDirection[0] == LeftToRight)
682 stripDirection[0] = RightToLeft;
683 else
684 stripDirection[0] = LeftToRight;
685 if (StripDirection[1] == LeftToRight)
686 stripDirection[1] = RightToLeft;
687 else
688 stripDirection[1] = LeftToRight;
689
690 stripAngle[0] = StripAngle[0];
691 stripAngle[1] = StripAngle[1];
692
693 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[0];
694 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[1];
695 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[0];
696 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[1];
697 }
698
699 cout << " ---\n";
700 cout << " Orig_UpLayer[0](x:y) = ( " << xOrig_UpLayer[0] << " : " << yOrig_UpLayer[0] << " )\n";
701 cout << " Orig_LowLayer[0](x:y) = ( " << xOrig_LowLayer[0] << " : " << yOrig_LowLayer[0] << " )\n";
702 cout << " Orig_UpLayer[1](x:y) = ( " << xOrig_UpLayer[1] << " : " << yOrig_UpLayer[1] << " )\n";
703 cout << " Orig_LowLayer[1](x:y) = ( " << xOrig_LowLayer[1] << " : " << yOrig_LowLayer[1] << " )\n";
704 cout << "\n\n";
705
706 cout << " ---\n";
707 cout << " Size_UpLayer[0](dx:dy) = ( " << xSize_UpLayer[0] << " : " << ySize_UpLayer[0] << " )\n";
708 cout << " Size_LowLayer[0](dx:dy) = ( " << xSize_LowLayer[0] << " : " << ySize_LowLayer[0] << " )\n";
709 cout << " Size_UpLayer[1](dx:dy) = ( " << xSize_UpLayer[1] << " : " << ySize_UpLayer[1] << " )\n";
710 cout << " Size_LowLayer[1](dx:dy) = ( " << xSize_LowLayer[1] << " : " << ySize_LowLayer[1] << " )\n";
711 cout << "\n\n";
712
713 cout << " ---\n";
714 cout << " LBorder_UpLayer[0](x:y) = ( " << xLBorder_UpLayer[0] << " : " << yLBorder_UpLayer[0] << " )\n";
715 cout << " RBorder_UpLayer[0](x:y) = ( " << xRBorder_UpLayer[0] << " : " << yRBorder_UpLayer[0] << " )\n";
716 cout << "\n";
717 cout << " LBorder_LowLayer[0](x:y) = ( " << xLBorder_LowLayer[0] << " : " << yLBorder_LowLayer[0]
718 << " )\n";
719 cout << " RBorder_LowLayer[0](x:y) = ( " << xRBorder_LowLayer[0] << " : " << yRBorder_LowLayer[0]
720 << " )\n";
721 cout << "\n";
722
723 cout << " LBorder_UpLayer[1](x:y) = ( " << xLBorder_UpLayer[1] << " : " << yLBorder_UpLayer[1] << " )\n";
724 cout << " RBorder_UpLayer[1](x:y) = ( " << xRBorder_UpLayer[1] << " : " << yRBorder_UpLayer[1] << " )\n";
725 cout << "\n";
726 cout << " LBorder_LowLayer[1](x:y) = ( " << xLBorder_LowLayer[1] << " : " << yLBorder_LowLayer[1]
727 << " )\n";
728 cout << " RBorder_LowLayer[1](x:y) = ( " << xRBorder_LowLayer[1] << " : " << yRBorder_LowLayer[1]
729 << " )\n";
730 cout << "\n\n";
731
732 cout << " ---\n";
733 cout << " DeadZone[0]:\n";
734 cout << " p0(x:y) = ( " << xDeadZone[0][0] << " : " << yDeadZone[0][0] << " )\n";
735 cout << " p1(x:y) = ( " << xDeadZone[0][1] << " : " << yDeadZone[0][1] << " )\n";
736 cout << " p2(x:y) = ( " << xDeadZone[0][2] << " : " << yDeadZone[0][2] << " )\n";
737 cout << "\n";
738
739 cout << " DeadZone[1]:\n";
740 cout << " p0(x:y) = ( " << xDeadZone[1][0] << " : " << yDeadZone[1][0] << " )\n";
741 cout << " p1(x:y) = ( " << xDeadZone[1][1] << " : " << yDeadZone[1][1] << " )\n";
742 cout << " p2(x:y) = ( " << xDeadZone[1][2] << " : " << yDeadZone[1][2] << " )\n";
743 cout << "\n";
744
745 cout << " ---\n";
746 cout << " stripDirection[0] = ";
747 if (stripDirection[0] == LeftToRight)
748 cout << "LeftToRight\n";
749 else
750 cout << "RightToLeft\n";
751 cout << " stripDirection[1] = ";
752 if (stripDirection[1] == LeftToRight)
753 cout << "LeftToRight\n";
754 else
755 cout << "RightToLeft\n";
756 cout << "\n";
757
758 cout << " ---\n";
759 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
760 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
761 cout << "\n";
762
763 cout << "---\n";
764 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
765 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
766 cout << "\n";
767
768 cout << "---\n";
769 cout << " firstStripNumber_UpLayer[0] = " << firstStripNumber_UpLayer[0] << "\n";
770 cout << " firstStripNumber_LowLayer[0] = " << firstStripNumber_LowLayer[0] << "\n";
771 cout << " firstStripNumber_UpLayer[1] = " << firstStripNumber_UpLayer[1] << "\n";
772 cout << " firstStripNumber_LowLayer[1] = " << firstStripNumber_LowLayer[1] << "\n";
773 cout << "\n";
774
775 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
776 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE)
777 {
778
779 // upper part of module: straight strips = back side ------------
780 SiFileOut << "\t\t\t<Layer";
781 SiFileOut << " zoneID=\"" << "0" << "\"";
782 SiFileOut << " type=\"" << "lower" << "\"";
783 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[1] << "\"";
784 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
785 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
786 SiFileOut << " xorig=\"" << xOrig_UpLayer[1] << "\"";
787 SiFileOut << " yorig=\"" << yOrig_UpLayer[1] << "\"";
788 SiFileOut << " xsize=\"" << xSize_UpLayer[1] << "\"";
789 SiFileOut << " ysize=\"" << ySize_UpLayer[1] << "\"";
790 SiFileOut << " stripDirection=\"";
791 if (stripDirection[1] == LeftToRight)
792 SiFileOut << "LeftToRight\"";
793 else
794 SiFileOut << "RightToLeft\"";
795 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[1] << "\"";
796 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[1] << "\"";
797 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[1] << "\"";
798 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[1] << "\"";
799 SiFileOut << ">";
800
801 if (isDeadZone_UpLayer == true) {
802 SiFileOut << "\n";
803 SiFileOut << "\t\t\t\t<DeadZone>\n";
804 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
805 SiFileOut << "\t\t\t\t\t<DeadPoint";
806 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
807 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
808 SiFileOut << " />\n";
809 }
810 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
811 }
812 SiFileOut << "</Layer>\n";
813 //--------------------------------------------------------------
814
815 // lower part of module: straight strips = back side ------------
816 SiFileOut << "\t\t\t<Layer";
817 SiFileOut << " zoneID=\"" << "0" << "\"";
818 SiFileOut << " type=\"" << "lower" << "\"";
819 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[1] << "\"";
820 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
821 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
822 SiFileOut << " xorig=\"" << xOrig_LowLayer[1] << "\"";
823 SiFileOut << " yorig=\"" << yOrig_LowLayer[1] << "\"";
824 SiFileOut << " xsize=\"" << xSize_LowLayer[1] << "\"";
825 SiFileOut << " ysize=\"" << ySize_LowLayer[1] << "\"";
826 SiFileOut << " stripDirection=\"";
827 if (stripDirection[1] == LeftToRight)
828 SiFileOut << "LeftToRight\"";
829 else
830 SiFileOut << "RightToLeft\"";
831 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[1] << "\"";
832 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[1] << "\"";
833 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[1] << "\"";
834 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[1] << "\"";
835 SiFileOut << ">";
836
837 if (isDeadZone_LowLayer == true) {
838 SiFileOut << "\n";
839 SiFileOut << "\t\t\t\t<DeadZone>\n";
840 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
841 SiFileOut << "\t\t\t\t\t<DeadPoint";
842 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
843 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
844 SiFileOut << " />\n";
845 }
846 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
847 }
848 SiFileOut << "</Layer>\n";
849 //--------------------------------------------------------------
850
851 // upper part of module: inclined strips = front side -----------
852 SiFileOut << "\t\t\t<Layer";
853 SiFileOut << " zoneID=\"" << "1" << "\"";
854 SiFileOut << " type=\"" << "upper" << "\"";
855 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[0] << "\"";
856 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
857 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
858 SiFileOut << " xorig=\"" << xOrig_UpLayer[0] << "\"";
859 SiFileOut << " yorig=\"" << yOrig_UpLayer[0] << "\"";
860 SiFileOut << " xsize=\"" << xSize_UpLayer[0] << "\"";
861 SiFileOut << " ysize=\"" << ySize_UpLayer[0] << "\"";
862 SiFileOut << " stripDirection=\"";
863 if (stripDirection[0] == LeftToRight)
864 SiFileOut << "LeftToRight\"";
865 else
866 SiFileOut << "RightToLeft\"";
867 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[0] << "\"";
868 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[0] << "\"";
869 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[0] << "\"";
870 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[0] << "\"";
871 SiFileOut << ">";
872
873 if (isDeadZone_UpLayer == true) {
874 SiFileOut << "\n";
875 SiFileOut << "\t\t\t\t<DeadZone>\n";
876 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
877 SiFileOut << "\t\t\t\t\t<DeadPoint";
878 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
879 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
880 SiFileOut << " />\n";
881 }
882 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
883 }
884 SiFileOut << "</Layer>\n";
885 //--------------------------------------------------------------
886
887 // lower part of module: inclined strips = front side -----------
888 SiFileOut << "\t\t\t<Layer";
889 SiFileOut << " zoneID=\"" << "1" << "\"";
890 SiFileOut << " type=\"" << "upper" << "\"";
891 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[0] << "\"";
892 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
893 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
894 SiFileOut << " xorig=\"" << xOrig_LowLayer[0] << "\"";
895 SiFileOut << " yorig=\"" << yOrig_LowLayer[0] << "\"";
896 SiFileOut << " xsize=\"" << xSize_LowLayer[0] << "\"";
897 SiFileOut << " ysize=\"" << ySize_LowLayer[0] << "\"";
898 SiFileOut << " stripDirection=\"";
899 if (stripDirection[0] == LeftToRight)
900 SiFileOut << "LeftToRight\"";
901 else
902 SiFileOut << "RightToLeft\"";
903 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[0] << "\"";
904 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[0] << "\"";
905 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[0] << "\"";
906 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[0] << "\"";
907 SiFileOut << ">";
908
909 if (isDeadZone_LowLayer == true) {
910 SiFileOut << "\n";
911 SiFileOut << "\t\t\t\t<DeadZone>\n";
912 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
913 SiFileOut << "\t\t\t\t\t<DeadPoint";
914 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
915 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
916 SiFileOut << " />\n";
917 }
918 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
919 }
920 SiFileOut << "</Layer>\n";
921 //--------------------------------------------------------------
922
923 SiFileOut << "\t\t</Module>\n";
924 SiFileOut << "\n";
925 }
926
927 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
928 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
929 {
930
931 Double_t xOrig[2];
932 Double_t yOrig[2];
933 Double_t xSize[2];
934 Double_t ySize[2];
935 Double_t xLBorder[2];
936 Double_t yLBorder[2];
937 Double_t xRBorder[2];
938 Double_t yRBorder[2];
939 Bool_t isDeadZone;
940
941 if (ModulesXRotations[istation][imodule] == false) {
942 xOrig[0] = xOrig_LowLayer[0];
943 xOrig[1] = xOrig_LowLayer[1];
944 yOrig[0] = yOrig_LowLayer[0];
945 yOrig[1] = yOrig_LowLayer[1];
946 xSize[0] = xSize_LowLayer[0];
947 xSize[1] = xSize_LowLayer[1];
948 ySize[0] = ySize_LowLayer[0];
949 ySize[1] = ySize_LowLayer[1];
950 xLBorder[0] = xLBorder_LowLayer[0];
951 xLBorder[1] = xLBorder_LowLayer[1];
952 yLBorder[0] = yLBorder_LowLayer[0];
953 yLBorder[1] = yLBorder_LowLayer[1];
954 xRBorder[0] = xRBorder_LowLayer[0];
955 xRBorder[1] = xRBorder_LowLayer[1];
956 yRBorder[0] = yRBorder_LowLayer[0];
957 yRBorder[1] = yRBorder_LowLayer[1];
958 isDeadZone = isDeadZone_LowLayer;
959 }
960 if (ModulesXRotations[istation][imodule] == true) {
961 xOrig[0] = xOrig_UpLayer[0];
962 xOrig[1] = xOrig_UpLayer[1];
963 yOrig[0] = yOrig_UpLayer[0];
964 yOrig[1] = yOrig_UpLayer[1];
965 xSize[0] = xSize_UpLayer[0];
966 xSize[1] = xSize_UpLayer[1];
967 ySize[0] = ySize_UpLayer[0];
968 ySize[1] = ySize_UpLayer[1];
969 xLBorder[0] = xLBorder_UpLayer[0];
970 xLBorder[1] = xLBorder_UpLayer[1];
971 yLBorder[0] = yLBorder_UpLayer[0];
972 yLBorder[1] = yLBorder_UpLayer[1];
973 xRBorder[0] = xRBorder_UpLayer[0];
974 xRBorder[1] = xRBorder_UpLayer[1];
975 yRBorder[0] = yRBorder_UpLayer[0];
976 yRBorder[1] = yRBorder_UpLayer[1];
977 isDeadZone = isDeadZone_UpLayer;
978 }
979
980 // one part of module: straight strips = back side --------------
981 SiFileOut << "\t\t\t<Layer";
982 SiFileOut << " zoneID=\"" << "0" << "\"";
983 SiFileOut << " type=\"" << "lower" << "\"";
984 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
985 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
986 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
987 SiFileOut << " xorig=\"" << xOrig[1] << "\"";
988 SiFileOut << " yorig=\"" << yOrig[1] << "\"";
989 SiFileOut << " xsize=\"" << xSize[1] << "\"";
990 SiFileOut << " ysize=\"" << ySize[1] << "\"";
991 SiFileOut << " stripDirection=\"";
992 if (stripDirection[1] == LeftToRight)
993 SiFileOut << "LeftToRight\"";
994 else
995 SiFileOut << "RightToLeft\"";
996 SiFileOut << " lxborder=\"" << xLBorder[1] << "\"";
997 SiFileOut << " lyborder=\"" << yLBorder[1] << "\"";
998 SiFileOut << " rxborder=\"" << xRBorder[1] << "\"";
999 SiFileOut << " ryborder=\"" << yRBorder[1] << "\"";
1000 SiFileOut << ">";
1001
1002 if (isDeadZone == true) {
1003 SiFileOut << "\n";
1004 SiFileOut << "\t\t\t\t<DeadZone>\n";
1005 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1006 SiFileOut << "\t\t\t\t\t<DeadPoint";
1007 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1008 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1009 SiFileOut << " />\n";
1010 }
1011 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1012 }
1013 SiFileOut << "</Layer>\n";
1014 //--------------------------------------------------------------
1015
1016 // one part of module: inclined strips = front side -------------
1017 SiFileOut << "\t\t\t<Layer";
1018 SiFileOut << " zoneID=\"" << "1" << "\"";
1019 SiFileOut << " type=\"" << "upper" << "\"";
1020 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1021 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1022 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1023 SiFileOut << " xorig=\"" << xOrig[0] << "\"";
1024 SiFileOut << " yorig=\"" << yOrig[0] << "\"";
1025 SiFileOut << " xsize=\"" << xSize[0] << "\"";
1026 SiFileOut << " ysize=\"" << ySize[0] << "\"";
1027 SiFileOut << " stripDirection=\"";
1028 if (stripDirection[0] == LeftToRight)
1029 SiFileOut << "LeftToRight\"";
1030 else
1031 SiFileOut << "RightToLeft\"";
1032 SiFileOut << " lxborder=\"" << xLBorder[0] << "\"";
1033 SiFileOut << " lyborder=\"" << yLBorder[0] << "\"";
1034 SiFileOut << " rxborder=\"" << xRBorder[0] << "\"";
1035 SiFileOut << " ryborder=\"" << yRBorder[0] << "\"";
1036 SiFileOut << ">";
1037
1038 if (isDeadZone == true) {
1039 SiFileOut << "\n";
1040 SiFileOut << "\t\t\t\t<DeadZone>\n";
1041 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1042 SiFileOut << "\t\t\t\t\t<DeadPoint";
1043 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1044 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1045 SiFileOut << " />\n";
1046 }
1047 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1048 }
1049 SiFileOut << "</Layer>\n";
1050 //--------------------------------------------------------------
1051
1052 SiFileOut << "\t\t</Module>\n";
1053 SiFileOut << "\n";
1054 }
1055 }
1056
1057 SiFileOut << "\t</Station>\n";
1058 SiFileOut << "\n";
1059
1060 cout << "------------------------------------------------------------\n";
1061 }
1062
1063 SiFileOut << "</StationSet>\n";
1064
1065 SiFileOut.close();
1066}
bool Bool_t
int Int_t
double Double_t
#define R__LOAD_LIBRARY(LIBRARY)
#define R__ADD_INCLUDE_PATH(PATH)
StripNumberingDirection
@ RightToLeft
@ LeftToRight
const char * Data() const
const Double_t YStationPositions[NStations]
const Double_t ZStationPositions[NStations]
const Double_t XStationPositions[NStations]
const Int_t NModulesInStations[NStations]
StripNumberingDirection StripDirection[2]
ModuleType
@ BEVEL_MODULE
@ RIGHT_ANGLED_MODULE_HALF
@ RIGHT_ANGLED_MODULE
const Bool_t ModulesYRotations[NStations][NMaxModules]
const ModuleType ModulesTypes[NStations][NMaxModules]
const Bool_t ModulesXRotations[NStations][NMaxModules]
void SiliconConfigCalculate_Run8_3stations()
Double_t ATan(Double_t)
constexpr Double_t PiOver2()
Double_t Cos(Double_t)
Double_t Sin(Double_t)
Double_t Tan(Double_t)
constexpr Double_t RadToDeg()
Definition json.hpp:4446