BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
GemConfigCalculate_Run8_8stations.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 (8 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 = 8; // 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, 1};
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*/, +50.494 /*7*/}; // 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*/, -0.186 /*7*/}; // center of hole for a half-plane nearest to the target
42const Double_t ZStationPositions[NStations] = {+61.229 /*0*/, +92.2505 /*1*/, +123.502 /*2*/,
43 +154.679 /*3*/, +185.9235 /*4*/, +217.194 /*5*/,
44 +248.344 /*6*/, +792.532 /*7*/}; // 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*/, 0.0 /*7*/};
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*/, 0.0 /*7*/};
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*/, 0.0 /*7*/};
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
76 {0.0} // st. 7
77};
79 {+22.5 + yShift[0], +22.5 + yShift[0], // st. 0 (upper h. plane)
80 -19.5, -19.5}, // st. 0 (lower h. plane)
81
82 {+22.5, +22.5, // st. 1 (upper h. plane)
83 -19.5 + yShift[1], -19.5 + yShift[1]}, // st. 1 (lower h. plane)
84
85 {+22.5 + yShift[2], +22.5 + yShift[2], // st. 2 (upper h. plane)
86 -19.5, -19.5}, // st. 2 (lower h. plane)
87
88 {+22.5, +22.5, // st. 3 (upper h. plane)
89 -19.5 + yShift[3], -19.5 + yShift[3]}, // st. 3 (lower h. plane)
90
91 {+22.5 + yShift[4], +22.5 + yShift[4], // st. 4 (upper h. plane)
92 -19.5, -19.5}, // st. 4 (lower h. plane)
93
94 {+22.5, +22.5, // st. 5 (upper h. plane)
95 -19.5 + yShift[5], -19.5 + yShift[5]}, // st. 5 (lower h. plane)
96
97 {+22.5 + yShift[6], +22.5 + yShift[6], // st. 6 (upper h. plane)
98 -19.5, -19.5}, // st. 6 (lower h. plane)
99
100 {0.0} // st. 7
101};
103 {zShift[0], zShift[0], 0.0, 0.0}, // st. 0
104 {0.0, 0.0, zShift[1], zShift[1]}, // st. 1
105 {zShift[2], zShift[2], 0.0, 0.0}, // st. 2
106 {0.0, 0.0, zShift[3], zShift[3]}, // st. 3
107 {zShift[4], zShift[4], 0.0, 0.0}, // st. 4
108 {0.0, 0.0, zShift[5], zShift[5]}, // st. 5
109 {zShift[6], zShift[6], 0.0, 0.0}, // st. 6
110 {0.0} // st. 7
111};
112
113/*
114 * Basic station:
115 *
116 * -------------------- --------------------
117 * | | |
118 * | module 0 | module 1 | ^ beam direction (Z)
119 * | | | /
120 * | ------------|-------------- | /
121 * | / | / | /
122 * | / | / |/
123 * -----------------------------------------
124 * | \ | \ |
125 * | \ | \ |
126 * | \___________|______________\ |
127 * | | |
128 * | | |
129 * | module 3 | module 4 |
130 * -----------------------------------------
131 *
132 */
133
134// rotations of stations around y-axis by 180 deg.
135const Bool_t YStationRotations[NStations] = {true /*0*/, false /*1*/, true /*2*/, false /*3*/,
136 true /*4*/, false /*5*/, true /*6*/, false /*7*/};
137
138// rotations of stations around x-axis by 180 deg.
139const Bool_t XStationRotations[NStations] = {false /*0*/, false /*1*/, false /*2*/, false /*3*/,
140 false /*4*/, false /*5*/, false /*6*/, false /*7*/};
141
142// drift direction in each module ("true" is "forward", "false" is "backward")
144 {false, false, true, true}, // st. 0
145 {true, true, false, false}, // st. 1
146 {false, false, true, true}, // st. 2
147 {true, true, false, false}, // st. 3
148 {false, false, true, true}, // st. 4
149 {true, true, false, false}, // st. 5
150 {false, false, true, true}, // st. 6
151 {true} // st. 7
152};
153
154// thicknesses of gaps inside a GEM chamber (for all modules)
159
160// upper half-plane (type UHP with sizes of 163.2 x 45.0 cm) --------------------
161const Double_t StripPitch_UHP = 0.08; // cm
162
165
168
169const Double_t XHotZoneLayerSize_InclinedStrips_UHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
170const Double_t YHotZoneLayerSize_InclinedStrips_UHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
171//------------------------------------------------------------------------------
172
173// lower half-plane (type LHP with sizes of 163.2 x 39.0 cm) --------------------
174const Double_t StripPitch_LHP = 0.08; // cm
175
178
181
182const Double_t XHotZoneLayerSize_InclinedStrips_LHP[2] = {37.99, 42.01}; // [0] - min, [1] - max
183const Double_t YHotZoneLayerSize_InclinedStrips_LHP = 15.0; // deg. (plus - clockwise, minus - anticlockwise)
184//------------------------------------------------------------------------------
185
186// small GEM (type SMALL with sizes of 10.0 x 10.0 cm) --------------------------
187const Double_t StripPitch_SMALL = 0.04; // cm
188
191//------------------------------------------------------------------------------
192
194const Int_t NLayersInModule[NStations] = {4, 4, 4, 4, 4, 4, 4, 2 /*smallGEM*/};
195
197 // 0 - main, 1 - hot zone
198 {0, 0, 1, 1}, // st. 0
199 {0, 0, 1, 1}, // st. 1
200 {0, 0, 1, 1}, // st. 2
201 {0, 0, 1, 1}, // st. 3
202 {0, 0, 1, 1}, // st. 4
203 {0, 0, 1, 1}, // st. 5
204 {0, 0, 1, 1}, // st. 6
205 {0, 0} // st. 7 (small GEM)
206};
207
209 // "lower" is straight strips, "upper " is inclined strips
210 {"lower", "upper", "lower", "upper"}, // st. 0
211 {"lower", "upper", "lower", "upper"}, // st. 1
212 {"lower", "upper", "lower", "upper"}, // st. 2
213 {"lower", "upper", "lower", "upper"}, // st. 3
214 {"lower", "upper", "lower", "upper"}, // st. 4
215 {"lower", "upper", "lower", "upper"}, // st. 5
216 {"lower", "upper", "lower", "upper"}, // st. 6
217 {"lower", "upper"} // st. 7 (small GEM)
218};
219
220// stereo angle for all layers with inclined strips in each module of a basic station
222 // deg. (plus - clockwise, minus - anticlockwise)
223 {+15.0, +15.0, -15.0, -15.0}, // st. 0
224 {+15.0, +15.0, -15.0, -15.0}, // st. 1
225 {+15.0, +15.0, -15.0, -15.0}, // st. 2
226 {+15.0, +15.0, -15.0, -15.0}, // st. 3
227 {+15.0, +15.0, -15.0, -15.0}, // st. 4
228 {+15.0, +15.0, -15.0, -15.0}, // st. 5
229 {+15.0, +15.0, -15.0, -15.0}, // st. 6
230 {+90.0} // st. 7 (small GEM)
231};
232
239
241
242// dead zones (upper half-plane) ------------------------------------------------
249
256
263
270
277
295
296//------------------------------------------------------------------------------
297
298// dead zones (lower half-plane) ------------------------------------------------
305
312
319
326
333
351
352//------------------------------------------------------------------------------
353
354// Function declarations
355// void PrintInfo();
356void CalculateParameters(TString config_name, TString author, TString date);
357//------------------------------------------------------------------------------
358
360{
361
362 TString ConfigName = "GemRun8";
363 TString AuthorName = "Baranov D.";
364 TString DateCreated = "18.01.2021";
365
366 // PrintInfo();
367 CalculateParameters(ConfigName, AuthorName, DateCreated);
368
369 cout << "It's the end" << "\n";
370 // gApplication->Terminate();
371}
372//------------------------------------------------------------------------------
373
374void CalculateParameters(TString config_name, TString author, TString date)
375{
376
377 TString FileName = config_name + TString(".xml");
378
379 cout << "\nCreating XML configuration file...\n";
380 cout << " Configuration name: " << config_name << "\n";
381 cout << " Author: " << author << "\n";
382 cout << " Date created: " << date << "\n";
383 cout << " 02.03.2021 (Updated): radius of hole in active zone (4.0 -> 6.0 cm)\n";
384 cout << " 09.03.2021 (Updated): the form of a 'hole' dead zone changed (square -> 12 sided polygon) \n";
385 cout << " 25.05.2021 (Updated): Z-distance from the target to the first sens. vol. has been increased \n";
386 cout << " 08.12.2022 (Updated): Positions were corrected in accordance with the measurement scheme \n";
387 cout << " 12.12.2022 (updated): small GEM added \n";
388 cout << " 24.01.2023 (updated): half-plane shifts have been added according to the measurement scheme \n";
389 cout << " File path: " << FileName << "\n";
390 cout << "\n";
391
392 // WARNING(!!!): the file will be written in the current directory
393 ofstream FileOut(FileName.Data(), ios::out);
394
395 FileOut << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
396
397 // reference frame usage comment
398 FileOut << "<!--\
399 \r\tConfig: "
400 << config_name << "\
401 \r\tAuthor: "
402 << author << "\
403 \r\tDate: "
404 << date << "\
405 \r\t02.03.2021 (Updated): radius of hole in active zone (4.0 -> 6.0 cm)\
406 \r\t09.03.2021 (Updated): the form of a 'hole' dead zone changed (square -> 12 sided polygon)\
407 \r\t25.05.2021 (Updated): Z-distance from the target to the first sens. vol. has been increased\
408 \r\t08.12.2022 (Updated): Positions were corrected in accordance with the measurement scheme\
409 \r\t12.12.2022 (updated): small GEM added\
410 \r\t24.01.2023 (updated): half-plane shifts have been added according to the measurement scheme\n\
411 \r\tA right-handed coordinates are used.\
412 \r\tIf you look at the GEMs from the target:\
413 \r\t\tx-axis is directed to the left,\
414 \r\t\ty-axis - to the top,\
415 \r\t\tz-axis - to the GEMs.\
416 \r-->\n\n";
417
418 FileOut << "<StationSet>\n";
419 FileOut << "\n";
420
421 for (Int_t istation = 0; istation < NStations; ++istation) {
422
423 // cout << "istation = " << istation << ": -----------------------------\n";
424
425 FileOut << "<!-- Station " << istation << " -->\n"; // comment
426
427 FileOut << "\t<Station";
428 FileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
429 FileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
430 FileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
431 if (istation != 7)
432 FileOut << " beamHole=\"" << HoleRadius << "\""; // small GEM
433 FileOut << ">\n";
434 FileOut << "\n";
435
436 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
437
438 // cout << " imodule = " << imodule << "\n";
439
440 FileOut << "\t\t<!-- module " << imodule << " -->\n"; // comment
441
442 FileOut << "\t\t<Module";
443 FileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
444 FileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
445 FileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
446 FileOut << " driftDirection=\"" << (DriftDirectionInModules[istation][imodule] ? "forward" : "backward")
447 << "\"";
448 FileOut << " gap_drift_thick=\"" << Gap_Drift_Thickness << "\"";
449 FileOut << " gap_ftransf_thick=\"" << Gap_FirstTransfer_Thickness << "\"";
450 FileOut << " gap_stransf_thick=\"" << Gap_SecondTransfer_Thickness << "\"";
451 FileOut << " gap_induct_thick=\"" << Gap_Induction_Thickness << "\"";
452 FileOut << ">\n";
453
454 for (Int_t ilayer = 0; ilayer < NLayersInModule[istation]; ++ilayer) {
455
456 // cout << " ilayer = " << ilayer << "\n";
457
458 FileOut << "\t\t\t<Layer";
459
460 FileOut << " zoneNumber=\"" << ZoneTypeOfLayers[istation][ilayer] << "\"";
461 FileOut << " type=\"" << StripTypeOfLayes[istation][ilayer] << "\"";
462
463 // define a strip angle for the current layer
464 Double_t layer_angle;
465 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
466 layer_angle = 0.0;
467 } else {
468 layer_angle = StripStereoAngleInModules[istation][imodule];
469 if (YStationRotations[istation] ^ XStationRotations[istation])
470 layer_angle *= -1;
471 }
472
473 FileOut << " stripAngle=\"" << layer_angle << "\"";
474
475 if (istation == 7) { // small GEM
476 FileOut << " pitch=\"" << StripPitch_SMALL << "\"";
477 } else {
478 if (imodule == 0 || imodule == 1)
479 FileOut << " pitch=\"" << StripPitch_UHP << "\"";
480 if (imodule == 2 || imodule == 3)
481 FileOut << " pitch=\"" << StripPitch_LHP << "\"";
482 }
483
484 // define 'xorig' and 'yorig' coordinates (left bottom point), 'xsize' and 'ysize'
485 Double_t xorig = 0.0; // default
486 Double_t yorig = 0.0; // default
487 Double_t xsize = 0.0; // default
488 Double_t ysize = 0.0; // default
489
490 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
491 if (istation == 7) { // small GEM
492 xorig = 0.0 + XMainZoneLayerSize_SMALL * 0.5;
493 yorig = 0.0 - YMainZoneLayerSize_SMALL * 0.5;
496 } else {
497 if (imodule == 0 || imodule == 1) {
498 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
499 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
502 }
503 if (imodule == 2 || imodule == 3) {
504 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
505 yorig = 0.0 - YMainZoneLayerSize_LHP * 0.5;
508 }
509 }
510 } else { // hot zone
511 switch (imodule) {
512 case 0:
513 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
515 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
518 } else {
520 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
523 }
524 break;
525
526 case 1:
527 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
528 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
529 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
532 } else {
533 xorig = 0.0 + XMainZoneLayerSize_UHP * 0.5;
534 yorig = 0.0 - YMainZoneLayerSize_UHP * 0.5;
537 }
538 break;
539
540 case 2:
541 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
546 } else {
551 }
552 break;
553
554 case 3:
555 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower")) {
556 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
560 } else {
561 xorig = 0.0 + XMainZoneLayerSize_LHP * 0.5;
565 }
566 break;
567 }
568 }
569
570 FileOut << " xorig=\"" << xorig << "\"";
571 FileOut << " yorig=\"" << yorig << "\"";
572 FileOut << " xsize=\"" << xsize << "\"";
573 FileOut << " ysize=\"" << ysize << "\"";
574
575 if (YStationRotations[istation] == false)
576 FileOut << " stripDirection=\"" << "LeftToRight" << "\"";
577 else
578 FileOut << " stripDirection=\"" << "RightToLeft" << "\"";
579
580 // define 'lborder' and 'rborder'
581 TString lborder = "";
582 TString rborder = "";
583
584 switch (imodule) {
585 case 0:
586 if (YStationRotations[istation] == false) {
587 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
588 lborder = "LeftTop";
589 rborder = "RightBottom";
590 } else { // hot zone
591 lborder = "LeftBottom";
592 rborder = "RightBottom";
593 }
594 } else {
595 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
596 lborder = "LeftBottom";
597 rborder = "RightTop";
598 } else { // hot zone
599 lborder = "LeftTop";
600 rborder = "RightTop";
601 }
602 }
603 break;
604
605 case 1:
606 if (YStationRotations[istation] == false) {
607 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
608 lborder = "LeftTop";
609 rborder = "RightBottom";
610 } else { // hot zone
611 lborder = "LeftTop";
612 rborder = "RightTop";
613 }
614 } else {
615 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
616 lborder = "LeftBottom";
617 rborder = "RightTop";
618 } else { // hot zone
619 lborder = "LeftBottom";
620 rborder = "RightBottom";
621 }
622 }
623 break;
624
625 case 2:
626 if (YStationRotations[istation] == false) {
627 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
628 lborder = "LeftBottom";
629 rborder = "RightTop";
630 } else { // hot zone
631 lborder = "LeftTop";
632 rborder = "RightTop";
633 }
634 } else {
635 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
636 lborder = "LeftTop";
637 rborder = "RightBottom";
638 } else { // hot zone
639 lborder = "LeftBottom";
640 rborder = "RightBottom";
641 }
642 }
643 break;
644
645 case 3:
646 if (YStationRotations[istation] == false) {
647 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
648 lborder = "LeftBottom";
649 rborder = "RightTop";
650 } else { // hot zone
651 lborder = "LeftBottom";
652 rborder = "RightBottom";
653 }
654 } else {
655 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
656 lborder = "LeftTop";
657 rborder = "RightBottom";
658 } else { // hot zone
659 lborder = "LeftTop";
660 rborder = "RightTop";
661 }
662 }
663 break;
664 }
665
666 FileOut << " lborder=\"" << lborder << "\"";
667 FileOut << " rborder=\"" << rborder << "\"";
668 FileOut << ">\n";
669
670 // add dead zones
671 if (istation != 7) { // small GEM
672 switch (imodule) {
673 // module 0 -------------------------------------------------
674 case 0:
675 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
676 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
677 { // straight strips
678 FileOut << "\t\t\t\t<DeadZone>\n";
679 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
680 FileOut << "\t\t\t\t\t<DeadPoint";
681 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] << "\"";
682 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
683 FileOut << "/>\n";
684 }
685 FileOut << "\t\t\t\t</DeadZone>\n";
686 } else { // inclined strips
687 FileOut << "\t\t\t\t<DeadZone>\n";
688 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
689 FileOut << "\t\t\t\t\t<DeadPoint";
690 if (YStationRotations[istation] == false) {
691 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] << "\"";
692 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
693 } else {
694 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] << "\"";
695 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
696 }
697 FileOut << "/>\n";
698 }
699 FileOut << "\t\t\t\t</DeadZone>\n";
700 }
701 } else { // hot zone
702 FileOut << "\t\t\t\t<DeadZone>"; // hole
703 FileOut << " <!-- hole -->\n";
704 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
705 FileOut << "\t\t\t\t\t<DeadPoint";
706 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] << "\"";
707 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
708 FileOut << "/>\n";
709 }
710 FileOut << "\t\t\t\t</DeadZone>\n";
711
712 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
713 { // inclined strips
714 FileOut << "\t\t\t\t<DeadZone>"; // triangle
715 FileOut << " <!-- triangle -->\n";
716 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
717 FileOut << "\t\t\t\t\t<DeadPoint";
718 if (YStationRotations[istation] == false) {
719 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] << "\"";
720 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
721 } else {
722 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] << "\"";
723 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
724 }
725 FileOut << "/>\n";
726 }
727 FileOut << "\t\t\t\t</DeadZone>\n";
728 }
729 }
730 break;
731 //----------------------------------------------------------
732 // module 1 -------------------------------------------------
733 case 1:
734 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
735 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
736 { // straight strips
737 FileOut << "\t\t\t\t<DeadZone>\n";
738 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
739 FileOut << "\t\t\t\t\t<DeadPoint";
740 FileOut << " x=\"" << XDeadZone_Rect_UHP[ipoint] * (-1) << "\"";
741 FileOut << " y=\"" << YDeadZone_Rect_UHP[ipoint] << "\"";
742 FileOut << "/>\n";
743 }
744 FileOut << "\t\t\t\t</DeadZone>\n";
745 } else { // inclined strips
746 FileOut << "\t\t\t\t<DeadZone>\n";
747 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
748 FileOut << "\t\t\t\t\t<DeadPoint";
749 if (YStationRotations[istation] == false) {
750 FileOut << " x=\"" << XDeadZone_TrapRight_UHP[ipoint] * (-1) << "\"";
751 FileOut << " y=\"" << YDeadZone_TrapRight_UHP[ipoint] << "\"";
752 } else {
753 FileOut << " x=\"" << XDeadZone_TrapLeft_UHP[ipoint] * (-1) << "\"";
754 FileOut << " y=\"" << YDeadZone_TrapLeft_UHP[ipoint] << "\"";
755 }
756 FileOut << "/>\n";
757 }
758 FileOut << "\t\t\t\t</DeadZone>\n";
759 }
760 } else { // hot zone
761 FileOut << "\t\t\t\t<DeadZone>"; // hole
762 FileOut << " <!-- hole -->\n";
763 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_UHP; ++ipoint) {
764 FileOut << "\t\t\t\t\t<DeadPoint";
765 FileOut << " x=\"" << XDeadZone_Hole_UHP[ipoint] * (-1) << "\"";
766 FileOut << " y=\"" << YDeadZone_Hole_UHP[ipoint] << "\"";
767 FileOut << "/>\n";
768 }
769 FileOut << "\t\t\t\t</DeadZone>\n";
770
771 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
772 { // inclined strips
773 FileOut << "\t\t\t\t<DeadZone>"; // triangle
774 FileOut << " <!-- triangle -->\n";
775 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
776 FileOut << "\t\t\t\t\t<DeadPoint";
777 if (YStationRotations[istation] == false) {
778 FileOut << " x=\"" << XDeadZone_TrianRight_UHP[ipoint] * (-1) << "\"";
779 FileOut << " y=\"" << YDeadZone_TrianRight_UHP[ipoint] << "\"";
780 } else {
781 FileOut << " x=\"" << XDeadZone_TrianLeft_UHP[ipoint] * (-1) << "\"";
782 FileOut << " y=\"" << YDeadZone_TrianLeft_UHP[ipoint] << "\"";
783 }
784 FileOut << "/>\n";
785 }
786 FileOut << "\t\t\t\t</DeadZone>\n";
787 }
788 }
789 break;
790 //----------------------------------------------------------
791 // module 2 -------------------------------------------------
792 case 2:
793 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
794 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
795 { // straight strips
796 FileOut << "\t\t\t\t<DeadZone>\n";
797 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
798 FileOut << "\t\t\t\t\t<DeadPoint";
799 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] << "\"";
800 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
801 FileOut << "/>\n";
802 }
803 FileOut << "\t\t\t\t</DeadZone>\n";
804 } else { // inclined strips
805 FileOut << "\t\t\t\t<DeadZone>\n";
806 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
807 FileOut << "\t\t\t\t\t<DeadPoint";
808 if (YStationRotations[istation] == false) {
809 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] << "\"";
810 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
811 } else {
812 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] << "\"";
813 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
814 }
815 FileOut << "/>\n";
816 }
817 FileOut << "\t\t\t\t</DeadZone>\n";
818 }
819 } else { // hot zone
820 FileOut << "\t\t\t\t<DeadZone>"; // hole
821 FileOut << " <!-- hole -->\n";
822 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
823 FileOut << "\t\t\t\t\t<DeadPoint";
824 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] << "\"";
825 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
826 FileOut << "/>\n";
827 }
828 FileOut << "\t\t\t\t</DeadZone>\n";
829
830 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
831 { // inclined strips
832 FileOut << "\t\t\t\t<DeadZone>"; // triangle
833 FileOut << " <!-- triangle -->\n";
834 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
835 FileOut << "\t\t\t\t\t<DeadPoint";
836 if (YStationRotations[istation] == false) {
837 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] << "\"";
838 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
839 } else {
840 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] << "\"";
841 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
842 }
843 FileOut << "/>\n";
844 }
845 FileOut << "\t\t\t\t</DeadZone>\n";
846 }
847 }
848 break;
849 //----------------------------------------------------------
850 // module 3 -------------------------------------------------
851 case 3:
852 if (ZoneTypeOfLayers[istation][ilayer] == 0) { // main zone
853 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("lower"))
854 { // straight strips
855 FileOut << "\t\t\t\t<DeadZone>\n";
856 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
857 FileOut << "\t\t\t\t\t<DeadPoint";
858 FileOut << " x=\"" << XDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
859 FileOut << " y=\"" << YDeadZone_Rect_LHP[ipoint] * (-1) << "\"";
860 FileOut << "/>\n";
861 }
862 FileOut << "\t\t\t\t</DeadZone>\n";
863 } else { // inclined strips
864 FileOut << "\t\t\t\t<DeadZone>\n";
865 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
866 FileOut << "\t\t\t\t\t<DeadPoint";
867 if (YStationRotations[istation] == false) {
868 FileOut << " x=\"" << XDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
869 FileOut << " y=\"" << YDeadZone_TrapRight_LHP[ipoint] * (-1) << "\"";
870 } else {
871 FileOut << " x=\"" << XDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
872 FileOut << " y=\"" << YDeadZone_TrapLeft_LHP[ipoint] * (-1) << "\"";
873 }
874 FileOut << "/>\n";
875 }
876 FileOut << "\t\t\t\t</DeadZone>\n";
877 }
878 } else { // hot zone
879 FileOut << "\t\t\t\t<DeadZone>"; // hole
880 FileOut << " <!-- hole -->\n";
881 for (Int_t ipoint = 0; ipoint < NPoints_DeadZone_Hole_LHP; ++ipoint) {
882 FileOut << "\t\t\t\t\t<DeadPoint";
883 FileOut << " x=\"" << XDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
884 FileOut << " y=\"" << YDeadZone_Hole_LHP[ipoint] * (-1) << "\"";
885 FileOut << "/>\n";
886 }
887 FileOut << "\t\t\t\t</DeadZone>\n";
888
889 if (TString(StripTypeOfLayes[istation][ilayer]) == TString("upper"))
890 { // inclined strips
891 FileOut << "\t\t\t\t<DeadZone>"; // triangle
892 FileOut << " <!-- triangle -->\n";
893 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
894 FileOut << "\t\t\t\t\t<DeadPoint";
895 if (YStationRotations[istation] == false) {
896 FileOut << " x=\"" << XDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
897 FileOut << " y=\"" << YDeadZone_TrianRight_LHP[ipoint] * (-1) << "\"";
898 } else {
899 FileOut << " x=\"" << XDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
900 FileOut << " y=\"" << YDeadZone_TrianLeft_LHP[ipoint] * (-1) << "\"";
901 }
902 FileOut << "/>\n";
903 }
904 FileOut << "\t\t\t\t</DeadZone>\n";
905 }
906 }
907 break;
908 //----------------------------------------------------------
909 }
910 }
911 FileOut << "\t\t\t</Layer>\n";
912 }
913 FileOut << "\t\t</Module>\n";
914 FileOut << "\n";
915 }
916 FileOut << "\t</Station>\n";
917 FileOut << "\n";
918
919 // cout << "------------------------------------------------------------\n";
920 }
921
922 FileOut << "</StationSet>\n";
923
924 FileOut.close();
925}
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
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_Run8_8stations()
constexpr Double_t DegToRad()
Double_t Sqrt(Double_t x)
Double_t Cos(Double_t)
Definition json.hpp:4446