BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SiliconConfigCalculate_RunSpring2018.C
Go to the documentation of this file.
1/*
2 * Description:
3 * Macro for calculating parameters of SILICON detector and writing them
4 * into the XML-file needed for simulation and reconstruction procedures.
5 * The obtained XML-file should be moved into the 'parameters/silicon/XMLConfigs' directory
6 *
7 * SILICON configuration: RunSpring2018 (BM@N RUN-7 where 3 SI-stations were)
8 *
9 * Created: 08.06.2018
10 * Modified: 30.10.2018 (z-positions of stations corrected)
11 * Author: D. Baranov
12 */
13
14#include "Rtypes.h"
15
16R__ADD_INCLUDE_PATH($VMCWORKDIR)
17R__LOAD_LIBRARY(libBmnData.so)
18
19#include "TString.h"
20
21#include <fstream>
22
23using namespace TMath;
24using namespace std;
25
26// Configuration of the module
27
28// Module 63x126 mm -------------------------------------------------------------
29
30Double_t YGapBetweenPartsOfModule = 0.0035; // Mrs. Slit
31
37
38Double_t XBevelSize = 3.82; // x-bevel for a angled cut
39Double_t YBevelSize = XBevelSize; // y-bevel for a angled cut
40
43
44// 0 - inclined strips (front side), 1 - straight strips (back side)
45Double_t XLeftBorder[2] = {0.1145, 0.10995};
46Double_t XRightBorder[2] = {0.1118, 0.11005};
47
48Double_t YTopBorder[2] = {0.1143, 0.1143};
49Double_t YMiddleBorderUpperPart[2] = {0.1121, 0.1055};
50Double_t YMiddleBorderLowerPart[2] = {0.1147, 0.1055};
51
52Double_t YBottomBorder[2] = {0.1148, 0.1055};
53
54Double_t XYBevelBorder[2] = {0.1146, 0.1076};
55
56// layers parameters
57
59 0.00795, 0.0}; // distance between the beginning of the first strip and the inner border of the frame
61
63 0.00675, 0.0}; // distance between the end of the last strip and the inner border of the frame
65
68
71
72//----------
73
76
80
85
90
95
100
105
108
115
116Double_t PitchValue[2] = {0.01029019668, 0.0095};
117Double_t StripAngle[2] = {+2.5, +0.0}; // plus - clockwise, minus - anticlockwise
120
121// dead zone (if you need)
122
123// find x and y projections of the bevel border thickness
126
127// find shifts of the sensitive zone from module borders via the equation of the straight line for the inner bevel
132
137
140
143//------------------------------------------------------------------------------
144
145// Configuration of the SI-stations ---------------------------------------------
146
147// Set Parameters of SILICON detector -------------------------------------------
148const Int_t NStations = 3; // stations in the detector
149const Int_t NMaxModules = 8; // max. number of modules in a station
150
152
153//(X-Y-Z)Positions of stations (sensitive volumes)
154const Double_t XStationPositions[NStations] = {+0.6295, +0.6295, +0.46525};
155const Double_t YStationPositions[NStations] = {-4.53225, -4.53225, -4.67125};
156// const Double_t XStationPositions[NStations] = { 0.0, 0.0, 0.0 };
157// const Double_t YStationPositions[NStations] = { -0.0, 0.0, 0.0 };
158// const Double_t ZStationPositions[NStations] = { +13.424, +13.424, +25.717 };
159const Double_t ZStationPositions[NStations] = {+10.524, +10.524,
160 +21.604}; // in accordance with rough alignment correction
161
162//(X-Y-Z)Shifts of modules in each station
164 {+6.4, -5.9, +5.9, -6.4},
165 {+5.9, -6.4},
166 {+12.15, +6.15, -6.15, -12.15, +12.15, +6.15, -6.15, -12.15}
167 //{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
168};
170 {-0.4, +0.1, -0.1, +0.4},
171 {-6.22, -6.72},
172 {-0.15, -0.15, -0.15, -0.15, +0.15, +0.15, +0.15, +0.15}
173 //{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
174};
176 {+1.44, +2.17, +2.17, +1.44},
177 {+4.71, +5.44},
178 {3.51 /*0*/, 1.98 /*1*/, 3.29 /*2*/, 1.76 /*3*/, 2.25 /*4*/, 3.78 /*5*/, 2.47 /*6*/, 4.0 /*7*/}};
179
180// Geometry parameters of modules
188
195
196// rotations of modules around y-axis by 180 deg.
197const Bool_t ModulesYRotations[NStations][NMaxModules] = {{true, false, true, false},
198 {true, false},
199 {true, true, false, false, true, true, false, false}};
200
201// rotations of modules around x-axis by 180 deg.
202const Bool_t ModulesXRotations[NStations][NMaxModules] = {{false, false, true, true},
203 {false, false},
204 {false, false, false, false, true, true, true, true}};
205
206//------------------------------------------------------------------------------
207
208// Function declarations
209void PrintInfo();
210void CalculateParameters(TString xml_file_name);
211//------------------------------------------------------------------------------
212
214{
215
216 PrintInfo();
217 CalculateParameters("SiliconRunSpring2018.xml");
218
219 cout << "It's the end" << "\n";
220 // gApplication->Terminate();
221}
222
223//------------------------------------------------------------------------------
224
226{
227
228 cout << "----------------------------------------------------------------\n";
229 cout << "Parameters of the standard module 63x126 mm:\n";
230 cout << "\n";
231 cout << " Upper layer (inclined strips):\n";
232 cout << " orig(x:y) = ( " << XOrigUpLayer[0] << " : " << YOrigUpLayer[0] << " )\n";
233 cout << " size(dx:dy) = ( " << XSizeUpLayer[0] << " : " << YSizeUpLayer[0] << " )\n";
234 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[0] << " : " << YLeftBorderUpperlayer[0] << " )\n";
235 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[0] << " : " << YRightBorderUpperlayer[0] << " )\n";
236 cout << " strip_direction = ";
237 if (StripDirection[0] == LeftToRight)
238 cout << "LeftToRight\n";
239 else
240 cout << "RightToLeft\n";
241 cout << " pitch = " << PitchValue[0] << "\n";
242 cout << " angle = " << StripAngle[0] << " deg\n";
243 cout << " first_strip_number = " << FirstStripNumberUpLayer[0] << "\n";
244 cout << "\n";
245
246 cout << " Lower layer (inclined strips):\n";
247 cout << " orig(x:y) = ( " << XOrigLowLayer[0] << " : " << YOrigLowLayer[0] << " )\n";
248 cout << " size(dx:dy) = ( " << XSizeLowLayer[0] << " : " << YSizeLowLayer[0] << " )\n";
249 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[0] << " : " << YLeftBorderLowerlayer[0] << " )\n";
250 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[0] << " : " << YRightBorderLowerlayer[0] << " )\n";
251 cout << " strip_direction = ";
252 if (StripDirection[0] == LeftToRight)
253 cout << "LeftToRight\n";
254 else
255 cout << "RightToLeft\n";
256 cout << " pitch = " << PitchValue[0] << "\n";
257 cout << " angle = " << StripAngle[0] << " deg\n";
258 cout << " first_strip_number = " << FirstStripNumberLowLayer[0] << "\n";
259 cout << " dead_zone(3 points):\n";
260 cout << " p0(x:y) = ( " << XDeadZone[0][0] << " : " << YDeadZone[0][0] << " )\n";
261 cout << " p1(x:y) = ( " << XDeadZone[0][1] << " : " << YDeadZone[0][1] << " )\n";
262 cout << " p2(x:y) = ( " << XDeadZone[0][2] << " : " << YDeadZone[0][2] << " )\n";
263 cout << "\n";
264
265 cout << " Upper layer (straight strips):\n";
266 cout << " orig(x:y) = ( " << XOrigUpLayer[1] << " : " << YOrigUpLayer[1] << " )\n";
267 cout << " size(dx:dy) = ( " << XSizeUpLayer[1] << " : " << YSizeUpLayer[1] << " )\n";
268 cout << " lborder(x:y) = ( " << XLeftBorderUpperlayer[1] << " : " << YLeftBorderUpperlayer[1] << " )\n";
269 cout << " rborder(x:y) = ( " << XRightBorderUpperlayer[1] << " : " << YRightBorderUpperlayer[1] << " )\n";
270 cout << " strip_direction = ";
271 if (StripDirection[1] == LeftToRight)
272 cout << "LeftToRight\n";
273 else
274 cout << "RightToLeft\n";
275 cout << " pitch = " << PitchValue[1] << "\n";
276 cout << " angle = " << StripAngle[1] << " deg\n";
277 cout << " first_strip_number = " << FirstStripNumberUpLayer[1] << "\n";
278 cout << "\n";
279
280 cout << " Lower layer (straight strips):\n";
281 cout << " orig(x:y) = ( " << XOrigLowLayer[1] << " : " << YOrigLowLayer[1] << " )\n";
282 cout << " size(dx:dy) = ( " << XSizeLowLayer[1] << " : " << YSizeLowLayer[1] << " )\n";
283 cout << " lborder(x:y) = ( " << XLeftBorderLowerlayer[1] << " : " << YLeftBorderLowerlayer[1] << " )\n";
284 cout << " rborder(x:y) = ( " << XRightBorderLowerlayer[1] << " : " << YRightBorderLowerlayer[1] << " )\n";
285 cout << " strip_direction = ";
286 if (StripDirection[1] == LeftToRight)
287 cout << "LeftToRight\n";
288 else
289 cout << "RightToLeft\n";
290 cout << " pitch = " << PitchValue[1] << "\n";
291 cout << " angle = " << StripAngle[1] << " deg\n";
292 cout << " first_strip_number = " << FirstStripNumberLowLayer[1] << "\n";
293 cout << " dead_zone(3 points):\n";
294 cout << " p0(x:y) = ( " << XDeadZone[1][0] << " : " << YDeadZone[1][0] << " )\n";
295 cout << " p1(x:y) = ( " << XDeadZone[1][1] << " : " << YDeadZone[1][1] << " )\n";
296 cout << " p2(x:y) = ( " << XDeadZone[1][2] << " : " << YDeadZone[1][2] << " )\n";
297 cout << "\n";
298
299 cout << "----------------------------------------------------------------\n";
300}
301//------------------------------------------------------------------------------
302
303void CalculateParameters(TString xml_file_name)
304{
305
306 ofstream SiFileOut(xml_file_name.Data(), ios::out);
307
308 SiFileOut << "<StationSet>\n";
309 SiFileOut << "\n";
310
311 for (Int_t istation = 0; istation < NStations; ++istation) {
312
313 cout << "istation = " << istation << ": -----------------------------\n";
314
315 SiFileOut << "<!-- Station " << istation << " -->\n";
316
317 SiFileOut << "\t<Station";
318 SiFileOut << " xPosition=\"" << XStationPositions[istation] << "\"";
319 SiFileOut << " yPosition=\"" << YStationPositions[istation] << "\"";
320 SiFileOut << " zPosition=\"" << ZStationPositions[istation] << "\"";
321 SiFileOut << " rotAngleDeg=\"" << "0.0" << "\"";
322 SiFileOut << " rotCenterX=\"" << "0.0" << "\"";
323 SiFileOut << " rotCenterY=\"" << "0.0" << "\"";
324 SiFileOut << ">\n";
325 SiFileOut << "\n";
326
327 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
328
329 cout << " imodule = " << imodule << "\n";
330
331 SiFileOut << "\t\t<!-- module " << imodule << " -->\n";
332
333 SiFileOut << "\t\t<Module";
334 // SiFileOut << " xShift=\"" << XModuleShifts[istation][imodule] << "\"";
335 // SiFileOut << " yShift=\"" << YModuleShifts[istation][imodule] << "\"";
336 SiFileOut << " xShift=\"" << 0.0 << "\"";
337 SiFileOut << " yShift=\"" << 0.0 << "\"";
338 SiFileOut << " zShift=\"" << ZModuleShifts[istation][imodule] << "\"";
339 SiFileOut << ">\n";
340
341 // Notice!!!: here:
342 // index "0" is a layer with inclined strips (the front side of the module)
343 // index "1" is a layer with straight strips (the back side of the module)
344 // "UpLayer" is the upper part of the module
345 // "LowLayer" is the lower part of the module
346
347 Double_t xOrig_UpLayer[2];
348 Double_t yOrig_UpLayer[2];
349 Double_t xOrig_LowLayer[2];
350 Double_t yOrig_LowLayer[2];
351
352 Double_t xSize_UpLayer[2];
353 Double_t ySize_UpLayer[2];
354 Double_t xSize_LowLayer[2];
355 Double_t ySize_LowLayer[2];
356
357 Double_t xLBorder_UpLayer[2];
358 Double_t yLBorder_UpLayer[2];
359 Double_t xLBorder_LowLayer[2];
360 Double_t yLBorder_LowLayer[2];
361 Double_t xRBorder_UpLayer[2];
362 Double_t yRBorder_UpLayer[2];
363 Double_t xRBorder_LowLayer[2];
364 Double_t yRBorder_LowLayer[2];
365
366 Double_t xDeadZone[2][3];
367 Double_t yDeadZone[2][3];
368
369 Bool_t isDeadZone_UpLayer = false;
370 Bool_t isDeadZone_LowLayer = false;
371
372 StripNumberingDirection stripDirection[2];
373 Double_t pitchValue[2] = {PitchValue[0], PitchValue[1]};
374 Double_t stripAngle[2];
375 Int_t firstStripNumber_UpLayer[2];
376 Int_t firstStripNumber_LowLayer[2];
377
378 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == false) {
379
380 xOrig_UpLayer[0] = XOrigUpLayer[0] + XModuleShifts[istation][imodule];
381 yOrig_UpLayer[0] = YOrigUpLayer[0] + YModuleShifts[istation][imodule];
382 xOrig_LowLayer[0] = XOrigLowLayer[0] + XModuleShifts[istation][imodule];
383 yOrig_LowLayer[0] = YOrigLowLayer[0] + YModuleShifts[istation][imodule];
384
385 xOrig_UpLayer[1] = XOrigUpLayer[1] + XModuleShifts[istation][imodule];
386 yOrig_UpLayer[1] = YOrigUpLayer[1] + YModuleShifts[istation][imodule];
387 xOrig_LowLayer[1] = XOrigLowLayer[1] + XModuleShifts[istation][imodule];
388 yOrig_LowLayer[1] = YOrigLowLayer[1] + YModuleShifts[istation][imodule];
389
390 xSize_UpLayer[0] = XSizeUpLayer[0];
391 ySize_UpLayer[0] = YSizeUpLayer[0];
392 xSize_LowLayer[0] = XSizeLowLayer[0];
393 ySize_LowLayer[0] = YSizeLowLayer[0];
394
395 xSize_UpLayer[1] = XSizeUpLayer[1];
396 ySize_UpLayer[1] = YSizeUpLayer[1];
397 xSize_LowLayer[1] = XSizeLowLayer[1];
398 ySize_LowLayer[1] = YSizeLowLayer[1];
399
400 xLBorder_UpLayer[0] = XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
401 xLBorder_UpLayer[1] = XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
402 yLBorder_UpLayer[0] = YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
403 yLBorder_UpLayer[1] = YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
404 xLBorder_LowLayer[0] = XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
405 xLBorder_LowLayer[1] = XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
406 yLBorder_LowLayer[0] = YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
407 yLBorder_LowLayer[1] = YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
408
409 xRBorder_UpLayer[0] = XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
410 xRBorder_UpLayer[1] = XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
411 yRBorder_UpLayer[0] = YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
412 yRBorder_UpLayer[1] = YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
413 xRBorder_LowLayer[0] = XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
414 xRBorder_LowLayer[1] = XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
415 yRBorder_LowLayer[0] = YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
416 yRBorder_LowLayer[1] = YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
417
418 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
419 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
420 xDeadZone[ilayer][ipoint] = XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
421 yDeadZone[ilayer][ipoint] = YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
422 }
423 }
424
425 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
426 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
427 {
428 isDeadZone_UpLayer = false;
429 isDeadZone_LowLayer = true;
430 }
431
432 if (StripDirection[0] == LeftToRight)
433 stripDirection[0] = LeftToRight;
434 else
435 stripDirection[0] = RightToLeft;
436 if (StripDirection[1] == LeftToRight)
437 stripDirection[1] = LeftToRight;
438 else
439 stripDirection[1] = RightToLeft;
440
441 stripAngle[0] = StripAngle[0];
442 stripAngle[1] = StripAngle[1];
443
444 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[0];
445 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[1];
446 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[0];
447 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[1];
448 }
449
450 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == false) {
451
452 xOrig_UpLayer[0] = -XOrigUpLayer[0] + XSizeUpLayer[0] + XModuleShifts[istation][imodule];
453 yOrig_UpLayer[0] = YOrigUpLayer[0] + YModuleShifts[istation][imodule];
454 xOrig_LowLayer[0] = -XOrigLowLayer[0] + XSizeLowLayer[0] + XModuleShifts[istation][imodule];
455 yOrig_LowLayer[0] = YOrigLowLayer[0] + YModuleShifts[istation][imodule];
456
457 xOrig_UpLayer[1] = -XOrigUpLayer[1] + XSizeUpLayer[1] + XModuleShifts[istation][imodule];
458 yOrig_UpLayer[1] = YOrigUpLayer[1] + YModuleShifts[istation][imodule];
459 xOrig_LowLayer[1] = -XOrigLowLayer[1] + XSizeLowLayer[1] + XModuleShifts[istation][imodule];
460 yOrig_LowLayer[1] = YOrigLowLayer[1] + YModuleShifts[istation][imodule];
461
462 xSize_UpLayer[0] = XSizeUpLayer[0];
463 ySize_UpLayer[0] = YSizeUpLayer[0];
464 xSize_LowLayer[0] = XSizeLowLayer[0];
465 ySize_LowLayer[0] = YSizeLowLayer[0];
466
467 xSize_UpLayer[1] = XSizeUpLayer[1];
468 ySize_UpLayer[1] = YSizeUpLayer[1];
469 xSize_LowLayer[1] = XSizeLowLayer[1];
470 ySize_LowLayer[1] = YSizeLowLayer[1];
471
472 xLBorder_UpLayer[0] = -XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
473 xLBorder_UpLayer[1] = -XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
474 yLBorder_UpLayer[0] = YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
475 yLBorder_UpLayer[1] = YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
476 xLBorder_LowLayer[0] = -XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
477 xLBorder_LowLayer[1] = -XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
478 yLBorder_LowLayer[0] = YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
479 yLBorder_LowLayer[1] = YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
480
481 xRBorder_UpLayer[0] = -XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
482 xRBorder_UpLayer[1] = -XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
483 yRBorder_UpLayer[0] = YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
484 yRBorder_UpLayer[1] = YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
485 xRBorder_LowLayer[0] = -XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
486 xRBorder_LowLayer[1] = -XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
487 yRBorder_LowLayer[0] = YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
488 yRBorder_LowLayer[1] = YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
489
490 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
491 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
492 xDeadZone[ilayer][ipoint] = -XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
493 yDeadZone[ilayer][ipoint] = YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
494 }
495 }
496
497 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
498 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
499 {
500 isDeadZone_UpLayer = false;
501 isDeadZone_LowLayer = true;
502 }
503
504 if (StripDirection[0] == LeftToRight)
505 stripDirection[0] = RightToLeft;
506 else
507 stripDirection[0] = LeftToRight;
508 if (StripDirection[1] == LeftToRight)
509 stripDirection[1] = RightToLeft;
510 else
511 stripDirection[1] = LeftToRight;
512
513 stripAngle[0] = -StripAngle[0];
514 stripAngle[1] = -StripAngle[1];
515
516 firstStripNumber_UpLayer[0] = FirstStripNumberUpLayer[0];
517 firstStripNumber_UpLayer[1] = FirstStripNumberUpLayer[1];
518 firstStripNumber_LowLayer[0] = FirstStripNumberLowLayer[0];
519 firstStripNumber_LowLayer[1] = FirstStripNumberLowLayer[1];
520 }
521
522 if (ModulesYRotations[istation][imodule] == false && ModulesXRotations[istation][imodule] == true) {
523
524 xOrig_UpLayer[0] = XOrigUpLayer[0] + XModuleShifts[istation][imodule];
525 yOrig_UpLayer[0] = -YOrigUpLayer[0] + YMiddleBorderLowerPart[0] + YMiddleBorderUpperPart[0]
526 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
527 xOrig_LowLayer[0] = XOrigLowLayer[0] + XModuleShifts[istation][imodule];
528 yOrig_LowLayer[0] = -YOrigLowLayer[0] - YSizeLowLayer[0] - YMiddleBorderLowerPart[0]
530 + YModuleShifts[istation][imodule];
531
532 xOrig_UpLayer[1] = XOrigUpLayer[1] + XModuleShifts[istation][imodule];
533 yOrig_UpLayer[1] = -YOrigUpLayer[1] + YMiddleBorderLowerPart[1] + YMiddleBorderUpperPart[1]
534 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
535 xOrig_LowLayer[1] = XOrigLowLayer[1] + XModuleShifts[istation][imodule];
536 yOrig_LowLayer[1] = -YOrigLowLayer[1] - YSizeLowLayer[1] - YMiddleBorderLowerPart[1]
538 + YModuleShifts[istation][imodule];
539
540 xSize_UpLayer[0] = XSizeLowLayer[0];
541 ySize_UpLayer[0] = YSizeLowLayer[0];
542 xSize_LowLayer[0] = XSizeUpLayer[0];
543 ySize_LowLayer[0] = YSizeUpLayer[0];
544
545 xSize_UpLayer[1] = XSizeLowLayer[1];
546 ySize_UpLayer[1] = YSizeLowLayer[1];
547 xSize_LowLayer[1] = XSizeUpLayer[1];
548 ySize_LowLayer[1] = YSizeUpLayer[1];
549
550 xLBorder_UpLayer[0] = XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
551 xLBorder_UpLayer[1] = XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
552 yLBorder_UpLayer[0] = -YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
553 yLBorder_UpLayer[1] = -YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
554 xLBorder_LowLayer[0] = XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
555 xLBorder_LowLayer[1] = XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
556 yLBorder_LowLayer[0] = -YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
557 yLBorder_LowLayer[1] = -YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
558
559 xRBorder_UpLayer[0] = XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
560 xRBorder_UpLayer[1] = XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
561 yRBorder_UpLayer[0] = -YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
562 yRBorder_UpLayer[1] = -YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
563 xRBorder_LowLayer[0] = XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
564 xRBorder_LowLayer[1] = XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
565 yRBorder_LowLayer[0] = -YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
566 yRBorder_LowLayer[1] = -YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
567
568 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
569 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
570 xDeadZone[ilayer][ipoint] = XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
571 yDeadZone[ilayer][ipoint] = -YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
572 }
573 }
574
575 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
576 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
577 {
578 isDeadZone_UpLayer = true;
579 isDeadZone_LowLayer = false;
580 }
581
582 if (StripDirection[0] == LeftToRight)
583 stripDirection[0] = LeftToRight;
584 else
585 stripDirection[0] = RightToLeft;
586 if (StripDirection[1] == LeftToRight)
587 stripDirection[1] = LeftToRight;
588 else
589 stripDirection[1] = RightToLeft;
590
591 stripAngle[0] = -StripAngle[0];
592 stripAngle[1] = -StripAngle[1];
593
594 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[0];
595 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[1];
596 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[0];
597 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[1];
598 }
599
600 if (ModulesYRotations[istation][imodule] == true && ModulesXRotations[istation][imodule] == true) {
601
602 xOrig_UpLayer[0] = -XOrigUpLayer[0] + XSizeUpLayer[0] + XModuleShifts[istation][imodule];
603 yOrig_UpLayer[0] = -YOrigUpLayer[0] + YMiddleBorderLowerPart[0] + YMiddleBorderUpperPart[0]
604 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
605 xOrig_LowLayer[0] = -XOrigLowLayer[0] + XSizeLowLayer[0] + XModuleShifts[istation][imodule];
606 yOrig_LowLayer[0] = -YOrigLowLayer[0] - YSizeLowLayer[0] - YMiddleBorderLowerPart[0]
608 + YModuleShifts[istation][imodule];
609
610 xOrig_UpLayer[1] = -XOrigUpLayer[1] + XSizeUpLayer[1] + XModuleShifts[istation][imodule];
611 yOrig_UpLayer[1] = -YOrigUpLayer[1] + YMiddleBorderLowerPart[1] + YMiddleBorderUpperPart[1]
612 + YGapBetweenPartsOfModule + YModuleShifts[istation][imodule];
613 xOrig_LowLayer[1] = -XOrigLowLayer[1] + XSizeLowLayer[1] + XModuleShifts[istation][imodule];
614 yOrig_LowLayer[1] = -YOrigLowLayer[1] - YSizeLowLayer[1] - YMiddleBorderLowerPart[1]
616 + YModuleShifts[istation][imodule];
617
618 xSize_UpLayer[0] = XSizeLowLayer[0];
619 ySize_UpLayer[0] = YSizeLowLayer[0];
620 xSize_LowLayer[0] = XSizeUpLayer[0];
621 ySize_LowLayer[0] = YSizeUpLayer[0];
622
623 xSize_UpLayer[1] = XSizeLowLayer[1];
624 ySize_UpLayer[1] = YSizeLowLayer[1];
625 xSize_LowLayer[1] = XSizeUpLayer[1];
626 ySize_LowLayer[1] = YSizeUpLayer[1];
627
628 xLBorder_UpLayer[0] = -XRightBorderLowerlayer[0] + XModuleShifts[istation][imodule];
629 xLBorder_UpLayer[1] = -XRightBorderLowerlayer[1] + XModuleShifts[istation][imodule];
630 yLBorder_UpLayer[0] = -YRightBorderLowerlayer[0] + YModuleShifts[istation][imodule];
631 yLBorder_UpLayer[1] = -YRightBorderLowerlayer[1] + YModuleShifts[istation][imodule];
632 xLBorder_LowLayer[0] = -XRightBorderUpperlayer[0] + XModuleShifts[istation][imodule];
633 xLBorder_LowLayer[1] = -XRightBorderUpperlayer[1] + XModuleShifts[istation][imodule];
634 yLBorder_LowLayer[0] = -YRightBorderUpperlayer[0] + YModuleShifts[istation][imodule];
635 yLBorder_LowLayer[1] = -YRightBorderUpperlayer[1] + YModuleShifts[istation][imodule];
636
637 xRBorder_UpLayer[0] = -XLeftBorderLowerlayer[0] + XModuleShifts[istation][imodule];
638 xRBorder_UpLayer[1] = -XLeftBorderLowerlayer[1] + XModuleShifts[istation][imodule];
639 yRBorder_UpLayer[0] = -YLeftBorderLowerlayer[0] + YModuleShifts[istation][imodule];
640 yRBorder_UpLayer[1] = -YLeftBorderLowerlayer[1] + YModuleShifts[istation][imodule];
641 xRBorder_LowLayer[0] = -XLeftBorderUpperlayer[0] + XModuleShifts[istation][imodule];
642 xRBorder_LowLayer[1] = -XLeftBorderUpperlayer[1] + XModuleShifts[istation][imodule];
643 yRBorder_LowLayer[0] = -YLeftBorderUpperlayer[0] + YModuleShifts[istation][imodule];
644 yRBorder_LowLayer[1] = -YLeftBorderUpperlayer[1] + YModuleShifts[istation][imodule];
645
646 for (Int_t ilayer = 0; ilayer < 2; ++ilayer) {
647 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
648 xDeadZone[ilayer][ipoint] = -XDeadZone[ilayer][ipoint] + XModuleShifts[istation][imodule];
649 yDeadZone[ilayer][ipoint] = -YDeadZone[ilayer][ipoint] + YModuleShifts[istation][imodule];
650 }
651 }
652
653 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
654 || ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF)
655 {
656 isDeadZone_UpLayer = true;
657 isDeadZone_LowLayer = false;
658 }
659
660 if (StripDirection[0] == LeftToRight)
661 stripDirection[0] = RightToLeft;
662 else
663 stripDirection[0] = LeftToRight;
664 if (StripDirection[1] == LeftToRight)
665 stripDirection[1] = RightToLeft;
666 else
667 stripDirection[1] = LeftToRight;
668
669 stripAngle[0] = StripAngle[0];
670 stripAngle[1] = StripAngle[1];
671
672 firstStripNumber_UpLayer[0] = FirstStripNumberLowLayer[0];
673 firstStripNumber_UpLayer[1] = FirstStripNumberLowLayer[1];
674 firstStripNumber_LowLayer[0] = FirstStripNumberUpLayer[0];
675 firstStripNumber_LowLayer[1] = FirstStripNumberUpLayer[1];
676 }
677
678 cout << " ---\n";
679 cout << " Orig_UpLayer[0](x:y) = ( " << xOrig_UpLayer[0] << " : " << yOrig_UpLayer[0] << " )\n";
680 cout << " Orig_LowLayer[0](x:y) = ( " << xOrig_LowLayer[0] << " : " << yOrig_LowLayer[0] << " )\n";
681 cout << " Orig_UpLayer[1](x:y) = ( " << xOrig_UpLayer[1] << " : " << yOrig_UpLayer[1] << " )\n";
682 cout << " Orig_LowLayer[1](x:y) = ( " << xOrig_LowLayer[1] << " : " << yOrig_LowLayer[1] << " )\n";
683 cout << "\n\n";
684
685 cout << " ---\n";
686 cout << " Size_UpLayer[0](dx:dy) = ( " << xSize_UpLayer[0] << " : " << ySize_UpLayer[0] << " )\n";
687 cout << " Size_LowLayer[0](dx:dy) = ( " << xSize_LowLayer[0] << " : " << ySize_LowLayer[0] << " )\n";
688 cout << " Size_UpLayer[1](dx:dy) = ( " << xSize_UpLayer[1] << " : " << ySize_UpLayer[1] << " )\n";
689 cout << " Size_LowLayer[1](dx:dy) = ( " << xSize_LowLayer[1] << " : " << ySize_LowLayer[1] << " )\n";
690 cout << "\n\n";
691
692 cout << " ---\n";
693 cout << " LBorder_UpLayer[0](x:y) = ( " << xLBorder_UpLayer[0] << " : " << yLBorder_UpLayer[0] << " )\n";
694 cout << " RBorder_UpLayer[0](x:y) = ( " << xRBorder_UpLayer[0] << " : " << yRBorder_UpLayer[0] << " )\n";
695 cout << "\n";
696 cout << " LBorder_LowLayer[0](x:y) = ( " << xLBorder_LowLayer[0] << " : " << yLBorder_LowLayer[0]
697 << " )\n";
698 cout << " RBorder_LowLayer[0](x:y) = ( " << xRBorder_LowLayer[0] << " : " << yRBorder_LowLayer[0]
699 << " )\n";
700 cout << "\n";
701
702 cout << " LBorder_UpLayer[1](x:y) = ( " << xLBorder_UpLayer[1] << " : " << yLBorder_UpLayer[1] << " )\n";
703 cout << " RBorder_UpLayer[1](x:y) = ( " << xRBorder_UpLayer[1] << " : " << yRBorder_UpLayer[1] << " )\n";
704 cout << "\n";
705 cout << " LBorder_LowLayer[1](x:y) = ( " << xLBorder_LowLayer[1] << " : " << yLBorder_LowLayer[1]
706 << " )\n";
707 cout << " RBorder_LowLayer[1](x:y) = ( " << xRBorder_LowLayer[1] << " : " << yRBorder_LowLayer[1]
708 << " )\n";
709 cout << "\n\n";
710
711 cout << " ---\n";
712 cout << " DeadZone[0]:\n";
713 cout << " p0(x:y) = ( " << xDeadZone[0][0] << " : " << yDeadZone[0][0] << " )\n";
714 cout << " p1(x:y) = ( " << xDeadZone[0][1] << " : " << yDeadZone[0][1] << " )\n";
715 cout << " p2(x:y) = ( " << xDeadZone[0][2] << " : " << yDeadZone[0][2] << " )\n";
716 cout << "\n";
717
718 cout << " DeadZone[1]:\n";
719 cout << " p0(x:y) = ( " << xDeadZone[1][0] << " : " << yDeadZone[1][0] << " )\n";
720 cout << " p1(x:y) = ( " << xDeadZone[1][1] << " : " << yDeadZone[1][1] << " )\n";
721 cout << " p2(x:y) = ( " << xDeadZone[1][2] << " : " << yDeadZone[1][2] << " )\n";
722 cout << "\n";
723
724 cout << " ---\n";
725 cout << " stripDirection[0] = ";
726 if (stripDirection[0] == LeftToRight)
727 cout << "LeftToRight\n";
728 else
729 cout << "RightToLeft\n";
730 cout << " stripDirection[1] = ";
731 if (stripDirection[1] == LeftToRight)
732 cout << "LeftToRight\n";
733 else
734 cout << "RightToLeft\n";
735 cout << "\n";
736
737 cout << " ---\n";
738 cout << " pitchValue[0] = " << pitchValue[0] << "\n";
739 cout << " pitchValue[1] = " << pitchValue[1] << "\n";
740 cout << "\n";
741
742 cout << "---\n";
743 cout << " stripAngle[0] = " << stripAngle[0] << "\n";
744 cout << " stripAngle[1] = " << stripAngle[1] << "\n";
745 cout << "\n";
746
747 cout << "---\n";
748 cout << " firstStripNumber_UpLayer[0] = " << firstStripNumber_UpLayer[0] << "\n";
749 cout << " firstStripNumber_LowLayer[0] = " << firstStripNumber_LowLayer[0] << "\n";
750 cout << " firstStripNumber_UpLayer[1] = " << firstStripNumber_UpLayer[1] << "\n";
751 cout << " firstStripNumber_LowLayer[1] = " << firstStripNumber_LowLayer[1] << "\n";
752 cout << "\n";
753
754 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE
755 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE)
756 {
757
758 // upper part of module: straight strips = back side ------------
759 SiFileOut << "\t\t\t<Layer";
760 SiFileOut << " zoneID=\"" << "0" << "\"";
761 SiFileOut << " type=\"" << "lower" << "\"";
762 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[1] << "\"";
763 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
764 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
765 SiFileOut << " xorig=\"" << xOrig_UpLayer[1] << "\"";
766 SiFileOut << " yorig=\"" << yOrig_UpLayer[1] << "\"";
767 SiFileOut << " xsize=\"" << xSize_UpLayer[1] << "\"";
768 SiFileOut << " ysize=\"" << ySize_UpLayer[1] << "\"";
769 SiFileOut << " stripDirection=\"";
770 if (stripDirection[1] == LeftToRight)
771 SiFileOut << "LeftToRight\"";
772 else
773 SiFileOut << "RightToLeft\"";
774 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[1] << "\"";
775 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[1] << "\"";
776 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[1] << "\"";
777 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[1] << "\"";
778 SiFileOut << ">";
779
780 if (isDeadZone_UpLayer == true) {
781 SiFileOut << "\n";
782 SiFileOut << "\t\t\t\t<DeadZone>\n";
783 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
784 SiFileOut << "\t\t\t\t\t<DeadPoint";
785 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
786 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
787 SiFileOut << " />\n";
788 }
789 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
790 }
791 SiFileOut << "</Layer>\n";
792 //--------------------------------------------------------------
793
794 // lower part of module: straight strips = back side ------------
795 SiFileOut << "\t\t\t<Layer";
796 SiFileOut << " zoneID=\"" << "0" << "\"";
797 SiFileOut << " type=\"" << "lower" << "\"";
798 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[1] << "\"";
799 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
800 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
801 SiFileOut << " xorig=\"" << xOrig_LowLayer[1] << "\"";
802 SiFileOut << " yorig=\"" << yOrig_LowLayer[1] << "\"";
803 SiFileOut << " xsize=\"" << xSize_LowLayer[1] << "\"";
804 SiFileOut << " ysize=\"" << ySize_LowLayer[1] << "\"";
805 SiFileOut << " stripDirection=\"";
806 if (stripDirection[1] == LeftToRight)
807 SiFileOut << "LeftToRight\"";
808 else
809 SiFileOut << "RightToLeft\"";
810 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[1] << "\"";
811 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[1] << "\"";
812 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[1] << "\"";
813 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[1] << "\"";
814 SiFileOut << ">";
815
816 if (isDeadZone_LowLayer == true) {
817 SiFileOut << "\n";
818 SiFileOut << "\t\t\t\t<DeadZone>\n";
819 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
820 SiFileOut << "\t\t\t\t\t<DeadPoint";
821 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
822 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
823 SiFileOut << " />\n";
824 }
825 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
826 }
827 SiFileOut << "</Layer>\n";
828 //--------------------------------------------------------------
829
830 // upper part of module: inclined strips = front side -----------
831 SiFileOut << "\t\t\t<Layer";
832 SiFileOut << " zoneID=\"" << "1" << "\"";
833 SiFileOut << " type=\"" << "upper" << "\"";
834 SiFileOut << " firstStripNumber=\"" << firstStripNumber_UpLayer[0] << "\"";
835 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
836 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
837 SiFileOut << " xorig=\"" << xOrig_UpLayer[0] << "\"";
838 SiFileOut << " yorig=\"" << yOrig_UpLayer[0] << "\"";
839 SiFileOut << " xsize=\"" << xSize_UpLayer[0] << "\"";
840 SiFileOut << " ysize=\"" << ySize_UpLayer[0] << "\"";
841 SiFileOut << " stripDirection=\"";
842 if (stripDirection[0] == LeftToRight)
843 SiFileOut << "LeftToRight\"";
844 else
845 SiFileOut << "RightToLeft\"";
846 SiFileOut << " lxborder=\"" << xLBorder_UpLayer[0] << "\"";
847 SiFileOut << " lyborder=\"" << yLBorder_UpLayer[0] << "\"";
848 SiFileOut << " rxborder=\"" << xRBorder_UpLayer[0] << "\"";
849 SiFileOut << " ryborder=\"" << yRBorder_UpLayer[0] << "\"";
850 SiFileOut << ">";
851
852 if (isDeadZone_UpLayer == true) {
853 SiFileOut << "\n";
854 SiFileOut << "\t\t\t\t<DeadZone>\n";
855 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
856 SiFileOut << "\t\t\t\t\t<DeadPoint";
857 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
858 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
859 SiFileOut << " />\n";
860 }
861 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
862 }
863 SiFileOut << "</Layer>\n";
864 //--------------------------------------------------------------
865
866 // lower part of module: inclined strips = front side -----------
867 SiFileOut << "\t\t\t<Layer";
868 SiFileOut << " zoneID=\"" << "1" << "\"";
869 SiFileOut << " type=\"" << "upper" << "\"";
870 SiFileOut << " firstStripNumber=\"" << firstStripNumber_LowLayer[0] << "\"";
871 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
872 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
873 SiFileOut << " xorig=\"" << xOrig_LowLayer[0] << "\"";
874 SiFileOut << " yorig=\"" << yOrig_LowLayer[0] << "\"";
875 SiFileOut << " xsize=\"" << xSize_LowLayer[0] << "\"";
876 SiFileOut << " ysize=\"" << ySize_LowLayer[0] << "\"";
877 SiFileOut << " stripDirection=\"";
878 if (stripDirection[0] == LeftToRight)
879 SiFileOut << "LeftToRight\"";
880 else
881 SiFileOut << "RightToLeft\"";
882 SiFileOut << " lxborder=\"" << xLBorder_LowLayer[0] << "\"";
883 SiFileOut << " lyborder=\"" << yLBorder_LowLayer[0] << "\"";
884 SiFileOut << " rxborder=\"" << xRBorder_LowLayer[0] << "\"";
885 SiFileOut << " ryborder=\"" << yRBorder_LowLayer[0] << "\"";
886 SiFileOut << ">";
887
888 if (isDeadZone_LowLayer == true) {
889 SiFileOut << "\n";
890 SiFileOut << "\t\t\t\t<DeadZone>\n";
891 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
892 SiFileOut << "\t\t\t\t\t<DeadPoint";
893 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
894 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
895 SiFileOut << " />\n";
896 }
897 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
898 }
899 SiFileOut << "</Layer>\n";
900 //--------------------------------------------------------------
901
902 SiFileOut << "\t\t</Module>\n";
903 SiFileOut << "\n";
904 }
905
906 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
907 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
908 {
909
910 Double_t xOrig[2];
911 Double_t yOrig[2];
912 Double_t xSize[2];
913 Double_t ySize[2];
914 Double_t xLBorder[2];
915 Double_t yLBorder[2];
916 Double_t xRBorder[2];
917 Double_t yRBorder[2];
918 Bool_t isDeadZone;
919
920 if (ModulesXRotations[istation][imodule] == false) {
921 xOrig[0] = xOrig_LowLayer[0];
922 xOrig[1] = xOrig_LowLayer[1];
923 yOrig[0] = yOrig_LowLayer[0];
924 yOrig[1] = yOrig_LowLayer[1];
925 xSize[0] = xSize_LowLayer[0];
926 xSize[1] = xSize_LowLayer[1];
927 ySize[0] = ySize_LowLayer[0];
928 ySize[1] = ySize_LowLayer[1];
929 xLBorder[0] = xLBorder_LowLayer[0];
930 xLBorder[1] = xLBorder_LowLayer[1];
931 yLBorder[0] = yLBorder_LowLayer[0];
932 yLBorder[1] = yLBorder_LowLayer[1];
933 xRBorder[0] = xRBorder_LowLayer[0];
934 xRBorder[1] = xRBorder_LowLayer[1];
935 yRBorder[0] = yRBorder_LowLayer[0];
936 yRBorder[1] = yRBorder_LowLayer[1];
937 isDeadZone = isDeadZone_LowLayer;
938 }
939 if (ModulesXRotations[istation][imodule] == true) {
940 xOrig[0] = xOrig_UpLayer[0];
941 xOrig[1] = xOrig_UpLayer[1];
942 yOrig[0] = yOrig_UpLayer[0];
943 yOrig[1] = yOrig_UpLayer[1];
944 xSize[0] = xSize_UpLayer[0];
945 xSize[1] = xSize_UpLayer[1];
946 ySize[0] = ySize_UpLayer[0];
947 ySize[1] = ySize_UpLayer[1];
948 xLBorder[0] = xLBorder_UpLayer[0];
949 xLBorder[1] = xLBorder_UpLayer[1];
950 yLBorder[0] = yLBorder_UpLayer[0];
951 yLBorder[1] = yLBorder_UpLayer[1];
952 xRBorder[0] = xRBorder_UpLayer[0];
953 xRBorder[1] = xRBorder_UpLayer[1];
954 yRBorder[0] = yRBorder_UpLayer[0];
955 yRBorder[1] = yRBorder_UpLayer[1];
956 isDeadZone = isDeadZone_UpLayer;
957 }
958
959 // one part of module: straight strips = back side --------------
960 SiFileOut << "\t\t\t<Layer";
961 SiFileOut << " zoneID=\"" << "0" << "\"";
962 SiFileOut << " type=\"" << "lower" << "\"";
963 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
964 SiFileOut << " stripAngle=\"" << stripAngle[1] << "\"";
965 SiFileOut << " pitch=\"" << pitchValue[1] << "\"";
966 SiFileOut << " xorig=\"" << xOrig[1] << "\"";
967 SiFileOut << " yorig=\"" << yOrig[1] << "\"";
968 SiFileOut << " xsize=\"" << xSize[1] << "\"";
969 SiFileOut << " ysize=\"" << ySize[1] << "\"";
970 SiFileOut << " stripDirection=\"";
971 if (stripDirection[1] == LeftToRight)
972 SiFileOut << "LeftToRight\"";
973 else
974 SiFileOut << "RightToLeft\"";
975 SiFileOut << " lxborder=\"" << xLBorder[1] << "\"";
976 SiFileOut << " lyborder=\"" << yLBorder[1] << "\"";
977 SiFileOut << " rxborder=\"" << xRBorder[1] << "\"";
978 SiFileOut << " ryborder=\"" << yRBorder[1] << "\"";
979 SiFileOut << ">";
980
981 if (isDeadZone == true) {
982 SiFileOut << "\n";
983 SiFileOut << "\t\t\t\t<DeadZone>\n";
984 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
985 SiFileOut << "\t\t\t\t\t<DeadPoint";
986 SiFileOut << " x=\"" << xDeadZone[1][ipoint] << "\"";
987 SiFileOut << " y=\"" << yDeadZone[1][ipoint] << "\"";
988 SiFileOut << " />\n";
989 }
990 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
991 }
992 SiFileOut << "</Layer>\n";
993 //--------------------------------------------------------------
994
995 // one part of module: inclined strips = front side -------------
996 SiFileOut << "\t\t\t<Layer";
997 SiFileOut << " zoneID=\"" << "1" << "\"";
998 SiFileOut << " type=\"" << "upper" << "\"";
999 SiFileOut << " firstStripNumber=\"" << 0 << "\"";
1000 SiFileOut << " stripAngle=\"" << stripAngle[0] << "\"";
1001 SiFileOut << " pitch=\"" << pitchValue[0] << "\"";
1002 SiFileOut << " xorig=\"" << xOrig[0] << "\"";
1003 SiFileOut << " yorig=\"" << yOrig[0] << "\"";
1004 SiFileOut << " xsize=\"" << xSize[0] << "\"";
1005 SiFileOut << " ysize=\"" << ySize[0] << "\"";
1006 SiFileOut << " stripDirection=\"";
1007 if (stripDirection[0] == LeftToRight)
1008 SiFileOut << "LeftToRight\"";
1009 else
1010 SiFileOut << "RightToLeft\"";
1011 SiFileOut << " lxborder=\"" << xLBorder[0] << "\"";
1012 SiFileOut << " lyborder=\"" << yLBorder[0] << "\"";
1013 SiFileOut << " rxborder=\"" << xRBorder[0] << "\"";
1014 SiFileOut << " ryborder=\"" << yRBorder[0] << "\"";
1015 SiFileOut << ">";
1016
1017 if (isDeadZone == true) {
1018 SiFileOut << "\n";
1019 SiFileOut << "\t\t\t\t<DeadZone>\n";
1020 for (Int_t ipoint = 0; ipoint < 3; ++ipoint) {
1021 SiFileOut << "\t\t\t\t\t<DeadPoint";
1022 SiFileOut << " x=\"" << xDeadZone[0][ipoint] << "\"";
1023 SiFileOut << " y=\"" << yDeadZone[0][ipoint] << "\"";
1024 SiFileOut << " />\n";
1025 }
1026 SiFileOut << "\t\t\t\t</DeadZone>\n\t\t\t";
1027 }
1028 SiFileOut << "</Layer>\n";
1029 //--------------------------------------------------------------
1030
1031 SiFileOut << "\t\t</Module>\n";
1032 SiFileOut << "\n";
1033 }
1034 }
1035
1036 SiFileOut << "\t</Station>\n";
1037 SiFileOut << "\n";
1038
1039 cout << "------------------------------------------------------------\n";
1040 }
1041
1042 SiFileOut << "</StationSet>\n";
1043
1044 SiFileOut.close();
1045}
bool Bool_t
int Int_t
double Double_t
#define R__LOAD_LIBRARY(LIBRARY)
#define R__ADD_INCLUDE_PATH(PATH)
StripNumberingDirection
@ RightToLeft
@ LeftToRight
const char * Data() const
const Double_t YStationPositions[NStations]
const Double_t ZStationPositions[NStations]
const Double_t XStationPositions[NStations]
const Int_t NModulesInStations[NStations]
StripNumberingDirection StripDirection[2]
ModuleType
@ BEVEL_MODULE
@ RIGHT_ANGLED_MODULE_HALF
@ RIGHT_ANGLED_MODULE
const Bool_t ModulesYRotations[NStations][NMaxModules]
const ModuleType ModulesTypes[NStations][NMaxModules]
const Bool_t ModulesXRotations[NStations][NMaxModules]
void SiliconConfigCalculate_RunSpring2018()
Double_t ATan(Double_t)
constexpr Double_t PiOver2()
Double_t Cos(Double_t)
Double_t Sin(Double_t)
Double_t Tan(Double_t)
constexpr Double_t RadToDeg()
Definition json.hpp:4446