BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
VSPConfigCalculate_Run9.C
Go to the documentation of this file.
1/*
2 * Description:
3 * Macro for calculating parameters of VSP 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/vsp/XMLConfigs' directory
8 *
9 * Author: D. Baranov
10 * Created: 08.07.2024
11 * Updated: ***
12 *
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// Configuration of VSP detector ------------------------------------------------
27
28// Set Parameters of VSP detector -----------------------------------------------
29const Int_t NStations = 1; // stations in the detector
30const Int_t NMaxModules = 6; // max. number of modules in a station
31
33
34//(X-Y-Z)Positions of stations (sensitive volumes)
37const Double_t ZStationPositions[NStations] = {6.5}; // the closest side to the target (frame or sensor)
38
39// shift of a module is its geometric center position
41 {+6.0 /*0*/, +0.0 /*1*/, -6.0 /*2*/,
42
43 +6.0 /*3*/, +0.0 /*4*/, -6.0 /*5*/},
44};
46 {+3.0 /*0*/, +5.8 /*1*/, +3.0 /*2*/,
47
48 -3.0 /*3*/, -5.8 /*4*/, -3.0 /*5*/},
49};
51 {2.48 /*0*/, 2.3 /*1*/, 2.48 /*2*/,
52
53 0.06 /*3*/, 0.24 /*4*/, 0.06 /*5*/},
54};
55
61
65
66// Rotations of modules around y-axis by 180 deg.
68 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/},
69};
70
71// Rotations of modules around x-axis by 180 deg.
73 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
74};
75//------------------------------------------------------------------------------
76
77// Configuration of modules -----------------------------------------------------
78
79// Module parameters ------------------------------------------------------------
82Double_t ZModuleSize = 0.03; // 300 mkm
83
88
89// Sensor zones -----------------------------------------------------------------
93//------------------------------------------------------------------------------
94
95// The next layers have the indices:
96// 0 - inclined strips of main zone (front side),
97// 1 - inclined strips of duplicate corner zone (front side)
98// 2 - straight strips (back side)
99
100Double_t XOrigLayer[3] = {0.0 + XSensorZoneSize * 0.5, 0.0 + XSensorZoneSize * 0.5, 0.0 + XSensorZoneSize * 0.5};
101
102Double_t YOrigLayer[3] = {0.0 - YSensorZoneSize * 0.5, 0.0 - YSensorZoneSize * 0.5, 0.0 - YSensorZoneSize * 0.5};
103
105
107
109
112
115
117
124// Double_t PitchValue[3] = { 0.0058, 0.0058, 0.0058 };
125Double_t PitchValue[3] = {0.00575038, 0.00575038, 0.0058};
126Double_t StripAngle[3] = {+7.5, +7.5, +0.0}; // plus - clockwise, minus - anticlockwise
128
129// Dead zones (if you need) -----------------------------------------------------
130
132 0.78191; // X-width of duplicate corner layer for inclined strips (134 inclined strips of 62x62 mm^2 module)
133//------------------------------------------------------------------------------
134
135// Function declarations --------------------------------------------------------
136void PrintInfo();
137void CalculateParameters(TString xml_file_name);
138//------------------------------------------------------------------------------
139
141{
142
143 PrintInfo();
144 CalculateParameters("VSP_Run9.xml");
145
146 cout << "It's the end" << "\n";
147 // gApplication->Terminate();
148}
149
150//------------------------------------------------------------------------------
151
153{
154
155 cout << "----------------------------------------------------------------\n";
156 cout << "Parameters of the VSP module 62x62 mm^2:\n";
157 cout << "\n";
158 cout << " Layer[0] (inclined strips):\n";
159 cout << " orig(x:y) = ( " << XOrigLayer[0] << " : " << YOrigLayer[0] << " )\n";
160 cout << " size(dx:dy) = ( " << XSizeLayer[0] << " : " << YSizeLayer[0] << " )\n";
161 cout << " lborder(x:y) = ( " << XLeftBorderLayer[0] << " : " << YLeftBorderLayer[0] << " )\n";
162 cout << " rborder(x:y) = ( " << XRightBorderLayer[0] << " : " << YRightBorderLayer[0] << " )\n";
163 cout << " strip_direction = ";
164 if (StripDirection[0] == LeftToRight)
165 cout << "LeftToRight\n";
166 else
167 cout << "RightToLeft\n";
168 cout << " pitch = " << PitchValue[0] << "\n";
169 cout << " angle = " << StripAngle[0] << " deg\n";
170 cout << " first_strip_number = " << FirstStripNumberLayer[0] << "\n";
171 cout << "\n";
172
173 cout << " Layer[1] (inclined strips):\n";
174 cout << " orig(x:y) = ( " << XOrigLayer[1] << " : " << YOrigLayer[1] << " )\n";
175 cout << " size(dx:dy) = ( " << XSizeLayer[1] << " : " << YSizeLayer[1] << " )\n";
176 cout << " lborder(x:y) = ( " << XLeftBorderLayer[1] << " : " << YLeftBorderLayer[1] << " )\n";
177 cout << " rborder(x:y) = ( " << XRightBorderLayer[1] << " : " << YRightBorderLayer[1] << " )\n";
178 cout << " strip_direction = ";
179 if (StripDirection[1] == LeftToRight)
180 cout << "LeftToRight\n";
181 else
182 cout << "RightToLeft\n";
183 cout << " pitch = " << PitchValue[1] << "\n";
184 cout << " angle = " << StripAngle[1] << " deg\n";
185 cout << " first_strip_number = " << FirstStripNumberLayer[1] << "\n";
186 cout << "\n";
187
188 cout << " Layer[2] (straight strips):\n";
189 cout << " orig(x:y) = ( " << XOrigLayer[2] << " : " << YOrigLayer[2] << " )\n";
190 cout << " size(dx:dy) = ( " << XSizeLayer[2] << " : " << YSizeLayer[2] << " )\n";
191 cout << " lborder(x:y) = ( " << XLeftBorderLayer[2] << " : " << YLeftBorderLayer[2] << " )\n";
192 cout << " rborder(x:y) = ( " << XRightBorderLayer[2] << " : " << YRightBorderLayer[2] << " )\n";
193 cout << " strip_direction = ";
194 if (StripDirection[2] == LeftToRight)
195 cout << "LeftToRight\n";
196 else
197 cout << "RightToLeft\n";
198 cout << " pitch = " << PitchValue[2] << "\n";
199 cout << " angle = " << StripAngle[2] << " deg\n";
200 cout << " first_strip_number = " << FirstStripNumberLayer[2] << "\n";
201 cout << "\n";
202 cout << "----------------------------------------------------------------\n";
203}
204//------------------------------------------------------------------------------
205
206void CalculateParameters(TString xml_file_name)
207{
208
209 ofstream SiFileOut(xml_file_name.Data(), ios::out);
210
211 SiFileOut << "<StationSet>\n";
212 SiFileOut << "\n";
213
214 for (Int_t istation = 0; istation < NStations; ++istation) {
215
216 cout << "istation = " << istation << ": -----------------------------\n";
217
218 SiFileOut << "<!-- Station " << istation << " -->\n";
219
220 SiFileOut << "\t<Station";
221 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
222 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
223 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
224 SiFileOut << " rotAngleDeg=\"" << "0.0" << "\"";
225 SiFileOut << " rotCenterX=\"" << "0.0" << "\"";
226 SiFileOut << " rotCenterY=\"" << "0.0" << "\"";
227 SiFileOut << ">\n";
228 SiFileOut << "\n";
229
230 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
231
232 cout << " imodule = " << imodule << "\n";
233
234 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
235
236 SiFileOut << "\t\t<Module";
237 SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
238 SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
239 // SiFileOut << " xShift=\"" << 0.0 << "\"";
240 // SiFileOut << " yShift=\"" << 0.0 << "\"";
241 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
242 SiFileOut << ">\n";
243
244 //------------------------------------------------------------------
245
246 // Notice!!!: here:
247 // 0 - inclined strips of main zone (front side),
248 // 1 - inclined strips of duplicate corner zone (front side)
249 // 2 - straight strips (back side)
250
251 Double_t xOrig_Layer[3];
252 Double_t yOrig_Layer[3];
253
254 Double_t xSize_Layer[3];
255 Double_t ySize_Layer[3];
256
257 Double_t xLBorder_Layer[3];
258 Double_t yLBorder_Layer[3];
259 Double_t xRBorder_Layer[3];
260 Double_t yRBorder_Layer[3];
261
262 StripNumberingDirection stripDirection[3];
263 Double_t pitchValue[3] = {PitchValue[0], PitchValue[1], PitchValue[2]};
264 Double_t stripAngle[3];
265 Int_t firstStripNumber_Layer[3];
266
267 Double_t XDeadZoneInMainInclinedLayer[3]; // 3-point dead zone
268 Double_t YDeadZoneInMainInclinedLayer[3]; // 3-point dead zone
269
270 Double_t XDeadZoneInCornerInclinedLayer[4]; // 4-point dead zone
271 Double_t YDeadZoneInCornerInclinedLayer[4]; // 4-point dead zone
272
273 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
274
275 xOrig_Layer[0] = XOrigLayer[0];
276 yOrig_Layer[0] = YOrigLayer[0];
277
278 xOrig_Layer[1] = XOrigLayer[1];
279 yOrig_Layer[1] = YOrigLayer[1];
280
281 xOrig_Layer[2] = XOrigLayer[2];
282 yOrig_Layer[2] = YOrigLayer[2];
283
284 xSize_Layer[0] = XSizeLayer[0];
285 ySize_Layer[0] = YSizeLayer[0];
286
287 xSize_Layer[1] = XSizeLayer[1];
288 ySize_Layer[1] = YSizeLayer[1];
289
290 xSize_Layer[2] = XSizeLayer[2];
291 ySize_Layer[2] = YSizeLayer[2];
292
293 xLBorder_Layer[0] = XLeftBorderLayer[0];
294 xLBorder_Layer[1] = XLeftBorderLayer[1];
295 xLBorder_Layer[2] = XLeftBorderLayer[2];
296
297 yLBorder_Layer[0] = YLeftBorderLayer[0];
298 yLBorder_Layer[1] = YLeftBorderLayer[1];
299 yLBorder_Layer[2] = YLeftBorderLayer[2];
300
301 xRBorder_Layer[0] = XRightBorderLayer[0];
302 xRBorder_Layer[1] = XRightBorderLayer[1];
303 xRBorder_Layer[2] = XRightBorderLayer[2];
304
305 yRBorder_Layer[0] = YRightBorderLayer[0];
306 yRBorder_Layer[1] = YRightBorderLayer[1];
307 yRBorder_Layer[2] = YRightBorderLayer[2];
308
309 if (StripDirection[0] == LeftToRight)
310 stripDirection[0] = LeftToRight;
311 else
312 stripDirection[0] = RightToLeft;
313 if (StripDirection[1] == LeftToRight)
314 stripDirection[1] = LeftToRight;
315 else
316 stripDirection[1] = RightToLeft;
317 if (StripDirection[2] == LeftToRight)
318 stripDirection[2] = LeftToRight;
319 else
320 stripDirection[2] = RightToLeft;
321
322 stripAngle[0] = StripAngle[0];
323 stripAngle[1] = StripAngle[1];
324 stripAngle[2] = StripAngle[2];
325
326 firstStripNumber_Layer[0] = FirstStripNumberLayer[0];
327 firstStripNumber_Layer[1] = FirstStripNumberLayer[1];
328 firstStripNumber_Layer[2] = FirstStripNumberLayer[2];
329
330 // Dead zone (in a main inclined strip layer) -------------------
331 XDeadZoneInMainInclinedLayer[0] = XOrigLayer[0] - XSizeLayer[0];
332 YDeadZoneInMainInclinedLayer[0] = YOrigLayer[0];
333
334 XDeadZoneInMainInclinedLayer[1] =
336 YDeadZoneInMainInclinedLayer[1] = YOrigLayer[0];
337
338 XDeadZoneInMainInclinedLayer[2] = XOrigLayer[0] - XSizeLayer[0];
339 YDeadZoneInMainInclinedLayer[2] = YOrigLayer[0] + YSizeLayer[0];
340 //--------------------------------------------------------------
341
342 // Dead zone (in a corner inclined strip layer) -----------------
343 XDeadZoneInCornerInclinedLayer[0] = XOrigLayer[0];
344 YDeadZoneInCornerInclinedLayer[0] = YOrigLayer[0];
345
346 XDeadZoneInCornerInclinedLayer[1] = XOrigLayer[0];
347 YDeadZoneInCornerInclinedLayer[1] = YOrigLayer[0] + YSizeLayer[1];
348
349 XDeadZoneInCornerInclinedLayer[2] = XOrigLayer[0] - XSizeLayer[0];
350 YDeadZoneInCornerInclinedLayer[2] = YOrigLayer[0] + YSizeLayer[0];
351
352 XDeadZoneInCornerInclinedLayer[3] =
354 YDeadZoneInCornerInclinedLayer[3] = YOrigLayer[0];
355 //--------------------------------------------------------------
356 }
357
358 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
359
360 xOrig_Layer[0] = XOrigLayer[0];
361 yOrig_Layer[0] = YOrigLayer[0];
362
363 xOrig_Layer[1] = XOrigLayer[1];
364 yOrig_Layer[1] = YOrigLayer[1];
365
366 xOrig_Layer[2] = XOrigLayer[2];
367 yOrig_Layer[2] = YOrigLayer[2];
368
369 xSize_Layer[0] = XSizeLayer[0];
370 ySize_Layer[0] = YSizeLayer[0];
371
372 xSize_Layer[1] = XSizeLayer[1];
373 ySize_Layer[1] = YSizeLayer[1];
374
375 xSize_Layer[2] = XSizeLayer[2];
376 ySize_Layer[2] = YSizeLayer[2];
377
378 xLBorder_Layer[0] = XLeftBorderLayer[0];
379 xLBorder_Layer[1] = XLeftBorderLayer[1] + XSizeLayer[1];
380 xLBorder_Layer[2] = XLeftBorderLayer[2];
381
382 yLBorder_Layer[0] = YLeftBorderLayer[0];
383 yLBorder_Layer[1] = YLeftBorderLayer[1] - YSizeLayer[1];
384 yLBorder_Layer[2] = YLeftBorderLayer[1] - YSizeLayer[2];
385
386 xRBorder_Layer[0] = XRightBorderLayer[0];
387 xRBorder_Layer[1] = XRightBorderLayer[1] + XSizeLayer[1];
388 xRBorder_Layer[2] = XRightBorderLayer[2];
389
390 yRBorder_Layer[0] = YRightBorderLayer[0];
391 yRBorder_Layer[1] = YRightBorderLayer[1] + YSizeLayer[1];
392 yRBorder_Layer[2] = YRightBorderLayer[2] + YSizeLayer[2];
393
394 if (StripDirection[0] == LeftToRight)
395 stripDirection[0] = RightToLeft;
396 else
397 stripDirection[0] = LeftToRight;
398 if (StripDirection[1] == LeftToRight)
399 stripDirection[1] = RightToLeft;
400 else
401 stripDirection[1] = LeftToRight;
402 if (StripDirection[2] == LeftToRight)
403 stripDirection[2] = RightToLeft;
404 else
405 stripDirection[2] = LeftToRight;
406
407 stripAngle[0] = -StripAngle[0];
408 stripAngle[1] = -StripAngle[1];
409 stripAngle[2] = -StripAngle[2];
410
411 firstStripNumber_Layer[0] = FirstStripNumberLayer[0];
412 firstStripNumber_Layer[1] = FirstStripNumberLayer[1];
413 firstStripNumber_Layer[2] = FirstStripNumberLayer[2];
414
415 // Dead zone (in a main inclined strip layer) -------------------
416 XDeadZoneInMainInclinedLayer[0] = XOrigLayer[0];
417 YDeadZoneInMainInclinedLayer[0] = YOrigLayer[0];
418
419 XDeadZoneInMainInclinedLayer[1] =
421 YDeadZoneInMainInclinedLayer[1] = YOrigLayer[0];
422
423 XDeadZoneInMainInclinedLayer[2] = XOrigLayer[0];
424 YDeadZoneInMainInclinedLayer[2] = YOrigLayer[0] + YSizeLayer[0];
425 //--------------------------------------------------------------
426
427 // Dead zone (in a corner inclined strip layer) -----------------
428 XDeadZoneInCornerInclinedLayer[0] = XOrigLayer[0] - XSizeLayer[1];
429 YDeadZoneInCornerInclinedLayer[0] = YOrigLayer[0];
430
431 XDeadZoneInCornerInclinedLayer[1] = XOrigLayer[0] - XSizeLayer[1];
432 YDeadZoneInCornerInclinedLayer[1] = YOrigLayer[0] + YSizeLayer[1];
433
434 XDeadZoneInCornerInclinedLayer[2] = XOrigLayer[0];
435 YDeadZoneInCornerInclinedLayer[2] = YOrigLayer[0] + YSizeLayer[1];
436
437 XDeadZoneInCornerInclinedLayer[3] =
439 YDeadZoneInCornerInclinedLayer[3] = YOrigLayer[0];
440 //--------------------------------------------------------------
441 }
442
443 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
444
445 xOrig_Layer[0] = XOrigLayer[0];
446 yOrig_Layer[0] = YOrigLayer[0];
447
448 xOrig_Layer[1] = XOrigLayer[1];
449 yOrig_Layer[1] = YOrigLayer[1];
450
451 xOrig_Layer[2] = XOrigLayer[2];
452 yOrig_Layer[2] = YOrigLayer[2];
453
454 xSize_Layer[0] = XSizeLayer[0];
455 ySize_Layer[0] = YSizeLayer[0];
456
457 xSize_Layer[1] = XSizeLayer[1];
458 ySize_Layer[1] = YSizeLayer[1];
459
460 xSize_Layer[2] = XSizeLayer[2];
461 ySize_Layer[2] = YSizeLayer[2];
462
463 xLBorder_Layer[0] = XLeftBorderLayer[0];
464 xLBorder_Layer[1] = XLeftBorderLayer[1];
465 xLBorder_Layer[2] = XLeftBorderLayer[2];
466
467 yLBorder_Layer[0] = YLeftBorderLayer[0] - YSizeLayer[0];
468 yLBorder_Layer[1] = YLeftBorderLayer[1] - YSizeLayer[1];
469 yLBorder_Layer[2] = YLeftBorderLayer[2] - YSizeLayer[2];
470
471 xRBorder_Layer[0] = XRightBorderLayer[0];
472 xRBorder_Layer[1] = XRightBorderLayer[1];
473 xRBorder_Layer[2] = XRightBorderLayer[2];
474
475 yRBorder_Layer[0] = YRightBorderLayer[0] - YSizeLayer[0];
476 yRBorder_Layer[1] = YRightBorderLayer[1] + YSizeLayer[1];
477 yRBorder_Layer[2] = YRightBorderLayer[2] + YSizeLayer[2];
478
479 if (StripDirection[0] == LeftToRight)
480 stripDirection[0] = LeftToRight;
481 else
482 stripDirection[0] = RightToLeft;
483 if (StripDirection[1] == LeftToRight)
484 stripDirection[1] = LeftToRight;
485 else
486 stripDirection[1] = RightToLeft;
487 if (StripDirection[2] == LeftToRight)
488 stripDirection[2] = LeftToRight;
489 else
490 stripDirection[2] = RightToLeft;
491
492 stripAngle[0] = -StripAngle[0];
493 stripAngle[1] = -StripAngle[1];
494 stripAngle[2] = -StripAngle[2];
495
496 firstStripNumber_Layer[0] = FirstStripNumberLayer[0];
497 firstStripNumber_Layer[1] = FirstStripNumberLayer[1];
498 firstStripNumber_Layer[2] = FirstStripNumberLayer[2];
499
500 // Dead zone (in a main inclined strip layer) -------------------
501 XDeadZoneInMainInclinedLayer[0] = XOrigLayer[0] - XSizeLayer[0];
502 YDeadZoneInMainInclinedLayer[0] = YOrigLayer[0] + YSizeLayer[0];
503
504 XDeadZoneInMainInclinedLayer[1] =
506 YDeadZoneInMainInclinedLayer[1] = YOrigLayer[0] + YSizeLayer[0];
507
508 XDeadZoneInMainInclinedLayer[2] = XOrigLayer[0] - XSizeLayer[0];
509 YDeadZoneInMainInclinedLayer[2] = YOrigLayer[0];
510 //--------------------------------------------------------------
511
512 // Dead zone (in a corner inclined strip layer) -----------------
513 XDeadZoneInCornerInclinedLayer[0] = XOrigLayer[0];
514 YDeadZoneInCornerInclinedLayer[0] = YOrigLayer[0] + YSizeLayer[1];
515
516 XDeadZoneInCornerInclinedLayer[1] = XOrigLayer[0];
517 YDeadZoneInCornerInclinedLayer[1] = YOrigLayer[0];
518
519 XDeadZoneInCornerInclinedLayer[2] = XOrigLayer[0] - XSizeLayer[1];
520 YDeadZoneInCornerInclinedLayer[2] = YOrigLayer[0];
521
522 XDeadZoneInCornerInclinedLayer[3] =
524 YDeadZoneInCornerInclinedLayer[3] = YOrigLayer[0] + YSizeLayer[1];
525 //--------------------------------------------------------------
526 }
527
528 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
529
530 xOrig_Layer[0] = XOrigLayer[0];
531 yOrig_Layer[0] = YOrigLayer[0];
532
533 xOrig_Layer[1] = XOrigLayer[1];
534 yOrig_Layer[1] = YOrigLayer[1];
535
536 xOrig_Layer[2] = XOrigLayer[2];
537 yOrig_Layer[2] = YOrigLayer[2];
538
539 xSize_Layer[0] = XSizeLayer[0];
540 ySize_Layer[0] = YSizeLayer[0];
541
542 xSize_Layer[1] = XSizeLayer[1];
543 ySize_Layer[1] = YSizeLayer[1];
544
545 xSize_Layer[2] = XSizeLayer[2];
546 ySize_Layer[2] = YSizeLayer[2];
547
548 xLBorder_Layer[0] = XLeftBorderLayer[0];
549 xLBorder_Layer[1] = XLeftBorderLayer[1] + XSizeLayer[1];
550 xLBorder_Layer[2] = XLeftBorderLayer[2];
551
552 yLBorder_Layer[0] = YLeftBorderLayer[0] - YSizeLayer[0];
553 yLBorder_Layer[1] = YLeftBorderLayer[1];
554 yLBorder_Layer[2] = YLeftBorderLayer[2];
555
556 xRBorder_Layer[0] = XRightBorderLayer[0];
557 xRBorder_Layer[1] = XRightBorderLayer[1] + XSizeLayer[1];
558 xRBorder_Layer[2] = XRightBorderLayer[2];
559
560 yRBorder_Layer[0] = YRightBorderLayer[0] - YSizeLayer[0];
561 yRBorder_Layer[1] = YRightBorderLayer[1];
562 yRBorder_Layer[2] = YRightBorderLayer[2];
563
564 if (StripDirection[0] == LeftToRight)
565 stripDirection[0] = RightToLeft;
566 else
567 stripDirection[0] = LeftToRight;
568 if (StripDirection[1] == LeftToRight)
569 stripDirection[1] = RightToLeft;
570 else
571 stripDirection[1] = LeftToRight;
572 if (StripDirection[2] == LeftToRight)
573 stripDirection[2] = RightToLeft;
574 else
575 stripDirection[2] = LeftToRight;
576
577 stripAngle[0] = StripAngle[0];
578 stripAngle[1] = StripAngle[1];
579 stripAngle[2] = StripAngle[2];
580
581 firstStripNumber_Layer[0] = FirstStripNumberLayer[0];
582 firstStripNumber_Layer[1] = FirstStripNumberLayer[1];
583 firstStripNumber_Layer[2] = FirstStripNumberLayer[2];
584
585 // Dead zone (in a main inclined strip layer) -------------------
586 XDeadZoneInMainInclinedLayer[0] = XOrigLayer[0];
587 YDeadZoneInMainInclinedLayer[0] = YOrigLayer[0] + YSizeLayer[0];
588
589 XDeadZoneInMainInclinedLayer[1] =
591 YDeadZoneInMainInclinedLayer[1] = YOrigLayer[0] + YSizeLayer[0];
592
593 XDeadZoneInMainInclinedLayer[2] = XOrigLayer[0];
594 YDeadZoneInMainInclinedLayer[2] = YOrigLayer[0];
595 //--------------------------------------------------------------
596
597 // Dead zone (in a corner inclined strip layer) -----------------
598 XDeadZoneInCornerInclinedLayer[0] = XOrigLayer[0] - XSizeLayer[1];
599 YDeadZoneInCornerInclinedLayer[0] = YOrigLayer[0] + YSizeLayer[1];
600
601 XDeadZoneInCornerInclinedLayer[1] = XOrigLayer[0] - XSizeLayer[1];
602 YDeadZoneInCornerInclinedLayer[1] = YOrigLayer[0];
603
604 XDeadZoneInCornerInclinedLayer[2] = XOrigLayer[0];
605 YDeadZoneInCornerInclinedLayer[2] = YOrigLayer[0];
606
607 XDeadZoneInCornerInclinedLayer[3] =
609 YDeadZoneInCornerInclinedLayer[3] = YOrigLayer[0] + YSizeLayer[1];
610 //--------------------------------------------------------------
611 }
612
613 cout << " ---\n";
614 cout << " Orig_Layer[0](x:y) = ( " << xOrig_Layer[0] << " : " << yOrig_Layer[0] << " )\n";
615 cout << " Orig_Layer[1](x:y) = ( " << xOrig_Layer[1] << " : " << yOrig_Layer[1] << " )\n";
616 cout << " Orig_Layer[2](x:y) = ( " << xOrig_Layer[2] << " : " << yOrig_Layer[2] << " )\n";
617 cout << "\n\n";
618
619 cout << " ---\n";
620 cout << " Size_Layer[0](dx:dy) = ( " << xSize_Layer[0] << " : " << ySize_Layer[0] << " )\n";
621 cout << " Size_Layer[1](dx:dy) = ( " << xSize_Layer[1] << " : " << ySize_Layer[1] << " )\n";
622 cout << " Size_Layer[2](dx:dy) = ( " << xSize_Layer[2] << " : " << ySize_Layer[2] << " )\n";
623 cout << "\n\n";
624
625 cout << " ---\n";
626 cout << " LBorder_Layer[0](x:y) = ( " << xLBorder_Layer[0] << " : " << yLBorder_Layer[0] << " )\n";
627 cout << " RBorder_Layer[0](x:y) = ( " << xRBorder_Layer[0] << " : " << yRBorder_Layer[0] << " )\n";
628 cout << "\n";
629
630 cout << " LBorder_Layer[1](x:y) = ( " << xLBorder_Layer[1] << " : " << yLBorder_Layer[1] << " )\n";
631 cout << " RBorder_Layer[1](x:y) = ( " << xRBorder_Layer[1] << " : " << yRBorder_Layer[1] << " )\n";
632 cout << "\n";
633
634 cout << " LBorder_Layer[2](x:y) = ( " << xLBorder_Layer[2] << " : " << yLBorder_Layer[2] << " )\n";
635 cout << " RBorder_Layer[2](x:y) = ( " << xRBorder_Layer[2] << " : " << yRBorder_Layer[2] << " )\n";
636 cout << "\n\n";
637
638 cout << " ---\n";
639 cout << " stripDirection[0] = ";
640 if (stripDirection[0] == LeftToRight)
641 cout << "LeftToRight\n";
642 else
643 cout << "RightToLeft\n";
644 cout << " stripDirection[1] = ";
645 if (stripDirection[1] == LeftToRight)
646 cout << "LeftToRight\n";
647 else
648 cout << "RightToLeft\n";
649 cout << " stripDirection[2] = ";
650 if (stripDirection[2] == LeftToRight)
651 cout << "LeftToRight\n";
652 else
653 cout << "RightToLeft\n";
654 cout << "\n";
655
656 cout << " ---\n";
657 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
658 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
659 cout << " pitchValue[2] = " << pitchValue[2] << "\n";
660 cout << "\n";
661
662 cout << "---\n";
663 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
664 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
665 cout << " stripAngle[2] = " << stripAngle[2] << "\n";
666 cout << "\n";
667
668 cout << "---\n";
669 cout << " firstStripNumber_Layer[0] = " << firstStripNumber_Layer[0] << "\n";
670 cout << " firstStripNumber_Layer[1] = " << firstStripNumber_Layer[1] << "\n";
671 cout << " firstStripNumber_Layer[2] = " << firstStripNumber_Layer[2] << "\n";
672 cout << "\n";
673
674 // file out for straight strips = back side -------------------------
675 SiFileOut << "\t\t\t<Layer";
676 SiFileOut << " zoneID=\"" << "0" << "\"";
677 SiFileOut << " type=\"" << "lower" << "\"";
678 SiFileOut << " firstStripNumber=\"" << firstStripNumber_Layer[2] << "\"";
679 SiFileOut << " stripAngle=\"" << stripAngle[2] << "\"";
680 SiFileOut << " pitch=\"" << pitchValue[2] << "\"";
681 SiFileOut << " xorig=\"" << xOrig_Layer[2] << "\"";
682 SiFileOut << " yorig=\"" << yOrig_Layer[2] << "\"";
683 SiFileOut << " xsize=\"" << xSize_Layer[2] << "\"";
684 SiFileOut << " ysize=\"" << ySize_Layer[2] << "\"";
685 SiFileOut << " stripDirection=\"";
686 if (stripDirection[2] == LeftToRight)
687 SiFileOut << "LeftToRight\"";
688 else
689 SiFileOut << "RightToLeft\"";
690 SiFileOut << " lxborder=\"" << xLBorder_Layer[2] << "\"";
691 SiFileOut << " lyborder=\"" << yLBorder_Layer[2] << "\"";
692 SiFileOut << " rxborder=\"" << xRBorder_Layer[2] << "\"";
693 SiFileOut << " ryborder=\"" << yRBorder_Layer[2] << "\"";
694 SiFileOut << ">";
695
696 SiFileOut << "</Layer>\n";
697 //------------------------------------------------------------------
698
699 // file out for inclined strips = front side (main zone) ------------
700 SiFileOut << "\t\t\t<Layer";
701 SiFileOut << " zoneID=\"" << "1" << "\"";
702 SiFileOut << " type=\"" << "upper" << "\"";
703 SiFileOut << " firstStripNumber=\"" << firstStripNumber_Layer[0] << "\"";
704 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
705 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
706 SiFileOut << " xorig=\"" << xOrig_Layer[0] << "\"";
707 SiFileOut << " yorig=\"" << yOrig_Layer[0] << "\"";
708 SiFileOut << " xsize=\"" << xSize_Layer[0] << "\"";
709 SiFileOut << " ysize=\"" << ySize_Layer[0] << "\"";
710 SiFileOut << " stripDirection=\"";
711 if (stripDirection[0] == LeftToRight)
712 SiFileOut << "LeftToRight\"";
713 else
714 SiFileOut << "RightToLeft\"";
715 SiFileOut << " lxborder=\"" << xLBorder_Layer[0] << "\"";
716 SiFileOut << " lyborder=\"" << yLBorder_Layer[0] << "\"";
717 SiFileOut << " rxborder=\"" << xRBorder_Layer[0] << "\"";
718 SiFileOut << " ryborder=\"" << yRBorder_Layer[0] << "\"";
719 SiFileOut << ">";
720
721 SiFileOut << "\n";
722 SiFileOut << "\t\t\t\t<DeadZone>\n";
723 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
724 SiFileOut << "\t\t\t\t\t<DeadPoint";
725 SiFileOut << " x=\"" << XDeadZoneInMainInclinedLayer[ipoint] << "\"";
726 SiFileOut << " y=\"" << YDeadZoneInMainInclinedLayer[ipoint] << "\"";
727 SiFileOut << " />\n";
728 }
729 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
730
731 SiFileOut << "</Layer>\n";
732 //------------------------------------------------------------------
733
734 // file out for inclined strips = front side (corner zone1) ---------
735 SiFileOut << "\t\t\t<Layer";
736 SiFileOut << " zoneID=\"" << "1" << "\"";
737 SiFileOut << " type=\"" << "upper" << "\"";
738 SiFileOut << " firstStripNumber=\"" << firstStripNumber_Layer[1] << "\"";
739 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
740 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
741 SiFileOut << " xorig=\"" << xOrig_Layer[1] << "\"";
742 SiFileOut << " yorig=\"" << yOrig_Layer[1] << "\"";
743 SiFileOut << " xsize=\"" << xSize_Layer[1] << "\"";
744 SiFileOut << " ysize=\"" << ySize_Layer[1] << "\"";
745 SiFileOut << " stripDirection=\"";
746 if (stripDirection[1] == LeftToRight)
747 SiFileOut << "LeftToRight\"";
748 else
749 SiFileOut << "RightToLeft\"";
750 SiFileOut << " lxborder=\"" << xLBorder_Layer[1] << "\"";
751 SiFileOut << " lyborder=\"" << yLBorder_Layer[1] << "\"";
752 SiFileOut << " rxborder=\"" << xRBorder_Layer[1] << "\"";
753 SiFileOut << " ryborder=\"" << yRBorder_Layer[1] << "\"";
754 SiFileOut << ">";
755
756 SiFileOut << "\n";
757 SiFileOut << "\t\t\t\t<DeadZone>\n";
758 for (Int_t ipoint = 0; ipoint < 4; ++ipoint) {
759 SiFileOut << "\t\t\t\t\t<DeadPoint";
760 SiFileOut << " x=\"" << XDeadZoneInCornerInclinedLayer[ipoint] << "\"";
761 SiFileOut << " y=\"" << YDeadZoneInCornerInclinedLayer[ipoint] << "\"";
762 SiFileOut << " />\n";
763 }
764 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
765
766 SiFileOut << "</Layer>\n";
767 //------------------------------------------------------------------
768
769 SiFileOut << "\t\t</Module>\n";
770 SiFileOut << "\n";
771 }
772
773 SiFileOut << "\t</Station>\n";
774 SiFileOut << "\n";
775
776 cout << "------------------------------------------------------------\n";
777 }
778
779 SiFileOut << "</StationSet>\n";
780
781 SiFileOut.close();
782}
bool Bool_t
int Int_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 Int_t NModulesInStations[NStations]
const Bool_t ModulesYRotations[NStations][NMaxModules]
const Bool_t ModulesXRotations[NStations][NMaxModules]
const ModuleFrameType ModulesFrameTypes[NStations][NMaxModules]
Double_t YRightBorderLayer[3]
Double_t XRightBorderFrame
Double_t YTopBorderFrame
Double_t XSizeLayer[3]
Double_t XLeftBorderFrame
void PrintInfo()
Double_t XRightBorderLayer[3]
Double_t YSensorZoneSize
Double_t XLeftBorderLayer[3]
Double_t YSizeLayer[3]
Double_t XOrigLayer[3]
Int_t FirstStripNumberLayer[3]
Double_t ZSensorZoneSize
Double_t YOrigLayer[3]
Double_t XSensorZoneSize
Double_t YBottomBorderFrame
Double_t XShift_DuplicateCornerLayer
Double_t YLeftBorderLayer[3]
void VSPConfigCalculate_Run9()
constexpr Double_t DegToRad()
Double_t Tan(Double_t)
Definition json.hpp:4446