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