BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_CSC_RunSRC2021.C
Go to the documentation of this file.
1/*
2 * Use this macro to create
3 * ROOT geometry for the SRC SRC in the configuration 2021
4 * including passive volumes (frames, al. cable supports, ...)
5 *
6 * Author: Baranov D.
7 * Created: 19.08.2021
8 * Updated: 10.09.2021 (Added: spacer elements in a sensor zone, supporting wires,
9 * technical holes)
10 */
11
12#include "TGeoMatrix.h"
13#include "TGeoVolume.h"
14#include "TString.h"
15
16// Set Parameters of CSC --------------------------------------------------------
17const Int_t NStations = 2; // stations in the detector
18const Int_t NMaxModules = 2; // max. number of modules in a station
19
20//(X-Y-Z)Positions of stations (distances from the origin to the center of the outboard side (not sens.) which is
21// nearest to the target)
23 +109.89 + 0.5055 /* +110.3955 */, // station 0 (left arm)
24 -109.89 + 0.5055 /* -109.3845 */ // station 1 (right arm)
25};
27 +0.0 - 4.623, // station 0 (left arm)
28 +0.0 - 4.623 // station 1 (right arm)
29};
31 +182.89 - 576.2 /* -393.31 */, // station 0 (left arm)
32 +182.89 - 576.2 /* -393.31 */ // station 1 (right arm)
33};
34//------------------------------------------------------------------------------
35
36//(X-Y-Z)Shifts of modules in each station
38 {0.0, 0.0}, // station 0
39 {0.0, 0.0}, // station 1
40};
42 {27.1875, -27.1875}, // station 0
43 {27.1875, -27.1875}, // station 1
44};
46 {1.25, 1.25}, // station 0
47 {1.25, 1.25}, // station 1
48};
49
50// Sizes of elements (cm) -------------------------------------------------------
51
52// Gas volume sizes (module: half of station) (AS MODULE SIZES)
53const Double_t XGasSize = 113.0;
54const Double_t YGasSize = 54.375;
55const Double_t ZGasSize = 0.76;
56
57// Sensitive volume sizes (module: half of station)
58const Double_t XSensSize = 112.9;
59const Double_t YSensSize = 53.25; // 106.5*0.5
60const Double_t ZSensSize = 0.76;
61//------------------------------------------------------------------------------
62
63// GeoManager
65
66// media
77
78class FairGeoMedia;
79class FairGeoBuilder;
80
81TGeoVolume* CreateStation(TString station_name);
82TGeoVolume* CreateModule(TString module_name);
84
85void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
86{
87
88 // air medium
89 FairGeoMedium* mAir = geoMedia->getMedium("air");
90 if (!mAir)
91 Fatal("Main", "FairMedium air not found");
92 geoBuild->createMedium(mAir);
93 pMedAir = gGeoManager->GetMedium("air");
94 if (!pMedAir)
95 Fatal("Main", "Medium air not found");
96
97 // carbon medium
98 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
99 if (!mCarbon)
100 Fatal("Main", "FairMedium carbon not found");
101 geoBuild->createMedium(mCarbon);
102 pMedCarbon = gGeoManager->GetMedium("carbon");
103 if (!pMedCarbon)
104 Fatal("Main", "Medium carbon not found");
105
106 // fiberglass medium
107 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
108 if (!mFiberGlass)
109 Fatal("Main", "FairMedium fiberglass not found");
110 geoBuild->createMedium(mFiberGlass);
111 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
112 if (!pMedFiberGlass)
113 Fatal("Main", "Medium fiberglass not found");
114
115 // arco27020 medium
116 FairGeoMedium* mArCO27030 = geoMedia->getMedium("arco27030");
117 if (!mArCO27030)
118 Fatal("Main", "FairMedium arco27030 not found");
119 geoBuild->createMedium(mArCO27030);
120 pMedArCO27030 = gGeoManager->GetMedium("arco27030");
121 if (!pMedArCO27030)
122 Fatal("Main", "Medium arco27030 not found");
123
124 // ArgonIsobutane (75/25): Ar-iC4H10 medium
125 FairGeoMedium* mArgonIsobutane7525 = geoMedia->getMedium("ArgonIsobutane7525");
126 if (!mArgonIsobutane7525)
127 Fatal("Main", "FairMedium ArgonIsobutane7525 not found");
128 geoBuild->createMedium(mArgonIsobutane7525);
129 pMedArgonIsobutane7525 = gGeoManager->GetMedium("ArgonIsobutane7525");
131 Fatal("Main", "Medium ArgonIsobutane7525 not found");
132
133 // HoneyComb medium
134 FairGeoMedium* mHoneyComb = geoMedia->getMedium("AramidHoneyComb");
135 if (!mHoneyComb)
136 Fatal("Main", "FairMedium AramidHoneyComb not found");
137 geoBuild->createMedium(mHoneyComb);
138 pMedHoneyComb = gGeoManager->GetMedium("AramidHoneyComb");
139 if (!pMedHoneyComb)
140 Fatal("Main", "Medium AramidHoneyComb not found");
141
142 // epoxide compound (as Araldit glue based on solid epoxide resin)
143 FairGeoMedium* mEpoxideCompound = geoMedia->getMedium("polyurethane_hd");
144 if (!mEpoxideCompound)
145 Fatal("Main", "FairMedium epoxideCompound not found");
146 geoBuild->createMedium(mEpoxideCompound);
147 pMedEpoxideCompound = gGeoManager->GetMedium("polyurethane_hd");
149 Fatal("Main", "Medium epoxideCompound not found");
150
151 // brass medium
152 FairGeoMedium* mBrass = geoMedia->getMedium("brass");
153 if (!mBrass)
154 Fatal("Main", "FairMedium brass not found");
155 geoBuild->createMedium(mBrass);
156 pMedBrass = gGeoManager->GetMedium("brass");
157 if (!pMedBrass)
158 Fatal("Main", "Medium brass not found");
159
160 // teflon medium
161 FairGeoMedium* mTeflon = geoMedia->getMedium("teflon");
162 if (!mTeflon)
163 Fatal("Main", "FairMedium teflon not found");
164 geoBuild->createMedium(mTeflon);
165 pMedTeflon = gGeoManager->GetMedium("teflon");
166 if (!pMedTeflon)
167 Fatal("Main", "Medium teflon not found");
168}
169
171{
172
173 // ---- set working directory --------------------------------------------
174 TString gPath = gSystem->Getenv("VMCWORKDIR");
175
176 // ------- Geometry file name (output) ----------------------------------
177 const TString geoDetectorName = "CSC";
178 const TString geoDetectorVersion = "RunSRC2021";
179 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
180
181 // ---- global geometry parameters ---------------------------------------
182 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
183 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
184
185 // ------- Load media from media file ----------------------------------
186 TString medFile = gPath + "/geometry/media.geo";
187 geoFace->setMediaFile(medFile);
188 geoFace->readMedia();
189 FairGeoMedia* geoMedia = geoFace->getMedia();
190 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
191
192 DefineRequiredMedia(geoMedia, geoBuild);
193 // -------------------------------------------------------------------------
194
195 // -------------- Create geometry and top volume ------------------------
196 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
197 gGeoMan->SetName(geoDetectorName + "_geom");
198 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
199 top->SetMedium(pMedAir);
200 gGeoMan->SetTopVolume(top);
201 // gGeoMan->SetTopVisible(1);
202 // -------------------------------------------------------------------------
203
204 // Define TOP Geometry
205 TGeoVolume* CSC = new TGeoVolumeAssembly(geoDetectorName);
206 CSC->SetMedium(pMedAir);
207
208 // station 0 (consisting of two modules)
209 if (1) {
210 Int_t stationNum = 0; // station number
211
212 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(stationNum, 10));
213
214 TGeoVolume* module0 = CreateModule(TString("module0_") + station->GetName());
215 TGeoVolume* module1 = CreateModule(TString("module1_") + station->GetName());
216
217 TGeoVolume* frame0 = CreateFrameForModule(TString("frame0_") + station->GetName());
218 TGeoVolume* frame1 = CreateFrameForModule(TString("frame1_") + station->GetName());
219
220 TGeoCombiTrans* module0_transform = new TGeoCombiTrans();
221 module0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
222 ZModuleShifts[stationNum][0] + 0.5 * ZGasSize);
223 module0_transform->RotateY(+31.0); // deg
224
225 TGeoCombiTrans* module1_transform = new TGeoCombiTrans();
226 module1_transform->RotateZ(180);
227 module1_transform->SetTranslation(XModuleShifts[stationNum][1], YModuleShifts[stationNum][1],
228 ZModuleShifts[stationNum][1] + 0.5 * ZGasSize);
229 module1_transform->RotateY(+31.0); // deg
230
231 TGeoCombiTrans* frame0_transform = new TGeoCombiTrans();
232 frame0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
233 ZModuleShifts[stationNum][0] + 0.5 * ZGasSize);
234 frame0_transform->RotateY(+31.0); // deg
235
236 TGeoCombiTrans* frame1_transform = new TGeoCombiTrans();
237 frame1_transform->RotateZ(180);
238 frame1_transform->SetTranslation(XModuleShifts[stationNum][1], YModuleShifts[stationNum][1],
239 ZModuleShifts[stationNum][1] + 0.5 * ZGasSize);
240 frame1_transform->RotateY(+31.0); // deg
241
242 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
243 station_transform->SetTranslation(XStationPositions[stationNum], YStationPositions[stationNum],
244 ZStationPositions[stationNum]);
245
246 station->AddNode(module0, 0, new TGeoCombiTrans(*module0_transform));
247 station->AddNode(module1, 0, new TGeoCombiTrans(*module1_transform));
248
249 station->AddNode(frame0, 0, new TGeoCombiTrans(*frame0_transform));
250 station->AddNode(frame1, 0, new TGeoCombiTrans(*frame1_transform));
251
252 CSC->AddNode(station, 0, station_transform);
253 }
254
255 // station 1 (consisting of two modules)
256 if (1) {
257 Int_t stationNum = 1; // station number
258
259 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(stationNum, 10));
260
261 TGeoVolume* module0 = CreateModule(TString("module0_") + station->GetName());
262 TGeoVolume* module1 = CreateModule(TString("module1_") + station->GetName());
263
264 TGeoVolume* frame0 = CreateFrameForModule(TString("frame0_") + station->GetName());
265 TGeoVolume* frame1 = CreateFrameForModule(TString("frame1_") + station->GetName());
266
267 TGeoCombiTrans* module0_transform = new TGeoCombiTrans();
268 module0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
269 ZModuleShifts[stationNum][0] + 0.5 * ZGasSize);
270 module0_transform->RotateY(-31.0); // deg
271
272 TGeoCombiTrans* module1_transform = new TGeoCombiTrans();
273 module1_transform->RotateZ(180);
274 module1_transform->SetTranslation(XModuleShifts[stationNum][1], YModuleShifts[stationNum][1],
275 ZModuleShifts[stationNum][1] + 0.5 * ZGasSize);
276 module1_transform->RotateY(-31.0); // deg
277
278 TGeoCombiTrans* frame0_transform = new TGeoCombiTrans();
279 frame0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
280 ZModuleShifts[stationNum][0] + 0.5 * ZGasSize);
281 frame0_transform->RotateY(-31.0); // deg
282
283 TGeoCombiTrans* frame1_transform = new TGeoCombiTrans();
284 frame1_transform->RotateZ(180);
285 frame1_transform->SetTranslation(XModuleShifts[stationNum][1], YModuleShifts[stationNum][1],
286 ZModuleShifts[stationNum][1] + 0.5 * ZGasSize);
287 frame1_transform->RotateY(-31.0); // deg
288
289 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
290 station_transform->SetTranslation(XStationPositions[stationNum], YStationPositions[stationNum],
291 ZStationPositions[stationNum]);
292
293 station->AddNode(module0, 0, new TGeoCombiTrans(*module0_transform));
294 station->AddNode(module1, 0, new TGeoCombiTrans(*module1_transform));
295
296 station->AddNode(frame0, 0, new TGeoCombiTrans(*frame0_transform));
297 station->AddNode(frame1, 0, new TGeoCombiTrans(*frame1_transform));
298
299 CSC->AddNode(station, 0, station_transform);
300 }
301
302 top->AddNode(CSC, 0);
304
305 // --------------- Finish -----------------------------------------------
306 gGeoMan->CloseGeometry();
307 gGeoMan->CheckOverlaps(0.0001);
308 gGeoMan->PrintOverlaps();
309 gGeoMan->Test();
310 // gGeoMan->RestoreMasterVolume();
311
312 TFile* geoFile = new TFile(geoFileName, "RECREATE");
313 top->Write();
314 geoFile->Close();
315 top->Draw("ogl");
316}
317
319{
320
321 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
322 stationA->SetMedium(pMedAir);
323
324 return stationA;
325}
326
328{
329
330 // shapes
331 TGeoShape* moduleS =
332 new TGeoBBox(TString("moduleS") += TString("_") + module_name, XGasSize * 0.5, YGasSize * 0.5, ZGasSize * 0.5);
333 TGeoShape* sensS =
334 new TGeoBBox(TString("sensS") += TString("_") + module_name, XSensSize * 0.5, YSensSize * 0.5, ZSensSize * 0.5);
335
336 // volumes
337 TGeoVolume* moduleV = new TGeoVolume(TString("moduleV") += TString("_") + module_name, moduleS);
338 TGeoVolume* sensV = new TGeoVolume(TString("CSCSensor") += TString("_") + module_name, sensS);
339
340 // medium
344 } else
345 Fatal("Main", "Invalid medium for moduleV and sensV volumes!");
346
347 // volume visual property (transparency)
348 moduleV->SetLineColor(TColor::GetColor("#47ffca"));
349 moduleV->SetTransparency(50);
350 sensV->SetLineColor(TColor::GetColor("#ff47ca"));
351 sensV->SetTransparency(50);
352
353 // inner spacer (the spacer located inside a sensitive volume (gas)) --------
354 Double_t innerSpacerPart1_Radius = 1.65 * 0.5; // cm
355 Double_t innerSpacerPart1_ZSize = 0.12; // cm
356
357 Double_t innerSpacerPart2_Radius = 1.15 * 0.5; // cm
358 Double_t innerSpacerPart2_ZSize = 0.52; // cm
359
360 TGeoShape* innerSpacerPart1S =
361 new TGeoTubeSeg(TString("innerSpacerPart1S") += TString("_") + moduleV->GetName(), 0.0, innerSpacerPart1_Radius,
362 innerSpacerPart1_ZSize * 0.5, 0.0, 180.0);
363 TGeoShape* innerSpacerPart2S =
364 new TGeoTubeSeg(TString("innerSpacerPart2S") += TString("_") + moduleV->GetName(), 0.0, innerSpacerPart2_Radius,
365 innerSpacerPart2_ZSize * 0.5, 0.0, 180.0);
366
367 TGeoTranslation* innerSpacerPart1_pos1 = new TGeoTranslation();
368 innerSpacerPart1_pos1->SetName(TString("innerSpacerPart1_pos1") += TString("_") + moduleV->GetName());
369 innerSpacerPart1_pos1->SetDx(0.0);
370 innerSpacerPart1_pos1->SetDy(0.0);
371 innerSpacerPart1_pos1->SetDz(-(ZGasSize * 0.5 - innerSpacerPart1_ZSize * 0.5));
372 innerSpacerPart1_pos1->RegisterYourself();
373
374 TGeoTranslation* innerSpacerPart1_pos2 = new TGeoTranslation();
375 innerSpacerPart1_pos2->SetName(TString("innerSpacerPart1_pos2") += TString("_") + moduleV->GetName());
376 innerSpacerPart1_pos2->SetDx(0.0);
377 innerSpacerPart1_pos2->SetDy(0.0);
378 innerSpacerPart1_pos2->SetDz(+(ZGasSize * 0.5 - innerSpacerPart1_ZSize * 0.5));
379 innerSpacerPart1_pos2->RegisterYourself();
380
381 TGeoTranslation* innerSpacerPart2_pos = new TGeoTranslation();
382 innerSpacerPart2_pos->SetName(TString("innerSpacerPart2_pos") += TString("_") + moduleV->GetName());
383 innerSpacerPart2_pos->SetDx(0.0);
384 innerSpacerPart2_pos->SetDy(0.0);
385 innerSpacerPart2_pos->SetDz(0.0);
386 innerSpacerPart2_pos->RegisterYourself();
387
388 TGeoCompositeShape* innerSpacerS = new TGeoCompositeShape();
389 innerSpacerS->SetName(TString("innerSpacerS") += TString("_") + moduleV->GetName());
390 {
391 TString expression = "innerSpacerPart1S";
392 expression += TString("_") + moduleV->GetName();
393 expression += ":innerSpacerPart1_pos1";
394 expression += TString("_") + moduleV->GetName();
395 expression += "+innerSpacerPart1S";
396 expression += TString("_") + moduleV->GetName();
397 expression += ":innerSpacerPart1_pos2";
398 expression += TString("_") + moduleV->GetName();
399 expression += "+innerSpacerPart2S";
400 expression += TString("_") + moduleV->GetName();
401 expression += ":innerSpacerPart2_pos";
402 expression += TString("_") + moduleV->GetName();
403
404 innerSpacerS->MakeNode(expression);
405 innerSpacerS->ComputeBBox(); // need to compute a bounding box
406 }
407
408 TGeoVolume* innerSpacerV =
409 new TGeoVolume(TString("innerSpacerV") += TString("_") + moduleV->GetName(), innerSpacerS);
410
411 // volume medium
412 TGeoMedium* innerSpacerV_medium = pMedEpoxideCompound;
413 if (innerSpacerV_medium) {
414 innerSpacerV->SetMedium(innerSpacerV_medium);
415 } else
416 Fatal("Main", "Invalid medium for innerSpacerV!");
417
418 // volume visual property (transparency)
419 innerSpacerV->SetLineColor(TColor::GetColor("#ffcf40"));
420 innerSpacerV->SetTransparency(0);
421
422 TGeoCombiTrans* innerSpacerV_transf[1];
423
424 innerSpacerV_transf[0] = new TGeoCombiTrans();
425 innerSpacerV_transf[0]->SetDx(0.0);
426 innerSpacerV_transf[0]->SetDy(-(YSensSize * 0.5));
427 innerSpacerV_transf[0]->SetDz(0.0);
428
429 sensV->AddNode(innerSpacerV, 0, innerSpacerV_transf[0]);
430 //--------------------------------------------------------------------------
431
432 // support wire -------------------------------------------------------------
433 Double_t supportWire_YSize = YSensSize - 1.15 * 0.5 /*cut element*/; // cm
434 Double_t supportWire_Radius = 0.08 * 0.5; // cm
435
436 TGeoShape* supportWireS = new TGeoTube(TString("supportWireS") += TString("_") + moduleV->GetName(), 0.0,
437 supportWire_Radius, supportWire_YSize * 0.5);
438
439 TGeoVolume* supportWireV =
440 new TGeoVolume(TString("supportWireV") += TString("_") + moduleV->GetName(), supportWireS);
441
442 // volume medium
443 TGeoMedium* supportWireV_medium = pMedTeflon;
444 if (supportWireV_medium) {
445 supportWireV->SetMedium(supportWireV_medium);
446 } else
447 Fatal("Main", "Invalid medium for supportWireV!");
448
449 // volume visual property (transparency)
450 supportWireV->SetLineColor(TColor::GetColor("#5294ff"));
451 supportWireV->SetTransparency(0);
452
453 TGeoCombiTrans* supportWireV_transf[2];
454
455 supportWireV_transf[0] = new TGeoCombiTrans();
456 supportWireV_transf[0]->RotateX(90.0);
457 supportWireV_transf[0]->SetDx(+0.4 /*shift*/);
458 supportWireV_transf[0]->SetDy(+(YSensSize - supportWire_YSize) * 0.5);
459 supportWireV_transf[0]->SetDz(-(supportWire_Radius + 0.005 /*shift*/));
460
461 supportWireV_transf[1] = new TGeoCombiTrans();
462 supportWireV_transf[1]->RotateX(90.0);
463 supportWireV_transf[1]->SetDx(+0.4 /*shift*/);
464 supportWireV_transf[1]->SetDy(+(YSensSize - supportWire_YSize) * 0.5);
465 supportWireV_transf[1]->SetDz(+(supportWire_Radius + 0.005 /*shift*/));
466
467 sensV->AddNode(supportWireV, 0, supportWireV_transf[0]);
468 sensV->AddNode(supportWireV, 1, supportWireV_transf[1]);
469 //--------------------------------------------------------------------------
470
471 TGeoCombiTrans* sensV_transf[1];
472 sensV_transf[0] = new TGeoCombiTrans();
473 sensV_transf[0]->SetDx(0.0);
474 sensV_transf[0]->SetDy(-(YGasSize - YSensSize) * 0.5);
475 sensV_transf[0]->SetDz(0.0);
476
477 moduleV->AddNode(sensV, 0, sensV_transf[0]);
478
479 return moduleV;
480}
481//------------------------------------------------------------------------------
482
484{
485
486 // frame
487 TGeoVolume* frameA = new TGeoVolumeAssembly(frame_name);
488 frameA->SetMedium(pMedAir);
489
490 // vertical frames ----------------------------------------------------------
491 Double_t verticalFrame_XSize = 4.5; // cm
492 Double_t verticalFrame_YSize = YGasSize; // cm
493 Double_t verticalFrame_ZSize = 3.25; // cm
494
495 Double_t verticalFrameHole_Radius = 1.6 * 0.5; // cm
496 Double_t verticalFrameHole_ZSize = 0.6; // cm
497
498 TGeoShape* verticalFrameS =
499 new TGeoBBox(TString("verticalFrameS") += TString("_") + frameA->GetName(), verticalFrame_XSize * 0.5,
500 verticalFrame_YSize * 0.5, verticalFrame_ZSize * 0.5);
501 TGeoShape* verticalFrameHoleS = new TGeoTube(TString("verticalFrameHoleS") += TString("_") + frameA->GetName(), 0.0,
502 verticalFrameHole_Radius, verticalFrameHole_ZSize * 0.5);
503
504 TGeoVolume* verticalFrameV =
505 new TGeoVolume(TString("verticalFrameV") += TString("_") + frameA->GetName(), verticalFrameS);
506 TGeoVolume* verticalFrameHoleV =
507 new TGeoVolume(TString("verticalFrameHoleV") += TString("_") + frameA->GetName(), verticalFrameHoleS);
508
509 // volume medium
510 TGeoMedium* verticalFrameV_medium = pMedFiberGlass;
511 if (verticalFrameV_medium) {
512 verticalFrameV->SetMedium(verticalFrameV_medium);
513 } else
514 Fatal("Main", "Invalid medium for verticalFrameV!");
515
516 TGeoMedium* verticalFrameHoleV_medium = pMedAir;
517 if (verticalFrameHoleV_medium) {
518 verticalFrameHoleV->SetMedium(verticalFrameHoleV_medium);
519 } else
520 Fatal("Main", "Invalid medium for verticalFrameHoleV!");
521
522 // volume visual property (transparency)
523 verticalFrameV->SetLineColor(TColor::GetColor("#9999ff"));
524 verticalFrameV->SetTransparency(0);
525 verticalFrameHoleV->SetLineColor(TColor::GetColor("#ffffff"));
526 verticalFrameHoleV->SetTransparency(0);
527
528 TGeoCombiTrans* verticalFrameHoleV_transf[4];
529 {
530 Double_t y_pos = +verticalFrame_YSize * 0.5 - 9.175;
531 for (Int_t i = 0; i < 4; ++i) {
532 verticalFrameHoleV_transf[i] = new TGeoCombiTrans();
533 verticalFrameHoleV_transf[i]->SetDx(+0.65 /*shift*/);
534 verticalFrameHoleV_transf[i]->SetDy(y_pos);
535 verticalFrameHoleV_transf[i]->SetDz(-verticalFrame_ZSize * 0.5 + verticalFrameHole_ZSize * 0.5
536 - 0.0001 /*shift*/);
537
538 verticalFrameHoleV_transf[i + 4] = new TGeoCombiTrans();
539 verticalFrameHoleV_transf[i + 4]->SetDx(+0.65 /*shift*/);
540 verticalFrameHoleV_transf[i + 4]->SetDy(y_pos);
541 verticalFrameHoleV_transf[i + 4]->SetDz(
542 -(-verticalFrame_ZSize * 0.5 + verticalFrameHole_ZSize * 0.5 - 0.0001 /*shift*/));
543
544 verticalFrameV->AddNode(verticalFrameHoleV, i, verticalFrameHoleV_transf[i]);
545 verticalFrameV->AddNode(verticalFrameHoleV, i + 4, verticalFrameHoleV_transf[i + 4]);
546
547 y_pos -= 12.5;
548 }
549 }
550
551 TGeoCombiTrans* verticalFrameV_transf[2];
552
553 verticalFrameV_transf[0] = new TGeoCombiTrans();
554 verticalFrameV_transf[0]->SetDx(+(XGasSize * 0.5 + verticalFrame_XSize * 0.5));
555 verticalFrameV_transf[0]->SetDy(0.0);
556 verticalFrameV_transf[0]->SetDz(0.0);
557
558 verticalFrameV_transf[1] = new TGeoCombiTrans();
559 verticalFrameV_transf[1]->ReflectX(true);
560 verticalFrameV_transf[1]->SetDx(-(XGasSize * 0.5 + verticalFrame_XSize * 0.5));
561 verticalFrameV_transf[1]->SetDy(0.0);
562 verticalFrameV_transf[1]->SetDz(0.0);
563
564 frameA->AddNode(verticalFrameV, 0, verticalFrameV_transf[0]);
565 frameA->AddNode(verticalFrameV, 1, verticalFrameV_transf[1]);
566 //--------------------------------------------------------------------------
567
568 // horizontal frame ---------------------------------------------------------
569 Double_t horizontalFrame_XSize = XGasSize + verticalFrame_XSize * 2; // cm
570 Double_t horizontalFrame_YSize = 4.5; // cm
571 Double_t horizontalFrame_ZSize = 3.25; // cm
572
573 Double_t horizontalFrameHole_Radius = 1.6 * 0.5; // cm
574 Double_t horizontalFrameHole_ZSize = 0.6; // cm
575
576 TGeoShape* horizontalFrameS =
577 new TGeoBBox(TString("horizontalFrameS") += TString("_") + frameA->GetName(), horizontalFrame_XSize * 0.5,
578 horizontalFrame_YSize * 0.5, horizontalFrame_ZSize * 0.5);
579 TGeoShape* horizontalFrameHoleS = new TGeoTube(TString("horizontalFrameHoleS") += TString("_") + frameA->GetName(),
580 0.0, horizontalFrameHole_Radius, horizontalFrameHole_ZSize * 0.5);
581
582 TGeoVolume* horizontalFrameV =
583 new TGeoVolume(TString("horizontalFrameV") += TString("_") + frameA->GetName(), horizontalFrameS);
584 TGeoVolume* horizontalFrameHoleV =
585 new TGeoVolume(TString("horizontalFrameHoleV") += TString("_") + frameA->GetName(), horizontalFrameHoleS);
586
587 // volume medium
588 TGeoMedium* horizontalFrameV_medium = pMedFiberGlass;
589 if (horizontalFrameV_medium) {
590 horizontalFrameV->SetMedium(horizontalFrameV_medium);
591 } else
592 Fatal("Main", "Invalid medium for horizontalFrameV!");
593
594 TGeoMedium* horizontalFrameHoleV_medium = pMedAir;
595 if (horizontalFrameHoleV_medium) {
596 horizontalFrameHoleV->SetMedium(horizontalFrameHoleV_medium);
597 } else
598 Fatal("Main", "Invalid medium for horizontalFrameHoleV!");
599
600 // volume visual property (transparency)
601 horizontalFrameV->SetLineColor(TColor::GetColor("#9999ff"));
602 horizontalFrameV->SetTransparency(0);
603 horizontalFrameHoleV->SetLineColor(TColor::GetColor("#ffffff"));
604 horizontalFrameHoleV->SetTransparency(0);
605
606 TGeoCombiTrans* horizontalFrameHoleV_transf[10];
607 {
608 Double_t x_pos = horizontalFrame_XSize * 0.5 - 1.6;
609 for (Int_t i = 0; i < 10; ++i) {
610 horizontalFrameHoleV_transf[i] = new TGeoCombiTrans();
611 horizontalFrameHoleV_transf[i]->SetDx(x_pos);
612 horizontalFrameHoleV_transf[i]->SetDy(+0.65 /*shift*/);
613 horizontalFrameHoleV_transf[i]->SetDz(-horizontalFrame_ZSize * 0.5 + horizontalFrameHole_ZSize * 0.5
614 - 0.0001 /*shift*/);
615
616 horizontalFrameHoleV_transf[i + 10] = new TGeoCombiTrans();
617 horizontalFrameHoleV_transf[i + 10]->SetDx(x_pos);
618 horizontalFrameHoleV_transf[i + 10]->SetDy(+0.65 /*shift*/);
619 horizontalFrameHoleV_transf[i + 10]->SetDz(
620 -(-horizontalFrame_ZSize * 0.5 + horizontalFrameHole_ZSize * 0.5 - 0.0001 /*shift*/));
621
622 horizontalFrameV->AddNode(horizontalFrameHoleV, i, horizontalFrameHoleV_transf[i]);
623 horizontalFrameV->AddNode(horizontalFrameHoleV, i + 10, horizontalFrameHoleV_transf[i + 10]);
624
625 if (i == 0 || i == 8)
626 x_pos -= 15.6;
627 else
628 x_pos -= 12.5;
629 }
630 }
631
632 TGeoCombiTrans* horizontalFrameV_transf[1];
633
634 horizontalFrameV_transf[0] = new TGeoCombiTrans();
635 horizontalFrameV_transf[0]->SetDx(0.0);
636 horizontalFrameV_transf[0]->SetDy(+(YGasSize * 0.5 + horizontalFrame_YSize * 0.5));
637 horizontalFrameV_transf[0]->SetDz(0.0);
638
639 frameA->AddNode(horizontalFrameV, 0, horizontalFrameV_transf[0]);
640 //--------------------------------------------------------------------------
641
642 // panels -------------------------------------------------------------------
643 Double_t fiberGlassPanel_XSize = XGasSize; // cm
644 Double_t fiberGlassPanel_YSize = YGasSize; // cm
645 Double_t fiberGlassPanel_ZSize = 0.1; // cm
646 Double_t fiberGlassPanel_HoleRadius = 1.75; // cm
647
648 Double_t honeyCombPanel_XSize = XGasSize; // cm
649 Double_t honeyCombPanel_YSize = YGasSize; // cm
650 Double_t honeyCombPanel_ZSize = 1.05; // cm
651 Double_t honeyCombPanel_HoleRadius = 1.75; // cm
652
653 // TGeoShape *fiberGlassPanelS = new TGeoBBox(TString("fiberGlassPanelS")+=TString("_") + frameA->GetName(),
654 // fiberGlassPanel_XSize*0.5, fiberGlassPanel_YSize*0.5, fiberGlassPanel_ZSize*0.5);
655 TGeoShape* fiberGlassPanelBigPartS = new TGeoBBox(
656 TString("fiberGlassPanelBigPartS") += TString("_") + frameA->GetName(), fiberGlassPanel_XSize * 0.5,
657 (fiberGlassPanel_YSize - fiberGlassPanel_HoleRadius) * 0.5, fiberGlassPanel_ZSize * 0.5);
658 TGeoShape* fiberGlassPanelSmallPartS =
659 new TGeoBBox(TString("fiberGlassPanelSmallPartS") += TString("_") + frameA->GetName(),
660 (fiberGlassPanel_XSize * 0.5 - fiberGlassPanel_HoleRadius) * 0.5, fiberGlassPanel_HoleRadius * 0.5,
661 fiberGlassPanel_ZSize * 0.5);
662
663 TGeoTranslation* fiberGlassPanelBigPart_pos = new TGeoTranslation();
664 fiberGlassPanelBigPart_pos->SetName(TString("fiberGlassPanelBigPart_pos") += TString("_") + frameA->GetName());
665 fiberGlassPanelBigPart_pos->SetDx(0.0);
666 fiberGlassPanelBigPart_pos->SetDy(+fiberGlassPanel_HoleRadius * 0.5 + 0.0001);
667 fiberGlassPanelBigPart_pos->SetDz(0.0);
668 fiberGlassPanelBigPart_pos->RegisterYourself();
669
670 TGeoTranslation* fiberGlassPanelSmallPart_pos1 = new TGeoTranslation();
671 fiberGlassPanelSmallPart_pos1->SetName(TString("fiberGlassPanelSmallPart_pos1") +=
672 TString("_") + frameA->GetName());
673 fiberGlassPanelSmallPart_pos1->SetDx(+(fiberGlassPanel_XSize * 0.5 + fiberGlassPanel_HoleRadius) * 0.5);
674 fiberGlassPanelSmallPart_pos1->SetDy(-(fiberGlassPanel_YSize - fiberGlassPanel_HoleRadius) * 0.5);
675 fiberGlassPanelSmallPart_pos1->SetDz(0.0);
676 fiberGlassPanelSmallPart_pos1->RegisterYourself();
677
678 TGeoTranslation* fiberGlassPanelSmallPart_pos2 = new TGeoTranslation();
679 fiberGlassPanelSmallPart_pos2->SetName(TString("fiberGlassPanelSmallPart_pos2") +=
680 TString("_") + frameA->GetName());
681 fiberGlassPanelSmallPart_pos2->SetDx(-(fiberGlassPanel_XSize * 0.5 + fiberGlassPanel_HoleRadius) * 0.5);
682 fiberGlassPanelSmallPart_pos2->SetDy(-(fiberGlassPanel_YSize - fiberGlassPanel_HoleRadius) * 0.5);
683 fiberGlassPanelSmallPart_pos2->SetDz(0.0);
684 fiberGlassPanelSmallPart_pos2->RegisterYourself();
685
686 TGeoCompositeShape* fiberGlassPanelS = new TGeoCompositeShape();
687 fiberGlassPanelS->SetName(TString("fiberGlassPanelS") += TString("_") + frameA->GetName());
688 {
689 TString expression = "fiberGlassPanelBigPartS";
690 expression += TString("_") + frameA->GetName();
691 expression += ":fiberGlassPanelBigPart_pos";
692 expression += TString("_") + frameA->GetName();
693 expression += "+fiberGlassPanelSmallPartS";
694 expression += TString("_") + frameA->GetName();
695 expression += ":fiberGlassPanelSmallPart_pos1";
696 expression += TString("_") + frameA->GetName();
697 expression += "+fiberGlassPanelSmallPartS";
698 expression += TString("_") + frameA->GetName();
699 expression += ":fiberGlassPanelSmallPart_pos2";
700 expression += TString("_") + frameA->GetName();
701
702 fiberGlassPanelS->MakeNode(expression);
703 fiberGlassPanelS->ComputeBBox(); // need to compute a bounding box
704 }
705
706 // TGeoShape *honeyCombPanelS = new TGeoBBox(TString("honeyCombPanelS")+=TString("_") + frameA->GetName(),
707 // honeyCombPanel_XSize*0.5, honeyCombPanel_YSize*0.5, honeyCombPanel_ZSize*0.5);
708 TGeoShape* honeyCombPanelBigPartS =
709 new TGeoBBox(TString("honeyCombPanelBigPartS") += TString("_") + frameA->GetName(), honeyCombPanel_XSize * 0.5,
710 (honeyCombPanel_YSize - honeyCombPanel_HoleRadius) * 0.5, honeyCombPanel_ZSize * 0.5);
711 TGeoShape* honeyCombPanelSmallPartS =
712 new TGeoBBox(TString("honeyCombPanelSmallPartS") += TString("_") + frameA->GetName(),
713 (honeyCombPanel_XSize * 0.5 - honeyCombPanel_HoleRadius) * 0.5, honeyCombPanel_HoleRadius * 0.5,
714 honeyCombPanel_ZSize * 0.5);
715
716 TGeoTranslation* honeyCombPanelBigPart_pos = new TGeoTranslation();
717 honeyCombPanelBigPart_pos->SetName(TString("honeyCombPanelBigPart_pos") += TString("_") + frameA->GetName());
718 honeyCombPanelBigPart_pos->SetDx(0.0);
719 honeyCombPanelBigPart_pos->SetDy(+honeyCombPanel_HoleRadius * 0.5 + 0.0001);
720 honeyCombPanelBigPart_pos->SetDz(0.0);
721 honeyCombPanelBigPart_pos->RegisterYourself();
722
723 TGeoTranslation* honeyCombPanelSmallPart_pos1 = new TGeoTranslation();
724 honeyCombPanelSmallPart_pos1->SetName(TString("honeyCombPanelSmallPart_pos1") += TString("_") + frameA->GetName());
725 honeyCombPanelSmallPart_pos1->SetDx(+(honeyCombPanel_XSize * 0.5 + honeyCombPanel_HoleRadius) * 0.5);
726 honeyCombPanelSmallPart_pos1->SetDy(-(honeyCombPanel_YSize - honeyCombPanel_HoleRadius) * 0.5);
727 honeyCombPanelSmallPart_pos1->SetDz(0.0);
728 honeyCombPanelSmallPart_pos1->RegisterYourself();
729
730 TGeoTranslation* honeyCombPanelSmallPart_pos2 = new TGeoTranslation();
731 honeyCombPanelSmallPart_pos2->SetName(TString("honeyCombPanelSmallPart_pos2") += TString("_") + frameA->GetName());
732 honeyCombPanelSmallPart_pos2->SetDx(-(honeyCombPanel_XSize * 0.5 + honeyCombPanel_HoleRadius) * 0.5);
733 honeyCombPanelSmallPart_pos2->SetDy(-(honeyCombPanel_YSize - honeyCombPanel_HoleRadius) * 0.5);
734 honeyCombPanelSmallPart_pos2->SetDz(0.0);
735 honeyCombPanelSmallPart_pos2->RegisterYourself();
736
737 TGeoCompositeShape* honeyCombPanelS = new TGeoCompositeShape();
738 honeyCombPanelS->SetName(TString("honeyCombPanelS") += TString("_") + frameA->GetName());
739 {
740 TString expression = "honeyCombPanelBigPartS";
741 expression += TString("_") + frameA->GetName();
742 expression += ":honeyCombPanelBigPart_pos";
743 expression += TString("_") + frameA->GetName();
744 expression += "+honeyCombPanelSmallPartS";
745 expression += TString("_") + frameA->GetName();
746 expression += ":honeyCombPanelSmallPart_pos1";
747 expression += TString("_") + frameA->GetName();
748 expression += "+honeyCombPanelSmallPartS";
749 expression += TString("_") + frameA->GetName();
750 expression += ":honeyCombPanelSmallPart_pos2";
751 expression += TString("_") + frameA->GetName();
752
753 honeyCombPanelS->MakeNode(expression);
754 honeyCombPanelS->ComputeBBox(); // need to compute a bounding box
755 }
756
757 TGeoVolume* fiberGlassPanelV =
758 new TGeoVolume(TString("fiberGlassPanelV") += TString("_") + frameA->GetName(), fiberGlassPanelS);
759 TGeoVolume* honeyCombPanelV =
760 new TGeoVolume(TString("honeyCombPanelV") += TString("_") + frameA->GetName(), honeyCombPanelS);
761
762 // volume medium
763 TGeoMedium* fiberGlassPanelV_medium = pMedFiberGlass;
764 if (fiberGlassPanelV_medium) {
765 fiberGlassPanelV->SetMedium(fiberGlassPanelV_medium);
766 } else
767 Fatal("Main", "Invalid medium for fiberGlassPanelV!");
768
769 TGeoMedium* honeyCombPanelV_medium = pMedHoneyComb;
770 if (honeyCombPanelV_medium) {
771 honeyCombPanelV->SetMedium(honeyCombPanelV_medium);
772 } else
773 Fatal("Main", "Invalid medium for honeyCombPanelV!");
774
775 // volume visual property (transparency)
776 fiberGlassPanelV->SetLineColor(TColor::GetColor("#ffcf40"));
777 fiberGlassPanelV->SetTransparency(0);
778 honeyCombPanelV->SetLineColor(TColor::GetColor("#ffff00"));
779 honeyCombPanelV->SetTransparency(0);
780
781 TGeoCombiTrans* fiberGlassPanelV_transf[4];
782
783 fiberGlassPanelV_transf[0] = new TGeoCombiTrans();
784 fiberGlassPanelV_transf[0]->SetDx(0.0);
785 fiberGlassPanelV_transf[0]->SetDy(0.0);
786 fiberGlassPanelV_transf[0]->SetDz(-(ZGasSize * 0.5 + fiberGlassPanel_ZSize * 0.5));
787
788 fiberGlassPanelV_transf[1] = new TGeoCombiTrans();
789 fiberGlassPanelV_transf[1]->SetDx(0.0);
790 fiberGlassPanelV_transf[1]->SetDy(0.0);
791 fiberGlassPanelV_transf[1]->SetDz(+(ZGasSize * 0.5 + fiberGlassPanel_ZSize * 0.5));
792
793 fiberGlassPanelV_transf[2] = new TGeoCombiTrans();
794 fiberGlassPanelV_transf[2]->SetDx(0.0);
795 fiberGlassPanelV_transf[2]->SetDy(0.0);
796 fiberGlassPanelV_transf[2]->SetDz(
797 -(ZGasSize * 0.5 + fiberGlassPanel_ZSize + honeyCombPanel_ZSize + fiberGlassPanel_ZSize * 0.5));
798
799 fiberGlassPanelV_transf[3] = new TGeoCombiTrans();
800 fiberGlassPanelV_transf[3]->SetDx(0.0);
801 fiberGlassPanelV_transf[3]->SetDy(0.0);
802 fiberGlassPanelV_transf[3]->SetDz(
803 +(ZGasSize * 0.5 + fiberGlassPanel_ZSize + honeyCombPanel_ZSize + fiberGlassPanel_ZSize * 0.5));
804
805 TGeoCombiTrans* honeyCombPanelV_transf[4];
806
807 honeyCombPanelV_transf[0] = new TGeoCombiTrans();
808 honeyCombPanelV_transf[0]->SetDx(0.0);
809 honeyCombPanelV_transf[0]->SetDy(0.0);
810 honeyCombPanelV_transf[0]->SetDz(-(ZGasSize * 0.5 + fiberGlassPanel_ZSize + honeyCombPanel_ZSize * 0.5));
811
812 honeyCombPanelV_transf[1] = new TGeoCombiTrans();
813 honeyCombPanelV_transf[1]->SetDx(0.0);
814 honeyCombPanelV_transf[1]->SetDy(0.0);
815 honeyCombPanelV_transf[1]->SetDz(+(ZGasSize * 0.5 + fiberGlassPanel_ZSize + honeyCombPanel_ZSize * 0.5));
816
817 frameA->AddNode(fiberGlassPanelV, 0, fiberGlassPanelV_transf[0]);
818 frameA->AddNode(fiberGlassPanelV, 1, fiberGlassPanelV_transf[1]);
819 frameA->AddNode(fiberGlassPanelV, 2, fiberGlassPanelV_transf[2]);
820 frameA->AddNode(fiberGlassPanelV, 3, fiberGlassPanelV_transf[3]);
821
822 frameA->AddNode(honeyCombPanelV, 0, honeyCombPanelV_transf[0]);
823 frameA->AddNode(honeyCombPanelV, 1, honeyCombPanelV_transf[1]);
824 //--------------------------------------------------------------------------
825
826 // outer spacer (the spacer located inside a sensitive volume (gas)) --------
827 Double_t outerSpacerPart1_Radius = 0.8 * 0.5; // cm
828 Double_t outerSpacerPart1_ZSize = 0.4; // cm
829
830 TGeoShape* outerSpacerPart1S =
831 new TGeoTubeSeg(TString("outerSpacerPart1S") += TString("_") + frameA->GetName(), 0.0, outerSpacerPart1_Radius,
832 outerSpacerPart1_ZSize * 0.5, 0.0, 360.0);
833
834 TGeoTranslation* outerSpacerPart1_pos1 = new TGeoTranslation();
835 outerSpacerPart1_pos1->SetName(TString("outerSpacerPart1_pos1") += TString("_") + frameA->GetName());
836 outerSpacerPart1_pos1->SetDx(0.0);
837 outerSpacerPart1_pos1->SetDy(0.0);
838 outerSpacerPart1_pos1->SetDz(-(ZGasSize * 0.5 + outerSpacerPart1_ZSize * 0.5));
839 outerSpacerPart1_pos1->RegisterYourself();
840
841 TGeoTranslation* outerSpacerPart1_pos2 = new TGeoTranslation();
842 outerSpacerPart1_pos2->SetName(TString("outerSpacerPart1_pos2") += TString("_") + frameA->GetName());
843 outerSpacerPart1_pos2->SetDx(0.0);
844 outerSpacerPart1_pos2->SetDy(0.0);
845 outerSpacerPart1_pos2->SetDz(+(ZGasSize * 0.5 + outerSpacerPart1_ZSize * 0.5));
846 outerSpacerPart1_pos2->RegisterYourself();
847
848 TGeoCompositeShape* outerSpacerS = new TGeoCompositeShape();
849 outerSpacerS->SetName(TString("outerSpacerS") += TString("_") + frameA->GetName());
850 {
851 TString expression = "outerSpacerPart1S";
852 expression += TString("_") + frameA->GetName();
853 expression += ":outerSpacerPart1_pos1";
854 expression += TString("_") + frameA->GetName();
855 expression += "+outerSpacerPart1S";
856 expression += TString("_") + frameA->GetName();
857 expression += ":outerSpacerPart1_pos2";
858 expression += TString("_") + frameA->GetName();
859
860 outerSpacerS->MakeNode(expression);
861 outerSpacerS->ComputeBBox(); // need to compute a bounding box
862 }
863
864 TGeoVolume* outerSpacerV =
865 new TGeoVolume(TString("outerSpacerV") += TString("_") + frameA->GetName(), outerSpacerS);
866
867 // volume medium
868 TGeoMedium* outerSpacerV_medium = pMedEpoxideCompound;
869 if (outerSpacerV_medium) {
870 outerSpacerV->SetMedium(outerSpacerV_medium);
871 } else
872 Fatal("Main", "Invalid medium for outerSpacerV!");
873
874 // volume visual property (transparency)
875 outerSpacerV->SetLineColor(TColor::GetColor("#ffcf40"));
876 outerSpacerV->SetTransparency(0);
877
878 TGeoCombiTrans* outerSpacerV_transf[1];
879
880 outerSpacerV_transf[0] = new TGeoCombiTrans();
881 outerSpacerV_transf[0]->SetDx(0.0);
882 outerSpacerV_transf[0]->SetDy(-(YGasSize * 0.5));
883 outerSpacerV_transf[0]->SetDz(0.0);
884
885 if (!TString(frameA->GetName()).Contains("frame1")) {
886 frameA->AddNode(outerSpacerV, 0, outerSpacerV_transf[0]);
887 }
888 //--------------------------------------------------------------------------
889
890 // spacer bed ---------------------------------------------------------------
891 Double_t spacerBed_XSize = 3.5; // cm
892 Double_t spacerBed_YSize = 3.5; // cm
893 Double_t spacerBed_ZSize = 1.25; // cm
894
895 Double_t spacerBedInnerHole_Radius = 0.8 * 0.5 + 0.01; // cm
896 Double_t spacerBedInnerHole_ZSize = 0.4; // cm
897
898 Double_t spacerBedOuterHole_Radius = 2.0 * 0.5; // cm
899 Double_t spacerBedOuterHole_ZSize = 0.85; // cm
900
901 TGeoShape* spacerBedBlankS = new TGeoBBox(TString("spacerBedBlankS") += TString("_") + frameA->GetName(),
902 spacerBed_XSize * 0.5, spacerBed_YSize * 0.5, spacerBed_ZSize * 0.5);
903 TGeoShape* spacerBedInnerHoleS = new TGeoTube(TString("spacerBedInnerHoleS") += TString("_") + frameA->GetName(),
904 0.0, spacerBedInnerHole_Radius, (spacerBed_ZSize + 0.01) * 0.5);
905 TGeoShape* spacerBedOuterHoleS =
906 new TGeoTube(TString("spacerBedOuterHoleS") += TString("_") + frameA->GetName(), 0.0, spacerBedOuterHole_Radius,
907 (spacerBedOuterHole_ZSize + 0.01) * 0.5);
908
909 TGeoTranslation* spacerBedBlank_pos = new TGeoTranslation();
910 spacerBedBlank_pos->SetName(TString("spacerBedBlank_pos") += TString("_") + frameA->GetName());
911 spacerBedBlank_pos->SetDx(0.0);
912 spacerBedBlank_pos->SetDy(0.0);
913 spacerBedBlank_pos->SetDz(0.0);
914 spacerBedBlank_pos->RegisterYourself();
915
916 TGeoTranslation* spacerBedInnerHole_pos = new TGeoTranslation();
917 spacerBedInnerHole_pos->SetName(TString("spacerBedInnerHole_pos") += TString("_") + frameA->GetName());
918 spacerBedInnerHole_pos->SetDx(0.0);
919 spacerBedInnerHole_pos->SetDy(0.0);
920 spacerBedInnerHole_pos->SetDz(0.0);
921 spacerBedInnerHole_pos->RegisterYourself();
922
923 TGeoTranslation* spacerBedOuterHole_pos = new TGeoTranslation();
924 spacerBedOuterHole_pos->SetName(TString("spacerBedOuterHole_pos") += TString("_") + frameA->GetName());
925 spacerBedOuterHole_pos->SetDx(0.0);
926 spacerBedOuterHole_pos->SetDy(0.0);
927 spacerBedOuterHole_pos->SetDz(-(spacerBed_ZSize * 0.5 - spacerBedOuterHole_ZSize * 0.5 + 0.01));
928 spacerBedOuterHole_pos->RegisterYourself();
929
930 TGeoCompositeShape* spacerBedS = new TGeoCompositeShape();
931 spacerBedS->SetName(TString("spacerBedS") += TString("_") + frameA->GetName());
932 {
933 TString expression = "spacerBedBlankS";
934 expression += TString("_") + frameA->GetName();
935 expression += ":spacerBedBlank_pos";
936 expression += TString("_") + frameA->GetName();
937 expression += "-spacerBedOuterHoleS";
938 expression += TString("_") + frameA->GetName();
939 expression += ":spacerBedOuterHole_pos";
940 expression += TString("_") + frameA->GetName();
941 expression += "-spacerBedInnerHoleS";
942 expression += TString("_") + frameA->GetName();
943 expression += ":spacerBedInnerHole_pos";
944 expression += TString("_") + frameA->GetName();
945
946 spacerBedS->MakeNode(expression);
947 spacerBedS->ComputeBBox(); // need to compute a bounding box
948 }
949
950 TGeoVolume* spacerBedV = new TGeoVolume(TString("spacerBedV") += TString("_") + frameA->GetName(), spacerBedS);
951
952 // volume medium
953 TGeoMedium* spacerBedV_medium = pMedFiberGlass;
954 if (spacerBedV_medium) {
955 spacerBedV->SetMedium(spacerBedV_medium);
956 } else
957 Fatal("Main", "Invalid medium for spacerBedV!");
958
959 // volume visual property (transparency)
960 spacerBedV->SetLineColor(TColor::GetColor("#c2ff99"));
961 spacerBedV->SetTransparency(0);
962
963 TGeoCombiTrans* spacerBedV_transf[2];
964
965 spacerBedV_transf[0] = new TGeoCombiTrans();
966 spacerBedV_transf[0]->SetDx(0.0);
967 spacerBedV_transf[0]->SetDy(-(YGasSize * 0.5));
968 spacerBedV_transf[0]->SetDz(-(ZGasSize * 0.5 + spacerBed_ZSize * 0.5));
969
970 spacerBedV_transf[1] = new TGeoCombiTrans();
971 spacerBedV_transf[1]->RotateY(180.0);
972 spacerBedV_transf[1]->SetDx(0.0);
973 spacerBedV_transf[1]->SetDy(-(YGasSize * 0.5));
974 spacerBedV_transf[1]->SetDz(+(ZGasSize * 0.5 + spacerBed_ZSize * 0.5));
975
976 if (!TString(frameA->GetName()).Contains("frame1")) {
977 frameA->AddNode(spacerBedV, 0, spacerBedV_transf[0]);
978 frameA->AddNode(spacerBedV, 1, spacerBedV_transf[1]);
979 }
980 //--------------------------------------------------------------------------
981
982 // fixing plate -------------------------------------------------------------
983 Double_t fixingPlate_Radius = 1.8 * 0.5; // cm
984 Double_t fixingPlate_ZSize = 0.3; // cm
985
986 TGeoShape* fixingPlateS = new TGeoTube(TString("fixingPlateS") += TString("_") + frameA->GetName(), 0.0,
987 fixingPlate_Radius, fixingPlate_ZSize * 0.5);
988
989 TGeoVolume* fixingPlateV =
990 new TGeoVolume(TString("fixingPlateV") += TString("_") + frameA->GetName(), fixingPlateS);
991
992 // volume medium
993 TGeoMedium* fixingPlateV_medium = pMedBrass;
994 if (fixingPlateV_medium) {
995 fixingPlateV->SetMedium(fixingPlateV_medium);
996 } else
997 Fatal("Main", "Invalid medium for fixingPlateV!");
998
999 // volume visual property (transparency)
1000 fixingPlateV->SetLineColor(TColor::GetColor("#ffcfaa"));
1001 fixingPlateV->SetTransparency(0);
1002
1003 TGeoCombiTrans* fixingPlateV_transf[2];
1004
1005 fixingPlateV_transf[0] = new TGeoCombiTrans();
1006 fixingPlateV_transf[0]->SetDx(0.0);
1007 fixingPlateV_transf[0]->SetDy(-(YGasSize * 0.5));
1008 fixingPlateV_transf[0]->SetDz(
1009 -(ZGasSize * 0.5 + fixingPlate_ZSize * 0.5 + spacerBedInnerHole_ZSize + 0.005 /*shift*/));
1010
1011 fixingPlateV_transf[1] = new TGeoCombiTrans();
1012 fixingPlateV_transf[1]->SetDx(0.0);
1013 fixingPlateV_transf[1]->SetDy(-(YGasSize * 0.5));
1014 fixingPlateV_transf[1]->SetDz(
1015 +(ZGasSize * 0.5 + fixingPlate_ZSize * 0.5 + spacerBedInnerHole_ZSize + 0.005 /*shift*/));
1016
1017 if (!TString(frameA->GetName()).Contains("frame1")) {
1018 frameA->AddNode(fixingPlateV, 0, fixingPlateV_transf[0]);
1019 frameA->AddNode(fixingPlateV, 1, fixingPlateV_transf[1]);
1020 }
1021 //--------------------------------------------------------------------------
1022
1023 return frameA;
1024}
int i
Definition P4_F32vec4.h:22
int Int_t
double Double_t
constexpr Bool_t kTRUE
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
#define gROOT
R__EXTERN TSystem * gSystem
static Int_t GetColor(const char *hexcolor)
void Close(Option_t *option="") override
void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE) override
void SetDz(Double_t dz) override
void RotateY(Double_t angle) override
void SetDy(Double_t dy) override
void SetDx(Double_t dx) override
void RotateX(Double_t angle) override
void SetTranslation(const TGeoTranslation &tr)
void RotateZ(Double_t angle) override
void ComputeBBox() override
void MakeNode(const char *expression)
virtual void RegisterYourself()
void SetDy(Double_t dy) override
void SetDz(Double_t dz) override
void SetDx(Double_t dx) override
void SetVisContainers(Bool_t flag=kTRUE) override
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
void Draw(Option_t *option="") override
void SetTransparency(Char_t transparency=0)
virtual void SetMedium(TGeoMedium *medium)
void SetLineColor(Color_t lcolor) override
const char * GetName() const override
virtual void SetName(const char *name)
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
static TString Itoa(Int_t value, Int_t base)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TGeoMedium * pMedAir
const Double_t YStationPositions[NStations]
TGeoMedium * pMedCarbon
TGeoManager * gGeoMan
const Int_t NMaxModules
const Double_t ZStationPositions[NStations]
TGeoMedium * pMedArCO27030
const Int_t NStations
TGeoMedium * pMedFiberGlass
const Double_t XStationPositions[NStations]
TGeoMedium * pMedCopper
const Double_t YSensSize
const Double_t ZSensSize
const Double_t YGasSize
const Double_t XGasSize
TGeoMedium * pMedArgonIsobutane7525
const Double_t XSensSize
const Double_t ZGasSize
TGeoMedium * pMedBrass
TGeoMedium * pMedTeflon
TGeoMedium * pMedHoneyComb
TGeoMedium * pMedEpoxideCompound
TGeoVolume * CreateModule(TString module_name)
void create_rootgeom_CSC_RunSRC2021()
TGeoVolume * CreateStation(TString station_name)
TGeoVolume * CreateFrameForModule(TString frame_name)
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)