BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
GemConfigCalculate_Run9.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: Run9 (8 stations)
8 *
9 *
10 * Author: Baranov D.
11 * Date: 07.04.2025 (created)
12 * 22.04.2025 (st.3 z-pos. corrected)
13 */
14
15#include "Rtypes.h"
16
17R__ADD_INCLUDE_PATH($VMCWORKDIR)
18
19#include "TString.h"
20
21#include <fstream>
22
23using namespace TMath;
24using namespace std;
25
26// Set Parameters of GEMs -------------------------------------------------------
27const Int_t NStations = 8; // stations in the detector
28const Int_t NMaxModules = 4; // max. number of modules in a station
29
30const Int_t NModulesInStations[NStations] = {4, 4, 4, 4, 4, 4, 4, 1};
31
32// X-position of the hole center for the plane closest to the target (in a station)
34 +1.419, // 0 st. (M15)
35 +2.529, // 1 st. (M10)
36 +3.408, // 2 st. (M14)
37 +4.697, // 3 st. (M8)
38 +6.335, // 4 st. (M16)
39 +8.213, // 5 st. (M7)
40 +9.784, // 6 st. (M12)
41 +50.494 // 7 st. (small GEM)
42};
43
44// Y-position of the hole center for the plane closest to the target (in a station)
46 -0.032, // 0 st. (M15)
47 +0.123, // 1 st. (M10)
48 +0.026, // 2 st. (M14)
49 -0.013, // 3 st. (M8),
50 -0.026, // 4 st. (M16)
51 +0.058, // 5 st. (M7)
52 -0.048, // 6 st. (M12)
53 -0.186 // 7 st. (small GEM)
54};
55
56// Z-position of gas volume for the plane closest to the target (in a station)
58 +61.107, // 0 st. (M15)
59 +92.313, // 1 st. (M10)
60 +123.541, // 2 st. (M14)
61 +154.778, // 3 st. (M8)
62 +185.458, // 4 st. (M16)
63 +217.141, // 5 st. (M7)
64 +248.367, // 6 st. (M12)
65 +792.532 // 7 st. (small GEM)
66};
67
68// Shifts for the second plane in a station relative to the closest half-plane
70 +0.111, // 0 st. (M6)
71 +0.142, // 1 st. (M13)
72 +0.081, // 2 st. (M11)
73 +0.100, // 3 st. (M18)
74 +0.092, // 4 st. (M5)
75 +0.113, // 5 st. (M17)
76 +0.155, // 6 st. (M9)
77 +0.0 // 7 st. (small GEM)
78};
80 +0.008, // 0 st. (M6)
81 -0.100, // 1 st. (M13)
82 +0.048, // 2 st. (M11)
83 +0.042, // 3 st. (M18)
84 +0.109, // 4 st. (M5)
85 -0.089, // 5 st. (M17)
86 +0.168, // 6 st. (M9)
87 +0.0 // 7 st. (small GEM)
88};
90 +4.691, // 0 st. (M6)
91 +4.158, // 1 st. (M13)
92 +4.672, // 2 st. (M11)
93 +4.124, // 3 st. (M18)
94 +4.683, // 4 st. (M5)
95 +3.995, // 5 st. (M17)
96 +4.063, // 6 st. (M9)
97 +0.0 // 7 st. (small GEM)
98};
99
100//(X-Y-Z)Shifts of modules in each station
102 {163.2 * 0.25 + xShift[0], -163.2 * 0.25 + xShift[0], // 0 st. (upper h. plane)
103 163.2 * 0.25, -163.2 * 0.25}, // 0 st. (lower h. plane)
104
105 {163.2 * 0.25, -163.2 * 0.25, // 1 st. (upper h. plane)
106 163.2 * 0.25 + xShift[1], -163.2 * 0.25 + xShift[1]}, // 1 st. (lower h. plane)
107
108 {163.2 * 0.25 + xShift[2], -163.2 * 0.25 + xShift[2], // 2 st. (upper h. plane)
109 163.2 * 0.25, -163.2 * 0.25}, // 2 st. (lower h. plane)
110
111 {163.2 * 0.25, -163.2 * 0.25, // 3 st. (upper h. plane)
112 163.2 * 0.25 + xShift[3], -163.2 * 0.25 + xShift[3]}, // 3 st. (lower h. plane)
113
114 {163.2 * 0.25 + xShift[4], -163.2 * 0.25 + xShift[4], // 4 st. (upper h. plane)
115 163.2 * 0.25, -163.2 * 0.25}, // 4 st. (lower h. plane)
116
117 {163.2 * 0.25, -163.2 * 0.25, // 5 st. (upper h. plane)
118 163.2 * 0.25 + xShift[5], -163.2 * 0.25 + xShift[5]}, // 5 st. (lower h. plane)
119
120 {163.2 * 0.25 + xShift[6], -163.2 * 0.25 + xShift[6], // 6 st. (upper h. plane)
121 163.2 * 0.25, -163.2 * 0.25}, // 6 st. (lower h. plane)
122
123 {0.0} // 7 st.
124};
126 {+22.5 + yShift[0], +22.5 + yShift[0], // 0 st. (upper h. plane)
127 -19.5, -19.5}, // 0 st. (lower h. plane)
128
129 {+22.5, +22.5, // 1 st. (upper h. plane)
130 -19.5 + yShift[1], -19.5 + yShift[1]}, // 1 st. (lower h. plane)
131
132 {+22.5 + yShift[2], +22.5 + yShift[2], // 2 st. (upper h. plane)
133 -19.5, -19.5}, // 2 st. (lower h. plane)
134
135 {+22.5, +22.5, // 3 st. (upper h. plane)
136 -19.5 + yShift[3], -19.5 + yShift[3]}, // 3 st. (lower h. plane)
137
138 {+22.5 + yShift[4], +22.5 + yShift[4], // 4 st. (upper h. plane)
139 -19.5, -19.5}, // 4 st. (lower h. plane)
140
141 {+22.5, +22.5, // 5 st. (upper h. plane)
142 -19.5 + yShift[5], -19.5 + yShift[5]}, // 5 st. (lower h. plane)
143
144 {+22.5 + yShift[6], +22.5 + yShift[6], // 6 st. (upper h. plane)
145 -19.5, -19.5}, // 6 st. (lower h. plane)
146
147 {0.0} // 7 st.
148};
150 {zShift[0], zShift[0], 0.0, 0.0}, // 0 st.
151 {0.0, 0.0, zShift[1], zShift[1]}, // 1 st.
152 {zShift[2], zShift[2], 0.0, 0.0}, // 2 st.
153 {0.0, 0.0, zShift[3], zShift[3]}, // 3 st.
154 {zShift[4], zShift[4], 0.0, 0.0}, // 4 st.
155 {0.0, 0.0, zShift[5], zShift[5]}, // 5 st.
156 {zShift[6], zShift[6], 0.0, 0.0}, // 6 st.
157 {0.0} // 7 st.
158};
159
160/*
161 * Basic station:
162 *
163 * -------------------- --------------------
164 * | | |
165 * | module 0 | module 1 | ^ beam direction (Z)
166 * | | | /
167 * | ------------|-------------- | /
168 * | / | / | /
169 * | / | / |/
170 * -----------------------------------------
171 * | \ | \ |
172 * | \ | \ |
173 * | \___________|______________\ |
174 * | | |
175 * | | |
176 * | module 2 | module 3 |
177 * -----------------------------------------
178 *
179 */
180
181// rotations of stations around y-axis by 180 deg.
182const Bool_t YStationRotations[NStations] = {true /*0*/, false /*1*/, true /*2*/, false /*3*/,
183 true /*4*/, false /*5*/, true /*6*/, false /*7*/};
184
185// rotations of stations around x-axis by 180 deg.
186const Bool_t XStationRotations[NStations] = {false /*0*/, false /*1*/, false /*2*/, false /*3*/,
187 false /*4*/, false /*5*/, false /*6*/, false /*7*/};
188
189// drift direction in each module ("true" is "forward", "false" is "backward")
191 {false, false, true, true}, // st. 0
192 {true, true, false, false}, // st. 1
193 {false, false, true, true}, // st. 2
194 {true, true, false, false}, // st. 3
195 {false, false, true, true}, // st. 4
196 {true, true, false, false}, // st. 5
197 {false, false, true, true}, // st. 6
198 {true} // st. 7
199};
200
201// thicknesses of gaps inside a GEM chamber (for all modules)
206
207// upper half-plane (type UHP with sizes of 163.2 x 45.0 cm) --------------------
208const Double_t StripPitch_UHP = 0.08; // cm
209
212
215
216const Double_t XHotZoneLayerSize_InclinedStrips_UHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
217const Double_t YHotZoneLayerSize_InclinedStrips_UHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
218//------------------------------------------------------------------------------
219
220// lower half-plane (type LHP with sizes of 163.2 x 39.0 cm) --------------------
221const Double_t StripPitch_LHP = 0.08; // cm
222
225
228
229const Double_t XHotZoneLayerSize_InclinedStrips_LHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
230const Double_t YHotZoneLayerSize_InclinedStrips_LHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
231//------------------------------------------------------------------------------
232
233// small GEM (type SMALL with sizes of 10.0 x 10.0 cm) --------------------------
234const Double_t StripPitch_SMALL = 0.04; // cm
235
238//------------------------------------------------------------------------------
239
241const Int_t NLayersInModule[NStations] = {4, 4, 4, 4, 4, 4, 4, 2 /*smallGEM*/};
242
244 // 0 - main, 1 - hot zone
245 {0, 0, 1, 1}, // st. 0
246 {0, 0, 1, 1}, // st. 1
247 {0, 0, 1, 1}, // st. 2
248 {0, 0, 1, 1}, // st. 3
249 {0, 0, 1, 1}, // st. 4
250 {0, 0, 1, 1}, // st. 5
251 {0, 0, 1, 1}, // st. 6
252 {0, 0} // st. 7 (small GEM)
253};
254
256 // "lower" is straight strips, "upper " is inclined strips
257 {"lower", "upper", "lower", "upper"}, // st. 0
258 {"lower", "upper", "lower", "upper"}, // st. 1
259 {"lower", "upper", "lower", "upper"}, // st. 2
260 {"lower", "upper", "lower", "upper"}, // st. 3
261 {"lower", "upper", "lower", "upper"}, // st. 4
262 {"lower", "upper", "lower", "upper"}, // st. 5
263 {"lower", "upper", "lower", "upper"}, // st. 6
264 {"lower", "upper"} // st. 7 (small GEM)
265};
266
267// stereo angle for all layers with inclined strips in each module of a basic station
269 // deg. (plus - clockwise, minus - anticlockwise)
270 {+15.0, +15.0, -15.0, -15.0}, // st. 0
271 {+15.0, +15.0, -15.0, -15.0}, // st. 1
272 {+15.0, +15.0, -15.0, -15.0}, // st. 2
273 {+15.0, +15.0, -15.0, -15.0}, // st. 3
274 {+15.0, +15.0, -15.0, -15.0}, // st. 4
275 {+15.0, +15.0, -15.0, -15.0}, // st. 5
276 {+15.0, +15.0, -15.0, -15.0}, // st. 6
277 {+90.0} // st. 7 (small GEM)
278};
279
286
288
289// dead zones (upper half-plane) ------------------------------------------------
296
303
310
317
324
342
343//------------------------------------------------------------------------------
344
345// dead zones (lower half-plane) ------------------------------------------------
352
359
366
373
380
398
399//------------------------------------------------------------------------------
400
401// Function declarations
402// void PrintInfo();
403void CalculateParameters(TString config_name, TString author, TString date);
404//------------------------------------------------------------------------------
405
407{
408
409 TString ConfigName = "GemRun9";
410 TString AuthorName = "Baranov D.";
411 TString DateCreated = "22.04.2025";
412
413 // PrintInfo();
414 CalculateParameters(ConfigName, AuthorName, DateCreated);
415
416 cout << "It's the end"
417 << "\n";
418 // gApplication->Terminate();
419}
420//------------------------------------------------------------------------------
421
422void CalculateParameters(TString config_name, TString author, TString date)
423{
424
425 TString FileName = config_name + TString(".xml");
426
427 cout << "\nCreating XML configuration file...\n";
428 cout << " Configuration name: " << config_name << "\n";
429 cout << " Author: " << author << "\n";
430 cout << " Date created: " << date << "\n";
431 cout << " File path: " << FileName << "\n";
432 cout << "\n";
433
434 // WARNING(!!!): the file will be written in the current directory
435 ofstream FileOut(FileName.Data(), ios::out);
436
437 FileOut << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
438
439 // reference frame usage comment
440 FileOut << "<!--\
441 \r\tConfig: "
442 << config_name << "\
443 \r\tAuthor: "
444 << author << "\
445 \r\tDate: "
446 << date << "\
447 \r\tA right-handed coordinates are used.\
448 \r\tIf you look at the GEMs from the target:\
449 \r\t\tx-axis is directed to the left,\
450 \r\t\ty-axis - to the top,\
451 \r\t\tz-axis - to the GEMs.\
452 \r-->\n\n";
453
454 FileOut << "<StationSet>\n";
455 FileOut << "\n";
456
457 for (Int_t istation = 0; istation < NStations; ++istation) {
458
459 // cout << "istation = " << istation << ": -----------------------------\n";
460
461 FileOut << "<!-- Station " << istation << " -->\n"; // comment
462
463 FileOut << "\t<Station";
464 FileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
465 FileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
466 FileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
467 if (istation != 7)
468 FileOut << " beamHole=\"" << HoleRadius << "\""; // small GEM
469 FileOut << ">\n";
470 FileOut << "\n";
471
472 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
473
474 // cout << " imodule = " << imodule << "\n";
475
476 FileOut << "\t\t<!-- module " << imodule << " -->\n"; // comment
477
478 FileOut << "\t\t<Module";
479 FileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
480 FileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
481 FileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
482 FileOut << " driftDirection=\"" << (DriftDirectionInModules[istation][imodule] ? "forward" : "backward")
483 << "\"";
484 FileOut << " gap_drift_thick=\"" << Gap_Drift_Thickness << "\"";
485 FileOut << " gap_ftransf_thick=\"" << Gap_FirstTransfer_Thickness << "\"";
486 FileOut << " gap_stransf_thick=\"" << Gap_SecondTransfer_Thickness << "\"";
487 FileOut << " gap_induct_thick=\"" << Gap_Induction_Thickness << "\"";
488 FileOut << ">\n";
489
490 for (Int_t ilayer = 0; ilayer < NLayersInModule[istation]; ++ilayer) {
491
492 // cout << " ilayer = " << ilayer << "\n";
493
494 FileOut << "\t\t\t<Layer";
495
496 FileOut << " zoneNumber=\"" << ZoneTypeOfLayers[istation][ilayer] << "\"";
497 FileOut << " type=\"" << StripTypeOfLayes[istation][ilayer] << "\"";
498
499 // define a strip angle for the current layer
500 Double_t layer_angle;
501 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
502 layer_angle = 0.0;
503 } else {
504 layer_angle = StripStereoAngleInModules[istation][imodule];
505 if (YStationRotations[istation] ^ XStationRotations[istation])
506 layer_angle *= -1;
507 }
508
509 FileOut << " stripAngle=\"" << layer_angle << "\"";
510
511 if (istation == 7) { // small GEM
512 FileOut << " pitch=\"" << StripPitch_SMALL << "\"";
513 } else {
514 if (imodule == 0 || imodule == 1)
515 FileOut << " pitch=\"" << StripPitch_UHP << "\"";
516 if (imodule == 2 || imodule == 3)
517 FileOut << " pitch=\"" << StripPitch_LHP << "\"";
518 }
519
520 // define 'xorig' and 'yorig' coordinates (left bottom point), 'xsize' and 'ysize'
521 Double_t xorig = 0.0; // default
522 Double_t yorig = 0.0; // default
523 Double_t xsize = 0.0; // default
524 Double_t ysize = 0.0; // default
525
526 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
527 if (istation == 7) { // small GEM
528 xorig = 0.0 + XMainZoneLayerSize_SMALL * 0.5;
529 yorig = 0.0 - YMainZoneLayerSize_SMALL * 0.5;
532 } else {
533 if (imodule == 0 || imodule == 1) {
534 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
535 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
538 }
539 if (imodule == 2 || imodule == 3) {
540 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
541 yorig = 0.0 - YMainZoneLayerSize_LHP * 0.5;
544 }
545 }
546 } else { // hot zone
547 switch (imodule) {
548 case 0:
549 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
551 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
554 } else {
556 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
559 }
560 break;
561
562 case 1:
563 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
564 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
565 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
568 } else {
569 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
570 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
573 }
574 break;
575
576 case 2:
577 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
582 } else {
587 }
588 break;
589
590 case 3:
591 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
592 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
596 } else {
597 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
601 }
602 break;
603 }
604 }
605
606 FileOut << " xorig=\"" << xorig << "\"";
607 FileOut << " yorig=\"" << yorig << "\"";
608 FileOut << " xsize=\"" << xsize << "\"";
609 FileOut << " ysize=\"" << ysize << "\"";
610
611 if (YStationRotations[istation] == false)
612 FileOut << " stripDirection=\""
613 << "LeftToRight"
614 << "\"";
615 else
616 FileOut << " stripDirection=\""
617 << "RightToLeft"
618 << "\"";
619
620 // define 'lborder' and 'rborder'
621 TString lborder = "";
622 TString rborder = "";
623
624 switch (imodule) {
625 case 0:
626 if (YStationRotations[istation] == false) {
627 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
628 lborder = "LeftTop";
629 rborder = "RightBottom";
630 } else { // hot zone
631 lborder = "LeftBottom";
632 rborder = "RightBottom";
633 }
634 } else {
635 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
636 lborder = "LeftBottom";
637 rborder = "RightTop";
638 } else { // hot zone
639 lborder = "LeftTop";
640 rborder = "RightTop";
641 }
642 }
643 break;
644
645 case 1:
646 if (YStationRotations[istation] == false) {
647 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
648 lborder = "LeftTop";
649 rborder = "RightBottom";
650 } else { // hot zone
651 lborder = "LeftTop";
652 rborder = "RightTop";
653 }
654 } else {
655 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
656 lborder = "LeftBottom";
657 rborder = "RightTop";
658 } else { // hot zone
659 lborder = "LeftBottom";
660 rborder = "RightBottom";
661 }
662 }
663 break;
664
665 case 2:
666 if (YStationRotations[istation] == false) {
667 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
668 lborder = "LeftBottom";
669 rborder = "RightTop";
670 } else { // hot zone
671 lborder = "LeftTop";
672 rborder = "RightTop";
673 }
674 } else {
675 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
676 lborder = "LeftTop";
677 rborder = "RightBottom";
678 } else { // hot zone
679 lborder = "LeftBottom";
680 rborder = "RightBottom";
681 }
682 }
683 break;
684
685 case 3:
686 if (YStationRotations[istation] == false) {
687 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
688 lborder = "LeftBottom";
689 rborder = "RightTop";
690 } else { // hot zone
691 lborder = "LeftBottom";
692 rborder = "RightBottom";
693 }
694 } else {
695 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
696 lborder = "LeftTop";
697 rborder = "RightBottom";
698 } else { // hot zone
699 lborder = "LeftTop";
700 rborder = "RightTop";
701 }
702 }
703 break;
704 }
705
706 FileOut << " lborder=\"" << lborder << "\"";
707 FileOut << " rborder=\"" << rborder << "\"";
708 FileOut << ">\n";
709
710 // add dead zones
711 if (istation != 7) { // small GEM
712 switch (imodule) {
713 // module 0 -------------------------------------------------
714 case 0:
715 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
716 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
717 { // straight strips
718 FileOut << "\t\t\t\t<DeadZone>\n";
719 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
720 FileOut << "\t\t\t\t\t<DeadPoint";
721 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] << "\"";
722 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
723 FileOut << "/>\n";
724 }
725 FileOut << "\t\t\t\t</DeadZone>\n";
726 } else { // inclined strips
727 FileOut << "\t\t\t\t<DeadZone>\n";
728 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
729 FileOut << "\t\t\t\t\t<DeadPoint";
730 if (YStationRotations[istation] == false) {
731 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] << "\"";
732 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
733 } else {
734 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] << "\"";
735 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
736 }
737 FileOut << "/>\n";
738 }
739 FileOut << "\t\t\t\t</DeadZone>\n";
740 }
741 } else { // hot zone
742 FileOut << "\t\t\t\t<DeadZone>"; // hole
743 FileOut << " <!-- hole -->\n";
744 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
745 FileOut << "\t\t\t\t\t<DeadPoint";
746 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] << "\"";
747 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
748 FileOut << "/>\n";
749 }
750 FileOut << "\t\t\t\t</DeadZone>\n";
751
752 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
753 { // inclined strips
754 FileOut << "\t\t\t\t<DeadZone>"; // triangle
755 FileOut << " <!-- triangle -->\n";
756 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
757 FileOut << "\t\t\t\t\t<DeadPoint";
758 if (YStationRotations[istation] == false) {
759 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] << "\"";
760 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
761 } else {
762 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] << "\"";
763 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
764 }
765 FileOut << "/>\n";
766 }
767 FileOut << "\t\t\t\t</DeadZone>\n";
768 }
769 }
770 break;
771 //----------------------------------------------------------
772 // module 1 -------------------------------------------------
773 case 1:
774 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
775 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
776 { // straight strips
777 FileOut << "\t\t\t\t<DeadZone>\n";
778 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
779 FileOut << "\t\t\t\t\t<DeadPoint";
780 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] * (-1) << "\"";
781 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
782 FileOut << "/>\n";
783 }
784 FileOut << "\t\t\t\t</DeadZone>\n";
785 } else { // inclined strips
786 FileOut << "\t\t\t\t<DeadZone>\n";
787 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
788 FileOut << "\t\t\t\t\t<DeadPoint";
789 if (YStationRotations[istation] == false) {
790 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] * (-1) << "\"";
791 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
792 } else {
793 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] * (-1) << "\"";
794 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
795 }
796 FileOut << "/>\n";
797 }
798 FileOut << "\t\t\t\t</DeadZone>\n";
799 }
800 } else { // hot zone
801 FileOut << "\t\t\t\t<DeadZone>"; // hole
802 FileOut << " <!-- hole -->\n";
803 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
804 FileOut << "\t\t\t\t\t<DeadPoint";
805 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] * (-1) << "\"";
806 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
807 FileOut << "/>\n";
808 }
809 FileOut << "\t\t\t\t</DeadZone>\n";
810
811 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
812 { // inclined strips
813 FileOut << "\t\t\t\t<DeadZone>"; // triangle
814 FileOut << " <!-- triangle -->\n";
815 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
816 FileOut << "\t\t\t\t\t<DeadPoint";
817 if (YStationRotations[istation] == false) {
818 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] * (-1) << "\"";
819 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
820 } else {
821 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] * (-1) << "\"";
822 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
823 }
824 FileOut << "/>\n";
825 }
826 FileOut << "\t\t\t\t</DeadZone>\n";
827 }
828 }
829 break;
830 //----------------------------------------------------------
831 // module 2 -------------------------------------------------
832 case 2:
833 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
834 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
835 { // straight strips
836 FileOut << "\t\t\t\t<DeadZone>\n";
837 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
838 FileOut << "\t\t\t\t\t<DeadPoint";
839 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] << "\"";
840 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
841 FileOut << "/>\n";
842 }
843 FileOut << "\t\t\t\t</DeadZone>\n";
844 } else { // inclined strips
845 FileOut << "\t\t\t\t<DeadZone>\n";
846 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
847 FileOut << "\t\t\t\t\t<DeadPoint";
848 if (YStationRotations[istation] == false) {
849 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] << "\"";
850 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
851 } else {
852 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] << "\"";
853 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
854 }
855 FileOut << "/>\n";
856 }
857 FileOut << "\t\t\t\t</DeadZone>\n";
858 }
859 } else { // hot zone
860 FileOut << "\t\t\t\t<DeadZone>"; // hole
861 FileOut << " <!-- hole -->\n";
862 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
863 FileOut << "\t\t\t\t\t<DeadPoint";
864 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] << "\"";
865 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
866 FileOut << "/>\n";
867 }
868 FileOut << "\t\t\t\t</DeadZone>\n";
869
870 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
871 { // inclined strips
872 FileOut << "\t\t\t\t<DeadZone>"; // triangle
873 FileOut << " <!-- triangle -->\n";
874 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
875 FileOut << "\t\t\t\t\t<DeadPoint";
876 if (YStationRotations[istation] == false) {
877 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] << "\"";
878 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
879 } else {
880 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] << "\"";
881 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
882 }
883 FileOut << "/>\n";
884 }
885 FileOut << "\t\t\t\t</DeadZone>\n";
886 }
887 }
888 break;
889 //----------------------------------------------------------
890 // module 3 -------------------------------------------------
891 case 3:
892 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
893 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
894 { // straight strips
895 FileOut << "\t\t\t\t<DeadZone>\n";
896 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
897 FileOut << "\t\t\t\t\t<DeadPoint";
898 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
899 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
900 FileOut << "/>\n";
901 }
902 FileOut << "\t\t\t\t</DeadZone>\n";
903 } else { // inclined strips
904 FileOut << "\t\t\t\t<DeadZone>\n";
905 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
906 FileOut << "\t\t\t\t\t<DeadPoint";
907 if (YStationRotations[istation] == false) {
908 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
909 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
910 } else {
911 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
912 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
913 }
914 FileOut << "/>\n";
915 }
916 FileOut << "\t\t\t\t</DeadZone>\n";
917 }
918 } else { // hot zone
919 FileOut << "\t\t\t\t<DeadZone>"; // hole
920 FileOut << " <!-- hole -->\n";
921 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
922 FileOut << "\t\t\t\t\t<DeadPoint";
923 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
924 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
925 FileOut << "/>\n";
926 }
927 FileOut << "\t\t\t\t</DeadZone>\n";
928
929 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
930 { // inclined strips
931 FileOut << "\t\t\t\t<DeadZone>"; // triangle
932 FileOut << " <!-- triangle -->\n";
933 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
934 FileOut << "\t\t\t\t\t<DeadPoint";
935 if (YStationRotations[istation] == false) {
936 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
937 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
938 } else {
939 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
940 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
941 }
942 FileOut << "/>\n";
943 }
944 FileOut << "\t\t\t\t</DeadZone>\n";
945 }
946 }
947 break;
948 //----------------------------------------------------------
949 }
950 }
951 FileOut << "\t\t\t</Layer>\n";
952 }
953 FileOut << "\t\t</Module>\n";
954 FileOut << "\n";
955 }
956 FileOut << "\t</Station>\n";
957 FileOut << "\n";
958
959 // cout << "------------------------------------------------------------\n";
960 }
961
962 FileOut << "</StationSet>\n";
963
964 FileOut.close();
965}
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]
Double_t HoleRadius
const Double_t Gap_Drift_Thickness
const Double_t XHotZoneLayerSize_StraightStrips_LHP
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]
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]
Double_t YDeadZone_TrapLeft_LHP[4]
const UInt_t NPoints_DeadZone_Hole_LHP
Double_t XDeadZone_Hole_LHP[NPoints_DeadZone_Hole_LHP]
const Double_t YMainZoneLayerSize_SMALL
const Double_t XMainZoneLayerSize_SMALL
const Double_t StripPitch_SMALL
const Int_t NMaxLayersInModule
void GemConfigCalculate_Run9()
constexpr Double_t DegToRad()
Double_t Sqrt(Double_t x)
Double_t Cos(Double_t)
Definition json.hpp:4446