BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SiliconConfigCalculate_5stations_2026.C
Go to the documentation of this file.
1/*
2 * Description:
3 * Macro for calculating parameters of FSD (Forward Silicon detector) and writing them
4 * into the XML-file needed for simulation and reconstruction procedures.
5 *
6 * !!! IMPORTANT !!!
7 * The obtained XML-file SHOULD BE MOVED into the 'parameters/silicon/XMLConfigs' directory
8 *
9 * Configuration of FSD for the future configuration of 5 stations (2026)
10 *
11 * Author: D. Baranov
12 * Created: 04.02.2026
13 */
14
15#include "Rtypes.h"
16
17R__ADD_INCLUDE_PATH($VMCWORKDIR)
18
19#include "TString.h"
20
21#include <fstream>
22
23using namespace TMath;
24using namespace std;
25
26// Configuration of modules -----------------------------------------------------
27
29{
32}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
33
34const unsigned int NModuleSizes = 2;
35
36Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/};
37
38Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
39
40Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
41Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
42
49
50Double_t ZModuleSize[NModuleSizes] = {0.03 /*STANDARD_MODULE*/, 0.03 /*LONG_MODULE*/};
51
52Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
53Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
54
59
64
65// The next variables have two indices: the first one is a mod-size type, the second - a layer type
66// 0 - inclined strips (front side), 1 - straight strips (back side)
67
69 {0.1145, 0.10995}, /*STANDARD_MODULE*/
70 {0.1118, 0.10995} /*LONG_MODULE*/
71};
72
74 {0.1118, 0.11005}, /*STANDARD_MODULE*/
75 {0.1118, 0.11005} /*LONG_MODULE*/
76};
77
79 {0.1143, 0.1143}, /*STANDARD_MODULE*/
80 {0.1148, 0.1055} /*LONG_MODULE*/
81};
82
84 {0.1121, 0.1055}, /*STANDARD_MODULE*/
85 {0.1148, 0.1055} /*LONG_MODULE*/
86};
87
89 {0.1147, 0.1055}, /*STANDARD_MODULE*/
90 {0.1148, 0.1055} /*LONG_MODULE*/
91};
92
94 {0.1148, 0.1055}, /*STANDARD_MODULE*/
95 {0.1148, 0.1055} /*LONG_MODULE*/
96};
97
99 {0.1146, 0.1076}, /*STANDARD_MODULE*/
100 {0.1148, 0.1055} /*LONG_MODULE*/
101};
102//------------------------------------------------------------------------------
103
104// Parameters of layers ---------------------------------------------------------
105
107 {0.00795, 0.0}, /*STANDARD_MODULE*/
108 {0.00261, 0.0} /*LONG_MODULE*/
109};
110
112 {0.00780, 0.0}, /*STANDARD_MODULE*/
113 {0.00261, 0.0} /*LONG_MODULE*/
114};
115
117 {0.00675, 0.0}, /*STANDARD_MODULE*/
118 {0.00255, 0.0} /*LONG_MODULE*/
119};
120
122 {0.00675, 0.0}, /*STANDARD_MODULE*/
123 {0.00255, 0.0} /*LONG_MODULE*/
124};
125
127 {0.0, 0.0}, /*STANDARD_MODULE*/
128 {0.0, 0.0} /*LONG_MODULE*/
129};
130
132 {0.0, 0.0}, /*STANDARD_MODULE*/
133 {0.0, 0.0} /*LONG_MODULE*/
134};
135
137 {0.0, 0.0}, /*STANDARD_MODULE*/
138 {0.0, 0.0} /*LONG_MODULE*/
139};
140
142 {0.0, 0.0}, /*STANDARD_MODULE*/
143 {0.0, 0.0} /*LONG_MODULE*/
144};
145//------------------------------------------------------------------------------
146
153// Double_t XOrigUpLayer[2] = { XModuleSize - XLeftBorder[0], XModuleSize - XLeftBorder[1] };
154
161// Double_t XOrigLowLayer[2] = { XModuleSize - XLeftBorder[0], XModuleSize - XLeftBorder[1] };
162
171// Double_t YOrigUpLayer[2] = { YModuleSize - YModuleSizeUpperPart + YMiddleBorderUpperPart[0], YModuleSize -
172// YModuleSizeUpperPart + YMiddleBorderUpperPart[1] };
173
178// Double_t YOrigLowLayer[2] = { YBottomBorder[0], YBottomBorder[1] };
179
187// Double_t XSizeUpLayer[2] = { XModuleSize - (XLeftBorder[0] + XRightBorder[0]) , XModuleSize - (XLeftBorder[1] +
188// XRightBorder[1]) };
189
199// Double_t YSizeUpLayer[2] = { YModuleSizeUpperPart - (YTopBorder[0] + YMiddleBorderUpperPart[0]), YModuleSizeUpperPart
200// - (YTopBorder[1] + YMiddleBorderUpperPart[1]) };
201
209// Double_t XSizeLowLayer[2] = { XModuleSize - (XLeftBorder[0] + XRightBorder[0]) , XModuleSize - (XLeftBorder[1] +
210// XRightBorder[1]) };
211
221// Double_t YSizeLowLayer[2] = { YModuleSizeLowerPart - (YBottomBorder[0] + YMiddleBorderLowerPart[0]),
222// YModuleSizeLowerPart - (YBottomBorder[1] + YMiddleBorderLowerPart[1]) };
223
232// Double_t XLeftBorderUpperlayer[2] = { XOrigUpLayer[0] - XShiftFirstStripUpLayer[0], XOrigUpLayer[1] -
233// XShiftLastStripUpLayer[1] + XShiftLastStripUpLayer[1] };
234
243// Double_t XLeftBorderLowerlayer[2] = { XOrigUpLayer[0] - XShiftFirstStripLowLayer[0], XOrigUpLayer[1] -
244// XShiftLastStripLowLayer[1] + XShiftLastStripLowLayer[1] };
245
254// Double_t XRightBorderUpperlayer[2] = { XOrigUpLayer[0] - XSizeUpLayer[0] + XShiftLastStripUpLayer[0], XOrigUpLayer[1]
255// - XSizeUpLayer[1] + XShiftFirstStripUpLayer[1] };
256
266// Double_t XRightBorderLowerlayer[2] = { XOrigLowLayer[0] - XSizeLowLayer[0] + XShiftLastStripLowLayer[0],
267// XOrigLowLayer[1] - XSizeLowLayer[1] + XShiftFirstStripLowLayer[1] };
268
277// Double_t YLeftBorderUpperlayer[2] = { YOrigUpLayer[0] + YSizeUpLayer[0] - YShiftFirstStripUpLayer[0], YOrigUpLayer[1]
278// + YSizeUpLayer[1] - YShiftFirstStripUpLayer[1] };
279
289// Double_t YLeftBorderLowerlayer[2] = { YOrigLowLayer[0] + YSizeLowLayer[0] - YShiftFirstStripLowLayer[0],
290// YOrigLowLayer[1] + YSizeLowLayer[1] - YShiftFirstStripLowLayer[1] };
291
296// Double_t YRightBorderUpperlayer[2] = { YOrigUpLayer[0], YOrigUpLayer[1] };
297
302// Double_t YRightBorderLowerlayer[2] = { YOrigLowLayer[0], YOrigLowLayer[1] };
303//------------------------------------------------------------------------------
304
310
312 {LeftToRight, RightToLeft}, /*STANDARD_MODULE*/
313 {LeftToRight, RightToLeft} /*LONG_MODULE*/
314};
315// StripNumberingDirection StripDirection[2] = { LeftToRight, RightToLeft };
316
318 {0.01029019668, 0.0095}, /*STANDARD_MODULE*/
319 {0.0107150, 0.0095} /*LONG_MODULE*/
320};
321// Double_t PitchValue[2] = { 0.01029019668, 0.0095 };
322
324 {+2.5, +0.0}, /*STANDARD_MODULE*/
325 {+2.5, +0.0} /*LONG_MODULE*/
326};
327// Double_t StripAngle[2] = { +2.5, +0.0 }; // plus - clockwise, minus - anticlockwise
328
330 {0, 0}, /*STANDARD_MODULE*/
331 {0, 0} /*LONG_MODULE*/
332};
333// Int_t FirstStripNumberUpLayer[2] = { 0, 0 };
334
336 {26, 0}, /*STANDARD_MODULE*/
337 {37, 0} /*LONG_MODULE*/
338};
339// Int_t FirstStripNumberLowLayer[2] = { 26, 0 };
340
341// Dead zones (if you need) -----------------------------------------------------
342
343// find x and y projections of the bevel border thickness -----------------------
344
351// Double_t x_delta[2] = { XYBevelBorder[0]/TMath::Cos(BevelAngleRad), XYBevelBorder[1]/TMath::Cos(BevelAngleRad) };
352
359// Double_t y_delta[2] = { XYBevelBorder[0]/TMath::Sin(BevelAngleRad), XYBevelBorder[1]/TMath::Sin(BevelAngleRad) };
360//------------------------------------------------------------------------------
361
362// find shifts of the sensitive zone from module borders via the equation of a straight line for the inner bevel
363
365 {XLeftBorder[STANDARD_MODULE][0], XLeftBorder[STANDARD_MODULE][1]}, /*STANDARD_MODULE*/
366 {XLeftBorder[LONG_MODULE][0], XLeftBorder[LONG_MODULE][1]} /*LONG_MODULE*/
367};
368// Double_t x_delta_top_BP[2] = { XLeftBorder[0], XLeftBorder[1] };
369
380// Double_t y_delta_top_BP[2] = { TMath::Tan(TMath::PiOver2()+BevelAngleRad)*x_delta_top_BP[0] +
381// (YBevelSize+y_delta[0]), TMath::Tan(TMath::PiOver2()+BevelAngleRad)*x_delta_top_BP[1] + (YBevelSize+y_delta[1]) };
382
387// Double_t y_delta_bottom_BP[2] = { YBottomBorder[0], YBottomBorder[1] };
388
399// Double_t x_delta_bottom_BP[2] = { (y_delta_bottom_BP[0] - (YBevelSize +
400// y_delta[0]))/(TMath::Tan(TMath::PiOver2()+BevelAngleRad)), (y_delta_bottom_BP[1] - (YBevelSize +
401// y_delta[1]))/(TMath::Tan(TMath::PiOver2()+BevelAngleRad)) };
402
413// Double_t XDeadZone[2][3] = {
414// { XOrigLowLayer[0], XOrigLowLayer[0], XModuleSize - x_delta_bottom_BP[0] },
415// { XOrigLowLayer[1], XOrigLowLayer[1], XModuleSize - x_delta_bottom_BP[1] }
416// };
417
425// Double_t YDeadZone[2][3] = {
426// { YOrigLowLayer[0], y_delta_top_BP[0], YOrigLowLayer[0] },
427// { YOrigLowLayer[1], y_delta_top_BP[1], YOrigLowLayer[1] }
428// };
429//------------------------------------------------------------------------------
430
431// Configuration of SI-stations ------------------------------------------------
432
433// Set Parameters of SILICON detector ------------------------------------------
434const Int_t NStations = 5; // stations in the detector
435const Int_t NMaxModules = 22; // max. number of modules in a station
436
437const Int_t NModulesInStations[NStations] = {6, 10, 14, 18, 22};
438
439//(X-Y-Z)Positions of stations (sensitive volumes) -----------------------------
441 // hole center of lower half-planes
442 +0.6250, // st. 0
443 +0.7045, // st. 1
444 +0.9185, // st. 2
445 +1.0180, // st. 3
446 +1.15 // st. 4 (preliminary)
447};
448
450 // hole center of lower half-planes
451 -0.0695, // st. 0
452 -0.0895, // st. 1
453 -0.0565, // st. 2
454 -0.0670, // st. 3
455 +0.0 // st. 4
456};
457
459 // reference point (average measured z-position of lower half-planes)
460 +14.1370, // st. 0
461 +22.9015, // st. 1
462 +31.6785, // st. 2
463 +40.5235, // st. 3
464 +48.91 // st. 4
465};
466//------------------------------------------------------------------------------
467
468const Double_t z_mod_thick = 0.03; // thickness of silicon sensor
469
470const Double_t z_shift_up = +2.68; // z-shift from reference point to local basic point of upper half-planes
471const Double_t z_shift_low = -0.61; // z-shift from reference point to local basic point of lower half-planes
472
473// x-distance from hole center to the base
475 21.7, // st. 0
476 21.7, // st. 1
477 27.7, // st. 2
478 33.7, // st. 3
479 39.7 // st. 4
480};
481
482// y-distance from hole center to the base
484 12.99, // st. 0
485 16.29, // st. 1
486 16.29, // st. 2
487 16.29, // st. 3
488 22.24 // st. 4
489};
490
491// z-shift of the upper half-plane relative to the lower one (dist. between two ref. points)
493 +5.0800, // st. 0
494 +5.1255, // st. 1
495 +4.9800, // st. 2
496 +5.0115, // st. 3
497 +5.6100 // st. 4 (preliminary)
498};
499
500// x-shift of hole-center of the upper half-plane relative to the lower half-plane
502 +0.0165, // st. 0
503 +0.0100, // st. 1
504 +0.0325, // st. 2
505 +0.0820, // st. 3
506 +0.0000 // st. 4 (preliminary)
507};
508
509// y-shift of hole-center of the upper half-plane relative to the lower half-plane
511 -0.0155, // st. 0
512 -0.0730, // st. 1
513 -0.0645, // st. 2
514 +0.6580, // st. 3
515 +0.0000 // st. 4 (preliminary)
516};
517
519 {-x_dist_cent_base[0] + x_shift_hp[0] + 30.850 /*0*/, -x_dist_cent_base[0] + x_shift_hp[0] + 24.852 /*1*/,
520 -x_dist_cent_base[0] + x_shift_hp[0] + 12.556 /*2*/,
521
522 -x_dist_cent_base[0] + 30.859 /*3*/, -x_dist_cent_base[0] + 24.863 /*4*/,
523 -x_dist_cent_base[0] + 12.558 /*5*/}, // st. 0
524
525 {-x_dist_cent_base[1] + x_shift_hp[1] + 36.860 /*0*/, -x_dist_cent_base[1] + x_shift_hp[1] + 30.844 /*1*/,
526 -x_dist_cent_base[1] + x_shift_hp[1] + 24.860 /*2*/, -x_dist_cent_base[1] + x_shift_hp[1] + 12.550 /*3*/,
527 -x_dist_cent_base[1] + x_shift_hp[1] + 6.557 /*4*/,
528
529 -x_dist_cent_base[1] + 36.8425 /*5*/, -x_dist_cent_base[1] + 30.8505 /*6*/, -x_dist_cent_base[1] + 24.8450 /*7*/,
530 -x_dist_cent_base[1] + 12.5550 /*8*/, -x_dist_cent_base[1] + 6.5585 /*9*/}, // st. 1
531
532 {-x_dist_cent_base[2] + x_shift_hp[2] + 48.8465 /*0*/, -x_dist_cent_base[2] + x_shift_hp[2] + 42.8315 /*1*/,
533 -x_dist_cent_base[2] + x_shift_hp[2] + 36.8485 /*2*/, -x_dist_cent_base[2] + x_shift_hp[2] + 30.8425 /*3*/,
534 -x_dist_cent_base[2] + x_shift_hp[2] + 18.5555 /*4*/, -x_dist_cent_base[2] + x_shift_hp[2] + 12.5395 /*5*/,
535 -x_dist_cent_base[2] + x_shift_hp[2] + 6.5530 /*6*/,
536
537 -x_dist_cent_base[2] + 48.8535 /*7*/, -x_dist_cent_base[2] + 42.8470 /*8*/, -x_dist_cent_base[2] + 36.8420 /*9*/,
538 -x_dist_cent_base[2] + 30.8435 /*10*/, -x_dist_cent_base[2] + 18.5445 /*11*/,
539 -x_dist_cent_base[2] + 12.5435 /*12*/, -x_dist_cent_base[2] + 6.5475 /*13*/}, // st. 2
540
541 {-x_dist_cent_base[3] + x_shift_hp[3] + 60.8580 /*0*/, -x_dist_cent_base[3] + x_shift_hp[3] + 54.8485 /*1*/,
542 -x_dist_cent_base[3] + x_shift_hp[3] + 48.8545 /*2*/, -x_dist_cent_base[3] + x_shift_hp[3] + 42.8390 /*3*/,
543 -x_dist_cent_base[3] + x_shift_hp[3] + 36.8435 /*4*/, -x_dist_cent_base[3] + x_shift_hp[3] + 24.5520 /*5*/,
544 -x_dist_cent_base[3] + x_shift_hp[3] + 18.5450 /*6*/, -x_dist_cent_base[3] + x_shift_hp[3] + 12.5470 /*7*/,
545 -x_dist_cent_base[3] + x_shift_hp[3] + 6.5585 /*8*/,
546
547 -x_dist_cent_base[3] + 60.860 /*9*/, -x_dist_cent_base[3] + 54.547 /*10*/, -x_dist_cent_base[3] + 48.860 /*11*/,
548 -x_dist_cent_base[3] + 42.845 /*12*/, -x_dist_cent_base[3] + 36.847 /*13*/, -x_dist_cent_base[3] + 24.5445 /*14*/,
549 -x_dist_cent_base[3] + 18.557 /*15*/, -x_dist_cent_base[3] + 12.552 /*16*/,
550 -x_dist_cent_base[3] + 6.5525 /*17*/}, // st. 3
551
552 {-x_dist_cent_base[4] + x_shift_hp[4] + 72.85 /*0*/,
553 -x_dist_cent_base[4] + x_shift_hp[4] + 66.85 /*1*/,
554 -x_dist_cent_base[4] + x_shift_hp[4] + 60.85 /*2*/,
555 -x_dist_cent_base[4] + x_shift_hp[4] + 54.85 /*3*/,
556 -x_dist_cent_base[4] + x_shift_hp[4] + 48.85 /*4*/,
557 -x_dist_cent_base[4] + x_shift_hp[4] + 42.85 /*5*/,
558 -x_dist_cent_base[4] + x_shift_hp[4] + 30.55 /*6*/,
559 -x_dist_cent_base[4] + x_shift_hp[4] + 24.55 /*7*/,
560 -x_dist_cent_base[4] + x_shift_hp[4] + 18.55 /*8*/,
561 -x_dist_cent_base[4] + x_shift_hp[4] + 12.55 /*9*/,
562 -x_dist_cent_base[4] + x_shift_hp[4] + 6.55 /*10*/,
563
564 -x_dist_cent_base[4] + 72.85 /*11*/,
565 -x_dist_cent_base[4] + 66.85 /*12*/,
566 -x_dist_cent_base[4] + 60.85 /*13*/,
567 -x_dist_cent_base[4] + 54.85 /*14*/,
568 -x_dist_cent_base[4] + 48.85 /*15*/,
569 -x_dist_cent_base[4] + 42.85 /*16*/,
570 -x_dist_cent_base[4] + 30.55 /*17*/,
571 -x_dist_cent_base[4] + 24.55 /*18*/,
572 -x_dist_cent_base[4] + 18.55 /*19*/,
573 -x_dist_cent_base[4] + 12.55 /*20*/,
574 -x_dist_cent_base[4] + 6.55 /*21*/} // st. 4
575};
576
578 {+y_dist_cent_base[0] + y_shift_hp[0] - 13.112 /*0*/, +y_dist_cent_base[0] + y_shift_hp[0] - 10.113 /*1*/,
579 +y_dist_cent_base[0] + y_shift_hp[0] - 13.086 /*2*/,
580
581 -y_dist_cent_base[0] + 13.100 /*3*/, -y_dist_cent_base[0] + 10.110 /*4*/,
582 -y_dist_cent_base[0] + 13.098 /*5*/}, // st. 0
583
584 {+y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*0*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.424 /*1*/,
585 +y_dist_cent_base[1] + y_shift_hp[1] - 13.421 /*2*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.421 /*3*/,
586 +y_dist_cent_base[1] + y_shift_hp[1] - 16.420 /*4*/,
587
588 -y_dist_cent_base[1] + 16.432 /*5*/, -y_dist_cent_base[1] + 16.423 /*6*/, -y_dist_cent_base[1] + 13.428 /*7*/,
589 -y_dist_cent_base[1] + 16.425 /*8*/, -y_dist_cent_base[1] + 16.429 /*9*/}, // st. 1
590
591 {+y_dist_cent_base[2] + y_shift_hp[2] - 16.424 /*0*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*1*/,
592 +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*2*/, +y_dist_cent_base[2] + y_shift_hp[2] - 13.411 /*3*/,
593 +y_dist_cent_base[2] + y_shift_hp[2] - 16.431 /*4*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.420 /*5*/,
594 +y_dist_cent_base[2] + y_shift_hp[2] - 16.430 /*6*/,
595
596 -y_dist_cent_base[2] + 16.418 /*7*/, -y_dist_cent_base[2] + 16.427 /*8*/, -y_dist_cent_base[2] + 16.421 /*9*/,
597 -y_dist_cent_base[2] + 13.428 /*10*/, -y_dist_cent_base[2] + 16.413 /*11*/, -y_dist_cent_base[2] + 16.427 /*12*/,
598 -y_dist_cent_base[2] + 16.414 /*13*/}, // st. 2
599
600 {+y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*0*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*1*/,
601 +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*2*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.432 /*3*/,
602 +y_dist_cent_base[3] + y_shift_hp[3] - 13.432 /*4*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*5*/,
603 +y_dist_cent_base[3] + y_shift_hp[3] - 16.422 /*6*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.423 /*7*/,
604 +y_dist_cent_base[3] + y_shift_hp[3] - 16.427 /*8*/,
605
606 -y_dist_cent_base[3] + 16.432 /*9*/, -y_dist_cent_base[3] + 16.437 /*10*/, -y_dist_cent_base[3] + 16.435 /*11*/,
607 -y_dist_cent_base[3] + 16.435 /*12*/, -y_dist_cent_base[3] + 13.437 /*13*/, -y_dist_cent_base[3] + 16.434 /*14*/,
608 -y_dist_cent_base[3] + 16.436 /*15*/, -y_dist_cent_base[3] + 16.431 /*16*/,
609 -y_dist_cent_base[3] + 16.428 /*17*/}, // st. 3
610
611 {+y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*0*/,
612 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*1*/,
613 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*2*/,
614 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*3*/,
615 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*4*/,
616 +y_dist_cent_base[4] + y_shift_hp[4] - 19.436 /*5*/,
617 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*6*/,
618 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*7*/,
619 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*8*/,
620 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*9*/,
621 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*10*/,
622
623 -y_dist_cent_base[4] + 22.436 /*11*/,
624 -y_dist_cent_base[4] + 22.436 /*12*/,
625 -y_dist_cent_base[4] + 22.436 /*13*/,
626 -y_dist_cent_base[4] + 22.436 /*14*/,
627 -y_dist_cent_base[4] + 22.436 /*15*/,
628 -y_dist_cent_base[4] + 19.436 /*16*/,
629 -y_dist_cent_base[4] + 22.436 /*17*/,
630 -y_dist_cent_base[4] + 22.436 /*18*/,
631 -y_dist_cent_base[4] + 22.436 /*19*/,
632 -y_dist_cent_base[4] + 22.436 /*20*/,
633 -y_dist_cent_base[4] + 22.436 /*21*/} // st. 4
634};
635
637 {+z_shift_hp[0] + z_shift_up - 2.6 /*0*/, +z_shift_hp[0] + z_shift_up - 1.45 /*1*/,
638 +z_shift_hp[0] + z_shift_up - 2.7 /*2*/,
639
640 +z_shift_low - z_mod_thick + 2.61 /*3*/, +z_shift_low - z_mod_thick + 1.4 /*4*/,
641 +z_shift_low - z_mod_thick + 2.78 /*5*/}, // st. 0
642
643 {+z_shift_hp[1] + z_shift_up - 1.41 /*0*/, +z_shift_hp[1] + z_shift_up - 2.585 /*1*/,
644 +z_shift_hp[1] + z_shift_up - 1.395 /*2*/, +z_shift_hp[1] + z_shift_up - 2.76 /*3*/,
645 +z_shift_hp[1] + z_shift_up - 1.585 /*4*/,
646
647 +z_shift_low - z_mod_thick + 1.425 /*5*/, +z_shift_low - z_mod_thick + 2.595 /*6*/,
648 +z_shift_low - z_mod_thick + 1.445 /*7*/, +z_shift_low - z_mod_thick + 2.73 /*8*/,
649 +z_shift_low - z_mod_thick + 1.51 /*9*/}, // st. 1
650
651 {+z_shift_hp[2] + z_shift_up - 2.595 /*0*/, +z_shift_hp[2] + z_shift_up - 1.395 /*1*/,
652 +z_shift_hp[2] + z_shift_up - 2.665 /*2*/, +z_shift_hp[2] + z_shift_up - 1.425 /*3*/,
653 +z_shift_hp[2] + z_shift_up - 2.735 /*4*/, +z_shift_hp[2] + z_shift_up - 1.56 /*5*/,
654 +z_shift_hp[2] + z_shift_up - 2.705 /*6*/,
655
656 +z_shift_low - z_mod_thick + 2.585 /*7*/, +z_shift_low - z_mod_thick + 1.435 /*8*/,
657 +z_shift_low - z_mod_thick + 2.595 /*9*/, +z_shift_low - z_mod_thick + 1.41 /*10*/,
658 +z_shift_low - z_mod_thick + 2.79 /*11*/, +z_shift_low - z_mod_thick + 1.6 /*12*/,
659 +z_shift_low - z_mod_thick + 2.83 /*13*/}, // st. 2
660
661 {+z_shift_hp[3] + z_shift_up - 1.41 /*0*/, +z_shift_hp[3] + z_shift_up - 2.59 /*1*/,
662 +z_shift_hp[3] + z_shift_up - 1.435 /*2*/, +z_shift_hp[3] + z_shift_up - 2.635 /*3*/,
663 +z_shift_hp[3] + z_shift_up - 1.4 /*4*/, +z_shift_hp[3] + z_shift_up - 2.775 /*5*/,
664 +z_shift_hp[3] + z_shift_up - 1.605 /*6*/, +z_shift_hp[3] + z_shift_up - 2.73 /*7*/,
665 +z_shift_hp[3] + z_shift_up - 1.6 /*8*/,
666
667 +z_shift_low - z_mod_thick + 1.45 /*9*/, +z_shift_low - z_mod_thick + 2.575 /*10*/,
668 +z_shift_low - z_mod_thick + 1.37 /*11*/, +z_shift_low - z_mod_thick + 2.585 /*12*/,
669 +z_shift_low - z_mod_thick + 1.42 /*13*/, +z_shift_low - z_mod_thick + 2.695 /*14*/,
670 +z_shift_low - z_mod_thick + 1.525 /*15*/, +z_shift_low - z_mod_thick + 2.68 /*16*/,
671 +z_shift_low - z_mod_thick + 1.515 /*17*/}, // st. 3
672
673 {+z_shift_hp[4] + z_shift_up - 2.82 /*0*/, +z_shift_hp[4] + z_shift_up - 1.6 /*1*/,
674 +z_shift_hp[4] + z_shift_up - 2.82 /*2*/, +z_shift_hp[4] + z_shift_up - 1.6 /*3*/,
675 +z_shift_hp[4] + z_shift_up - 2.82 /*4*/, +z_shift_hp[4] + z_shift_up - 1.6 /*5*/,
676 +z_shift_hp[4] + z_shift_up - 2.95 /*6*/, +z_shift_hp[4] + z_shift_up - 1.73 /*7*/,
677 +z_shift_hp[4] + z_shift_up - 2.95 /*8*/, +z_shift_hp[4] + z_shift_up - 1.73 /*9*/,
678 +z_shift_hp[4] + z_shift_up - 2.95 /*10*/,
679
680 +z_shift_low - z_mod_thick + 2.82 /*11*/, +z_shift_low - z_mod_thick + 1.6 /*12*/,
681 +z_shift_low - z_mod_thick + 2.82 /*13*/, +z_shift_low - z_mod_thick + 1.6 /*14*/,
682 +z_shift_low - z_mod_thick + 2.82 /*15*/, +z_shift_low - z_mod_thick + 1.6 /*16*/,
683 +z_shift_low - z_mod_thick + 2.95 /*17*/, +z_shift_low - z_mod_thick + 1.73 /*18*/,
684 +z_shift_low - z_mod_thick + 2.95 /*19*/, +z_shift_low - z_mod_thick + 1.73 /*20*/,
685 +z_shift_low - z_mod_thick + 2.95 /*21*/} // st. 4
686};
687
688// Geometry parameters of modules
696
714
715// rotations of modules around y-axis by 180 deg.
717 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
718 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
719 false /*9*/},
720 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
721 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
722 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
723 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
724 false /*17*/},
725 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, true /*5*/, false /*6*/, false /*7*/,
726 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
727 true /*16*/, false /*17*/, false /*18*/, false /*19*/, false /*20*/, false /*21*/}};
728
729// rotations of modules around x-axis by 180 deg.
731 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
732 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
733 true /*9*/},
734 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
735 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
736 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
737 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
738 true /*17*/},
739 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
740 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
741 true /*16*/, true /*17*/, true /*18*/, true /*19*/, true /*20*/, true /*21*/}};
742
743/*
744//rotations of half-planes around y-axis (angles in degrees)
745const Int_t NMaxHalfPlanes = 2;
746const Double_t HalfPlanesYRotations[NStations][NMaxHalfPlanes] = {
747 {-0.205, -0.235}, // st.0 (upper [0] and lower [1] half-planes)
748 {-0.399, -0.173}, // st.1
749 {-0.151, -0.584}, // st.2
750 {-0.108, +0.367}, // st.3
751 {+0.000, +0.000} // st.4
752};
753*/
754
755//------------------------------------------------------------------------------
756
757// Function declarations
758void PrintInfo();
759void CalculateParameters(TString config_name, TString author, TString date);
760//------------------------------------------------------------------------------
761
763{
764
765 TString ConfigName = "Silicon_5stations_2026";
766 TString AuthorName = "Baranov D.";
767 TString DateCreated = "04.02.2026";
768
769 // PrintInfo();
770 CalculateParameters(ConfigName, AuthorName, DateCreated);
771
772 cout << "It's the end"
773 << "\n";
774 // gApplication->Terminate();
775}
776
777//------------------------------------------------------------------------------
778
780{
781
782 cout << "----------------------------------------------------------------\n";
783 cout << "Parameters of the standard module 63x126 mm:\n";
784 cout << "\n";
785 cout << " Upper layer (inclined strips):\n";
786 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][0] << " : " << YOrigUpLayer[STANDARD_MODULE][0]
787 << " )\n";
788 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][0] << " : " << YSizeUpLayer[STANDARD_MODULE][0]
789 << " )\n";
790 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][0] << " : "
791 << YLeftBorderUpperlayer[STANDARD_MODULE][0] << " )\n";
792 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][0] << " : "
794 cout << " strip_direction = ";
796 cout << "LeftToRight\n";
797 else
798 cout << "RightToLeft\n";
799 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
800 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
801 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][0] << "\n";
802 cout << "\n";
803
804 cout << " Lower layer (inclined strips):\n";
805 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][0] << " : " << YOrigLowLayer[STANDARD_MODULE][0]
806 << " )\n";
807 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][0] << " : " << YSizeLowLayer[STANDARD_MODULE][0]
808 << " )\n";
809 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][0] << " : "
810 << YLeftBorderLowerlayer[STANDARD_MODULE][0] << " )\n";
811 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][0] << " : "
813 cout << " strip_direction = ";
815 cout << "LeftToRight\n";
816 else
817 cout << "RightToLeft\n";
818 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
819 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
820 cout << " first_strip_number = " << FirstStripNumberLowLayer[STANDARD_MODULE][0] << "\n";
821 cout << " dead_zone(3 points):\n";
822 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][0] << " : " << YDeadZone[STANDARD_MODULE][0][0]
823 << " )\n";
824 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][1] << " : " << YDeadZone[STANDARD_MODULE][0][1]
825 << " )\n";
826 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][2] << " : " << YDeadZone[STANDARD_MODULE][0][2]
827 << " )\n";
828 cout << "\n";
829
830 cout << " Upper layer (straight strips):\n";
831 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][1] << " : " << YOrigUpLayer[STANDARD_MODULE][1]
832 << " )\n";
833 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][1] << " : " << YSizeUpLayer[STANDARD_MODULE][1]
834 << " )\n";
835 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][1] << " : "
836 << YLeftBorderUpperlayer[STANDARD_MODULE][1] << " )\n";
837 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][1] << " : "
839 cout << " strip_direction = ";
841 cout << "LeftToRight\n";
842 else
843 cout << "RightToLeft\n";
844 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
845 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
846 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][1] << "\n";
847 cout << "\n";
848
849 cout << " Lower layer (straight strips):\n";
850 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][1] << " : " << YOrigLowLayer[STANDARD_MODULE][1]
851 << " )\n";
852 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][1] << " : " << YSizeLowLayer[STANDARD_MODULE][1]
853 << " )\n";
854 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][1] << " : "
855 << YLeftBorderLowerlayer[STANDARD_MODULE][1] << " )\n";
856 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][1] << " : "
858 cout << " strip_direction = ";
860 cout << "LeftToRight\n";
861 else
862 cout << "RightToLeft\n";
863 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
864 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
865 cout << " first_strip_number = " << FirstStripNumberLowLayer[STANDARD_MODULE][1] << "\n";
866 cout << " dead_zone(3 points):\n";
867 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][0] << " : " << YDeadZone[STANDARD_MODULE][1][0]
868 << " )\n";
869 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][1] << " : " << YDeadZone[STANDARD_MODULE][1][1]
870 << " )\n";
871 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][2] << " : " << YDeadZone[STANDARD_MODULE][1][2]
872 << " )\n";
873 cout << "\n";
874
875 cout << "----------------------------------------------------------------\n";
876
877 cout << "----------------------------------------------------------------\n";
878 cout << "Parameters of the long module 63x186 mm:\n";
879 cout << "\n";
880 cout << " Upper layer (inclined strips):\n";
881 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][0] << " : " << YOrigUpLayer[LONG_MODULE][0] << " )\n";
882 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][0] << " : " << YSizeUpLayer[LONG_MODULE][0] << " )\n";
883 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][0] << " : "
884 << YLeftBorderUpperlayer[LONG_MODULE][0] << " )\n";
885 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][0] << " : "
886 << YRightBorderUpperlayer[LONG_MODULE][0] << " )\n";
887 cout << " strip_direction = ";
889 cout << "LeftToRight\n";
890 else
891 cout << "RightToLeft\n";
892 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
893 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
894 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][0] << "\n";
895 cout << "\n";
896
897 cout << " Lower layer (inclined strips):\n";
898 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][0] << " : " << YOrigLowLayer[LONG_MODULE][0] << " )\n";
899 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][0] << " : " << YSizeLowLayer[LONG_MODULE][0] << " )\n";
900 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][0] << " : "
901 << YLeftBorderLowerlayer[LONG_MODULE][0] << " )\n";
902 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][0] << " : "
903 << YRightBorderLowerlayer[LONG_MODULE][0] << " )\n";
904 cout << " strip_direction = ";
906 cout << "LeftToRight\n";
907 else
908 cout << "RightToLeft\n";
909 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
910 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
911 cout << " first_strip_number = " << FirstStripNumberLowLayer[LONG_MODULE][0] << "\n";
912 cout << " dead_zone(3 points):\n";
913 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][0][0] << " : " << YDeadZone[LONG_MODULE][0][0] << " )\n";
914 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][0][1] << " : " << YDeadZone[LONG_MODULE][0][1] << " )\n";
915 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][0][2] << " : " << YDeadZone[LONG_MODULE][0][2] << " )\n";
916 cout << "\n";
917
918 cout << " Upper layer (straight strips):\n";
919 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][1] << " : " << YOrigUpLayer[LONG_MODULE][1] << " )\n";
920 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][1] << " : " << YSizeUpLayer[LONG_MODULE][1] << " )\n";
921 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][1] << " : "
922 << YLeftBorderUpperlayer[LONG_MODULE][1] << " )\n";
923 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][1] << " : "
924 << YRightBorderUpperlayer[LONG_MODULE][1] << " )\n";
925 cout << " strip_direction = ";
927 cout << "LeftToRight\n";
928 else
929 cout << "RightToLeft\n";
930 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
931 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
932 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][1] << "\n";
933 cout << "\n";
934
935 cout << " Lower layer (straight strips):\n";
936 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][1] << " : " << YOrigLowLayer[LONG_MODULE][1] << " )\n";
937 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][1] << " : " << YSizeLowLayer[LONG_MODULE][1] << " )\n";
938 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][1] << " : "
939 << YLeftBorderLowerlayer[LONG_MODULE][1] << " )\n";
940 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][1] << " : "
941 << YRightBorderLowerlayer[LONG_MODULE][1] << " )\n";
942 cout << " strip_direction = ";
944 cout << "LeftToRight\n";
945 else
946 cout << "RightToLeft\n";
947 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
948 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
949 cout << " first_strip_number = " << FirstStripNumberLowLayer[LONG_MODULE][1] << "\n";
950 cout << " dead_zone(3 points):\n";
951 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][1][0] << " : " << YDeadZone[LONG_MODULE][1][0] << " )\n";
952 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][1][1] << " : " << YDeadZone[LONG_MODULE][1][1] << " )\n";
953 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][1][2] << " : " << YDeadZone[LONG_MODULE][1][2] << " )\n";
954 cout << "\n";
955
956 cout << "----------------------------------------------------------------\n";
957}
958//------------------------------------------------------------------------------
959
960void CalculateParameters(TString config_name, TString author, TString date)
961{
962
963 TString FileName = config_name + TString(".xml");
964
965 cout << "\nCreating XML configuration file...\n";
966 cout << " Configuration name: " << config_name << "\n";
967 cout << " Author: " << author << "\n";
968 cout << " Date created: " << date << "\n";
969 cout << " File path: " << FileName << "\n";
970 cout << "\n";
971
972 // WARNING(!!!): the file will be written in the current directory
973 ofstream SiFileOut(FileName.Data(), ios::out);
974
975 SiFileOut << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
976
977 // reference frame usage comment
978 SiFileOut << "<!--\
979 \r\tConfig: "
980 << config_name << "\
981 \r\tAuthor: "
982 << author << "\
983 \r\tDate: "
984 << date << "\n\
985 \r\tA right-handed coordinates are used.\
986 \r\tIf you look at the FSD from the target:\
987 \r\t\tx-axis is directed to the left,\
988 \r\t\ty-axis - to the top,\
989 \r\t\tz-axis - to the FSD.\
990 \r-->\n\n";
991
992 SiFileOut << "<StationSet>\n";
993 SiFileOut << "\n";
994
995 for (Int_t istation = 0; istation < NStations; ++istation) {
996
997 cout << "istation = " << istation << ": -----------------------------\n";
998
999 // module size in a station
1000 ModuleSize module_size = STANDARD_MODULE;
1001
1002 //(!!!) Long modules (!!!)
1003 if (istation == 0)
1004 module_size = LONG_MODULE;
1005
1006 if (istation == 4)
1007 module_size = LONG_MODULE;
1008
1009 SiFileOut << "<!-- Station " << istation << " -->\n";
1010
1011 SiFileOut << "\t<Station";
1012 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
1013 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
1014 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
1015 SiFileOut << " rotAngleDeg=\""
1016 << "0.0"
1017 << "\"";
1018 SiFileOut << " rotCenterX=\""
1019 << "0.0"
1020 << "\"";
1021 SiFileOut << " rotCenterY=\""
1022 << "0.0"
1023 << "\"";
1024 SiFileOut << ">\n";
1025 SiFileOut << "\n";
1026
1027 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
1028
1029 cout << " imodule = " << imodule << "\n";
1030
1031 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
1032
1033 SiFileOut << "\t\t<Module";
1034 // SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
1035 // SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
1036 SiFileOut << " xShift=\"" << 0.0 << "\"";
1037 SiFileOut << " yShift=\"" << 0.0 << "\"";
1038 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
1039 SiFileOut << ">";
1040 /*
1041 //Transforms -------------------------------------------------------
1042
1043 //Translation: station: forward shifts
1044 SiFileOut << "\t\t\t<Transform";
1045 SiFileOut << " rotOrder=\"" << "XYZ" << "\"";
1046 SiFileOut << " xRotationDeg=\"" << 0.0 << "\"";
1047 SiFileOut << " yRotationDeg=\"" << 0.0 << "\"";
1048 SiFileOut << " zRotationDeg=\"" << 0.0 << "\"";
1049 SiFileOut << " xTranslation=\"" << -XStationPositions[istation] << "\"";
1050 SiFileOut << " yTranslation=\"" << -YStationPositions[istation] << "\"";
1051 SiFileOut << " zTranslation=\"" << -ZStationPositions[istation] << "\"";
1052 SiFileOut << " />\n";
1053
1054
1055 //Translation: only for upper modules: forward shifts
1056 if(imodule < NModulesInStations[istation]/2) { //modules of upper half-plane
1057 SiFileOut << "\t\t\t<Transform";
1058 SiFileOut << " rotOrder=\"" << "XYZ" << "\"";
1059 SiFileOut << " xRotationDeg=\"" << 0.0 << "\"";
1060 SiFileOut << " yRotationDeg=\"" << 0.0 << "\"";
1061 SiFileOut << " zRotationDeg=\"" << 0.0 << "\"";
1062 SiFileOut << " xTranslation=\"" << -x_shift_hp[istation] << "\"";
1063 SiFileOut << " yTranslation=\"" << -y_shift_hp[istation] << "\"";
1064 SiFileOut << " zTranslation=\"" << -z_shift_hp[istation] << "\"";
1065 SiFileOut << " />\n";
1066 }
1067
1068 //Rotation module (as a part of the whole half-plane) around Y-axis
1069 SiFileOut << "\t\t\t<Transform";
1070 SiFileOut << " rotOrder=\"" << "XYZ" << "\"";
1071 SiFileOut << " xRotationDeg=\"" << 0.0 << "\"";
1072 if(imodule < NModulesInStations[istation]/2) SiFileOut << " yRotationDeg=\"" <<
1073 HalfPlanesYRotations[istation][0] << "\""; //modules of upper half-plane else SiFileOut << "
1074 yRotationDeg=\"" << HalfPlanesYRotations[istation][1] << "\""; //modules of lower half-plane SiFileOut <<
1075 " zRotationDeg=\"" << 0.0 << "\""; SiFileOut << " xTranslation=\"" << 0.0 << "\""; SiFileOut << "
1076 yTranslation=\"" << 0.0 << "\""; SiFileOut << " zTranslation=\"" << 0.0 << "\""; SiFileOut << " />\n";
1077
1078 //Translation: only for upper modules: backward shifts
1079 if(imodule < NModulesInStations[istation]/2) { //modules of upper half-plane
1080 SiFileOut << "\t\t\t<Transform";
1081 SiFileOut << " rotOrder=\"" << "XYZ" << "\"";
1082 SiFileOut << " xRotationDeg=\"" << 0.0 << "\"";
1083 SiFileOut << " yRotationDeg=\"" << 0.0 << "\"";
1084 SiFileOut << " zRotationDeg=\"" << 0.0 << "\"";
1085 SiFileOut << " xTranslation=\"" << +x_shift_hp[istation] << "\"";
1086 SiFileOut << " yTranslation=\"" << +y_shift_hp[istation] << "\"";
1087 SiFileOut << " zTranslation=\"" << +z_shift_hp[istation] << "\"";
1088 SiFileOut << " />\n";
1089 }
1090
1091 //Translation: station: backward shifts
1092 SiFileOut << "\t\t\t<Transform";
1093 SiFileOut << " rotOrder=\"" << "XYZ" << "\"";
1094 SiFileOut << " xRotationDeg=\"" << 0.0 << "\"";
1095 SiFileOut << " yRotationDeg=\"" << 0.0 << "\"";
1096 SiFileOut << " zRotationDeg=\"" << 0.0 << "\"";
1097 SiFileOut << " xTranslation=\"" << +XStationPositions[istation] << "\"";
1098 SiFileOut << " yTranslation=\"" << +YStationPositions[istation] << "\"";
1099 SiFileOut << " zTranslation=\"" << +ZStationPositions[istation] << "\"";
1100 SiFileOut << " />\n";
1101 */
1102 SiFileOut << "\n";
1103
1104 //------------------------------------------------------------------
1105
1106 // Notice!!!: here:
1107 // index "0" is a layer with inclined strips (the front side of the module)
1108 // index "1" is a layer with straight strips (the back side of the module)
1109 // "UpLayer" is the upper part of the module
1110 // "LowLayer" is the lower part of the module
1111
1112 Double_t xOrig_UpLayer[2];
1113 Double_t yOrig_UpLayer[2];
1114 Double_t xOrig_LowLayer[2];
1115 Double_t yOrig_LowLayer[2];
1116
1117 Double_t xSize_UpLayer[2];
1118 Double_t ySize_UpLayer[2];
1119 Double_t xSize_LowLayer[2];
1120 Double_t ySize_LowLayer[2];
1121
1122 Double_t xLBorder_UpLayer[2];
1123 Double_t yLBorder_UpLayer[2];
1124 Double_t xLBorder_LowLayer[2];
1125 Double_t yLBorder_LowLayer[2];
1126 Double_t xRBorder_UpLayer[2];
1127 Double_t yRBorder_UpLayer[2];
1128 Double_t xRBorder_LowLayer[2];
1129 Double_t yRBorder_LowLayer[2];
1130
1131 Double_t xDeadZone[2][3];
1132 Double_t yDeadZone[2][3];
1133
1134 Bool_t isDeadZone_UpLayer = false;
1135 Bool_t isDeadZone_LowLayer = false;
1136
1137 StripNumberingDirection stripDirection[2];
1138 Double_t pitchValue[2] = {PitchValue[module_size][0], PitchValue[module_size][1]};
1139 Double_t stripAngle[2];
1140 Int_t firstStripNumber_UpLayer[2];
1141 Int_t firstStripNumber_LowLayer[2];
1142
1143 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
1144
1145 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1146 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
1147 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1148 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
1149
1150 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1151 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
1152 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1153 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
1154
1155 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
1156 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
1157 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
1158 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
1159
1160 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
1161 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
1162 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
1163 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
1164
1165 xLBorder_UpLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1166 xLBorder_UpLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1167 yLBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1168 yLBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1169 xLBorder_LowLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1170 xLBorder_LowLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1171 yLBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1172 yLBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1173
1174 xRBorder_UpLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1175 xRBorder_UpLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1176 yRBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1177 yRBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1178 xRBorder_LowLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1179 xRBorder_LowLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1180 yRBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1181 yRBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1182
1183 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1184 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1185 xDeadZone[ilayer][ipoint] =
1186 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1187 yDeadZone[ilayer][ipoint] =
1188 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1189 }
1190 }
1191
1192 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1193 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1194 {
1195 isDeadZone_UpLayer = false;
1196 isDeadZone_LowLayer = true;
1197 }
1198
1199 if (StripDirection[module_size][0] == LeftToRight)
1200 stripDirection[0] = LeftToRight;
1201 else
1202 stripDirection[0] = RightToLeft;
1203 if (StripDirection[module_size][1] == LeftToRight)
1204 stripDirection[1] = LeftToRight;
1205 else
1206 stripDirection[1] = RightToLeft;
1207
1208 stripAngle[0] = StripAngle[module_size][0];
1209 stripAngle[1] = StripAngle[module_size][1];
1210
1211 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
1212 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
1213 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
1214 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
1215 }
1216
1217 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
1218
1219 xOrig_UpLayer[0] =
1220 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1221 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
1222 xOrig_LowLayer[0] =
1223 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1224 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
1225
1226 xOrig_UpLayer[1] =
1227 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1228 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
1229 xOrig_LowLayer[1] =
1230 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1231 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
1232
1233 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
1234 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
1235 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
1236 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
1237
1238 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
1239 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
1240 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
1241 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
1242
1243 xLBorder_UpLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1244 xLBorder_UpLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1245 yLBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1246 yLBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1247 xLBorder_LowLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1248 xLBorder_LowLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1249 yLBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1250 yLBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1251
1252 xRBorder_UpLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1253 xRBorder_UpLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1254 yRBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1255 yRBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1256 xRBorder_LowLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1257 xRBorder_LowLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1258 yRBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1259 yRBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1260
1261 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1262 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1263 xDeadZone[ilayer][ipoint] =
1264 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1265 yDeadZone[ilayer][ipoint] =
1266 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1267 }
1268 }
1269
1270 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1271 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1272 {
1273 isDeadZone_UpLayer = false;
1274 isDeadZone_LowLayer = true;
1275 }
1276
1277 if (StripDirection[module_size][0] == LeftToRight)
1278 stripDirection[0] = RightToLeft;
1279 else
1280 stripDirection[0] = LeftToRight;
1281 if (StripDirection[module_size][1] == LeftToRight)
1282 stripDirection[1] = RightToLeft;
1283 else
1284 stripDirection[1] = LeftToRight;
1285
1286 stripAngle[0] = -StripAngle[module_size][0];
1287 stripAngle[1] = -StripAngle[module_size][1];
1288
1289 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
1290 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
1291 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
1292 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
1293 }
1294
1295 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
1296
1297 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1298 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
1299 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
1300 + YModuleShifts[istation][imodule];
1301 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1302 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
1303 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
1304 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
1305 + YModuleShifts[istation][imodule];
1306
1307 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1308 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
1309 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
1310 + YModuleShifts[istation][imodule];
1311 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1312 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
1313 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
1314 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
1315 + YModuleShifts[istation][imodule];
1316
1317 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
1318 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1319 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1320 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1321
1322 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1323 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1324 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1325 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1326
1327 xLBorder_UpLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1328 xLBorder_UpLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1329 yLBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1330 yLBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1331 xLBorder_LowLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1332 xLBorder_LowLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1333 yLBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1334 yLBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1335
1336 xRBorder_UpLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1337 xRBorder_UpLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1338 yRBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1339 yRBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1340 xRBorder_LowLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1341 xRBorder_LowLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1342 yRBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1343 yRBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1344
1345 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1346 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1347 xDeadZone[ilayer][ipoint] =
1348 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1349 yDeadZone[ilayer][ipoint] =
1350 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1351 }
1352 }
1353
1354 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1355 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1356 {
1357 isDeadZone_UpLayer = true;
1358 isDeadZone_LowLayer = false;
1359 }
1360
1361 if (StripDirection[module_size][0] == LeftToRight)
1362 stripDirection[0] = LeftToRight;
1363 else
1364 stripDirection[0] = RightToLeft;
1365 if (StripDirection[module_size][1] == LeftToRight)
1366 stripDirection[1] = LeftToRight;
1367 else
1368 stripDirection[1] = RightToLeft;
1369
1370 stripAngle[0] = -StripAngle[module_size][0];
1371 stripAngle[1] = -StripAngle[module_size][1];
1372
1373 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1374 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1375 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1376 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1377 }
1378
1379 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
1380
1381 xOrig_UpLayer[0] =
1382 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1383 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
1384 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
1385 + YModuleShifts[istation][imodule];
1386 xOrig_LowLayer[0] =
1387 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1388 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
1389 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
1390 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
1391 + YModuleShifts[istation][imodule];
1392
1393 xOrig_UpLayer[1] =
1394 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1395 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
1396 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
1397 + YModuleShifts[istation][imodule];
1398 xOrig_LowLayer[1] =
1399 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1400 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
1401 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
1402 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
1403 + YModuleShifts[istation][imodule];
1404
1405 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
1406 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1407 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1408 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1409
1410 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1411 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1412 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1413 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1414
1415 xLBorder_UpLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1416 xLBorder_UpLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1417 yLBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1418 yLBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1419 xLBorder_LowLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1420 xLBorder_LowLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1421 yLBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1422 yLBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1423
1424 xRBorder_UpLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1425 xRBorder_UpLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1426 yRBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1427 yRBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1428 xRBorder_LowLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1429 xRBorder_LowLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1430 yRBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1431 yRBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1432
1433 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1434 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1435 xDeadZone[ilayer][ipoint] =
1436 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1437 yDeadZone[ilayer][ipoint] =
1438 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1439 }
1440 }
1441
1442 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1443 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1444 {
1445 isDeadZone_UpLayer = true;
1446 isDeadZone_LowLayer = false;
1447 }
1448
1449 if (StripDirection[module_size][0] == LeftToRight)
1450 stripDirection[0] = RightToLeft;
1451 else
1452 stripDirection[0] = LeftToRight;
1453 if (StripDirection[module_size][1] == LeftToRight)
1454 stripDirection[1] = RightToLeft;
1455 else
1456 stripDirection[1] = LeftToRight;
1457
1458 stripAngle[0] = StripAngle[module_size][0];
1459 stripAngle[1] = StripAngle[module_size][1];
1460
1461 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1462 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1463 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1464 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1465 }
1466
1467 cout << " ---\n";
1468 cout << " Orig_UpLayer[0](x:y) = ( " << xOrig_UpLayer[0] << " : " << yOrig_UpLayer[0] << " )\n";
1469 cout << " Orig_LowLayer[0](x:y) = ( " << xOrig_LowLayer[0] << " : " << yOrig_LowLayer[0] << " )\n";
1470 cout << " Orig_UpLayer[1](x:y) = ( " << xOrig_UpLayer[1] << " : " << yOrig_UpLayer[1] << " )\n";
1471 cout << " Orig_LowLayer[1](x:y) = ( " << xOrig_LowLayer[1] << " : " << yOrig_LowLayer[1] << " )\n";
1472 cout << "\n\n";
1473
1474 cout << " ---\n";
1475 cout << " Size_UpLayer[0](dx:dy) = ( " << xSize_UpLayer[0] << " : " << ySize_UpLayer[0] << " )\n";
1476 cout << " Size_LowLayer[0](dx:dy) = ( " << xSize_LowLayer[0] << " : " << ySize_LowLayer[0] << " )\n";
1477 cout << " Size_UpLayer[1](dx:dy) = ( " << xSize_UpLayer[1] << " : " << ySize_UpLayer[1] << " )\n";
1478 cout << " Size_LowLayer[1](dx:dy) = ( " << xSize_LowLayer[1] << " : " << ySize_LowLayer[1] << " )\n";
1479 cout << "\n\n";
1480
1481 cout << " ---\n";
1482 cout << " LBorder_UpLayer[0](x:y) = ( " << xLBorder_UpLayer[0] << " : " << yLBorder_UpLayer[0] << " )\n";
1483 cout << " RBorder_UpLayer[0](x:y) = ( " << xRBorder_UpLayer[0] << " : " << yRBorder_UpLayer[0] << " )\n";
1484 cout << "\n";
1485 cout << " LBorder_LowLayer[0](x:y) = ( " << xLBorder_LowLayer[0] << " : " << yLBorder_LowLayer[0]
1486 << " )\n";
1487 cout << " RBorder_LowLayer[0](x:y) = ( " << xRBorder_LowLayer[0] << " : " << yRBorder_LowLayer[0]
1488 << " )\n";
1489 cout << "\n";
1490
1491 cout << " LBorder_UpLayer[1](x:y) = ( " << xLBorder_UpLayer[1] << " : " << yLBorder_UpLayer[1] << " )\n";
1492 cout << " RBorder_UpLayer[1](x:y) = ( " << xRBorder_UpLayer[1] << " : " << yRBorder_UpLayer[1] << " )\n";
1493 cout << "\n";
1494 cout << " LBorder_LowLayer[1](x:y) = ( " << xLBorder_LowLayer[1] << " : " << yLBorder_LowLayer[1]
1495 << " )\n";
1496 cout << " RBorder_LowLayer[1](x:y) = ( " << xRBorder_LowLayer[1] << " : " << yRBorder_LowLayer[1]
1497 << " )\n";
1498 cout << "\n\n";
1499
1500 cout << " ---\n";
1501 cout << " DeadZone[0]:\n";
1502 cout << " p0(x:y) = ( " << xDeadZone[0][0] << " : " << yDeadZone[0][0] << " )\n";
1503 cout << " p1(x:y) = ( " << xDeadZone[0][1] << " : " << yDeadZone[0][1] << " )\n";
1504 cout << " p2(x:y) = ( " << xDeadZone[0][2] << " : " << yDeadZone[0][2] << " )\n";
1505 cout << "\n";
1506
1507 cout << " DeadZone[1]:\n";
1508 cout << " p0(x:y) = ( " << xDeadZone[1][0] << " : " << yDeadZone[1][0] << " )\n";
1509 cout << " p1(x:y) = ( " << xDeadZone[1][1] << " : " << yDeadZone[1][1] << " )\n";
1510 cout << " p2(x:y) = ( " << xDeadZone[1][2] << " : " << yDeadZone[1][2] << " )\n";
1511 cout << "\n";
1512
1513 cout << " ---\n";
1514 cout << " stripDirection[0] = ";
1515 if (stripDirection[0] == LeftToRight)
1516 cout << "LeftToRight\n";
1517 else
1518 cout << "RightToLeft\n";
1519 cout << " stripDirection[1] = ";
1520 if (stripDirection[1] == LeftToRight)
1521 cout << "LeftToRight\n";
1522 else
1523 cout << "RightToLeft\n";
1524 cout << "\n";
1525
1526 cout << " ---\n";
1527 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
1528 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
1529 cout << "\n";
1530
1531 cout << "---\n";
1532 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
1533 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
1534 cout << "\n";
1535
1536 cout << "---\n";
1537 cout << " firstStripNumber_UpLayer[0] = " << firstStripNumber_UpLayer[0] << "\n";
1538 cout << " firstStripNumber_LowLayer[0] = " << firstStripNumber_LowLayer[0] << "\n";
1539 cout << " firstStripNumber_UpLayer[1] = " << firstStripNumber_UpLayer[1] << "\n";
1540 cout << " firstStripNumber_LowLayer[1] = " << firstStripNumber_LowLayer[1] << "\n";
1541 cout << "\n";
1542
1543 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1544 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE)
1545 {
1546
1547 // upper part of module: straight strips = back side ------------
1548 SiFileOut << "\t\t\t<Layer";
1549 SiFileOut << " zoneID=\""
1550 << "0"
1551 << "\"";
1552 SiFileOut << " type=\""
1553 << "lower"
1554 << "\"";
1555 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[1] << "\"";
1556 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1557 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1558 SiFileOut << " xorig=\"" << xOrig_UpLayer[1] << "\"";
1559 SiFileOut << " yorig=\"" << yOrig_UpLayer[1] << "\"";
1560 SiFileOut << " xsize=\"" << xSize_UpLayer[1] << "\"";
1561 SiFileOut << " ysize=\"" << ySize_UpLayer[1] << "\"";
1562 SiFileOut << " stripDirection=\"";
1563 if (stripDirection[1] == LeftToRight)
1564 SiFileOut << "LeftToRight\"";
1565 else
1566 SiFileOut << "RightToLeft\"";
1567 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[1] << "\"";
1568 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[1] << "\"";
1569 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[1] << "\"";
1570 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[1] << "\"";
1571 SiFileOut << ">";
1572
1573 if (isDeadZone_UpLayer == true) {
1574 SiFileOut << "\n";
1575 SiFileOut << "\t\t\t\t<DeadZone>\n";
1576 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1577 SiFileOut << "\t\t\t\t\t<DeadPoint";
1578 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1579 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1580 SiFileOut << " />\n";
1581 }
1582 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1583 }
1584 SiFileOut << "</Layer>\n";
1585 //--------------------------------------------------------------
1586
1587 // lower part of module: straight strips = back side ------------
1588 SiFileOut << "\t\t\t<Layer";
1589 SiFileOut << " zoneID=\""
1590 << "0"
1591 << "\"";
1592 SiFileOut << " type=\""
1593 << "lower"
1594 << "\"";
1595 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[1] << "\"";
1596 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1597 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1598 SiFileOut << " xorig=\"" << xOrig_LowLayer[1] << "\"";
1599 SiFileOut << " yorig=\"" << yOrig_LowLayer[1] << "\"";
1600 SiFileOut << " xsize=\"" << xSize_LowLayer[1] << "\"";
1601 SiFileOut << " ysize=\"" << ySize_LowLayer[1] << "\"";
1602 SiFileOut << " stripDirection=\"";
1603 if (stripDirection[1] == LeftToRight)
1604 SiFileOut << "LeftToRight\"";
1605 else
1606 SiFileOut << "RightToLeft\"";
1607 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[1] << "\"";
1608 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[1] << "\"";
1609 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[1] << "\"";
1610 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[1] << "\"";
1611 SiFileOut << ">";
1612
1613 if (isDeadZone_LowLayer == true) {
1614 SiFileOut << "\n";
1615 SiFileOut << "\t\t\t\t<DeadZone>\n";
1616 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1617 SiFileOut << "\t\t\t\t\t<DeadPoint";
1618 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1619 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1620 SiFileOut << " />\n";
1621 }
1622 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1623 }
1624 SiFileOut << "</Layer>\n";
1625 //--------------------------------------------------------------
1626
1627 // upper part of module: inclined strips = front side -----------
1628 SiFileOut << "\t\t\t<Layer";
1629 SiFileOut << " zoneID=\""
1630 << "1"
1631 << "\"";
1632 SiFileOut << " type=\""
1633 << "upper"
1634 << "\"";
1635 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[0] << "\"";
1636 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1637 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1638 SiFileOut << " xorig=\"" << xOrig_UpLayer[0] << "\"";
1639 SiFileOut << " yorig=\"" << yOrig_UpLayer[0] << "\"";
1640 SiFileOut << " xsize=\"" << xSize_UpLayer[0] << "\"";
1641 SiFileOut << " ysize=\"" << ySize_UpLayer[0] << "\"";
1642 SiFileOut << " stripDirection=\"";
1643 if (stripDirection[0] == LeftToRight)
1644 SiFileOut << "LeftToRight\"";
1645 else
1646 SiFileOut << "RightToLeft\"";
1647 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[0] << "\"";
1648 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[0] << "\"";
1649 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[0] << "\"";
1650 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[0] << "\"";
1651 SiFileOut << ">";
1652
1653 if (isDeadZone_UpLayer == true) {
1654 SiFileOut << "\n";
1655 SiFileOut << "\t\t\t\t<DeadZone>\n";
1656 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1657 SiFileOut << "\t\t\t\t\t<DeadPoint";
1658 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1659 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1660 SiFileOut << " />\n";
1661 }
1662 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1663 }
1664 SiFileOut << "</Layer>\n";
1665 //--------------------------------------------------------------
1666
1667 // lower part of module: inclined strips = front side -----------
1668 SiFileOut << "\t\t\t<Layer";
1669 SiFileOut << " zoneID=\""
1670 << "1"
1671 << "\"";
1672 SiFileOut << " type=\""
1673 << "upper"
1674 << "\"";
1675 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[0] << "\"";
1676 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1677 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1678 SiFileOut << " xorig=\"" << xOrig_LowLayer[0] << "\"";
1679 SiFileOut << " yorig=\"" << yOrig_LowLayer[0] << "\"";
1680 SiFileOut << " xsize=\"" << xSize_LowLayer[0] << "\"";
1681 SiFileOut << " ysize=\"" << ySize_LowLayer[0] << "\"";
1682 SiFileOut << " stripDirection=\"";
1683 if (stripDirection[0] == LeftToRight)
1684 SiFileOut << "LeftToRight\"";
1685 else
1686 SiFileOut << "RightToLeft\"";
1687 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[0] << "\"";
1688 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[0] << "\"";
1689 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[0] << "\"";
1690 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[0] << "\"";
1691 SiFileOut << ">";
1692
1693 if (isDeadZone_LowLayer == true) {
1694 SiFileOut << "\n";
1695 SiFileOut << "\t\t\t\t<DeadZone>\n";
1696 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1697 SiFileOut << "\t\t\t\t\t<DeadPoint";
1698 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1699 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1700 SiFileOut << " />\n";
1701 }
1702 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1703 }
1704 SiFileOut << "</Layer>\n";
1705 //--------------------------------------------------------------
1706
1707 SiFileOut << "\t\t</Module>\n";
1708 SiFileOut << "\n";
1709 }
1710
1711 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
1712 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
1713 {
1714
1715 Double_t xOrig[2];
1716 Double_t yOrig[2];
1717 Double_t xSize[2];
1718 Double_t ySize[2];
1719 Double_t xLBorder[2];
1720 Double_t yLBorder[2];
1721 Double_t xRBorder[2];
1722 Double_t yRBorder[2];
1723 Bool_t isDeadZone;
1724
1725 if (ModulesXRotations[istation][imodule] == false) {
1726 xOrig[0] = xOrig_LowLayer[0];
1727 xOrig[1] = xOrig_LowLayer[1];
1728 yOrig[0] = yOrig_LowLayer[0];
1729 yOrig[1] = yOrig_LowLayer[1];
1730 xSize[0] = xSize_LowLayer[0];
1731 xSize[1] = xSize_LowLayer[1];
1732 ySize[0] = ySize_LowLayer[0];
1733 ySize[1] = ySize_LowLayer[1];
1734 xLBorder[0] = xLBorder_LowLayer[0];
1735 xLBorder[1] = xLBorder_LowLayer[1];
1736 yLBorder[0] = yLBorder_LowLayer[0];
1737 yLBorder[1] = yLBorder_LowLayer[1];
1738 xRBorder[0] = xRBorder_LowLayer[0];
1739 xRBorder[1] = xRBorder_LowLayer[1];
1740 yRBorder[0] = yRBorder_LowLayer[0];
1741 yRBorder[1] = yRBorder_LowLayer[1];
1742 isDeadZone = isDeadZone_LowLayer;
1743 }
1744 if (ModulesXRotations[istation][imodule] == true) {
1745 xOrig[0] = xOrig_UpLayer[0];
1746 xOrig[1] = xOrig_UpLayer[1];
1747 yOrig[0] = yOrig_UpLayer[0];
1748 yOrig[1] = yOrig_UpLayer[1];
1749 xSize[0] = xSize_UpLayer[0];
1750 xSize[1] = xSize_UpLayer[1];
1751 ySize[0] = ySize_UpLayer[0];
1752 ySize[1] = ySize_UpLayer[1];
1753 xLBorder[0] = xLBorder_UpLayer[0];
1754 xLBorder[1] = xLBorder_UpLayer[1];
1755 yLBorder[0] = yLBorder_UpLayer[0];
1756 yLBorder[1] = yLBorder_UpLayer[1];
1757 xRBorder[0] = xRBorder_UpLayer[0];
1758 xRBorder[1] = xRBorder_UpLayer[1];
1759 yRBorder[0] = yRBorder_UpLayer[0];
1760 yRBorder[1] = yRBorder_UpLayer[1];
1761 isDeadZone = isDeadZone_UpLayer;
1762 }
1763
1764 // one part of module: straight strips = back side --------------
1765 SiFileOut << "\t\t\t<Layer";
1766 SiFileOut << " zoneID=\""
1767 << "0"
1768 << "\"";
1769 SiFileOut << " type=\""
1770 << "lower"
1771 << "\"";
1772 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1773 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1774 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1775 SiFileOut << " xorig=\"" << xOrig[1] << "\"";
1776 SiFileOut << " yorig=\"" << yOrig[1] << "\"";
1777 SiFileOut << " xsize=\"" << xSize[1] << "\"";
1778 SiFileOut << " ysize=\"" << ySize[1] << "\"";
1779 SiFileOut << " stripDirection=\"";
1780 if (stripDirection[1] == LeftToRight)
1781 SiFileOut << "LeftToRight\"";
1782 else
1783 SiFileOut << "RightToLeft\"";
1784 SiFileOut << " lxborder=\"" << xLBorder[1] << "\"";
1785 SiFileOut << " lyborder=\"" << yLBorder[1] << "\"";
1786 SiFileOut << " rxborder=\"" << xRBorder[1] << "\"";
1787 SiFileOut << " ryborder=\"" << yRBorder[1] << "\"";
1788 SiFileOut << ">";
1789
1790 if (isDeadZone == true) {
1791 SiFileOut << "\n";
1792 SiFileOut << "\t\t\t\t<DeadZone>\n";
1793 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1794 SiFileOut << "\t\t\t\t\t<DeadPoint";
1795 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1796 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1797 SiFileOut << " />\n";
1798 }
1799 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1800 }
1801 SiFileOut << "</Layer>\n";
1802 //--------------------------------------------------------------
1803
1804 // one part of module: inclined strips = front side -------------
1805 SiFileOut << "\t\t\t<Layer";
1806 SiFileOut << " zoneID=\""
1807 << "1"
1808 << "\"";
1809 SiFileOut << " type=\""
1810 << "upper"
1811 << "\"";
1812 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1813 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1814 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1815 SiFileOut << " xorig=\"" << xOrig[0] << "\"";
1816 SiFileOut << " yorig=\"" << yOrig[0] << "\"";
1817 SiFileOut << " xsize=\"" << xSize[0] << "\"";
1818 SiFileOut << " ysize=\"" << ySize[0] << "\"";
1819 SiFileOut << " stripDirection=\"";
1820 if (stripDirection[0] == LeftToRight)
1821 SiFileOut << "LeftToRight\"";
1822 else
1823 SiFileOut << "RightToLeft\"";
1824 SiFileOut << " lxborder=\"" << xLBorder[0] << "\"";
1825 SiFileOut << " lyborder=\"" << yLBorder[0] << "\"";
1826 SiFileOut << " rxborder=\"" << xRBorder[0] << "\"";
1827 SiFileOut << " ryborder=\"" << yRBorder[0] << "\"";
1828 SiFileOut << ">";
1829
1830 if (isDeadZone == true) {
1831 SiFileOut << "\n";
1832 SiFileOut << "\t\t\t\t<DeadZone>\n";
1833 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1834 SiFileOut << "\t\t\t\t\t<DeadPoint";
1835 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1836 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1837 SiFileOut << " />\n";
1838 }
1839 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1840 }
1841 SiFileOut << "</Layer>\n";
1842 //--------------------------------------------------------------
1843
1844 SiFileOut << "\t\t</Module>\n";
1845 SiFileOut << "\n";
1846 }
1847 }
1848
1849 SiFileOut << "\t</Station>\n";
1850 SiFileOut << "\n";
1851
1852 cout << "------------------------------------------------------------\n";
1853 }
1854
1855 SiFileOut << "</StationSet>\n";
1856
1857 SiFileOut.close();
1858}
bool Bool_t
int Int_t
double Double_t
#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]
Double_t ZModuleSize[NModuleSizes]
Double_t YMiddleBorderUpperPart[NModuleSizes][2]
Double_t XLeftBorder[NModuleSizes][2]
Double_t YSizeUpLayer[NModuleSizes][2]
const Double_t x_dist_cent_base[NStations]
Double_t BevelAngleRad[NModuleSizes]
const Double_t x_shift_hp[NStations]
Double_t YShiftLastStripLowLayer[NModuleSizes][2]
ModuleType
@ BEVEL_MODULE
@ RIGHT_ANGLED_MODULE_HALF
@ RIGHT_ANGLED_MODULE
Double_t YTopBorder[NModuleSizes][2]
const Double_t z_mod_thick
const Double_t z_shift_low
const Double_t y_dist_cent_base[NStations]
Double_t YShiftLastStripUpLayer[NModuleSizes][2]
Double_t XShiftFirstStripLowLayer[NModuleSizes][2]
Double_t YModuleSizeUpperPart[NModuleSizes]
Double_t YOrigLowLayer[NModuleSizes][2]
Double_t YOrigUpLayer[NModuleSizes][2]
Double_t FirstStripNumberLowLayer[NModuleSizes][2]
Double_t XShiftLastStripUpLayer[NModuleSizes][2]
Double_t YRightBorderLowerlayer[NModuleSizes][2]
Double_t XLeftBorderLowerlayer[NModuleSizes][2]
Double_t PitchValue[NModuleSizes][2]
Double_t YLeftBorderUpperlayer[NModuleSizes][2]
Double_t x_delta_bottom_BP[NModuleSizes][2]
Double_t YBevelSize[NModuleSizes]
Double_t YShiftFirstStripUpLayer[NModuleSizes][2]
Double_t XShiftLastStripLowLayer[NModuleSizes][2]
const Double_t y_shift_hp[NStations]
Double_t XRightBorder[NModuleSizes][2]
Double_t XLeftBorderUpperlayer[NModuleSizes][2]
ModuleSize
@ STANDARD_MODULE
Double_t XYBevelBorder[NModuleSizes][2]
const Bool_t ModulesYRotations[NStations][NMaxModules]
Double_t XOrigLowLayer[NModuleSizes][2]
Double_t YBottomBorder[NModuleSizes][2]
Double_t YModuleSize[NModuleSizes]
Double_t x_delta[NModuleSizes][2]
Double_t y_delta_bottom_BP[NModuleSizes][2]
Double_t StripAngle[NModuleSizes][2]
Double_t YModuleSizeLowerPart[NModuleSizes]
const Double_t z_shift_up
Double_t XDeadZone[NModuleSizes][2][3]
Double_t XOrigUpLayer[NModuleSizes][2]
Double_t x_delta_top_BP[NModuleSizes][2]
Double_t YMiddleBorderLowerPart[NModuleSizes][2]
Double_t YShiftFirstStripLowLayer[NModuleSizes][2]
Double_t y_delta[NModuleSizes][2]
Double_t BevelAngleDeg[NModuleSizes]
Double_t FirstStripNumberUpLayer[NModuleSizes][2]
Double_t YRightBorderUpperlayer[NModuleSizes][2]
Double_t YDeadZone[NModuleSizes][2][3]
Double_t YGapBetweenPartsOfModule[NModuleSizes]
Double_t XModuleSize[NModuleSizes]
Double_t YSizeLowLayer[NModuleSizes][2]
Double_t XRightBorderLowerlayer[NModuleSizes][2]
Double_t YLeftBorderLowerlayer[NModuleSizes][2]
const unsigned int NModuleSizes
const ModuleType ModulesTypes[NStations][NMaxModules]
const Double_t z_shift_hp[NStations]
Double_t y_delta_top_BP[NModuleSizes][2]
Double_t XSizeLowLayer[NModuleSizes][2]
Double_t XRightBorderUpperlayer[NModuleSizes][2]
Double_t XShiftFirstStripUpLayer[NModuleSizes][2]
const Bool_t ModulesXRotations[NStations][NMaxModules]
Double_t XBevelSize[NModuleSizes]
Double_t XSizeUpLayer[NModuleSizes][2]
void SiliconConfigCalculate_5stations_2026()
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