BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
GemConfigCalculate_Run8_7stations.C
Go to the documentation of this file.
1/*
2 * Description:
3 * Macro for calculating parameters of GEM detector and writing them
4 * into the XML-file needed for simulation and reconstruction procedures.
5 * The obtained XML-file should be moved into the 'parameters/gem/XMLConfigs' directory
6 *
7 * GEM configuration: Run8 (7 stations)
8 *
9 * Created: 12.05.2020
10 * 02.03.2021 (Updated): radius of hole in active zone (4.0 -> 6.0 cm)
11 * 09.03.2021 (Updated): the form of a 'hole' dead zone changed (square -> 12 sided polygon)
12 * 25.05.2021 (Updated): Z-distance from the target to the first sens. vol. has been increased
13 * 08.12.2022 (Updated): Positions were corrected in accordance with the measurement scheme
14 * 24.01.2023 (updated): half-plane shifts have been added according to the measurement scheme
15 * Author: Baranov D.
16 */
17
18#include "Rtypes.h"
19
20R__ADD_INCLUDE_PATH($VMCWORKDIR)
21
22#include "TString.h"
23
24#include <fstream>
25
26using namespace TMath;
27using namespace std;
28
29// Set Parameters of GEMs -------------------------------------------------------
30const Int_t NStations = 7; // stations in the detector
31const Int_t NMaxModules = 4; // max. number of modules in a station
32
33const Int_t NModulesInStations[NStations] = {4, 4, 4, 4, 4, 4, 4};
34
35//(X-Y-Z)Positions of stations (sensitive volumes)
37 +1.476 /*0*/, +2.614 /*1*/, +3.342 /*2*/, +4.674 /*3*/,
38 +6.303 /*4*/, +8.140 /*5*/, +9.871 /*6*/}; // center of hole for a half-plane nearest to the target
40 -0.148 /*0*/, -0.107 /*1*/, -0.064 /*2*/, -0.120 /*3*/,
41 -0.071 /*4*/, +0.123 /*5*/, -0.050 /*6*/}; // center of hole for a half-plane nearest to the target
43 +61.229 /*0*/, +92.2505 /*1*/, +123.502 /*2*/, +154.679 /*3*/,
44 +185.9235 /*4*/, +217.194 /*5*/, +248.344 /*6*/}; // half-plane nearest to the target
45
46const Double_t xShift[NStations] = {-0.004 /*0*/, 0.0 /*1*/, +0.102 /*2*/, +0.05 /*3*/,
47 +0.067 /*4*/, +0.098 /*5*/, +0.045 /*6*/};
48const Double_t yShift[NStations] = {+0.125 /*0*/, 0.0 /*1*/, +0.131 /*2*/, +0.046 /*3*/,
49 +0.136 /*4*/, -0.197 /*5*/, +0.122 /*6*/};
50const Double_t zShift[NStations] = {+3.998 /*0*/, +4.101 /*1*/, +4.0785 /*2*/, +4.055 /*3*/,
51 +4.0985 /*4*/, +3.903 /*5*/, +4.1075 /*6*/};
52
53//(X-Y-Z)Shifts of modules in each station
55 {163.2 * 0.25 + xShift[0], -163.2 * 0.25 + xShift[0], // st. 0 (upper h. plane)
56 163.2 * 0.25, -163.2 * 0.25}, // st. 0 (lower h. plane)
57
58 {163.2 * 0.25, -163.2 * 0.25, // st. 1 (upper h. plane)
59 163.2 * 0.25 + xShift[1], -163.2 * 0.25 + xShift[1]}, // st. 1 (lower h. plane)
60
61 {163.2 * 0.25 + xShift[2], -163.2 * 0.25 + xShift[2], // st. 2 (upper h. plane)
62 163.2 * 0.25, -163.2 * 0.25}, // st. 2 (lower h. plane)
63
64 {163.2 * 0.25, -163.2 * 0.25, // st. 3 (upper h. plane)
65 163.2 * 0.25 + xShift[3], -163.2 * 0.25 + xShift[3]}, // st. 3 (lower h. plane)
66
67 {163.2 * 0.25 + xShift[4], -163.2 * 0.25 + xShift[4], // st. 4 (upper h. plane)
68 163.2 * 0.25, -163.2 * 0.25}, // st. 4 (lower h. plane)
69
70 {163.2 * 0.25, -163.2 * 0.25, // st. 5 (upper h. plane)
71 163.2 * 0.25 + xShift[5], -163.2 * 0.25 + xShift[5]}, // st. 5 (lower h. plane)
72
73 {163.2 * 0.25 + xShift[6], -163.2 * 0.25 + xShift[6], // st. 6 (upper h. plane)
74 163.2 * 0.25, -163.2 * 0.25} // st. 6 (lower h. plane)
75};
77 {+22.5 + yShift[0], +22.5 + yShift[0], // st. 0 (upper h. plane)
78 -19.5, -19.5}, // st. 0 (lower h. plane)
79
80 {+22.5, +22.5, // st. 1 (upper h. plane)
81 -19.5 + yShift[1], -19.5 + yShift[1]}, // st. 1 (lower h. plane)
82
83 {+22.5 + yShift[2], +22.5 + yShift[2], // st. 2 (upper h. plane)
84 -19.5, -19.5}, // st. 2 (lower h. plane)
85
86 {+22.5, +22.5, // st. 3 (upper h. plane)
87 -19.5 + yShift[3], -19.5 + yShift[3]}, // st. 3 (lower h. plane)
88
89 {+22.5 + yShift[4], +22.5 + yShift[4], // st. 4 (upper h. plane)
90 -19.5, -19.5}, // st. 4 (lower h. plane)
91
92 {+22.5, +22.5, // st. 5 (upper h. plane)
93 -19.5 + yShift[5], -19.5 + yShift[5]}, // st. 5 (lower h. plane)
94
95 {+22.5 + yShift[6], +22.5 + yShift[6], // st. 6 (upper h. plane)
96 -19.5, -19.5} // st. 6 (lower h. plane)
97
98};
100 {zShift[0], zShift[0], 0.0, 0.0}, // st. 0
101 {0.0, 0.0, zShift[1], zShift[1]}, // st. 1
102 {zShift[2], zShift[2], 0.0, 0.0}, // st. 2
103 {0.0, 0.0, zShift[3], zShift[3]}, // st. 3
104 {zShift[4], zShift[4], 0.0, 0.0}, // st. 4
105 {0.0, 0.0, zShift[5], zShift[5]}, // st. 5
106 {zShift[6], zShift[6], 0.0, 0.0} // st. 6
107};
108
109/*
110 * Basic station:
111 *
112 * -------------------- --------------------
113 * | | |
114 * | module 0 | module 1 | ^ beam direction (Z)
115 * | | | /
116 * | ------------|-------------- | /
117 * | / | / | /
118 * | / | / |/
119 * -----------------------------------------
120 * | \ | \ |
121 * | \ | \ |
122 * | \___________|______________\ |
123 * | | |
124 * | | |
125 * | module 3 | module 4 |
126 * -----------------------------------------
127 *
128 */
129
130// rotations of stations around y-axis by 180 deg.
131const Bool_t YStationRotations[NStations] = {true /*0*/, false /*1*/, true /*2*/, false /*3*/,
132 true /*4*/, false /*5*/, true /*6*/};
133
134// rotations of stations around x-axis by 180 deg.
135const Bool_t XStationRotations[NStations] = {false /*0*/, false /*1*/, false /*2*/, false /*3*/,
136 false /*4*/, false /*5*/, false /*6*/};
137
138// drift direction in each module ("true" is "forward", "false" is "backward")
140 {false, false, true, true}, // st. 0
141 {true, true, false, false}, // st. 1
142 {false, false, true, true}, // st. 2
143 {true, true, false, false}, // st. 3
144 {false, false, true, true}, // st. 4
145 {true, true, false, false}, // st. 5
146 {false, false, true, true} // st. 6
147};
148
149// thicknesses of gaps inside a GEM chamber (for all modules)
154
155// upper half-plane (type UHP with sizes of 163.2 x 45.0 cm) --------------------
156const Double_t StripPitch_UHP = 0.08; // cm
157
160
163
164const Double_t XHotZoneLayerSize_InclinedStrips_UHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
165const Double_t YHotZoneLayerSize_InclinedStrips_UHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
166//------------------------------------------------------------------------------
167
168// lower half-plane (type LHP with sizes of 163.2 x 39.0 cm) --------------------
169const Double_t StripPitch_LHP = 0.08; // cm
170
173
176
177const Double_t XHotZoneLayerSize_InclinedStrips_LHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
178const Double_t YHotZoneLayerSize_InclinedStrips_LHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
179//------------------------------------------------------------------------------
180
182
183const Int_t ZoneTypeOfLayers[NLayersInModule] = {0, 0, 1, 1}; // 0 - main, 1 - hot zone
184const char* StripTypeOfLayes[NLayersInModule] = {"lower", "upper", "lower",
185 "upper"}; // "lower" is straight strips, "upper " is inclined strips
186
187// stereo angle for all layers with inclined strips in each module of a basic station
189 -15.0}; // deg. (plus - clockwise, minus - anticlockwise)
190
197
199
200// dead zones (upper half-plane) ------------------------------------------------
207
214
221
228
235
253
254//------------------------------------------------------------------------------
255
256// dead zones (lower half-plane) ------------------------------------------------
263
270
277
284
291
309
310//------------------------------------------------------------------------------
311
312// Function declarations
313// void PrintInfo();
314void CalculateParameters(TString config_name, TString author, TString date);
315//------------------------------------------------------------------------------
316
318{
319
320 TString ConfigName = "GemRun8";
321 TString AuthorName = "Baranov D.";
322 TString DateCreated = "18.01.2021";
323
324 // PrintInfo();
325 CalculateParameters(ConfigName, AuthorName, DateCreated);
326
327 cout << "It's the end" << "\n";
328 // gApplication->Terminate();
329}
330//------------------------------------------------------------------------------
331
332void CalculateParameters(TString config_name, TString author, TString date)
333{
334
335 TString FileName = config_name + TString(".xml");
336
337 cout << "\nCreating XML configuration file...\n";
338 cout << " Configuration name: " << config_name << "\n";
339 cout << " Author: " << author << "\n";
340 cout << " Date created: " << date << "\n";
341 cout << " 02.03.2021 (Updated): radius of hole in active zone (4.0 -> 6.0 cm)\n";
342 cout << " 09.03.2021 (Updated): the form of a 'hole' dead zone changed (square -> 12 sided polygon) \n";
343 cout << " 25.05.2021 (Updated): Z-distance from the target to the first sens. vol. has been increased \n";
344 cout << " 08.12.2022 (Updated): Positions were corrected in accordance with the measurement scheme \n";
345 cout << " 24.01.2023 (updated): half-plane shifts have been added according to the measurement scheme \n";
346 cout << " File path: " << FileName << "\n";
347 cout << "\n";
348
349 // WARNING(!!!): the file will be written in the current directory
350 ofstream FileOut(FileName.Data(), ios::out);
351
352 FileOut << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
353
354 // reference frame usage comment
355 FileOut << "<!--\
356 \r\tConfig: "
357 << config_name << "\
358 \r\tAuthor: "
359 << author << "\
360 \r\tDate: "
361 << date << "\
362 \r\t02.03.2021 (Updated): radius of hole in active zone (4.0 -> 6.0 cm)\
363 \r\t09.03.2021 (Updated): the form of a 'hole' dead zone changed (square -> 12 sided polygon)\
364 \r\t25.05.2021 (Updated): Z-distance from the target to the first sens. vol. has been increased\
365 \r\t08.12.2022 (Updated): Positions were corrected in accordance with the measurement scheme\
366 \r\t24.01.2023 (updated): half-plane shifts have been added according to the measurement scheme\n\
367 \r\tA right-handed coordinates are used.\
368 \r\tIf you look at the GEMs from the target:\
369 \r\t\tx-axis is directed to the left,\
370 \r\t\ty-axis - to the top,\
371 \r\t\tz-axis - to the GEMs.\
372 \r-->\n\n";
373
374 FileOut << "<StationSet>\n";
375 FileOut << "\n";
376
377 for (Int_t istation = 0; istation < NStations; ++istation) {
378
379 // cout << "istation = " << istation << ": -----------------------------\n";
380
381 FileOut << "<!-- Station " << istation << " -->\n"; // comment
382
383 FileOut << "\t<Station";
384 FileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
385 FileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
386 FileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
387 FileOut << " beamHole=\"" << HoleRadius << "\"";
388 FileOut << ">\n";
389 FileOut << "\n";
390
391 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
392
393 // cout << " imodule = " << imodule << "\n";
394
395 FileOut << "\t\t<!-- module " << imodule << " -->\n"; // comment
396
397 FileOut << "\t\t<Module";
398 FileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
399 FileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
400 FileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
401 FileOut << " driftDirection=\"" << (DriftDirectionInModules[istation][imodule] ? "forward" : "backward")
402 << "\"";
403 FileOut << " gap_drift_thick=\"" << Gap_Drift_Thickness << "\"";
404 FileOut << " gap_ftransf_thick=\"" << Gap_FirstTransfer_Thickness << "\"";
405 FileOut << " gap_stransf_thick=\"" << Gap_SecondTransfer_Thickness << "\"";
406 FileOut << " gap_induct_thick=\"" << Gap_Induction_Thickness << "\"";
407 FileOut << ">\n";
408
409 for (Int_t ilayer = 0; ilayer < NLayersInModule; ++ilayer) {
410
411 // cout << " ilayer = " << ilayer << "\n";
412
413 FileOut << "\t\t\t<Layer";
414
415 FileOut << " zoneNumber=\"" << ZoneTypeOfLayers[ilayer] << "\"";
416 FileOut << " type=\"" << StripTypeOfLayes[ilayer] << "\"";
417
418 // define a strip angle for the current layer
419 Double_t layer_angle;
420 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) {
421 layer_angle = 0.0;
422 } else {
423 layer_angle = StripStereoAngleInModules[imodule];
424 if (YStationRotations[istation] ^ XStationRotations[istation])
425 layer_angle *= -1;
426 }
427
428 FileOut << " stripAngle=\"" << layer_angle << "\"";
429 if (imodule == 0 || imodule == 1)
430 FileOut << " pitch=\"" << StripPitch_UHP << "\"";
431 if (imodule == 2 || imodule == 3)
432 FileOut << " pitch=\"" << StripPitch_LHP << "\"";
433
434 // define 'xorig' and 'yorig' coordinates (left bottom point), 'xsize' and 'ysize'
435 Double_t xorig = 0.0; // default
436 Double_t yorig = 0.0; // default
437 Double_t xsize = 0.0; // default
438 Double_t ysize = 0.0; // default
439
440 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
441 if (imodule == 0 || imodule == 1) {
442 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
443 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
446 }
447 if (imodule == 2 || imodule == 3) {
448 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
449 yorig = 0.0 - YMainZoneLayerSize_LHP * 0.5;
452 }
453 } else { // hot zone
454 switch (imodule) {
455 case 0:
456 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) {
458 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
461 } else {
463 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
466 }
467 break;
468
469 case 1:
470 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) {
471 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
472 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
475 } else {
476 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
477 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
480 }
481 break;
482
483 case 2:
484 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) {
489 } else {
494 }
495 break;
496
497 case 3:
498 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) {
499 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
503 } else {
504 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
508 }
509 break;
510 }
511 }
512
513 FileOut << " xorig=\"" << xorig << "\"";
514 FileOut << " yorig=\"" << yorig << "\"";
515 FileOut << " xsize=\"" << xsize << "\"";
516 FileOut << " ysize=\"" << ysize << "\"";
517
518 if (YStationRotations[istation] == false)
519 FileOut << " stripDirection=\"" << "LeftToRight" << "\"";
520 else
521 FileOut << " stripDirection=\"" << "RightToLeft" << "\"";
522
523 // define 'lborder' and 'rborder'
524 TString lborder = "";
525 TString rborder = "";
526
527 switch (imodule) {
528 case 0:
529 if (YStationRotations[istation] == false) {
530 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
531 lborder = "LeftTop";
532 rborder = "RightBottom";
533 } else { // hot zone
534 lborder = "LeftBottom";
535 rborder = "RightBottom";
536 }
537 } else {
538 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
539 lborder = "LeftBottom";
540 rborder = "RightTop";
541 } else { // hot zone
542 lborder = "LeftTop";
543 rborder = "RightTop";
544 }
545 }
546 break;
547
548 case 1:
549 if (YStationRotations[istation] == false) {
550 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
551 lborder = "LeftTop";
552 rborder = "RightBottom";
553 } else { // hot zone
554 lborder = "LeftTop";
555 rborder = "RightTop";
556 }
557 } else {
558 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
559 lborder = "LeftBottom";
560 rborder = "RightTop";
561 } else { // hot zone
562 lborder = "LeftBottom";
563 rborder = "RightBottom";
564 }
565 }
566 break;
567
568 case 2:
569 if (YStationRotations[istation] == false) {
570 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
571 lborder = "LeftBottom";
572 rborder = "RightTop";
573 } else { // hot zone
574 lborder = "LeftTop";
575 rborder = "RightTop";
576 }
577 } else {
578 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
579 lborder = "LeftTop";
580 rborder = "RightBottom";
581 } else { // hot zone
582 lborder = "LeftBottom";
583 rborder = "RightBottom";
584 }
585 }
586 break;
587
588 case 3:
589 if (YStationRotations[istation] == false) {
590 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
591 lborder = "LeftBottom";
592 rborder = "RightTop";
593 } else { // hot zone
594 lborder = "LeftBottom";
595 rborder = "RightBottom";
596 }
597 } else {
598 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
599 lborder = "LeftTop";
600 rborder = "RightBottom";
601 } else { // hot zone
602 lborder = "LeftTop";
603 rborder = "RightTop";
604 }
605 }
606 break;
607 }
608
609 FileOut << " lborder=\"" << lborder << "\"";
610 FileOut << " rborder=\"" << rborder << "\"";
611 FileOut << ">\n";
612
613 // add dead zones
614
615 switch (imodule) {
616 // module 0 -------------------------------------------------
617 case 0:
618 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
619 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) { // straight strips
620 FileOut << "\t\t\t\t<DeadZone>\n";
621 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
622 FileOut << "\t\t\t\t\t<DeadPoint";
623 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] << "\"";
624 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
625 FileOut << "/>\n";
626 }
627 FileOut << "\t\t\t\t</DeadZone>\n";
628 } else { // inclined strips
629 FileOut << "\t\t\t\t<DeadZone>\n";
630 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
631 FileOut << "\t\t\t\t\t<DeadPoint";
632 if (YStationRotations[istation] == false) {
633 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] << "\"";
634 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
635 } else {
636 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] << "\"";
637 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
638 }
639 FileOut << "/>\n";
640 }
641 FileOut << "\t\t\t\t</DeadZone>\n";
642 }
643 } else { // hot zone
644 FileOut << "\t\t\t\t<DeadZone>"; // hole
645 FileOut << " <!-- hole -->\n";
646 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
647 FileOut << "\t\t\t\t\t<DeadPoint";
648 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] << "\"";
649 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
650 FileOut << "/>\n";
651 }
652 FileOut << "\t\t\t\t</DeadZone>\n";
653
654 if (TString(StripTypeOfLayes[ilayer]) == TString("upper")) { // inclined strips
655 FileOut << "\t\t\t\t<DeadZone>"; // triangle
656 FileOut << " <!-- triangle -->\n";
657 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
658 FileOut << "\t\t\t\t\t<DeadPoint";
659 if (YStationRotations[istation] == false) {
660 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] << "\"";
661 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
662 } else {
663 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] << "\"";
664 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
665 }
666 FileOut << "/>\n";
667 }
668 FileOut << "\t\t\t\t</DeadZone>\n";
669 }
670 }
671 break;
672 //----------------------------------------------------------
673 // module 1 -------------------------------------------------
674 case 1:
675 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
676 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) { // straight strips
677 FileOut << "\t\t\t\t<DeadZone>\n";
678 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
679 FileOut << "\t\t\t\t\t<DeadPoint";
680 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] * (-1) << "\"";
681 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
682 FileOut << "/>\n";
683 }
684 FileOut << "\t\t\t\t</DeadZone>\n";
685 } else { // inclined strips
686 FileOut << "\t\t\t\t<DeadZone>\n";
687 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
688 FileOut << "\t\t\t\t\t<DeadPoint";
689 if (YStationRotations[istation] == false) {
690 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] * (-1) << "\"";
691 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
692 } else {
693 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] * (-1) << "\"";
694 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
695 }
696 FileOut << "/>\n";
697 }
698 FileOut << "\t\t\t\t</DeadZone>\n";
699 }
700 } else { // hot zone
701 FileOut << "\t\t\t\t<DeadZone>"; // hole
702 FileOut << " <!-- hole -->\n";
703 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
704 FileOut << "\t\t\t\t\t<DeadPoint";
705 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] * (-1) << "\"";
706 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
707 FileOut << "/>\n";
708 }
709 FileOut << "\t\t\t\t</DeadZone>\n";
710
711 if (TString(StripTypeOfLayes[ilayer]) == TString("upper")) { // inclined strips
712 FileOut << "\t\t\t\t<DeadZone>"; // triangle
713 FileOut << " <!-- triangle -->\n";
714 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
715 FileOut << "\t\t\t\t\t<DeadPoint";
716 if (YStationRotations[istation] == false) {
717 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] * (-1) << "\"";
718 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
719 } else {
720 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] * (-1) << "\"";
721 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
722 }
723 FileOut << "/>\n";
724 }
725 FileOut << "\t\t\t\t</DeadZone>\n";
726 }
727 }
728 break;
729 //----------------------------------------------------------
730 // module 2 -------------------------------------------------
731 case 2:
732 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
733 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) { // straight strips
734 FileOut << "\t\t\t\t<DeadZone>\n";
735 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
736 FileOut << "\t\t\t\t\t<DeadPoint";
737 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] << "\"";
738 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
739 FileOut << "/>\n";
740 }
741 FileOut << "\t\t\t\t</DeadZone>\n";
742 } else { // inclined strips
743 FileOut << "\t\t\t\t<DeadZone>\n";
744 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
745 FileOut << "\t\t\t\t\t<DeadPoint";
746 if (YStationRotations[istation] == false) {
747 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] << "\"";
748 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
749 } else {
750 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] << "\"";
751 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
752 }
753 FileOut << "/>\n";
754 }
755 FileOut << "\t\t\t\t</DeadZone>\n";
756 }
757 } else { // hot zone
758 FileOut << "\t\t\t\t<DeadZone>"; // hole
759 FileOut << " <!-- hole -->\n";
760 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
761 FileOut << "\t\t\t\t\t<DeadPoint";
762 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] << "\"";
763 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
764 FileOut << "/>\n";
765 }
766 FileOut << "\t\t\t\t</DeadZone>\n";
767
768 if (TString(StripTypeOfLayes[ilayer]) == TString("upper")) { // inclined strips
769 FileOut << "\t\t\t\t<DeadZone>"; // triangle
770 FileOut << " <!-- triangle -->\n";
771 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
772 FileOut << "\t\t\t\t\t<DeadPoint";
773 if (YStationRotations[istation] == false) {
774 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] << "\"";
775 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
776 } else {
777 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] << "\"";
778 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
779 }
780 FileOut << "/>\n";
781 }
782 FileOut << "\t\t\t\t</DeadZone>\n";
783 }
784 }
785 break;
786 //----------------------------------------------------------
787 // module 3 -------------------------------------------------
788 case 3:
789 if (ZoneTypeOfLayers[ilayer] == 0) { // main zone
790 if (TString(StripTypeOfLayes[ilayer]) == TString("lower")) { // straight strips
791 FileOut << "\t\t\t\t<DeadZone>\n";
792 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
793 FileOut << "\t\t\t\t\t<DeadPoint";
794 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
795 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
796 FileOut << "/>\n";
797 }
798 FileOut << "\t\t\t\t</DeadZone>\n";
799 } else { // inclined strips
800 FileOut << "\t\t\t\t<DeadZone>\n";
801 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
802 FileOut << "\t\t\t\t\t<DeadPoint";
803 if (YStationRotations[istation] == false) {
804 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
805 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
806 } else {
807 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
808 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
809 }
810 FileOut << "/>\n";
811 }
812 FileOut << "\t\t\t\t</DeadZone>\n";
813 }
814 } else { // hot zone
815 FileOut << "\t\t\t\t<DeadZone>"; // hole
816 FileOut << " <!-- hole -->\n";
817 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
818 FileOut << "\t\t\t\t\t<DeadPoint";
819 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
820 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
821 FileOut << "/>\n";
822 }
823 FileOut << "\t\t\t\t</DeadZone>\n";
824
825 if (TString(StripTypeOfLayes[ilayer]) == TString("upper")) { // inclined strips
826 FileOut << "\t\t\t\t<DeadZone>"; // triangle
827 FileOut << " <!-- triangle -->\n";
828 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
829 FileOut << "\t\t\t\t\t<DeadPoint";
830 if (YStationRotations[istation] == false) {
831 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
832 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
833 } else {
834 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
835 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
836 }
837 FileOut << "/>\n";
838 }
839 FileOut << "\t\t\t\t</DeadZone>\n";
840 }
841 }
842 break;
843 //----------------------------------------------------------
844 }
845 FileOut << "\t\t\t</Layer>\n";
846 }
847 FileOut << "\t\t</Module>\n";
848 FileOut << "\n";
849 }
850 FileOut << "\t</Station>\n";
851 FileOut << "\n";
852
853 // cout << "------------------------------------------------------------\n";
854 }
855
856 FileOut << "</StationSet>\n";
857
858 FileOut.close();
859}
bool Bool_t
int Int_t
unsigned int UInt_t
double Double_t
#define R__ADD_INCLUDE_PATH(PATH)
StripNumberingDirection
@ RightToLeft
@ LeftToRight
const char * Data() const
const Double_t YStationPositions[NStations]
const Int_t NMaxModules
const Double_t ZStationPositions[NStations]
const Int_t NStations
const Double_t XStationPositions[NStations]
const Double_t XHotZoneLayerSize_InclinedStrips_LHP[2]
Double_t YDeadZone_Hole_LHP[NPoints_DeadZone_Hole_LHP]
const Double_t yShift[NStations]
const Double_t Gap_Drift_Thickness
const Double_t XHotZoneLayerSize_StraightStrips_LHP
const Int_t ZoneTypeOfLayers[NLayersInModule]
Double_t YDeadZone_TrapLeft_UHP[4]
const Double_t xShift[NStations]
const Bool_t XStationRotations[NStations]
Double_t YDeadZone_TrianRight_UHP[3]
Double_t YDeadZone_TrianLeft_UHP[3]
Double_t XDeadZone_Hole_UHP[NPoints_DeadZone_Hole_UHP]
const Double_t zShift[NStations]
const Double_t XMainZoneLayerSize_UHP
const Double_t Gap_FirstTransfer_Thickness
const Double_t Gap_Induction_Thickness
const Int_t NModulesInStations[NStations]
Double_t XDeadZone_TrianLeft_LHP[3]
const Bool_t YStationRotations[NStations]
const Double_t YMainZoneLayerSize_UHP
const Double_t YHotZoneLayerSize_InclinedStrips_LHP
Double_t XDeadZone_TrianRight_LHP[3]
Double_t YDeadZone_Rect_UHP[4]
const Double_t XHotZoneLayerSize_InclinedStrips_UHP[2]
const Double_t YHotZoneLayerSize_StraightStrips_LHP
const Double_t XHotZoneLayerSize_StraightStrips_UHP
const Double_t StripPitch_UHP
const Double_t YHotZoneLayerSize_StraightStrips_UHP
const UInt_t NPoints_DeadZone_Hole_UHP
Double_t YDeadZone_TrianLeft_LHP[3]
const Int_t NLayersInModule
Double_t YDeadZone_TrapRight_UHP[4]
Double_t YDeadZone_TrianRight_LHP[3]
const Double_t StripPitch_LHP
const Double_t XMainZoneLayerSize_LHP
Double_t XDeadZone_TrapLeft_UHP[4]
StripNumberingDirection StripDirection[2]
Double_t XDeadZone_Rect_LHP[4]
Double_t YDeadZone_Rect_LHP[4]
const Double_t YHotZoneLayerSize_InclinedStrips_UHP
Double_t XDeadZone_TrapRight_UHP[4]
Double_t XDeadZone_TrapLeft_LHP[4]
Double_t XDeadZone_Rect_UHP[4]
const Double_t YMainZoneLayerSize_LHP
const Bool_t DriftDirectionInModules[NStations][NMaxModules]
Double_t XDeadZone_TrianLeft_UHP[3]
Double_t YDeadZone_Hole_UHP[NPoints_DeadZone_Hole_UHP]
Double_t YDeadZone_TrapRight_LHP[4]
const Double_t Gap_SecondTransfer_Thickness
Double_t XDeadZone_TrianRight_UHP[3]
Double_t XDeadZone_TrapRight_LHP[4]
const char * StripTypeOfLayes[NLayersInModule]
const Double_t StripStereoAngleInModules[NLayersInModule]
Double_t YDeadZone_TrapLeft_LHP[4]
const UInt_t NPoints_DeadZone_Hole_LHP
Double_t XDeadZone_Hole_LHP[NPoints_DeadZone_Hole_LHP]
void GemConfigCalculate_Run8_7stations()
constexpr Double_t DegToRad()
Double_t Sqrt(Double_t x)
Double_t Cos(Double_t)
Definition json.hpp:4446