BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SiliconConfigCalculate_Run8_4stations.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 *
6 * !!! IMPORTANT !!!
7 * The obtained XML-file SHOULD BE MOVED into the 'parameters/silicon/XMLConfigs' directory
8 *
9 * SILICON configuration: Run8_4stations (4 SI-stations (10-14-18-22 mods))
10 *
11 * Created: 21.07.2021
12 * Updated: 19.10.2021 (configuration renamed)
13 * Author: D. Baranov
14 */
15
16#include "Rtypes.h"
17
18R__ADD_INCLUDE_PATH($VMCWORKDIR)
19R__LOAD_LIBRARY(libBmnData.so)
20
21#include "TString.h"
22
23#include <fstream>
24
25using namespace TMath;
26using namespace std;
27
28// Configuration of modules -----------------------------------------------------
29
31{
34}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
35const unsigned int NModuleSizes = 2;
36
37Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/};
38
39Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
40
41Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
42Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
43
50
51Double_t ZModuleSize[NModuleSizes] = {0.03 /*STANDARD_MODULE*/, 0.03 /*LONG_MODULE*/};
52
53Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
54Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
55
60
65
66// The next variables have two indices: the first one is a mod-size type, the second - a layer type
67// 0 - inclined strips (front side), 1 - straight strips (back side)
68
70 {0.1145, 0.10995}, /*STANDARD_MODULE*/
71 {0.1118, 0.11005} /*LONG_MODULE*/
72};
73
75 {0.1118, 0.11005}, /*STANDARD_MODULE*/
76 {0.1118, 0.11005} /*LONG_MODULE*/
77};
78
80 {0.1143, 0.1143}, /*STANDARD_MODULE*/
81 {0.1148, 0.1055} /*LONG_MODULE*/
82};
83
85 {0.1121, 0.1055}, /*STANDARD_MODULE*/
86 {0.1148, 0.1055} /*LONG_MODULE*/
87};
88
90 {0.1147, 0.1055}, /*STANDARD_MODULE*/
91 {0.1148, 0.1055} /*LONG_MODULE*/
92};
93
95 {0.1148, 0.1055}, /*STANDARD_MODULE*/
96 {0.1148, 0.1055} /*LONG_MODULE*/
97};
98
100 {0.1146, 0.1076}, /*STANDARD_MODULE*/
101 {0.1148, 0.1055} /*LONG_MODULE*/
102};
103//------------------------------------------------------------------------------
104
105// Parameters of layers ---------------------------------------------------------
106
108 {0.00795, 0.0}, /*STANDARD_MODULE*/
109 {0.00261, 0.0} /*LONG_MODULE*/
110};
111
113 {0.00780, 0.0}, /*STANDARD_MODULE*/
114 {0.00261, 0.0} /*LONG_MODULE*/
115};
116
118 {0.00675, 0.0}, /*STANDARD_MODULE*/
119 {0.00255, 0.0} /*LONG_MODULE*/
120};
121
123 {0.00675, 0.0}, /*STANDARD_MODULE*/
124 {0.00255, 0.0} /*LONG_MODULE*/
125};
126
128 {0.0, 0.0}, /*STANDARD_MODULE*/
129 {0.0, 0.0} /*LONG_MODULE*/
130};
131
133 {0.0, 0.0}, /*STANDARD_MODULE*/
134 {0.0, 0.0} /*LONG_MODULE*/
135};
136
138 {0.0, 0.0}, /*STANDARD_MODULE*/
139 {0.0, 0.0} /*LONG_MODULE*/
140};
141
143 {0.0, 0.0}, /*STANDARD_MODULE*/
144 {0.0, 0.0} /*LONG_MODULE*/
145};
146//------------------------------------------------------------------------------
147
154// Double_t XOrigUpLayer[2] = { XModuleSize - XLeftBorder[0], XModuleSize - XLeftBorder[1] };
155
162// Double_t XOrigLowLayer[2] = { XModuleSize - XLeftBorder[0], XModuleSize - XLeftBorder[1] };
163
172// Double_t YOrigUpLayer[2] = { YModuleSize - YModuleSizeUpperPart + YMiddleBorderUpperPart[0], YModuleSize -
173// YModuleSizeUpperPart + YMiddleBorderUpperPart[1] };
174
179// Double_t YOrigLowLayer[2] = { YBottomBorder[0], YBottomBorder[1] };
180
188// Double_t XSizeUpLayer[2] = { XModuleSize - (XLeftBorder[0] + XRightBorder[0]) , XModuleSize - (XLeftBorder[1] +
189// XRightBorder[1]) };
190
200// Double_t YSizeUpLayer[2] = { YModuleSizeUpperPart - (YTopBorder[0] + YMiddleBorderUpperPart[0]), YModuleSizeUpperPart
201// - (YTopBorder[1] + YMiddleBorderUpperPart[1]) };
202
210// Double_t XSizeLowLayer[2] = { XModuleSize - (XLeftBorder[0] + XRightBorder[0]) , XModuleSize - (XLeftBorder[1] +
211// XRightBorder[1]) };
212
222// Double_t YSizeLowLayer[2] = { YModuleSizeLowerPart - (YBottomBorder[0] + YMiddleBorderLowerPart[0]),
223// YModuleSizeLowerPart - (YBottomBorder[1] + YMiddleBorderLowerPart[1]) };
224
233// Double_t XLeftBorderUpperlayer[2] = { XOrigUpLayer[0] - XShiftFirstStripUpLayer[0], XOrigUpLayer[1] -
234// XShiftLastStripUpLayer[1] + XShiftLastStripUpLayer[1] };
235
244// Double_t XLeftBorderLowerlayer[2] = { XOrigUpLayer[0] - XShiftFirstStripLowLayer[0], XOrigUpLayer[1] -
245// XShiftLastStripLowLayer[1] + XShiftLastStripLowLayer[1] };
246
255// Double_t XRightBorderUpperlayer[2] = { XOrigUpLayer[0] - XSizeUpLayer[0] + XShiftLastStripUpLayer[0], XOrigUpLayer[1]
256// - XSizeUpLayer[1] + XShiftFirstStripUpLayer[1] };
257
267// Double_t XRightBorderLowerlayer[2] = { XOrigLowLayer[0] - XSizeLowLayer[0] + XShiftLastStripLowLayer[0],
268// XOrigLowLayer[1] - XSizeLowLayer[1] + XShiftFirstStripLowLayer[1] };
269
278// Double_t YLeftBorderUpperlayer[2] = { YOrigUpLayer[0] + YSizeUpLayer[0] - YShiftFirstStripUpLayer[0], YOrigUpLayer[1]
279// + YSizeUpLayer[1] - YShiftFirstStripUpLayer[1] };
280
290// Double_t YLeftBorderLowerlayer[2] = { YOrigLowLayer[0] + YSizeLowLayer[0] - YShiftFirstStripLowLayer[0],
291// YOrigLowLayer[1] + YSizeLowLayer[1] - YShiftFirstStripLowLayer[1] };
292
297// Double_t YRightBorderUpperlayer[2] = { YOrigUpLayer[0], YOrigUpLayer[1] };
298
303// Double_t YRightBorderLowerlayer[2] = { YOrigLowLayer[0], YOrigLowLayer[1] };
304//------------------------------------------------------------------------------
305
311
313 {LeftToRight, RightToLeft}, /*STANDARD_MODULE*/
314 {LeftToRight, RightToLeft} /*LONG_MODULE*/
315};
316// StripNumberingDirection StripDirection[2] = { LeftToRight, RightToLeft };
317
319 {0.01029019668, 0.0095}, /*STANDARD_MODULE*/
320 {0.0107150, 0.0095} /*LONG_MODULE*/
321};
322// Double_t PitchValue[2] = { 0.01029019668, 0.0095 };
323
325 {+2.5, +0.0}, /*STANDARD_MODULE*/
326 {+2.5, +0.0} /*LONG_MODULE*/
327};
328// Double_t StripAngle[2] = { +2.5, +0.0 }; // plus - clockwise, minus - anticlockwise
329
331 {0, 0}, /*STANDARD_MODULE*/
332 {0, 0} /*LONG_MODULE*/
333};
334// Int_t FirstStripNumberUpLayer[2] = { 0, 0 };
335
337 {26, 0}, /*STANDARD_MODULE*/
338 {37, 0} /*LONG_MODULE*/
339};
340// Int_t FirstStripNumberLowLayer[2] = { 26, 0 };
341
342// Dead zones (if you need) -----------------------------------------------------
343
344// find x and y projections of the bevel border thickness -----------------------
345
352// Double_t x_delta[2] = { XYBevelBorder[0]/TMath::Cos(BevelAngleRad), XYBevelBorder[1]/TMath::Cos(BevelAngleRad) };
353
360// Double_t y_delta[2] = { XYBevelBorder[0]/TMath::Sin(BevelAngleRad), XYBevelBorder[1]/TMath::Sin(BevelAngleRad) };
361//------------------------------------------------------------------------------
362
363// find shifts of the sensitive zone from module borders via the equation of a straight line for the inner bevel
364
366 {XLeftBorder[STANDARD_MODULE][0], XLeftBorder[STANDARD_MODULE][1]}, /*STANDARD_MODULE*/
367 {XLeftBorder[LONG_MODULE][0], XLeftBorder[LONG_MODULE][1]} /*LONG_MODULE*/
368};
369// Double_t x_delta_top_BP[2] = { XLeftBorder[0], XLeftBorder[1] };
370
381// Double_t y_delta_top_BP[2] = { TMath::Tan(TMath::PiOver2()+BevelAngleRad)*x_delta_top_BP[0] +
382// (YBevelSize+y_delta[0]), TMath::Tan(TMath::PiOver2()+BevelAngleRad)*x_delta_top_BP[1] + (YBevelSize+y_delta[1]) };
383
388// Double_t y_delta_bottom_BP[2] = { YBottomBorder[0], YBottomBorder[1] };
389
400// Double_t x_delta_bottom_BP[2] = { (y_delta_bottom_BP[0] - (YBevelSize +
401// y_delta[0]))/(TMath::Tan(TMath::PiOver2()+BevelAngleRad)), (y_delta_bottom_BP[1] - (YBevelSize +
402// y_delta[1]))/(TMath::Tan(TMath::PiOver2()+BevelAngleRad)) };
403
414// Double_t XDeadZone[2][3] = {
415// { XOrigLowLayer[0], XOrigLowLayer[0], XModuleSize - x_delta_bottom_BP[0] },
416// { XOrigLowLayer[1], XOrigLowLayer[1], XModuleSize - x_delta_bottom_BP[1] }
417// };
418
426// Double_t YDeadZone[2][3] = {
427// { YOrigLowLayer[0], y_delta_top_BP[0], YOrigLowLayer[0] },
428// { YOrigLowLayer[1], y_delta_top_BP[1], YOrigLowLayer[1] }
429// };
430//------------------------------------------------------------------------------
431
432// Configuration of SI-stations -------------------------------------------------
433
434// Set Parameters of SILICON detector -------------------------------------------
435const Int_t NStations = 4; // stations in the detector
436const Int_t NMaxModules = 22; // max. number of modules in a station
437
438const Int_t NModulesInStations[NStations] = {10, 14, 18, 22};
439
440//(X-Y-Z)Positions of stations (sensitive volumes)
441const Double_t XStationPositions[NStations] = {0.0, 0.0, 0.0};
442const Double_t YStationPositions[NStations] = {0.0, 0.0, 0.0};
443const Double_t ZStationPositions[NStations] = {+15.7, +15.7 + 8.64, +15.7 + 8.64 + 8.64, +15.7 + 8.64 + 8.64 + 8.64};
444
445//(X-Y-Z)Shifts of modules in each station
447 {+15.15 /*0*/, +9.15 /*1*/, +3.15 /*2*/, -9.15 /*3*/, -15.15 /*4*/, +15.15 /*5*/, +9.15 /*6*/, +3.15 /*7*/,
448 -9.15 /*8*/, -15.15 /*9*/},
449 {+21.15 /*0*/, +15.15 /*1*/, +9.15 /*2*/, +3.15 /*3*/, -9.15 /*4*/, -15.15 /*5*/, -21.15 /*6*/, +21.15 /*7*/,
450 +15.15 /*8*/, +9.15 /*9*/, +3.15 /*10*/, -9.15 /*11*/, -15.15 /*12*/, -21.15 /*13*/},
451 {+27.15 /*0*/, +21.15 /*1*/, +15.15 /*2*/, +9.15 /*3*/, +3.15 /*4*/, -9.15 /*5*/, -15.15 /*6*/, -21.15 /*7*/,
452 -27.15 /*8*/, +27.15 /*9*/, +21.15 /*10*/, +15.15 /*11*/, +9.15 /*12*/, +3.15 /*13*/, -9.15 /*14*/, -15.15 /*15*/,
453 -21.15 /*16*/, -27.15 /*17*/},
454 {+33.15 /*0*/, +27.15 /*1*/, +21.15 /*2*/, +15.15 /*3*/, +9.15 /*4*/, +3.15 /*5*/,
455 -9.15 /*6*/, -15.15 /*7*/, -21.15 /*8*/, -27.15 /*9*/, -33.15 /*10*/, +33.15 /*11*/,
456 +27.15 /*12*/, +21.15 /*13*/, +15.15 /*14*/, +9.15 /*15*/, +3.15 /*16*/, -9.15 /*17*/,
457 -15.15 /*18*/, -21.15 /*19*/, -27.15 /*20*/, -33.15 /*21*/}};
459 {-0.15 /*0*/, -0.15 /*1*/, +2.85 /*2*/, -0.15 /*3*/, -0.15 /*4*/, +0.15 /*5*/, +0.15 /*6*/, -2.85 /*7*/,
460 +0.15 /*8*/, +0.15 /*9*/},
461 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, +2.85 /*3*/, -0.15 /*4*/, -0.15 /*5*/, -0.15 /*6*/, +0.15 /*7*/,
462 +0.15 /*8*/, +0.15 /*9*/, -2.85 /*10*/, +0.15 /*11*/, +0.15 /*12*/, +0.15 /*13*/},
463 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, -0.15 /*3*/, +2.85 /*4*/, -0.15 /*5*/, -0.15 /*6*/, -0.15 /*7*/,
464 -0.15 /*8*/, +0.15 /*9*/, +0.15 /*10*/, +0.15 /*11*/, +0.15 /*12*/, -2.85 /*13*/, +0.15 /*14*/, +0.15 /*15*/,
465 +0.15 /*16*/, +0.15 /*17*/},
466 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, -0.15 /*3*/, -0.15 /*4*/, +2.85 /*5*/, -0.15 /*6*/, -0.15 /*7*/,
467 -0.15 /*8*/, -0.15 /*9*/, -0.15 /*10*/, +0.15 /*11*/, +0.15 /*12*/, +0.15 /*13*/, +0.15 /*14*/, +0.15 /*15*/,
468 -2.85 /*16*/, +0.15 /*17*/, +0.15 /*18*/, +0.15 /*19*/, +0.15 /*20*/, +0.15 /*21*/}};
470 {+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*/,
471 +1.22 /*6*/, 0.0 /*7*/, +1.36 /*8*/, +0.14 /*9*/},
472 {+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*/,
473 +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*/,
474 +0.14 /*12*/, +1.36 /*13*/},
475 {+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*/,
476 +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*/,
477 +0.0 /*11*/, +1.22 /*12*/, +0.0 /*13*/, +1.36 /*14*/, +0.14 /*15*/, +1.36 /*16*/, +0.14 /*17*/},
478 {+0.14 + 4.31 /*0*/, +1.36 + 4.31 /*1*/,
479 +0.14 + 4.31 /*2*/, +1.36 + 4.31 /*3*/,
480 +0.14 + 4.31 /*4*/, +1.36 + 4.31 /*5*/,
481 +0.0 + 4.31 /*6*/, +1.22 + 4.31 /*7*/,
482 +0.0 + 4.31 /*8*/, +1.22 + 4.31 /*9*/,
483 +0.0 + 4.31 /*10*/, +1.22 /*11*/,
484 +0.0 /*12*/, +1.22 /*13*/,
485 +0.0 /*14*/, +1.22 /*15*/,
486 +0.0 /*16*/, +1.36 /*17*/,
487 +0.14 /*18*/, +1.36 /*19*/,
488 +0.14 /*20*/, +1.36 /*21*/}};
489
490// Geometry parameters of modules
498
514
515// rotations of modules around y-axis by 180 deg.
517 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
518 false /*9*/},
519 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
520 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
521 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
522 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
523 false /*17*/},
524 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, true /*5*/, false /*6*/, false /*7*/,
525 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
526 true /*16*/, false /*17*/, false /*18*/, false /*19*/, false /*20*/, false /*21*/}
527
528};
529
530// rotations of modules around x-axis by 180 deg.
532 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
533 true /*9*/},
534 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
535 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
536 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
537 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
538 true /*17*/},
539 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
540 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
541 true /*16*/, true /*17*/, true /*18*/, true /*19*/, true /*20*/, true /*21*/}};
542//------------------------------------------------------------------------------
543
544// Function declarations
545void PrintInfo();
546void CalculateParameters(TString xml_file_name);
547//------------------------------------------------------------------------------
548
550{
551
552 PrintInfo();
553 CalculateParameters("SiliconRun8_4stations.xml");
554
555 cout << "It's the end" << "\n";
556 // gApplication->Terminate();
557}
558
559//------------------------------------------------------------------------------
560
562{
563
564 cout << "----------------------------------------------------------------\n";
565 cout << "Parameters of the standard module 63x126 mm:\n";
566 cout << "\n";
567 cout << " Upper layer (inclined strips):\n";
568 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][0] << " : " << YOrigUpLayer[STANDARD_MODULE][0]
569 << " )\n";
570 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][0] << " : " << YSizeUpLayer[STANDARD_MODULE][0]
571 << " )\n";
572 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][0] << " : "
573 << YLeftBorderUpperlayer[STANDARD_MODULE][0] << " )\n";
574 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][0] << " : "
576 cout << " strip_direction = ";
578 cout << "LeftToRight\n";
579 else
580 cout << "RightToLeft\n";
581 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
582 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
583 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][0] << "\n";
584 cout << "\n";
585
586 cout << " Lower layer (inclined strips):\n";
587 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][0] << " : " << YOrigLowLayer[STANDARD_MODULE][0]
588 << " )\n";
589 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][0] << " : " << YSizeLowLayer[STANDARD_MODULE][0]
590 << " )\n";
591 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][0] << " : "
592 << YLeftBorderLowerlayer[STANDARD_MODULE][0] << " )\n";
593 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][0] << " : "
595 cout << " strip_direction = ";
597 cout << "LeftToRight\n";
598 else
599 cout << "RightToLeft\n";
600 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
601 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
602 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
603 cout << " dead_zone(3 points):\n";
604 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][0] << " : " << YDeadZone[STANDARD_MODULE][0][0]
605 << " )\n";
606 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][1] << " : " << YDeadZone[STANDARD_MODULE][0][1]
607 << " )\n";
608 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][2] << " : " << YDeadZone[STANDARD_MODULE][0][2]
609 << " )\n";
610 cout << "\n";
611
612 cout << " Upper layer (straight strips):\n";
613 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][1] << " : " << YOrigUpLayer[STANDARD_MODULE][1]
614 << " )\n";
615 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][1] << " : " << YSizeUpLayer[STANDARD_MODULE][1]
616 << " )\n";
617 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][1] << " : "
618 << YLeftBorderUpperlayer[STANDARD_MODULE][1] << " )\n";
619 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][1] << " : "
621 cout << " strip_direction = ";
623 cout << "LeftToRight\n";
624 else
625 cout << "RightToLeft\n";
626 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
627 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
628 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][1] << "\n";
629 cout << "\n";
630
631 cout << " Lower layer (straight strips):\n";
632 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][1] << " : " << YOrigLowLayer[STANDARD_MODULE][1]
633 << " )\n";
634 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][1] << " : " << YSizeLowLayer[STANDARD_MODULE][1]
635 << " )\n";
636 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][1] << " : "
637 << YLeftBorderLowerlayer[STANDARD_MODULE][1] << " )\n";
638 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][1] << " : "
640 cout << " strip_direction = ";
642 cout << "LeftToRight\n";
643 else
644 cout << "RightToLeft\n";
645 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
646 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
647 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
648 cout << " dead_zone(3 points):\n";
649 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][0] << " : " << YDeadZone[STANDARD_MODULE][1][0]
650 << " )\n";
651 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][1] << " : " << YDeadZone[STANDARD_MODULE][1][1]
652 << " )\n";
653 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][2] << " : " << YDeadZone[STANDARD_MODULE][1][2]
654 << " )\n";
655 cout << "\n";
656
657 cout << "----------------------------------------------------------------\n";
658
659 cout << "----------------------------------------------------------------\n";
660 cout << "Parameters of the long module 63x186 mm:\n";
661 cout << "\n";
662 cout << " Upper layer (inclined strips):\n";
663 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][0] << " : " << YOrigUpLayer[LONG_MODULE][0] << " )\n";
664 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][0] << " : " << YSizeUpLayer[LONG_MODULE][0] << " )\n";
665 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][0] << " : "
666 << YLeftBorderUpperlayer[LONG_MODULE][0] << " )\n";
667 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][0] << " : "
668 << YRightBorderUpperlayer[LONG_MODULE][0] << " )\n";
669 cout << " strip_direction = ";
671 cout << "LeftToRight\n";
672 else
673 cout << "RightToLeft\n";
674 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
675 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
676 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][0] << "\n";
677 cout << "\n";
678
679 cout << " Lower layer (inclined strips):\n";
680 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][0] << " : " << YOrigLowLayer[LONG_MODULE][0] << " )\n";
681 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][0] << " : " << YSizeLowLayer[LONG_MODULE][0] << " )\n";
682 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][0] << " : "
683 << YLeftBorderLowerlayer[LONG_MODULE][0] << " )\n";
684 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][0] << " : "
685 << YRightBorderLowerlayer[LONG_MODULE][0] << " )\n";
686 cout << " strip_direction = ";
688 cout << "LeftToRight\n";
689 else
690 cout << "RightToLeft\n";
691 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
692 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
693 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
694 cout << " dead_zone(3 points):\n";
695 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][0][0] << " : " << YDeadZone[LONG_MODULE][0][0] << " )\n";
696 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][0][1] << " : " << YDeadZone[LONG_MODULE][0][1] << " )\n";
697 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][0][2] << " : " << YDeadZone[LONG_MODULE][0][2] << " )\n";
698 cout << "\n";
699
700 cout << " Upper layer (straight strips):\n";
701 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][1] << " : " << YOrigUpLayer[LONG_MODULE][1] << " )\n";
702 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][1] << " : " << YSizeUpLayer[LONG_MODULE][1] << " )\n";
703 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][1] << " : "
704 << YLeftBorderUpperlayer[LONG_MODULE][1] << " )\n";
705 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][1] << " : "
706 << YRightBorderUpperlayer[LONG_MODULE][1] << " )\n";
707 cout << " strip_direction = ";
709 cout << "LeftToRight\n";
710 else
711 cout << "RightToLeft\n";
712 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
713 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
714 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][1] << "\n";
715 cout << "\n";
716
717 cout << " Lower layer (straight strips):\n";
718 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][1] << " : " << YOrigLowLayer[LONG_MODULE][1] << " )\n";
719 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][1] << " : " << YSizeLowLayer[LONG_MODULE][1] << " )\n";
720 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][1] << " : "
721 << YLeftBorderLowerlayer[LONG_MODULE][1] << " )\n";
722 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][1] << " : "
723 << YRightBorderLowerlayer[LONG_MODULE][1] << " )\n";
724 cout << " strip_direction = ";
726 cout << "LeftToRight\n";
727 else
728 cout << "RightToLeft\n";
729 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
730 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
731 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
732 cout << " dead_zone(3 points):\n";
733 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][1][0] << " : " << YDeadZone[LONG_MODULE][1][0] << " )\n";
734 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][1][1] << " : " << YDeadZone[LONG_MODULE][1][1] << " )\n";
735 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][1][2] << " : " << YDeadZone[LONG_MODULE][1][2] << " )\n";
736 cout << "\n";
737
738 cout << "----------------------------------------------------------------\n";
739}
740//------------------------------------------------------------------------------
741
742void CalculateParameters(TString xml_file_name)
743{
744
745 ofstream SiFileOut(xml_file_name.Data(), ios::out);
746
747 SiFileOut << "<StationSet>\n";
748 SiFileOut << "\n";
749
750 for (Int_t istation = 0; istation < NStations; ++istation) {
751
752 cout << "istation = " << istation << ": -----------------------------\n";
753
754 // module size in a station
755 ModuleSize module_size = STANDARD_MODULE;
756
757 //(!!!) the third station has long modules (!!!)
758 if (istation == 3)
759 module_size = LONG_MODULE;
760
761 SiFileOut << "<!-- Station " << istation << " -->\n";
762
763 SiFileOut << "\t<Station";
764 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
765 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
766 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
767 SiFileOut << " rotAngleDeg=\"" << "0.0" << "\"";
768 SiFileOut << " rotCenterX=\"" << "0.0" << "\"";
769 SiFileOut << " rotCenterY=\"" << "0.0" << "\"";
770 SiFileOut << ">\n";
771 SiFileOut << "\n";
772
773 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
774
775 cout << " imodule = " << imodule << "\n";
776
777 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
778
779 SiFileOut << "\t\t<Module";
780 // SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
781 // SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
782 SiFileOut << " xShift=\"" << 0.0 << "\"";
783 SiFileOut << " yShift=\"" << 0.0 << "\"";
784 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
785 SiFileOut << ">\n";
786
787 // Notice!!!: here:
788 // index "0" is a layer with inclined strips (the front side of the module)
789 // index "1" is a layer with straight strips (the back side of the module)
790 // "UpLayer" is the upper part of the module
791 // "LowLayer" is the lower part of the module
792
793 Double_t xOrig_UpLayer[2];
794 Double_t yOrig_UpLayer[2];
795 Double_t xOrig_LowLayer[2];
796 Double_t yOrig_LowLayer[2];
797
798 Double_t xSize_UpLayer[2];
799 Double_t ySize_UpLayer[2];
800 Double_t xSize_LowLayer[2];
801 Double_t ySize_LowLayer[2];
802
803 Double_t xLBorder_UpLayer[2];
804 Double_t yLBorder_UpLayer[2];
805 Double_t xLBorder_LowLayer[2];
806 Double_t yLBorder_LowLayer[2];
807 Double_t xRBorder_UpLayer[2];
808 Double_t yRBorder_UpLayer[2];
809 Double_t xRBorder_LowLayer[2];
810 Double_t yRBorder_LowLayer[2];
811
812 Double_t xDeadZone[2][3];
813 Double_t yDeadZone[2][3];
814
815 Bool_t isDeadZone_UpLayer = false;
816 Bool_t isDeadZone_LowLayer = false;
817
818 StripNumberingDirection stripDirection[2];
819 Double_t pitchValue[2] = {PitchValue[module_size][0], PitchValue[module_size][1]};
820 Double_t stripAngle[2];
821 Int_t firstStripNumber_UpLayer[2];
822 Int_t firstStripNumber_LowLayer[2];
823
824 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
825
826 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
827 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
828 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
829 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
830
831 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
832 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
833 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
834 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
835
836 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
837 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
838 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
839 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
840
841 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
842 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
843 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
844 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
845
846 xLBorder_UpLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
847 xLBorder_UpLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
848 yLBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
849 yLBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
850 xLBorder_LowLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
851 xLBorder_LowLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
852 yLBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
853 yLBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
854
855 xRBorder_UpLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
856 xRBorder_UpLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
857 yRBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
858 yRBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
859 xRBorder_LowLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
860 xRBorder_LowLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
861 yRBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
862 yRBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
863
864 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
865 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
866 xDeadZone[ilayer][ipoint] =
867 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
868 yDeadZone[ilayer][ipoint] =
869 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
870 }
871 }
872
873 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
874 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
875 {
876 isDeadZone_UpLayer = false;
877 isDeadZone_LowLayer = true;
878 }
879
880 if (StripDirection[module_size][0] == LeftToRight)
881 stripDirection[0] = LeftToRight;
882 else
883 stripDirection[0] = RightToLeft;
884 if (StripDirection[module_size][1] == LeftToRight)
885 stripDirection[1] = LeftToRight;
886 else
887 stripDirection[1] = RightToLeft;
888
889 stripAngle[0] = StripAngle[module_size][0];
890 stripAngle[1] = StripAngle[module_size][1];
891
892 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
893 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
894 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
895 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
896 }
897
898 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
899
900 xOrig_UpLayer[0] =
901 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
902 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
903 xOrig_LowLayer[0] =
904 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
905 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
906
907 xOrig_UpLayer[1] =
908 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
909 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
910 xOrig_LowLayer[1] =
911 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
912 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
913
914 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
915 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
916 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
917 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
918
919 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
920 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
921 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
922 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
923
924 xLBorder_UpLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
925 xLBorder_UpLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
926 yLBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
927 yLBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
928 xLBorder_LowLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
929 xLBorder_LowLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
930 yLBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
931 yLBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
932
933 xRBorder_UpLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
934 xRBorder_UpLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
935 yRBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
936 yRBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
937 xRBorder_LowLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
938 xRBorder_LowLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
939 yRBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
940 yRBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
941
942 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
943 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
944 xDeadZone[ilayer][ipoint] =
945 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
946 yDeadZone[ilayer][ipoint] =
947 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
948 }
949 }
950
951 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
952 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
953 {
954 isDeadZone_UpLayer = false;
955 isDeadZone_LowLayer = true;
956 }
957
958 if (StripDirection[module_size][0] == LeftToRight)
959 stripDirection[0] = RightToLeft;
960 else
961 stripDirection[0] = LeftToRight;
962 if (StripDirection[module_size][1] == LeftToRight)
963 stripDirection[1] = RightToLeft;
964 else
965 stripDirection[1] = LeftToRight;
966
967 stripAngle[0] = -StripAngle[module_size][0];
968 stripAngle[1] = -StripAngle[module_size][1];
969
970 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
971 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
972 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
973 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
974 }
975
976 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
977
978 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
979 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
980 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
981 + YModuleShifts[istation][imodule];
982 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
983 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
984 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
985 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
986 + YModuleShifts[istation][imodule];
987
988 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
989 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
990 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
991 + YModuleShifts[istation][imodule];
992 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
993 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
994 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
995 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
996 + YModuleShifts[istation][imodule];
997
998 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
999 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1000 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1001 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1002
1003 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1004 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1005 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1006 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1007
1008 xLBorder_UpLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1009 xLBorder_UpLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1010 yLBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1011 yLBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1012 xLBorder_LowLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1013 xLBorder_LowLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1014 yLBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1015 yLBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1016
1017 xRBorder_UpLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1018 xRBorder_UpLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1019 yRBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1020 yRBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1021 xRBorder_LowLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1022 xRBorder_LowLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1023 yRBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1024 yRBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1025
1026 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1027 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1028 xDeadZone[ilayer][ipoint] =
1029 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1030 yDeadZone[ilayer][ipoint] =
1031 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1032 }
1033 }
1034
1035 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1036 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1037 {
1038 isDeadZone_UpLayer = true;
1039 isDeadZone_LowLayer = false;
1040 }
1041
1042 if (StripDirection[module_size][0] == LeftToRight)
1043 stripDirection[0] = LeftToRight;
1044 else
1045 stripDirection[0] = RightToLeft;
1046 if (StripDirection[module_size][1] == LeftToRight)
1047 stripDirection[1] = LeftToRight;
1048 else
1049 stripDirection[1] = RightToLeft;
1050
1051 stripAngle[0] = -StripAngle[module_size][0];
1052 stripAngle[1] = -StripAngle[module_size][1];
1053
1054 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1055 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1056 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1057 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1058 }
1059
1060 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
1061
1062 xOrig_UpLayer[0] =
1063 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1064 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
1065 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
1066 + YModuleShifts[istation][imodule];
1067 xOrig_LowLayer[0] =
1068 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1069 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
1070 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
1071 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
1072 + YModuleShifts[istation][imodule];
1073
1074 xOrig_UpLayer[1] =
1075 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1076 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
1077 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
1078 + YModuleShifts[istation][imodule];
1079 xOrig_LowLayer[1] =
1080 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1081 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
1082 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
1083 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
1084 + YModuleShifts[istation][imodule];
1085
1086 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
1087 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1088 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1089 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1090
1091 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1092 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1093 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1094 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1095
1096 xLBorder_UpLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1097 xLBorder_UpLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1098 yLBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1099 yLBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1100 xLBorder_LowLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1101 xLBorder_LowLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1102 yLBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1103 yLBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1104
1105 xRBorder_UpLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1106 xRBorder_UpLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1107 yRBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1108 yRBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1109 xRBorder_LowLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1110 xRBorder_LowLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1111 yRBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1112 yRBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1113
1114 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1115 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1116 xDeadZone[ilayer][ipoint] =
1117 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1118 yDeadZone[ilayer][ipoint] =
1119 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1120 }
1121 }
1122
1123 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1124 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1125 {
1126 isDeadZone_UpLayer = true;
1127 isDeadZone_LowLayer = false;
1128 }
1129
1130 if (StripDirection[module_size][0] == LeftToRight)
1131 stripDirection[0] = RightToLeft;
1132 else
1133 stripDirection[0] = LeftToRight;
1134 if (StripDirection[module_size][1] == LeftToRight)
1135 stripDirection[1] = RightToLeft;
1136 else
1137 stripDirection[1] = LeftToRight;
1138
1139 stripAngle[0] = StripAngle[module_size][0];
1140 stripAngle[1] = StripAngle[module_size][1];
1141
1142 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1143 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1144 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1145 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1146 }
1147
1148 cout << " ---\n";
1149 cout << " Orig_UpLayer[0](x:y) = ( " << xOrig_UpLayer[0] << " : " << yOrig_UpLayer[0] << " )\n";
1150 cout << " Orig_LowLayer[0](x:y) = ( " << xOrig_LowLayer[0] << " : " << yOrig_LowLayer[0] << " )\n";
1151 cout << " Orig_UpLayer[1](x:y) = ( " << xOrig_UpLayer[1] << " : " << yOrig_UpLayer[1] << " )\n";
1152 cout << " Orig_LowLayer[1](x:y) = ( " << xOrig_LowLayer[1] << " : " << yOrig_LowLayer[1] << " )\n";
1153 cout << "\n\n";
1154
1155 cout << " ---\n";
1156 cout << " Size_UpLayer[0](dx:dy) = ( " << xSize_UpLayer[0] << " : " << ySize_UpLayer[0] << " )\n";
1157 cout << " Size_LowLayer[0](dx:dy) = ( " << xSize_LowLayer[0] << " : " << ySize_LowLayer[0] << " )\n";
1158 cout << " Size_UpLayer[1](dx:dy) = ( " << xSize_UpLayer[1] << " : " << ySize_UpLayer[1] << " )\n";
1159 cout << " Size_LowLayer[1](dx:dy) = ( " << xSize_LowLayer[1] << " : " << ySize_LowLayer[1] << " )\n";
1160 cout << "\n\n";
1161
1162 cout << " ---\n";
1163 cout << " LBorder_UpLayer[0](x:y) = ( " << xLBorder_UpLayer[0] << " : " << yLBorder_UpLayer[0] << " )\n";
1164 cout << " RBorder_UpLayer[0](x:y) = ( " << xRBorder_UpLayer[0] << " : " << yRBorder_UpLayer[0] << " )\n";
1165 cout << "\n";
1166 cout << " LBorder_LowLayer[0](x:y) = ( " << xLBorder_LowLayer[0] << " : " << yLBorder_LowLayer[0]
1167 << " )\n";
1168 cout << " RBorder_LowLayer[0](x:y) = ( " << xRBorder_LowLayer[0] << " : " << yRBorder_LowLayer[0]
1169 << " )\n";
1170 cout << "\n";
1171
1172 cout << " LBorder_UpLayer[1](x:y) = ( " << xLBorder_UpLayer[1] << " : " << yLBorder_UpLayer[1] << " )\n";
1173 cout << " RBorder_UpLayer[1](x:y) = ( " << xRBorder_UpLayer[1] << " : " << yRBorder_UpLayer[1] << " )\n";
1174 cout << "\n";
1175 cout << " LBorder_LowLayer[1](x:y) = ( " << xLBorder_LowLayer[1] << " : " << yLBorder_LowLayer[1]
1176 << " )\n";
1177 cout << " RBorder_LowLayer[1](x:y) = ( " << xRBorder_LowLayer[1] << " : " << yRBorder_LowLayer[1]
1178 << " )\n";
1179 cout << "\n\n";
1180
1181 cout << " ---\n";
1182 cout << " DeadZone[0]:\n";
1183 cout << " p0(x:y) = ( " << xDeadZone[0][0] << " : " << yDeadZone[0][0] << " )\n";
1184 cout << " p1(x:y) = ( " << xDeadZone[0][1] << " : " << yDeadZone[0][1] << " )\n";
1185 cout << " p2(x:y) = ( " << xDeadZone[0][2] << " : " << yDeadZone[0][2] << " )\n";
1186 cout << "\n";
1187
1188 cout << " DeadZone[1]:\n";
1189 cout << " p0(x:y) = ( " << xDeadZone[1][0] << " : " << yDeadZone[1][0] << " )\n";
1190 cout << " p1(x:y) = ( " << xDeadZone[1][1] << " : " << yDeadZone[1][1] << " )\n";
1191 cout << " p2(x:y) = ( " << xDeadZone[1][2] << " : " << yDeadZone[1][2] << " )\n";
1192 cout << "\n";
1193
1194 cout << " ---\n";
1195 cout << " stripDirection[0] = ";
1196 if (stripDirection[0] == LeftToRight)
1197 cout << "LeftToRight\n";
1198 else
1199 cout << "RightToLeft\n";
1200 cout << " stripDirection[1] = ";
1201 if (stripDirection[1] == LeftToRight)
1202 cout << "LeftToRight\n";
1203 else
1204 cout << "RightToLeft\n";
1205 cout << "\n";
1206
1207 cout << " ---\n";
1208 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
1209 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
1210 cout << "\n";
1211
1212 cout << "---\n";
1213 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
1214 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
1215 cout << "\n";
1216
1217 cout << "---\n";
1218 cout << " firstStripNumber_UpLayer[0] = " << firstStripNumber_UpLayer[0] << "\n";
1219 cout << " firstStripNumber_LowLayer[0] = " << firstStripNumber_LowLayer[0] << "\n";
1220 cout << " firstStripNumber_UpLayer[1] = " << firstStripNumber_UpLayer[1] << "\n";
1221 cout << " firstStripNumber_LowLayer[1] = " << firstStripNumber_LowLayer[1] << "\n";
1222 cout << "\n";
1223
1224 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1225 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE)
1226 {
1227
1228 // upper part of module: straight strips = back side ------------
1229 SiFileOut << "\t\t\t<Layer";
1230 SiFileOut << " zoneID=\"" << "0" << "\"";
1231 SiFileOut << " type=\"" << "lower" << "\"";
1232 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[1] << "\"";
1233 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1234 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1235 SiFileOut << " xorig=\"" << xOrig_UpLayer[1] << "\"";
1236 SiFileOut << " yorig=\"" << yOrig_UpLayer[1] << "\"";
1237 SiFileOut << " xsize=\"" << xSize_UpLayer[1] << "\"";
1238 SiFileOut << " ysize=\"" << ySize_UpLayer[1] << "\"";
1239 SiFileOut << " stripDirection=\"";
1240 if (stripDirection[1] == LeftToRight)
1241 SiFileOut << "LeftToRight\"";
1242 else
1243 SiFileOut << "RightToLeft\"";
1244 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[1] << "\"";
1245 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[1] << "\"";
1246 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[1] << "\"";
1247 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[1] << "\"";
1248 SiFileOut << ">";
1249
1250 if (isDeadZone_UpLayer == true) {
1251 SiFileOut << "\n";
1252 SiFileOut << "\t\t\t\t<DeadZone>\n";
1253 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1254 SiFileOut << "\t\t\t\t\t<DeadPoint";
1255 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1256 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1257 SiFileOut << " />\n";
1258 }
1259 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1260 }
1261 SiFileOut << "</Layer>\n";
1262 //--------------------------------------------------------------
1263
1264 // lower part of module: straight strips = back side ------------
1265 SiFileOut << "\t\t\t<Layer";
1266 SiFileOut << " zoneID=\"" << "0" << "\"";
1267 SiFileOut << " type=\"" << "lower" << "\"";
1268 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[1] << "\"";
1269 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1270 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1271 SiFileOut << " xorig=\"" << xOrig_LowLayer[1] << "\"";
1272 SiFileOut << " yorig=\"" << yOrig_LowLayer[1] << "\"";
1273 SiFileOut << " xsize=\"" << xSize_LowLayer[1] << "\"";
1274 SiFileOut << " ysize=\"" << ySize_LowLayer[1] << "\"";
1275 SiFileOut << " stripDirection=\"";
1276 if (stripDirection[1] == LeftToRight)
1277 SiFileOut << "LeftToRight\"";
1278 else
1279 SiFileOut << "RightToLeft\"";
1280 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[1] << "\"";
1281 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[1] << "\"";
1282 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[1] << "\"";
1283 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[1] << "\"";
1284 SiFileOut << ">";
1285
1286 if (isDeadZone_LowLayer == true) {
1287 SiFileOut << "\n";
1288 SiFileOut << "\t\t\t\t<DeadZone>\n";
1289 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1290 SiFileOut << "\t\t\t\t\t<DeadPoint";
1291 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1292 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1293 SiFileOut << " />\n";
1294 }
1295 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1296 }
1297 SiFileOut << "</Layer>\n";
1298 //--------------------------------------------------------------
1299
1300 // upper part of module: inclined strips = front side -----------
1301 SiFileOut << "\t\t\t<Layer";
1302 SiFileOut << " zoneID=\"" << "1" << "\"";
1303 SiFileOut << " type=\"" << "upper" << "\"";
1304 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[0] << "\"";
1305 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1306 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1307 SiFileOut << " xorig=\"" << xOrig_UpLayer[0] << "\"";
1308 SiFileOut << " yorig=\"" << yOrig_UpLayer[0] << "\"";
1309 SiFileOut << " xsize=\"" << xSize_UpLayer[0] << "\"";
1310 SiFileOut << " ysize=\"" << ySize_UpLayer[0] << "\"";
1311 SiFileOut << " stripDirection=\"";
1312 if (stripDirection[0] == LeftToRight)
1313 SiFileOut << "LeftToRight\"";
1314 else
1315 SiFileOut << "RightToLeft\"";
1316 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[0] << "\"";
1317 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[0] << "\"";
1318 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[0] << "\"";
1319 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[0] << "\"";
1320 SiFileOut << ">";
1321
1322 if (isDeadZone_UpLayer == true) {
1323 SiFileOut << "\n";
1324 SiFileOut << "\t\t\t\t<DeadZone>\n";
1325 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1326 SiFileOut << "\t\t\t\t\t<DeadPoint";
1327 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1328 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1329 SiFileOut << " />\n";
1330 }
1331 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1332 }
1333 SiFileOut << "</Layer>\n";
1334 //--------------------------------------------------------------
1335
1336 // lower part of module: inclined strips = front side -----------
1337 SiFileOut << "\t\t\t<Layer";
1338 SiFileOut << " zoneID=\"" << "1" << "\"";
1339 SiFileOut << " type=\"" << "upper" << "\"";
1340 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[0] << "\"";
1341 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1342 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1343 SiFileOut << " xorig=\"" << xOrig_LowLayer[0] << "\"";
1344 SiFileOut << " yorig=\"" << yOrig_LowLayer[0] << "\"";
1345 SiFileOut << " xsize=\"" << xSize_LowLayer[0] << "\"";
1346 SiFileOut << " ysize=\"" << ySize_LowLayer[0] << "\"";
1347 SiFileOut << " stripDirection=\"";
1348 if (stripDirection[0] == LeftToRight)
1349 SiFileOut << "LeftToRight\"";
1350 else
1351 SiFileOut << "RightToLeft\"";
1352 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[0] << "\"";
1353 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[0] << "\"";
1354 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[0] << "\"";
1355 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[0] << "\"";
1356 SiFileOut << ">";
1357
1358 if (isDeadZone_LowLayer == true) {
1359 SiFileOut << "\n";
1360 SiFileOut << "\t\t\t\t<DeadZone>\n";
1361 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1362 SiFileOut << "\t\t\t\t\t<DeadPoint";
1363 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1364 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1365 SiFileOut << " />\n";
1366 }
1367 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1368 }
1369 SiFileOut << "</Layer>\n";
1370 //--------------------------------------------------------------
1371
1372 SiFileOut << "\t\t</Module>\n";
1373 SiFileOut << "\n";
1374 }
1375
1376 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
1377 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
1378 {
1379
1380 Double_t xOrig[2];
1381 Double_t yOrig[2];
1382 Double_t xSize[2];
1383 Double_t ySize[2];
1384 Double_t xLBorder[2];
1385 Double_t yLBorder[2];
1386 Double_t xRBorder[2];
1387 Double_t yRBorder[2];
1388 Bool_t isDeadZone;
1389
1390 if (ModulesXRotations[istation][imodule] == false) {
1391 xOrig[0] = xOrig_LowLayer[0];
1392 xOrig[1] = xOrig_LowLayer[1];
1393 yOrig[0] = yOrig_LowLayer[0];
1394 yOrig[1] = yOrig_LowLayer[1];
1395 xSize[0] = xSize_LowLayer[0];
1396 xSize[1] = xSize_LowLayer[1];
1397 ySize[0] = ySize_LowLayer[0];
1398 ySize[1] = ySize_LowLayer[1];
1399 xLBorder[0] = xLBorder_LowLayer[0];
1400 xLBorder[1] = xLBorder_LowLayer[1];
1401 yLBorder[0] = yLBorder_LowLayer[0];
1402 yLBorder[1] = yLBorder_LowLayer[1];
1403 xRBorder[0] = xRBorder_LowLayer[0];
1404 xRBorder[1] = xRBorder_LowLayer[1];
1405 yRBorder[0] = yRBorder_LowLayer[0];
1406 yRBorder[1] = yRBorder_LowLayer[1];
1407 isDeadZone = isDeadZone_LowLayer;
1408 }
1409 if (ModulesXRotations[istation][imodule] == true) {
1410 xOrig[0] = xOrig_UpLayer[0];
1411 xOrig[1] = xOrig_UpLayer[1];
1412 yOrig[0] = yOrig_UpLayer[0];
1413 yOrig[1] = yOrig_UpLayer[1];
1414 xSize[0] = xSize_UpLayer[0];
1415 xSize[1] = xSize_UpLayer[1];
1416 ySize[0] = ySize_UpLayer[0];
1417 ySize[1] = ySize_UpLayer[1];
1418 xLBorder[0] = xLBorder_UpLayer[0];
1419 xLBorder[1] = xLBorder_UpLayer[1];
1420 yLBorder[0] = yLBorder_UpLayer[0];
1421 yLBorder[1] = yLBorder_UpLayer[1];
1422 xRBorder[0] = xRBorder_UpLayer[0];
1423 xRBorder[1] = xRBorder_UpLayer[1];
1424 yRBorder[0] = yRBorder_UpLayer[0];
1425 yRBorder[1] = yRBorder_UpLayer[1];
1426 isDeadZone = isDeadZone_UpLayer;
1427 }
1428
1429 // one part of module: straight strips = back side --------------
1430 SiFileOut << "\t\t\t<Layer";
1431 SiFileOut << " zoneID=\"" << "0" << "\"";
1432 SiFileOut << " type=\"" << "lower" << "\"";
1433 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1434 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1435 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1436 SiFileOut << " xorig=\"" << xOrig[1] << "\"";
1437 SiFileOut << " yorig=\"" << yOrig[1] << "\"";
1438 SiFileOut << " xsize=\"" << xSize[1] << "\"";
1439 SiFileOut << " ysize=\"" << ySize[1] << "\"";
1440 SiFileOut << " stripDirection=\"";
1441 if (stripDirection[1] == LeftToRight)
1442 SiFileOut << "LeftToRight\"";
1443 else
1444 SiFileOut << "RightToLeft\"";
1445 SiFileOut << " lxborder=\"" << xLBorder[1] << "\"";
1446 SiFileOut << " lyborder=\"" << yLBorder[1] << "\"";
1447 SiFileOut << " rxborder=\"" << xRBorder[1] << "\"";
1448 SiFileOut << " ryborder=\"" << yRBorder[1] << "\"";
1449 SiFileOut << ">";
1450
1451 if (isDeadZone == true) {
1452 SiFileOut << "\n";
1453 SiFileOut << "\t\t\t\t<DeadZone>\n";
1454 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1455 SiFileOut << "\t\t\t\t\t<DeadPoint";
1456 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1457 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1458 SiFileOut << " />\n";
1459 }
1460 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1461 }
1462 SiFileOut << "</Layer>\n";
1463 //--------------------------------------------------------------
1464
1465 // one part of module: inclined strips = front side -------------
1466 SiFileOut << "\t\t\t<Layer";
1467 SiFileOut << " zoneID=\"" << "1" << "\"";
1468 SiFileOut << " type=\"" << "upper" << "\"";
1469 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1470 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1471 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1472 SiFileOut << " xorig=\"" << xOrig[0] << "\"";
1473 SiFileOut << " yorig=\"" << yOrig[0] << "\"";
1474 SiFileOut << " xsize=\"" << xSize[0] << "\"";
1475 SiFileOut << " ysize=\"" << ySize[0] << "\"";
1476 SiFileOut << " stripDirection=\"";
1477 if (stripDirection[0] == LeftToRight)
1478 SiFileOut << "LeftToRight\"";
1479 else
1480 SiFileOut << "RightToLeft\"";
1481 SiFileOut << " lxborder=\"" << xLBorder[0] << "\"";
1482 SiFileOut << " lyborder=\"" << yLBorder[0] << "\"";
1483 SiFileOut << " rxborder=\"" << xRBorder[0] << "\"";
1484 SiFileOut << " ryborder=\"" << yRBorder[0] << "\"";
1485 SiFileOut << ">";
1486
1487 if (isDeadZone == true) {
1488 SiFileOut << "\n";
1489 SiFileOut << "\t\t\t\t<DeadZone>\n";
1490 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1491 SiFileOut << "\t\t\t\t\t<DeadPoint";
1492 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1493 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1494 SiFileOut << " />\n";
1495 }
1496 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1497 }
1498 SiFileOut << "</Layer>\n";
1499 //--------------------------------------------------------------
1500
1501 SiFileOut << "\t\t</Module>\n";
1502 SiFileOut << "\n";
1503 }
1504 }
1505
1506 SiFileOut << "\t</Station>\n";
1507 SiFileOut << "\n";
1508
1509 cout << "------------------------------------------------------------\n";
1510 }
1511
1512 SiFileOut << "</StationSet>\n";
1513
1514 SiFileOut.close();
1515}
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]
Double_t ZModuleSize[NModuleSizes]
Double_t YMiddleBorderUpperPart[NModuleSizes][2]
Double_t XLeftBorder[NModuleSizes][2]
Double_t YSizeUpLayer[NModuleSizes][2]
Double_t BevelAngleRad[NModuleSizes]
Double_t YShiftLastStripLowLayer[NModuleSizes][2]
ModuleType
@ BEVEL_MODULE
@ RIGHT_ANGLED_MODULE_HALF
@ RIGHT_ANGLED_MODULE
Double_t YTopBorder[NModuleSizes][2]
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]
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]
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]
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_Run8_4stations()
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