BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SiliconConfigCalculate_Run8_5stations.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_5stations (5 SI-stations (6-10-14-18-22 mods))
10 *
11 * Created: 05.01.2022
12 * Author: D. Baranov
13 */
14
15#include "Rtypes.h"
16
17R__ADD_INCLUDE_PATH($VMCWORKDIR)
18R__LOAD_LIBRARY(libBmnData.so)
19
20#include "TString.h"
21
22#include <fstream>
23
24using namespace TMath;
25using namespace std;
26
27// Configuration of modules -----------------------------------------------------
28
30{
33}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
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.11005} /*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)
440const Double_t XStationPositions[NStations] = {0.0, 0.0, 0.0, 0.0};
441const Double_t YStationPositions[NStations] = {0.0, 0.0, 0.0, 0.0};
442const Double_t ZStationPositions[NStations] = {15.7 - 8.64 /*7.06*/, +15.7, +15.7 + 8.64, +15.7 + 8.64 + 8.64,
443 +15.7 + 8.64 + 8.64 + 8.64};
444
445//(X-Y-Z)Shifts of modules in each station
447 {+9.15 /*0*/, +3.15 /*1*/, -9.15 /*2*/, +9.15 /*3*/, +3.15 /*4*/, -9.15 /*5*/},
448 {+15.15 /*0*/, +9.15 /*1*/, +3.15 /*2*/, -9.15 /*3*/, -15.15 /*4*/, +15.15 /*5*/, +9.15 /*6*/, +3.15 /*7*/,
449 -9.15 /*8*/, -15.15 /*9*/},
450 {+21.15 /*0*/, +15.15 /*1*/, +9.15 /*2*/, +3.15 /*3*/, -9.15 /*4*/, -15.15 /*5*/, -21.15 /*6*/, +21.15 /*7*/,
451 +15.15 /*8*/, +9.15 /*9*/, +3.15 /*10*/, -9.15 /*11*/, -15.15 /*12*/, -21.15 /*13*/},
452 {+27.15 /*0*/, +21.15 /*1*/, +15.15 /*2*/, +9.15 /*3*/, +3.15 /*4*/, -9.15 /*5*/, -15.15 /*6*/, -21.15 /*7*/,
453 -27.15 /*8*/, +27.15 /*9*/, +21.15 /*10*/, +15.15 /*11*/, +9.15 /*12*/, +3.15 /*13*/, -9.15 /*14*/, -15.15 /*15*/,
454 -21.15 /*16*/, -27.15 /*17*/},
455 {+33.15 /*0*/, +27.15 /*1*/, +21.15 /*2*/, +15.15 /*3*/, +9.15 /*4*/, +3.15 /*5*/,
456 -9.15 /*6*/, -15.15 /*7*/, -21.15 /*8*/, -27.15 /*9*/, -33.15 /*10*/, +33.15 /*11*/,
457 +27.15 /*12*/, +21.15 /*13*/, +15.15 /*14*/, +9.15 /*15*/, +3.15 /*16*/, -9.15 /*17*/,
458 -15.15 /*18*/, -21.15 /*19*/, -27.15 /*20*/, -33.15 /*21*/}};
460 {-0.15 /*0*/, +2.85 /*1*/, -0.15 /*2*/, +0.15 /*3*/, -2.85 /*4*/, +0.15 /*5*/},
461 {-0.15 /*0*/, -0.15 /*1*/, +2.85 /*2*/, -0.15 /*3*/, -0.15 /*4*/, +0.15 /*5*/, +0.15 /*6*/, -2.85 /*7*/,
462 +0.15 /*8*/, +0.15 /*9*/},
463 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, +2.85 /*3*/, -0.15 /*4*/, -0.15 /*5*/, -0.15 /*6*/, +0.15 /*7*/,
464 +0.15 /*8*/, +0.15 /*9*/, -2.85 /*10*/, +0.15 /*11*/, +0.15 /*12*/, +0.15 /*13*/},
465 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, -0.15 /*3*/, +2.85 /*4*/, -0.15 /*5*/, -0.15 /*6*/, -0.15 /*7*/,
466 -0.15 /*8*/, +0.15 /*9*/, +0.15 /*10*/, +0.15 /*11*/, +0.15 /*12*/, -2.85 /*13*/, +0.15 /*14*/, +0.15 /*15*/,
467 +0.15 /*16*/, +0.15 /*17*/},
468 {-0.15 /*0*/, -0.15 /*1*/, -0.15 /*2*/, -0.15 /*3*/, -0.15 /*4*/, +2.85 /*5*/, -0.15 /*6*/, -0.15 /*7*/,
469 -0.15 /*8*/, -0.15 /*9*/, -0.15 /*10*/, +0.15 /*11*/, +0.15 /*12*/, +0.15 /*13*/, +0.15 /*14*/, +0.15 /*15*/,
470 -2.85 /*16*/, +0.15 /*17*/, +0.15 /*18*/, +0.15 /*19*/, +0.15 /*20*/, +0.15 /*21*/}};
472 {+0.14 + 4.31 /*0*/, +1.36 + 4.31 /*1*/, +0.0 + 4.31 /*2*/, +1.22 /*3*/, 0.0 /*4*/, +1.36 /*5*/},
473 {+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*/,
474 +1.22 /*6*/, 0.0 /*7*/, +1.36 /*8*/, +0.14 /*9*/},
475 {+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*/,
476 +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*/,
477 +0.14 /*12*/, +1.36 /*13*/},
478 {+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*/,
479 +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*/,
480 +0.0 /*11*/, +1.22 /*12*/, +0.0 /*13*/, +1.36 /*14*/, +0.14 /*15*/, +1.36 /*16*/, +0.14 /*17*/},
481 {+0.14 + 4.31 /*0*/, +1.36 + 4.31 /*1*/,
482 +0.14 + 4.31 /*2*/, +1.36 + 4.31 /*3*/,
483 +0.14 + 4.31 /*4*/, +1.36 + 4.31 /*5*/,
484 +0.0 + 4.31 /*6*/, +1.22 + 4.31 /*7*/,
485 +0.0 + 4.31 /*8*/, +1.22 + 4.31 /*9*/,
486 +0.0 + 4.31 /*10*/, +1.22 /*11*/,
487 +0.0 /*12*/, +1.22 /*13*/,
488 +0.0 /*14*/, +1.22 /*15*/,
489 +0.0 /*16*/, +1.36 /*17*/,
490 +0.14 /*18*/, +1.36 /*19*/,
491 +0.14 /*20*/, +1.36 /*21*/}};
492
493// Geometry parameters of modules
501
519
520// rotations of modules around y-axis by 180 deg.
522 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
523 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
524 false /*9*/},
525 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
526 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
527 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
528 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
529 false /*17*/},
530 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, true /*5*/, false /*6*/, false /*7*/,
531 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
532 true /*16*/, false /*17*/, false /*18*/, false /*19*/, false /*20*/, false /*21*/}
533
534};
535
536// rotations of modules around x-axis by 180 deg.
538 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
539 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
540 true /*9*/},
541 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
542 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
543 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
544 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
545 true /*17*/},
546 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
547 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
548 true /*16*/, true /*17*/, true /*18*/, true /*19*/, true /*20*/, true /*21*/}};
549//------------------------------------------------------------------------------
550
551// Function declarations
552void PrintInfo();
553void CalculateParameters(TString xml_file_name);
554//------------------------------------------------------------------------------
555
557{
558
559 PrintInfo();
560 CalculateParameters("SiliconRun8_5stations.xml");
561
562 cout << "It's the end" << "\n";
563 // gApplication->Terminate();
564}
565
566//------------------------------------------------------------------------------
567
569{
570
571 cout << "----------------------------------------------------------------\n";
572 cout << "Parameters of the standard module 63x126 mm:\n";
573 cout << "\n";
574 cout << " Upper layer (inclined strips):\n";
575 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][0] << " : " << YOrigUpLayer[STANDARD_MODULE][0]
576 << " )\n";
577 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][0] << " : " << YSizeUpLayer[STANDARD_MODULE][0]
578 << " )\n";
579 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][0] << " : "
580 << YLeftBorderUpperlayer[STANDARD_MODULE][0] << " )\n";
581 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][0] << " : "
583 cout << " strip_direction = ";
585 cout << "LeftToRight\n";
586 else
587 cout << "RightToLeft\n";
588 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
589 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
590 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][0] << "\n";
591 cout << "\n";
592
593 cout << " Lower layer (inclined strips):\n";
594 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][0] << " : " << YOrigLowLayer[STANDARD_MODULE][0]
595 << " )\n";
596 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][0] << " : " << YSizeLowLayer[STANDARD_MODULE][0]
597 << " )\n";
598 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][0] << " : "
599 << YLeftBorderLowerlayer[STANDARD_MODULE][0] << " )\n";
600 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][0] << " : "
602 cout << " strip_direction = ";
604 cout << "LeftToRight\n";
605 else
606 cout << "RightToLeft\n";
607 cout << " pitch = " << PitchValue[STANDARD_MODULE][0] << "\n";
608 cout << " angle = " << StripAngle[STANDARD_MODULE][0] << " deg\n";
609 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
610 cout << " dead_zone(3 points):\n";
611 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][0] << " : " << YDeadZone[STANDARD_MODULE][0][0]
612 << " )\n";
613 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][1] << " : " << YDeadZone[STANDARD_MODULE][0][1]
614 << " )\n";
615 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][0][2] << " : " << YDeadZone[STANDARD_MODULE][0][2]
616 << " )\n";
617 cout << "\n";
618
619 cout << " Upper layer (straight strips):\n";
620 cout << " orig(x:y) = ( " << XOrigUpLayer[STANDARD_MODULE][1] << " : " << YOrigUpLayer[STANDARD_MODULE][1]
621 << " )\n";
622 cout << " size(dx:dy) = ( " << XSizeUpLayer[STANDARD_MODULE][1] << " : " << YSizeUpLayer[STANDARD_MODULE][1]
623 << " )\n";
624 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[STANDARD_MODULE][1] << " : "
625 << YLeftBorderUpperlayer[STANDARD_MODULE][1] << " )\n";
626 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[STANDARD_MODULE][1] << " : "
628 cout << " strip_direction = ";
630 cout << "LeftToRight\n";
631 else
632 cout << "RightToLeft\n";
633 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
634 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
635 cout << " first_strip_number = " << FirstStripNumberUpLayer[STANDARD_MODULE][1] << "\n";
636 cout << "\n";
637
638 cout << " Lower layer (straight strips):\n";
639 cout << " orig(x:y) = ( " << XOrigLowLayer[STANDARD_MODULE][1] << " : " << YOrigLowLayer[STANDARD_MODULE][1]
640 << " )\n";
641 cout << " size(dx:dy) = ( " << XSizeLowLayer[STANDARD_MODULE][1] << " : " << YSizeLowLayer[STANDARD_MODULE][1]
642 << " )\n";
643 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[STANDARD_MODULE][1] << " : "
644 << YLeftBorderLowerlayer[STANDARD_MODULE][1] << " )\n";
645 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[STANDARD_MODULE][1] << " : "
647 cout << " strip_direction = ";
649 cout << "LeftToRight\n";
650 else
651 cout << "RightToLeft\n";
652 cout << " pitch = " << PitchValue[STANDARD_MODULE][1] << "\n";
653 cout << " angle = " << StripAngle[STANDARD_MODULE][1] << " deg\n";
654 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
655 cout << " dead_zone(3 points):\n";
656 cout << " p0(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][0] << " : " << YDeadZone[STANDARD_MODULE][1][0]
657 << " )\n";
658 cout << " p1(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][1] << " : " << YDeadZone[STANDARD_MODULE][1][1]
659 << " )\n";
660 cout << " p2(x:y) = ( " << XDeadZone[STANDARD_MODULE][1][2] << " : " << YDeadZone[STANDARD_MODULE][1][2]
661 << " )\n";
662 cout << "\n";
663
664 cout << "----------------------------------------------------------------\n";
665
666 cout << "----------------------------------------------------------------\n";
667 cout << "Parameters of the long module 63x186 mm:\n";
668 cout << "\n";
669 cout << " Upper layer (inclined strips):\n";
670 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][0] << " : " << YOrigUpLayer[LONG_MODULE][0] << " )\n";
671 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][0] << " : " << YSizeUpLayer[LONG_MODULE][0] << " )\n";
672 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][0] << " : "
673 << YLeftBorderUpperlayer[LONG_MODULE][0] << " )\n";
674 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][0] << " : "
675 << YRightBorderUpperlayer[LONG_MODULE][0] << " )\n";
676 cout << " strip_direction = ";
678 cout << "LeftToRight\n";
679 else
680 cout << "RightToLeft\n";
681 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
682 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
683 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][0] << "\n";
684 cout << "\n";
685
686 cout << " Lower layer (inclined strips):\n";
687 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][0] << " : " << YOrigLowLayer[LONG_MODULE][0] << " )\n";
688 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][0] << " : " << YSizeLowLayer[LONG_MODULE][0] << " )\n";
689 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][0] << " : "
690 << YLeftBorderLowerlayer[LONG_MODULE][0] << " )\n";
691 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][0] << " : "
692 << YRightBorderLowerlayer[LONG_MODULE][0] << " )\n";
693 cout << " strip_direction = ";
695 cout << "LeftToRight\n";
696 else
697 cout << "RightToLeft\n";
698 cout << " pitch = " << PitchValue[LONG_MODULE][0] << "\n";
699 cout << " angle = " << StripAngle[LONG_MODULE][0] << " deg\n";
700 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
701 cout << " dead_zone(3 points):\n";
702 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][0][0] << " : " << YDeadZone[LONG_MODULE][0][0] << " )\n";
703 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][0][1] << " : " << YDeadZone[LONG_MODULE][0][1] << " )\n";
704 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][0][2] << " : " << YDeadZone[LONG_MODULE][0][2] << " )\n";
705 cout << "\n";
706
707 cout << " Upper layer (straight strips):\n";
708 cout << " orig(x:y) = ( " << XOrigUpLayer[LONG_MODULE][1] << " : " << YOrigUpLayer[LONG_MODULE][1] << " )\n";
709 cout << " size(dx:dy) = ( " << XSizeUpLayer[LONG_MODULE][1] << " : " << YSizeUpLayer[LONG_MODULE][1] << " )\n";
710 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[LONG_MODULE][1] << " : "
711 << YLeftBorderUpperlayer[LONG_MODULE][1] << " )\n";
712 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[LONG_MODULE][1] << " : "
713 << YRightBorderUpperlayer[LONG_MODULE][1] << " )\n";
714 cout << " strip_direction = ";
716 cout << "LeftToRight\n";
717 else
718 cout << "RightToLeft\n";
719 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
720 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
721 cout << " first_strip_number = " << FirstStripNumberUpLayer[LONG_MODULE][1] << "\n";
722 cout << "\n";
723
724 cout << " Lower layer (straight strips):\n";
725 cout << " orig(x:y) = ( " << XOrigLowLayer[LONG_MODULE][1] << " : " << YOrigLowLayer[LONG_MODULE][1] << " )\n";
726 cout << " size(dx:dy) = ( " << XSizeLowLayer[LONG_MODULE][1] << " : " << YSizeLowLayer[LONG_MODULE][1] << " )\n";
727 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[LONG_MODULE][1] << " : "
728 << YLeftBorderLowerlayer[LONG_MODULE][1] << " )\n";
729 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[LONG_MODULE][1] << " : "
730 << YRightBorderLowerlayer[LONG_MODULE][1] << " )\n";
731 cout << " strip_direction = ";
733 cout << "LeftToRight\n";
734 else
735 cout << "RightToLeft\n";
736 cout << " pitch = " << PitchValue[LONG_MODULE][1] << "\n";
737 cout << " angle = " << StripAngle[LONG_MODULE][1] << " deg\n";
738 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
739 cout << " dead_zone(3 points):\n";
740 cout << " p0(x:y) = ( " << XDeadZone[LONG_MODULE][1][0] << " : " << YDeadZone[LONG_MODULE][1][0] << " )\n";
741 cout << " p1(x:y) = ( " << XDeadZone[LONG_MODULE][1][1] << " : " << YDeadZone[LONG_MODULE][1][1] << " )\n";
742 cout << " p2(x:y) = ( " << XDeadZone[LONG_MODULE][1][2] << " : " << YDeadZone[LONG_MODULE][1][2] << " )\n";
743 cout << "\n";
744
745 cout << "----------------------------------------------------------------\n";
746}
747//------------------------------------------------------------------------------
748
749void CalculateParameters(TString xml_file_name)
750{
751
752 ofstream SiFileOut(xml_file_name.Data(), ios::out);
753
754 SiFileOut << "<StationSet>\n";
755 SiFileOut << "\n";
756
757 for (Int_t istation = 0; istation < NStations; ++istation) {
758
759 cout << "istation = " << istation << ": -----------------------------\n";
760
761 // module size in a station
762 ModuleSize module_size = STANDARD_MODULE;
763
764 //(!!!) the last (fourth) station has long modules (!!!)
765 if (istation == 4)
766 module_size = LONG_MODULE;
767
768 SiFileOut << "<!-- Station " << istation << " -->\n";
769
770 SiFileOut << "\t<Station";
771 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
772 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
773 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
774 SiFileOut << " rotAngleDeg=\"" << "0.0" << "\"";
775 SiFileOut << " rotCenterX=\"" << "0.0" << "\"";
776 SiFileOut << " rotCenterY=\"" << "0.0" << "\"";
777 SiFileOut << ">\n";
778 SiFileOut << "\n";
779
780 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
781
782 cout << " imodule = " << imodule << "\n";
783
784 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
785
786 SiFileOut << "\t\t<Module";
787 // SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
788 // SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
789 SiFileOut << " xShift=\"" << 0.0 << "\"";
790 SiFileOut << " yShift=\"" << 0.0 << "\"";
791 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
792 SiFileOut << ">\n";
793
794 // Notice!!!: here:
795 // index "0" is a layer with inclined strips (the front side of the module)
796 // index "1" is a layer with straight strips (the back side of the module)
797 // "UpLayer" is the upper part of the module
798 // "LowLayer" is the lower part of the module
799
800 Double_t xOrig_UpLayer[2];
801 Double_t yOrig_UpLayer[2];
802 Double_t xOrig_LowLayer[2];
803 Double_t yOrig_LowLayer[2];
804
805 Double_t xSize_UpLayer[2];
806 Double_t ySize_UpLayer[2];
807 Double_t xSize_LowLayer[2];
808 Double_t ySize_LowLayer[2];
809
810 Double_t xLBorder_UpLayer[2];
811 Double_t yLBorder_UpLayer[2];
812 Double_t xLBorder_LowLayer[2];
813 Double_t yLBorder_LowLayer[2];
814 Double_t xRBorder_UpLayer[2];
815 Double_t yRBorder_UpLayer[2];
816 Double_t xRBorder_LowLayer[2];
817 Double_t yRBorder_LowLayer[2];
818
819 Double_t xDeadZone[2][3];
820 Double_t yDeadZone[2][3];
821
822 Bool_t isDeadZone_UpLayer = false;
823 Bool_t isDeadZone_LowLayer = false;
824
825 StripNumberingDirection stripDirection[2];
826 Double_t pitchValue[2] = {PitchValue[module_size][0], PitchValue[module_size][1]};
827 Double_t stripAngle[2];
828 Int_t firstStripNumber_UpLayer[2];
829 Int_t firstStripNumber_LowLayer[2];
830
831 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
832
833 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
834 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
835 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
836 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
837
838 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
839 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
840 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
841 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
842
843 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
844 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
845 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
846 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
847
848 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
849 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
850 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
851 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
852
853 xLBorder_UpLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
854 xLBorder_UpLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
855 yLBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
856 yLBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
857 xLBorder_LowLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
858 xLBorder_LowLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
859 yLBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
860 yLBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
861
862 xRBorder_UpLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
863 xRBorder_UpLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
864 yRBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
865 yRBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
866 xRBorder_LowLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
867 xRBorder_LowLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
868 yRBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
869 yRBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
870
871 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
872 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
873 xDeadZone[ilayer][ipoint] =
874 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
875 yDeadZone[ilayer][ipoint] =
876 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
877 }
878 }
879
880 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
881 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
882 {
883 isDeadZone_UpLayer = false;
884 isDeadZone_LowLayer = true;
885 }
886
887 if (StripDirection[module_size][0] == LeftToRight)
888 stripDirection[0] = LeftToRight;
889 else
890 stripDirection[0] = RightToLeft;
891 if (StripDirection[module_size][1] == LeftToRight)
892 stripDirection[1] = LeftToRight;
893 else
894 stripDirection[1] = RightToLeft;
895
896 stripAngle[0] = StripAngle[module_size][0];
897 stripAngle[1] = StripAngle[module_size][1];
898
899 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
900 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
901 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
902 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
903 }
904
905 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
906
907 xOrig_UpLayer[0] =
908 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
909 yOrig_UpLayer[0] = YOrigUpLayer[module_size][0] + YModuleShifts[istation][imodule];
910 xOrig_LowLayer[0] =
911 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
912 yOrig_LowLayer[0] = YOrigLowLayer[module_size][0] + YModuleShifts[istation][imodule];
913
914 xOrig_UpLayer[1] =
915 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
916 yOrig_UpLayer[1] = YOrigUpLayer[module_size][1] + YModuleShifts[istation][imodule];
917 xOrig_LowLayer[1] =
918 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
919 yOrig_LowLayer[1] = YOrigLowLayer[module_size][1] + YModuleShifts[istation][imodule];
920
921 xSize_UpLayer[0] = XSizeUpLayer[module_size][0];
922 ySize_UpLayer[0] = YSizeUpLayer[module_size][0];
923 xSize_LowLayer[0] = XSizeLowLayer[module_size][0];
924 ySize_LowLayer[0] = YSizeLowLayer[module_size][0];
925
926 xSize_UpLayer[1] = XSizeUpLayer[module_size][1];
927 ySize_UpLayer[1] = YSizeUpLayer[module_size][1];
928 xSize_LowLayer[1] = XSizeLowLayer[module_size][1];
929 ySize_LowLayer[1] = YSizeLowLayer[module_size][1];
930
931 xLBorder_UpLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
932 xLBorder_UpLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
933 yLBorder_UpLayer[0] = YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
934 yLBorder_UpLayer[1] = YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
935 xLBorder_LowLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
936 xLBorder_LowLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
937 yLBorder_LowLayer[0] = YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
938 yLBorder_LowLayer[1] = YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
939
940 xRBorder_UpLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
941 xRBorder_UpLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
942 yRBorder_UpLayer[0] = YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
943 yRBorder_UpLayer[1] = YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
944 xRBorder_LowLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
945 xRBorder_LowLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
946 yRBorder_LowLayer[0] = YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
947 yRBorder_LowLayer[1] = YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
948
949 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
950 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
951 xDeadZone[ilayer][ipoint] =
952 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
953 yDeadZone[ilayer][ipoint] =
954 YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
955 }
956 }
957
958 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
959 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
960 {
961 isDeadZone_UpLayer = false;
962 isDeadZone_LowLayer = true;
963 }
964
965 if (StripDirection[module_size][0] == LeftToRight)
966 stripDirection[0] = RightToLeft;
967 else
968 stripDirection[0] = LeftToRight;
969 if (StripDirection[module_size][1] == LeftToRight)
970 stripDirection[1] = RightToLeft;
971 else
972 stripDirection[1] = LeftToRight;
973
974 stripAngle[0] = -StripAngle[module_size][0];
975 stripAngle[1] = -StripAngle[module_size][1];
976
977 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[module_size][0];
978 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[module_size][1];
979 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[module_size][0];
980 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[module_size][1];
981 }
982
983 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
984
985 xOrig_UpLayer[0] = XOrigUpLayer[module_size][0] + XModuleShifts[istation][imodule];
986 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
987 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
988 + YModuleShifts[istation][imodule];
989 xOrig_LowLayer[0] = XOrigLowLayer[module_size][0] + XModuleShifts[istation][imodule];
990 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
991 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
992 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
993 + YModuleShifts[istation][imodule];
994
995 xOrig_UpLayer[1] = XOrigUpLayer[module_size][1] + XModuleShifts[istation][imodule];
996 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
997 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
998 + YModuleShifts[istation][imodule];
999 xOrig_LowLayer[1] = XOrigLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1000 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
1001 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
1002 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
1003 + YModuleShifts[istation][imodule];
1004
1005 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
1006 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1007 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1008 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1009
1010 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1011 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1012 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1013 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1014
1015 xLBorder_UpLayer[0] = XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1016 xLBorder_UpLayer[1] = XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1017 yLBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1018 yLBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1019 xLBorder_LowLayer[0] = XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1020 xLBorder_LowLayer[1] = XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1021 yLBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1022 yLBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1023
1024 xRBorder_UpLayer[0] = XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1025 xRBorder_UpLayer[1] = XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1026 yRBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1027 yRBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1028 xRBorder_LowLayer[0] = XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1029 xRBorder_LowLayer[1] = XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1030 yRBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1031 yRBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1032
1033 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1034 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1035 xDeadZone[ilayer][ipoint] =
1036 XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1037 yDeadZone[ilayer][ipoint] =
1038 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1039 }
1040 }
1041
1042 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1043 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1044 {
1045 isDeadZone_UpLayer = true;
1046 isDeadZone_LowLayer = false;
1047 }
1048
1049 if (StripDirection[module_size][0] == LeftToRight)
1050 stripDirection[0] = LeftToRight;
1051 else
1052 stripDirection[0] = RightToLeft;
1053 if (StripDirection[module_size][1] == LeftToRight)
1054 stripDirection[1] = LeftToRight;
1055 else
1056 stripDirection[1] = RightToLeft;
1057
1058 stripAngle[0] = -StripAngle[module_size][0];
1059 stripAngle[1] = -StripAngle[module_size][1];
1060
1061 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1062 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1063 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1064 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1065 }
1066
1067 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
1068
1069 xOrig_UpLayer[0] =
1070 -XOrigUpLayer[module_size][0] + XSizeUpLayer[module_size][0] + XModuleShifts[istation][imodule];
1071 yOrig_UpLayer[0] = -YOrigUpLayer[module_size][0] + YMiddleBorderLowerPart[module_size][0]
1072 + YMiddleBorderUpperPart[module_size][0] + YGapBetweenPartsOfModule[module_size]
1073 + YModuleShifts[istation][imodule];
1074 xOrig_LowLayer[0] =
1075 -XOrigLowLayer[module_size][0] + XSizeLowLayer[module_size][0] + XModuleShifts[istation][imodule];
1076 yOrig_LowLayer[0] = -YOrigLowLayer[module_size][0] - YSizeLowLayer[module_size][0]
1077 - YMiddleBorderLowerPart[module_size][0] - YMiddleBorderUpperPart[module_size][0]
1078 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][0]
1079 + YModuleShifts[istation][imodule];
1080
1081 xOrig_UpLayer[1] =
1082 -XOrigUpLayer[module_size][1] + XSizeUpLayer[module_size][1] + XModuleShifts[istation][imodule];
1083 yOrig_UpLayer[1] = -YOrigUpLayer[module_size][1] + YMiddleBorderLowerPart[module_size][1]
1084 + YMiddleBorderUpperPart[module_size][1] + YGapBetweenPartsOfModule[module_size]
1085 + YModuleShifts[istation][imodule];
1086 xOrig_LowLayer[1] =
1087 -XOrigLowLayer[module_size][1] + XSizeLowLayer[module_size][1] + XModuleShifts[istation][imodule];
1088 yOrig_LowLayer[1] = -YOrigLowLayer[module_size][1] - YSizeLowLayer[module_size][1]
1089 - YMiddleBorderLowerPart[module_size][1] - YMiddleBorderUpperPart[module_size][1]
1090 - YGapBetweenPartsOfModule[module_size] - YSizeUpLayer[module_size][1]
1091 + YModuleShifts[istation][imodule];
1092
1093 xSize_UpLayer[0] = XSizeLowLayer[module_size][0];
1094 ySize_UpLayer[0] = YSizeLowLayer[module_size][0];
1095 xSize_LowLayer[0] = XSizeUpLayer[module_size][0];
1096 ySize_LowLayer[0] = YSizeUpLayer[module_size][0];
1097
1098 xSize_UpLayer[1] = XSizeLowLayer[module_size][1];
1099 ySize_UpLayer[1] = YSizeLowLayer[module_size][1];
1100 xSize_LowLayer[1] = XSizeUpLayer[module_size][1];
1101 ySize_LowLayer[1] = YSizeUpLayer[module_size][1];
1102
1103 xLBorder_UpLayer[0] = -XRightBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1104 xLBorder_UpLayer[1] = -XRightBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1105 yLBorder_UpLayer[0] = -YRightBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1106 yLBorder_UpLayer[1] = -YRightBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1107 xLBorder_LowLayer[0] = -XRightBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1108 xLBorder_LowLayer[1] = -XRightBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1109 yLBorder_LowLayer[0] = -YRightBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1110 yLBorder_LowLayer[1] = -YRightBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1111
1112 xRBorder_UpLayer[0] = -XLeftBorderLowerlayer[module_size][0] + XModuleShifts[istation][imodule];
1113 xRBorder_UpLayer[1] = -XLeftBorderLowerlayer[module_size][1] + XModuleShifts[istation][imodule];
1114 yRBorder_UpLayer[0] = -YLeftBorderLowerlayer[module_size][0] + YModuleShifts[istation][imodule];
1115 yRBorder_UpLayer[1] = -YLeftBorderLowerlayer[module_size][1] + YModuleShifts[istation][imodule];
1116 xRBorder_LowLayer[0] = -XLeftBorderUpperlayer[module_size][0] + XModuleShifts[istation][imodule];
1117 xRBorder_LowLayer[1] = -XLeftBorderUpperlayer[module_size][1] + XModuleShifts[istation][imodule];
1118 yRBorder_LowLayer[0] = -YLeftBorderUpperlayer[module_size][0] + YModuleShifts[istation][imodule];
1119 yRBorder_LowLayer[1] = -YLeftBorderUpperlayer[module_size][1] + YModuleShifts[istation][imodule];
1120
1121 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
1122 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1123 xDeadZone[ilayer][ipoint] =
1124 -XDeadZone[module_size][ilayer][ipoint] + XModuleShifts[istation][imodule];
1125 yDeadZone[ilayer][ipoint] =
1126 -YDeadZone[module_size][ilayer][ipoint] + YModuleShifts[istation][imodule];
1127 }
1128 }
1129
1130 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1131 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
1132 {
1133 isDeadZone_UpLayer = true;
1134 isDeadZone_LowLayer = false;
1135 }
1136
1137 if (StripDirection[module_size][0] == LeftToRight)
1138 stripDirection[0] = RightToLeft;
1139 else
1140 stripDirection[0] = LeftToRight;
1141 if (StripDirection[module_size][1] == LeftToRight)
1142 stripDirection[1] = RightToLeft;
1143 else
1144 stripDirection[1] = LeftToRight;
1145
1146 stripAngle[0] = StripAngle[module_size][0];
1147 stripAngle[1] = StripAngle[module_size][1];
1148
1149 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[module_size][0];
1150 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[module_size][1];
1151 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[module_size][0];
1152 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[module_size][1];
1153 }
1154
1155 cout << " ---\n";
1156 cout << " Orig_UpLayer[0](x:y) = ( " << xOrig_UpLayer[0] << " : " << yOrig_UpLayer[0] << " )\n";
1157 cout << " Orig_LowLayer[0](x:y) = ( " << xOrig_LowLayer[0] << " : " << yOrig_LowLayer[0] << " )\n";
1158 cout << " Orig_UpLayer[1](x:y) = ( " << xOrig_UpLayer[1] << " : " << yOrig_UpLayer[1] << " )\n";
1159 cout << " Orig_LowLayer[1](x:y) = ( " << xOrig_LowLayer[1] << " : " << yOrig_LowLayer[1] << " )\n";
1160 cout << "\n\n";
1161
1162 cout << " ---\n";
1163 cout << " Size_UpLayer[0](dx:dy) = ( " << xSize_UpLayer[0] << " : " << ySize_UpLayer[0] << " )\n";
1164 cout << " Size_LowLayer[0](dx:dy) = ( " << xSize_LowLayer[0] << " : " << ySize_LowLayer[0] << " )\n";
1165 cout << " Size_UpLayer[1](dx:dy) = ( " << xSize_UpLayer[1] << " : " << ySize_UpLayer[1] << " )\n";
1166 cout << " Size_LowLayer[1](dx:dy) = ( " << xSize_LowLayer[1] << " : " << ySize_LowLayer[1] << " )\n";
1167 cout << "\n\n";
1168
1169 cout << " ---\n";
1170 cout << " LBorder_UpLayer[0](x:y) = ( " << xLBorder_UpLayer[0] << " : " << yLBorder_UpLayer[0] << " )\n";
1171 cout << " RBorder_UpLayer[0](x:y) = ( " << xRBorder_UpLayer[0] << " : " << yRBorder_UpLayer[0] << " )\n";
1172 cout << "\n";
1173 cout << " LBorder_LowLayer[0](x:y) = ( " << xLBorder_LowLayer[0] << " : " << yLBorder_LowLayer[0]
1174 << " )\n";
1175 cout << " RBorder_LowLayer[0](x:y) = ( " << xRBorder_LowLayer[0] << " : " << yRBorder_LowLayer[0]
1176 << " )\n";
1177 cout << "\n";
1178
1179 cout << " LBorder_UpLayer[1](x:y) = ( " << xLBorder_UpLayer[1] << " : " << yLBorder_UpLayer[1] << " )\n";
1180 cout << " RBorder_UpLayer[1](x:y) = ( " << xRBorder_UpLayer[1] << " : " << yRBorder_UpLayer[1] << " )\n";
1181 cout << "\n";
1182 cout << " LBorder_LowLayer[1](x:y) = ( " << xLBorder_LowLayer[1] << " : " << yLBorder_LowLayer[1]
1183 << " )\n";
1184 cout << " RBorder_LowLayer[1](x:y) = ( " << xRBorder_LowLayer[1] << " : " << yRBorder_LowLayer[1]
1185 << " )\n";
1186 cout << "\n\n";
1187
1188 cout << " ---\n";
1189 cout << " DeadZone[0]:\n";
1190 cout << " p0(x:y) = ( " << xDeadZone[0][0] << " : " << yDeadZone[0][0] << " )\n";
1191 cout << " p1(x:y) = ( " << xDeadZone[0][1] << " : " << yDeadZone[0][1] << " )\n";
1192 cout << " p2(x:y) = ( " << xDeadZone[0][2] << " : " << yDeadZone[0][2] << " )\n";
1193 cout << "\n";
1194
1195 cout << " DeadZone[1]:\n";
1196 cout << " p0(x:y) = ( " << xDeadZone[1][0] << " : " << yDeadZone[1][0] << " )\n";
1197 cout << " p1(x:y) = ( " << xDeadZone[1][1] << " : " << yDeadZone[1][1] << " )\n";
1198 cout << " p2(x:y) = ( " << xDeadZone[1][2] << " : " << yDeadZone[1][2] << " )\n";
1199 cout << "\n";
1200
1201 cout << " ---\n";
1202 cout << " stripDirection[0] = ";
1203 if (stripDirection[0] == LeftToRight)
1204 cout << "LeftToRight\n";
1205 else
1206 cout << "RightToLeft\n";
1207 cout << " stripDirection[1] = ";
1208 if (stripDirection[1] == LeftToRight)
1209 cout << "LeftToRight\n";
1210 else
1211 cout << "RightToLeft\n";
1212 cout << "\n";
1213
1214 cout << " ---\n";
1215 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
1216 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
1217 cout << "\n";
1218
1219 cout << "---\n";
1220 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
1221 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
1222 cout << "\n";
1223
1224 cout << "---\n";
1225 cout << " firstStripNumber_UpLayer[0] = " << firstStripNumber_UpLayer[0] << "\n";
1226 cout << " firstStripNumber_LowLayer[0] = " << firstStripNumber_LowLayer[0] << "\n";
1227 cout << " firstStripNumber_UpLayer[1] = " << firstStripNumber_UpLayer[1] << "\n";
1228 cout << " firstStripNumber_LowLayer[1] = " << firstStripNumber_LowLayer[1] << "\n";
1229 cout << "\n";
1230
1231 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
1232 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE)
1233 {
1234
1235 // upper part of module: straight strips = back side ------------
1236 SiFileOut << "\t\t\t<Layer";
1237 SiFileOut << " zoneID=\"" << "0" << "\"";
1238 SiFileOut << " type=\"" << "lower" << "\"";
1239 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[1] << "\"";
1240 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1241 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1242 SiFileOut << " xorig=\"" << xOrig_UpLayer[1] << "\"";
1243 SiFileOut << " yorig=\"" << yOrig_UpLayer[1] << "\"";
1244 SiFileOut << " xsize=\"" << xSize_UpLayer[1] << "\"";
1245 SiFileOut << " ysize=\"" << ySize_UpLayer[1] << "\"";
1246 SiFileOut << " stripDirection=\"";
1247 if (stripDirection[1] == LeftToRight)
1248 SiFileOut << "LeftToRight\"";
1249 else
1250 SiFileOut << "RightToLeft\"";
1251 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[1] << "\"";
1252 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[1] << "\"";
1253 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[1] << "\"";
1254 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[1] << "\"";
1255 SiFileOut << ">";
1256
1257 if (isDeadZone_UpLayer == true) {
1258 SiFileOut << "\n";
1259 SiFileOut << "\t\t\t\t<DeadZone>\n";
1260 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1261 SiFileOut << "\t\t\t\t\t<DeadPoint";
1262 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1263 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1264 SiFileOut << " />\n";
1265 }
1266 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1267 }
1268 SiFileOut << "</Layer>\n";
1269 //--------------------------------------------------------------
1270
1271 // lower part of module: straight strips = back side ------------
1272 SiFileOut << "\t\t\t<Layer";
1273 SiFileOut << " zoneID=\"" << "0" << "\"";
1274 SiFileOut << " type=\"" << "lower" << "\"";
1275 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[1] << "\"";
1276 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1277 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1278 SiFileOut << " xorig=\"" << xOrig_LowLayer[1] << "\"";
1279 SiFileOut << " yorig=\"" << yOrig_LowLayer[1] << "\"";
1280 SiFileOut << " xsize=\"" << xSize_LowLayer[1] << "\"";
1281 SiFileOut << " ysize=\"" << ySize_LowLayer[1] << "\"";
1282 SiFileOut << " stripDirection=\"";
1283 if (stripDirection[1] == LeftToRight)
1284 SiFileOut << "LeftToRight\"";
1285 else
1286 SiFileOut << "RightToLeft\"";
1287 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[1] << "\"";
1288 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[1] << "\"";
1289 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[1] << "\"";
1290 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[1] << "\"";
1291 SiFileOut << ">";
1292
1293 if (isDeadZone_LowLayer == true) {
1294 SiFileOut << "\n";
1295 SiFileOut << "\t\t\t\t<DeadZone>\n";
1296 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1297 SiFileOut << "\t\t\t\t\t<DeadPoint";
1298 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1299 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1300 SiFileOut << " />\n";
1301 }
1302 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1303 }
1304 SiFileOut << "</Layer>\n";
1305 //--------------------------------------------------------------
1306
1307 // upper part of module: inclined strips = front side -----------
1308 SiFileOut << "\t\t\t<Layer";
1309 SiFileOut << " zoneID=\"" << "1" << "\"";
1310 SiFileOut << " type=\"" << "upper" << "\"";
1311 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[0] << "\"";
1312 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1313 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1314 SiFileOut << " xorig=\"" << xOrig_UpLayer[0] << "\"";
1315 SiFileOut << " yorig=\"" << yOrig_UpLayer[0] << "\"";
1316 SiFileOut << " xsize=\"" << xSize_UpLayer[0] << "\"";
1317 SiFileOut << " ysize=\"" << ySize_UpLayer[0] << "\"";
1318 SiFileOut << " stripDirection=\"";
1319 if (stripDirection[0] == LeftToRight)
1320 SiFileOut << "LeftToRight\"";
1321 else
1322 SiFileOut << "RightToLeft\"";
1323 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[0] << "\"";
1324 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[0] << "\"";
1325 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[0] << "\"";
1326 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[0] << "\"";
1327 SiFileOut << ">";
1328
1329 if (isDeadZone_UpLayer == true) {
1330 SiFileOut << "\n";
1331 SiFileOut << "\t\t\t\t<DeadZone>\n";
1332 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1333 SiFileOut << "\t\t\t\t\t<DeadPoint";
1334 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1335 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1336 SiFileOut << " />\n";
1337 }
1338 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1339 }
1340 SiFileOut << "</Layer>\n";
1341 //--------------------------------------------------------------
1342
1343 // lower part of module: inclined strips = front side -----------
1344 SiFileOut << "\t\t\t<Layer";
1345 SiFileOut << " zoneID=\"" << "1" << "\"";
1346 SiFileOut << " type=\"" << "upper" << "\"";
1347 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[0] << "\"";
1348 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1349 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1350 SiFileOut << " xorig=\"" << xOrig_LowLayer[0] << "\"";
1351 SiFileOut << " yorig=\"" << yOrig_LowLayer[0] << "\"";
1352 SiFileOut << " xsize=\"" << xSize_LowLayer[0] << "\"";
1353 SiFileOut << " ysize=\"" << ySize_LowLayer[0] << "\"";
1354 SiFileOut << " stripDirection=\"";
1355 if (stripDirection[0] == LeftToRight)
1356 SiFileOut << "LeftToRight\"";
1357 else
1358 SiFileOut << "RightToLeft\"";
1359 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[0] << "\"";
1360 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[0] << "\"";
1361 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[0] << "\"";
1362 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[0] << "\"";
1363 SiFileOut << ">";
1364
1365 if (isDeadZone_LowLayer == true) {
1366 SiFileOut << "\n";
1367 SiFileOut << "\t\t\t\t<DeadZone>\n";
1368 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1369 SiFileOut << "\t\t\t\t\t<DeadPoint";
1370 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1371 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1372 SiFileOut << " />\n";
1373 }
1374 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1375 }
1376 SiFileOut << "</Layer>\n";
1377 //--------------------------------------------------------------
1378
1379 SiFileOut << "\t\t</Module>\n";
1380 SiFileOut << "\n";
1381 }
1382
1383 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
1384 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
1385 {
1386
1387 Double_t xOrig[2];
1388 Double_t yOrig[2];
1389 Double_t xSize[2];
1390 Double_t ySize[2];
1391 Double_t xLBorder[2];
1392 Double_t yLBorder[2];
1393 Double_t xRBorder[2];
1394 Double_t yRBorder[2];
1395 Bool_t isDeadZone;
1396
1397 if (ModulesXRotations[istation][imodule] == false) {
1398 xOrig[0] = xOrig_LowLayer[0];
1399 xOrig[1] = xOrig_LowLayer[1];
1400 yOrig[0] = yOrig_LowLayer[0];
1401 yOrig[1] = yOrig_LowLayer[1];
1402 xSize[0] = xSize_LowLayer[0];
1403 xSize[1] = xSize_LowLayer[1];
1404 ySize[0] = ySize_LowLayer[0];
1405 ySize[1] = ySize_LowLayer[1];
1406 xLBorder[0] = xLBorder_LowLayer[0];
1407 xLBorder[1] = xLBorder_LowLayer[1];
1408 yLBorder[0] = yLBorder_LowLayer[0];
1409 yLBorder[1] = yLBorder_LowLayer[1];
1410 xRBorder[0] = xRBorder_LowLayer[0];
1411 xRBorder[1] = xRBorder_LowLayer[1];
1412 yRBorder[0] = yRBorder_LowLayer[0];
1413 yRBorder[1] = yRBorder_LowLayer[1];
1414 isDeadZone = isDeadZone_LowLayer;
1415 }
1416 if (ModulesXRotations[istation][imodule] == true) {
1417 xOrig[0] = xOrig_UpLayer[0];
1418 xOrig[1] = xOrig_UpLayer[1];
1419 yOrig[0] = yOrig_UpLayer[0];
1420 yOrig[1] = yOrig_UpLayer[1];
1421 xSize[0] = xSize_UpLayer[0];
1422 xSize[1] = xSize_UpLayer[1];
1423 ySize[0] = ySize_UpLayer[0];
1424 ySize[1] = ySize_UpLayer[1];
1425 xLBorder[0] = xLBorder_UpLayer[0];
1426 xLBorder[1] = xLBorder_UpLayer[1];
1427 yLBorder[0] = yLBorder_UpLayer[0];
1428 yLBorder[1] = yLBorder_UpLayer[1];
1429 xRBorder[0] = xRBorder_UpLayer[0];
1430 xRBorder[1] = xRBorder_UpLayer[1];
1431 yRBorder[0] = yRBorder_UpLayer[0];
1432 yRBorder[1] = yRBorder_UpLayer[1];
1433 isDeadZone = isDeadZone_UpLayer;
1434 }
1435
1436 // one part of module: straight strips = back side --------------
1437 SiFileOut << "\t\t\t<Layer";
1438 SiFileOut << " zoneID=\"" << "0" << "\"";
1439 SiFileOut << " type=\"" << "lower" << "\"";
1440 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1441 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
1442 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
1443 SiFileOut << " xorig=\"" << xOrig[1] << "\"";
1444 SiFileOut << " yorig=\"" << yOrig[1] << "\"";
1445 SiFileOut << " xsize=\"" << xSize[1] << "\"";
1446 SiFileOut << " ysize=\"" << ySize[1] << "\"";
1447 SiFileOut << " stripDirection=\"";
1448 if (stripDirection[1] == LeftToRight)
1449 SiFileOut << "LeftToRight\"";
1450 else
1451 SiFileOut << "RightToLeft\"";
1452 SiFileOut << " lxborder=\"" << xLBorder[1] << "\"";
1453 SiFileOut << " lyborder=\"" << yLBorder[1] << "\"";
1454 SiFileOut << " rxborder=\"" << xRBorder[1] << "\"";
1455 SiFileOut << " ryborder=\"" << yRBorder[1] << "\"";
1456 SiFileOut << ">";
1457
1458 if (isDeadZone == true) {
1459 SiFileOut << "\n";
1460 SiFileOut << "\t\t\t\t<DeadZone>\n";
1461 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1462 SiFileOut << "\t\t\t\t\t<DeadPoint";
1463 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
1464 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
1465 SiFileOut << " />\n";
1466 }
1467 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1468 }
1469 SiFileOut << "</Layer>\n";
1470 //--------------------------------------------------------------
1471
1472 // one part of module: inclined strips = front side -------------
1473 SiFileOut << "\t\t\t<Layer";
1474 SiFileOut << " zoneID=\"" << "1" << "\"";
1475 SiFileOut << " type=\"" << "upper" << "\"";
1476 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1477 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1478 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1479 SiFileOut << " xorig=\"" << xOrig[0] << "\"";
1480 SiFileOut << " yorig=\"" << yOrig[0] << "\"";
1481 SiFileOut << " xsize=\"" << xSize[0] << "\"";
1482 SiFileOut << " ysize=\"" << ySize[0] << "\"";
1483 SiFileOut << " stripDirection=\"";
1484 if (stripDirection[0] == LeftToRight)
1485 SiFileOut << "LeftToRight\"";
1486 else
1487 SiFileOut << "RightToLeft\"";
1488 SiFileOut << " lxborder=\"" << xLBorder[0] << "\"";
1489 SiFileOut << " lyborder=\"" << yLBorder[0] << "\"";
1490 SiFileOut << " rxborder=\"" << xRBorder[0] << "\"";
1491 SiFileOut << " ryborder=\"" << yRBorder[0] << "\"";
1492 SiFileOut << ">";
1493
1494 if (isDeadZone == true) {
1495 SiFileOut << "\n";
1496 SiFileOut << "\t\t\t\t<DeadZone>\n";
1497 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1498 SiFileOut << "\t\t\t\t\t<DeadPoint";
1499 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1500 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1501 SiFileOut << " />\n";
1502 }
1503 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1504 }
1505 SiFileOut << "</Layer>\n";
1506 //--------------------------------------------------------------
1507
1508 SiFileOut << "\t\t</Module>\n";
1509 SiFileOut << "\n";
1510 }
1511 }
1512
1513 SiFileOut << "\t</Station>\n";
1514 SiFileOut << "\n";
1515
1516 cout << "------------------------------------------------------------\n";
1517 }
1518
1519 SiFileOut << "</StationSet>\n";
1520
1521 SiFileOut.close();
1522}
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_5stations()
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