15 const Int_t NofDisks = 3;
17 const Double_t DiskVolInnerRadius[NofDisks] = { 4.50, 4.50, 4.50 };
18 const Double_t DiskVolOuterRadius[NofDisks] = { 44.06, 56.06, 74.06 };
19 const Double_t DiskZPosition [NofDisks] = { 119.40, 155.40, 188.50 };
22 const Int_t DiskNFoils [NofDisks] = { 2 , 2 , 4 };
23 const Double_t MiddleROBarHfTh[NofDisks] = { 2.35, 2.35, 2.35 };
24 const Double_t HalfStationThickness = 8.003;
26 const Double_t carbonRingInnerRadius[NofDisks] = { 39.97, 50.97, 68.97 };
27 const Double_t carbonRingOuterRadius[NofDisks] = { 40.17, 51.17, 69.17 };
28 const Double_t carbonRingHalfThickness = 1.50;
30 const Double_t copperRingInnerRadius[NofDisks] = { 39.47, 50.47, 68.47 };
31 const Double_t copperRingOuterRadius[NofDisks] = { 39.67, 50.67, 68.67 };
32 const Double_t copperRingHalfThickness = 3.75;
34 const Double_t AlRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
35 const Double_t AlRingOuterRadius[NofDisks] = { 43.70, 55.70, 73.70 };
36 const Double_t AlRingHalfThickness = 3.75;
38 const Double_t SegmentHalfThickness = 0.25;
39 const Int_t NofSegments = 24;
41 const Double_t FirstSegmentAngle = 7.5;
42 const TString newsegment [NofSegments] = {
"seg1" ,
"seg2" ,
"seg3" ,
"seg4" ,
"seg5" ,
"seg6" ,
"seg7" ,
"seg8" ,
43 "seg9" ,
"seg10",
"seg11",
"seg12",
"seg13",
"seg14",
"seg15",
"seg16",
44 "seg17",
"seg18",
"seg19",
"seg20",
"seg21",
"seg22",
"seg23",
"seg24" };
46 const Double_t moduleRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
47 const Double_t moduleRingOuterRadius[NofDisks] = { 43.65, 55.65, 73.65 };
48 const Double_t moduleRingHalfThickness = 3.75;
50 const Double_t moduleSegmentHalfThickness = 1.30;
51 const Int_t NofmoduleSegments = 24;
53 const Double_t FirstmoduleSegmentAngle = 0.0 ;
54 const TString newmodulesegment [NofmoduleSegments] = {
"moduleseg1" ,
"moduleseg2" ,
"moduleseg3" ,
"moduleseg4" ,
"moduleseg5" ,
"moduleseg6" ,
"moduleseg7" ,
"moduleseg8" ,
55 "moduleseg9" ,
"moduleseg10",
"moduleseg11",
"moduleseg12",
"moduleseg13",
"moduleseg14",
"moduleseg15",
"moduleseg16",
56 "moduleseg17",
"moduleseg18",
"moduleseg19",
"moduleseg20",
"moduleseg21",
"moduleseg22",
"moduleseg23",
"moduleseg24" };
58 const Double_t AlumiRingInnerRadius[NofDisks] = { 43.7, 55.7, 73.7 };
59 const Double_t AlumiRingOuterRadius[NofDisks] = { 44.0, 56.0, 74.0 };
60 const Double_t AlumiRingHalfThickness = 3.75;
62 const Double_t coverRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
63 const Double_t coverRingOuterRadius[NofDisks] = { 44.00, 56.00, 74.00 };
64 const Double_t coverRingHalfThickness = 0.2;
68 const Double_t rcopperbarHalfThickness = 8.40;
72 const Double_t lcopperbarHalfThickness = 4.00;
77 const Double_t mcopperbarHalfThickness = 9.80;
80 const Int_t NofLayers = 49+48;
82 const TString LayerName [NofLayers] = {
"space",
83 "gap_air",
"window1_foil_out_aluminium",
"gap_air",
"WindowF_kapton",
"gap_air",
"window2_foil_out_aluminium",
"gap_air",
85 "gap_air",
"WindowF_aluminium",
"gap_air",
"CathodeF_kapton",
"gap_air",
"CathodeF_aluminium",
"gap_air",
90 "gap_air",
"Gem1F_copper",
"gap_air",
"Gem1_kapton",
"gap_air",
"Gem1B_copper",
"gap_air",
92 "gap_air",
"Gem2F_copper",
"gap_air",
"Gem2_kapton",
"gap_air",
"Gem2B_copper",
"gap_air",
94 "gap_air",
"Gem3F_copper",
"gap_air",
"Gem3_kapton",
"gap_air",
"Gem3B_copper",
"gap_air",
98 "gap_air",
"PadF_copper",
"gap_air",
"Pad_kapton",
"gap_air",
"PadB_copper",
"gap_air",
102 "gap_air",
"Gem4F_copper",
"gap_air",
"Gem4_kapton",
"gap_air",
"Gem4B_copper",
"gap_air",
104 "gap_air",
"Gem5F_copper",
"gap_air",
"Gem5_kapton",
"gap_air",
"Gem5B_copper",
"gap_air",
106 "gap_air",
"Gem6F_copper",
"gap_air",
"Gem6_kapton",
"gap_air",
"Gem6B_copper",
"gap_air",
111 "gap_air",
"CathodeB_aluminium",
"gap_air",
"CathodeB_kapton",
"gap_air",
"WindowB_aluminium",
"gap_air",
113 "gap_air",
"window1_foil_in_aluminium",
"gap_air",
"WindowB_kapton",
"gap_air",
"window2_foil_in_aluminium",
"gap_air",
117 const Double_t LayerThick[NofLayers] = { 1.0,
118 0.00001, 0.0001, 0.00001, 0.0007, 0.00001, 0.0001, 0.00001,
120 0.00001, 0.0001, 0.00001, 0.0007, 0.00001, 0.0001, 0.00001,
125 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
127 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
129 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
133 0.00001, 0.001, 0.00001, 0.001, 0.00001, 0.001, 0.00001,
137 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
139 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
141 0.00001, 0.0005, 0.00001, 0.0050, 0.00001, 0.0005, 0.00001,
146 0.00001, 0.0001, 0.00001, 0.0007, 0.00001, 0.0001, 0.00001,
148 0.00001, 0.0001, 0.00001, 0.0007, 0.00001, 0.0001, 0.00001,
153 const Double_t DiskOuterRadius[NofLayers][NofDisks] = {
155 38.95, 49.95, 67.95, 38.95, 49.95, 67.95, 39.40, 50.40, 68.40, 39.40, 50.40, 68.40, 38.95, 49.95, 67.95, 38.95, 49.95, 67.95, 38.95, 49.95, 67.95,
157 38.45, 49.45, 67.45, 38.45, 49.45, 67.45, 39.40, 50.40, 68.40, 39.40, 50.40, 68.40, 38.45, 49.45, 67.45, 38.45, 49.45, 67.45, 38.45, 49.45, 67.45,
162 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
164 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
166 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
170 43.90, 55.90, 73.90, 43.90, 55.90, 73.90, 43.90, 55.90, 73.90, 43.90, 55.90, 73.90, 43.90, 55.90, 73.90, 43.90, 55.90, 73.90, 39.05, 50.40, 68.40,
174 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
176 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
178 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45, 38.10, 49.45, 67.45,
183 38.45, 49.45, 67.45, 38.45, 49.45, 67.45, 39.40, 50.40, 68.40, 39.40, 50.40, 68.40, 38.45, 49.45, 67.45, 38.45, 49.45, 67.45, 38.45, 49.45, 67.45,
185 39.40, 50.40, 68.40, 39.40, 50.40, 68.40, 38.95, 49.45, 67.95, 38.95, 49.45, 67.95, 39.40, 50.40, 68.40, 39.40, 50.40, 68.40, 39.40, 50.40, 68.40,
186 39.40, 50.40, 68.40 };
189 const Double_t DiskInnerRadius[NofLayers][NofDisks] = {
191 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
193 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
198 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
200 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
202 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
206 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
210 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
212 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
214 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
219 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
221 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
230 const Int_t NofSensLayers = 2;
232 const Double_t sMiddleROBarHfTh[NofDisks] = { 2.35, 2.35, 2.35 };
234 const TString SensLayerName[NofSensLayers] = {
"Gem1_Sensor_GEMmixture",
235 "Gem6_Sensor_GEMmixture" };
237 const Double_t SensLayerThick[NofSensLayers] = { 0.85,
240 const Double_t SensZPosition[NofSensLayers][NofDisks] = { -0.69412, -0.69412, 0.69520,
241 0.69520, 0.69520, -0.69412 };
243 const Double_t SensOuterRadius[NofSensLayers][NofDisks] = { 38.15, 49.15, 67.15,
244 38.15, 49.15, 67.15 };
246 const Double_t SensInnerRadius[NofSensLayers][NofDisks] = { 5.00, 5.00, 5.00,
254 const Int_t NofHLayers = 16;
256 const TString HLayersName [NofHLayers] = {
"windowF1_ring_carbon",
258 "windowF2_ring_carbon",
260 "cathodeF_ring_GlassFiber",
262 "gem_ring1_GlassFiber",
264 "gem_ring2_GlassFiber",
266 "gem_ring3_GlassFiber",
268 "gem_ring4_GlassFiber",
269 "padplaneF_support_GlassFiber",
271 "padplaneB_support_GlassFiber",
272 "gem_ring5_GlassFiber",
274 "gem_ring6_GlassFiber",
276 "gem_ring7_GlassFiber",
278 "gem_ring8_GlassFiber",
280 "cathodeB_ring_GlassFiber",
282 "windowB1_ring_carbon",
284 "windowB2_ring_carbon" };
286 const Double_t HLayersThick[NofHLayers] = { 1.00,
304 const Double_t HZPosition[NofHLayers][NofDisks] = { -2.62100, -2.62100, -2.62100,
305 -1.62006, -1.62006, -1.62006,
306 -0.71912, -0.71912, -0.71912,
307 -0.29411, -0.29411, -0.29411,
308 -0.23807, -0.23807, -0.23807,
309 -0.18203, -0.18203, -0.18203,
310 -0.12599, -0.12599, -0.12599,
311 -0.05098, -0.05098, -0.05098,
312 0.05206, 0.05206, 0.05206,
313 0.12707, 0.12707, 0.12707,
314 0.18311, 0.18311, 0.18311,
315 0.23915, 0.23915, 0.23915,
316 0.29519, 0.29519, 0.29519,
317 0.72020, 0.72020, 0.72020,
318 1.62114, 1.62114, 1.62114,
319 2.62208, 2.62114, 2.62114 };
322 const Double_t HOuterRadius[NofHLayers][NofDisks] = { 39.90, 50.90, 68.90,
337 39.40, 50.40, 68.40 };
339 const Double_t HInnerRadius[NofHLayers][NofDisks] = { 38.50, 49.50, 67.50,
354 38.50, 49.50, 67.50 };
362 const Double_t HTY[NofHLayers][NofDisks] = { 25.0, 45.0, 65.0,
381 const Int_t SensorStripType [2] = { 3 , 2 };
383 const Double_t SensorStripAngle[2][2] = { 0. , 0. , 0. , 0. };
384 const Double_t SensorStripPitch[2][2] = { 0.04, 0.04, 0.04, 0.04};
388 for ( Int_t ilayer = 0 ; ilayer < NofLayers ; ilayer++ ) {
389 cout << LayerName[ilayer].Data() <<
" -> " << LayerThick[ilayer] << endl;
390 firstLayerOffset += LayerThick[ilayer];
393 cout <<
"total thickness is " << firstLayerOffset << endl;
394 firstLayerOffset = firstLayerOffset/2.;
395 firstLayerOffset = -0.001*(TMath::Floor(1000.*firstLayerOffset));
396 cout <<
"first layer offset is " << firstLayerOffset << endl;
399 TString vmcWorkdir = getenv(
"VMCWORKDIR");
401 TString outfile=
"../../geometry/gem_3Stations_realistic_v2.root";
404 TFile*
fi =
new TFile(outfile,
"RECREATE");
406 cout <<
"created output file" << endl;
407 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
408 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
409 cout <<
"geoface setmediafile" << endl;
410 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
411 cout <<
"geoface readmedia" << endl;
412 geoFace->readMedia();
413 cout <<
"geoface print" << endl;
415 cout <<
"geoface done" << endl;
417 FairGeoMedia *
Media = geoFace->getMedia();
418 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
424 FairGeoMedium *CbmMediumCopper = Media->getMedium(
"copper");
425 FairGeoMedium *CbmMediumKapton = Media->getMedium(
"kapton");
426 FairGeoMedium *CbmMediumArCO2 = Media->getMedium(
"GEMmixture");
427 FairGeoMedium *CbmMediumUranium = Media->getMedium(
"uranium");
428 FairGeoMedium *CbmMediumGlassFiber= Media->getMedium(
"GlassFiber");
430 Int_t
nmed=geobuild->createMedium(CbmMediumAir);
431 nmed=geobuild->createMedium(CbmMediumPWO);
432 nmed=geobuild->createMedium(CbmMediumCarbon);
433 nmed=geobuild->createMedium(CbmMediumAluminium);
434 nmed=geobuild->createMedium(CbmMediumCopper);
435 nmed=geobuild->createMedium(CbmMediumKapton);
436 nmed=geobuild->createMedium(CbmMediumArCO2);
437 nmed=geobuild->createMedium(CbmMediumUranium);
438 nmed=geobuild->createMedium(CbmMediumGlassFiber);
441 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
443 TGeoVolume *
top =
new TGeoVolumeAssembly(
"Gem");
445 gGeoMan->SetTopVolume(top);
447 cout <<
"-------------------------------------------------------------------" << endl;
448 TList* mediaList = (TList*)gGeoMan->GetListOfMedia();
450 cout <<
"media known: " << mediaList->GetEntries() <<
"." << endl;
451 for ( Int_t itemp = 0 ; itemp < mediaList->GetEntries() ; itemp++ ) {
452 TGeoMedium*
medium = (TGeoMedium*)mediaList->At(itemp);
453 cout <<
"medium " << itemp <<
" name is " << medium->GetName() << endl;
455 cout <<
"-------------------------------------------------------------------" << endl;
457 TGeoRotation*
dummyrot =
new TGeoRotation();
459 TGeoVolumeAssembly*
SubunitVol =
new TGeoVolumeAssembly(
"Gem_Disks");
462 TGeoShape *DiskShape[NofDisks];
463 TGeoVolume *DiskVol [NofDisks];
464 TGeoRotation *DiskRotat[NofDisks];
465 TGeoTranslation *DiskTrans[NofDisks];
466 TGeoCombiTrans *DiskCombi[NofDisks];
468 TGeoShape *carbonRingShape[NofDisks];
469 TGeoVolume *carbonRingVol [NofDisks];
470 TGeoTranslation *carbonRingTrans[NofDisks];
471 TGeoCombiTrans *carbonRingCombi[NofDisks];
473 TGeoShape *copperRingShape[NofDisks];
474 TGeoVolume *copperRingVol [NofDisks];
475 TGeoTranslation *copperRingTrans[NofDisks];
476 TGeoCombiTrans *copperRingCombi[NofDisks];
478 TGeoShape *coverRingShape[NofDisks];
479 TGeoVolume *coverRingVol [NofDisks];
480 TGeoTranslation *coverRingTrans[NofDisks];
481 TGeoCombiTrans *coverRingCombi[NofDisks];
483 TGeoShape *tAcopperbarShape;
484 TGeoVolume *tAcopperbarVol ;
485 TGeoTranslation *tAcopperbarTrans;
486 TGeoRotation *tAcopperbarRot;
487 TGeoCombiTrans *tAcopperbarCombi;
489 TGeoShape *tMcopperbarShape;
490 TGeoVolume *tMcopperbarVol ;
491 TGeoTranslation *tMcopperbarTrans;
492 TGeoRotation *tMcopperbarRot;
493 TGeoCombiTrans *tMcopperbarCombi;
495 TGeoShape *tBcopperbarShape;
496 TGeoVolume *tBcopperbarVol ;
497 TGeoTranslation *tBcopperbarTrans;
498 TGeoRotation *tBcopperbarRot;
499 TGeoCombiTrans *tBcopperbarCombi;
501 TGeoShape *dAcopperbarShape;
502 TGeoVolume *dAcopperbarVol ;
503 TGeoTranslation *dAcopperbarTrans;
504 TGeoRotation *dAcopperbarRot;
505 TGeoCombiTrans *dAcopperbarCombi;
507 TGeoShape *dMcopperbarShape;
508 TGeoVolume *dMcopperbarVol ;
509 TGeoTranslation *dMcopperbarTrans;
510 TGeoRotation *dMcopperbarRot;
511 TGeoCombiTrans *dMcopperbarCombi;
513 TGeoShape *dBcopperbarShape;
514 TGeoVolume *dBcopperbarVol ;
515 TGeoTranslation *dBcopperbarTrans;
516 TGeoRotation *dBcopperbarRot;
517 TGeoCombiTrans *dBcopperbarCombi;
519 TGeoShape *AlRingShape[NofDisks][NofSegments];
520 TGeoVolume *AlRingVol [NofDisks][NofSegments];
521 TGeoTranslation *AlRingTrans[NofDisks][NofSegments];
522 TGeoCombiTrans *AlRingCombi[NofDisks][NofSegments];
524 TGeoShape *moduleRingShape[NofDisks][NofmoduleSegments];
525 TGeoVolume *moduleRingVol [NofDisks][NofmoduleSegments];
526 TGeoTranslation *moduleRingTrans[NofDisks][NofmoduleSegments];
527 TGeoCombiTrans *moduleRingCombi[NofDisks][NofmoduleSegments];
529 TGeoShape *AlumiRingShape[NofDisks];
530 TGeoVolume *AlumiRingVol [NofDisks];
531 TGeoTranslation *AlumiRingTrans[NofDisks];
532 TGeoCombiTrans *AlumiRingCombi[NofDisks];
534 TGeoShape *DiskLayersShapeA [NofLayers][NofDisks][4];
535 TGeoShape *DiskLayersShapeB [NofLayers][NofDisks][4];
536 TGeoSubtraction *DiskLayersSubtr [NofLayers][NofDisks][4];
537 TGeoShape *DiskLayersShapeC [NofLayers][NofDisks][4];
538 TGeoShape *DiskLayersShapeHole [NofLayers][NofDisks][4];
539 TGeoCompositeShape *DiskLayersShapecompos[NofLayers][NofDisks][4];
540 TGeoVolume *DiskLayersVol [NofLayers][NofDisks][4];
541 TGeoTranslation *DiskLayersTranshA [NofLayers][NofDisks][4];
542 TGeoTranslation *DiskLayersTranshB [NofLayers][NofDisks][4];
543 TGeoTranslation *DiskLayersTrans [NofLayers][NofDisks][4];
544 TGeoCombiTrans *DiskLayersCombi [NofLayers][NofDisks][4];
546 TGeoShape *SensDiskLayersShapeA [NofSensLayers][NofDisks][4];
547 TGeoShape *SensDiskLayersShapeB [NofSensLayers][NofDisks][4];
548 TGeoSubtraction *SensDiskLayersSubtr [NofSensLayers][NofDisks][4];
549 TGeoShape *SensDiskLayersShapeC [NofSensLayers][NofDisks][4];
550 TGeoShape *SensDiskLayersShapeHole [NofSensLayers][NofDisks][4];
551 TGeoCompositeShape *SensDiskLayersShapecompos[NofSensLayers][NofDisks][4];
552 TGeoVolume *SensDiskLayersVol [NofSensLayers][NofDisks][4];
553 TGeoTranslation *SensDiskLayersTranshA [NofSensLayers][NofDisks][4];
554 TGeoTranslation *SensDiskLayersTranshB [NofSensLayers][NofDisks][4];
555 TGeoTranslation *SensDiskLayersTrans [NofSensLayers][NofDisks][4];
556 TGeoCombiTrans *SensDiskLayersCombi [NofSensLayers][NofDisks][4];
558 TGeoShape *HLayersShapeTube [NofHLayers][NofDisks];
559 TGeoShape *HLayersShapeBox [NofHLayers][NofDisks];
560 TGeoShape *HLayersShapePlate [NofHLayers][NofDisks];
561 TGeoShape *HLayersShapeHT [NofHLayers][NofDisks];
562 TGeoShape *HLayersShapeHTM [NofHLayers][NofDisks];
563 TGeoShape *HLayersShapeHTD [NofHLayers][NofDisks];
564 TGeoCompositeShape *HLayersShapecompos[NofHLayers][NofDisks];
565 TGeoVolume *HLayersVolcomp [NofHLayers][NofDisks];
566 TGeoTranslation *HLayersTranstA [NofHLayers][NofDisks];
567 TGeoTranslation *HLayersTranstB [NofHLayers][NofDisks];
568 TGeoTranslation *HLayersTranstC [NofHLayers][NofDisks];
569 TGeoTranslation *HLayersTranstD [NofHLayers][NofDisks];
570 TGeoTranslation *HLayersTranstE [NofHLayers][NofDisks];
571 TGeoTranslation *HLayersTranstF [NofHLayers][NofDisks];
572 TGeoRotation *HLayersRotrA [NofHLayers][NofDisks];
573 TGeoShape *HLayersShape [NofHLayers][NofDisks];
574 TGeoVolume *HLayersVol [NofHLayers][NofDisks];
575 TGeoTranslation *HLayersTrans [NofHLayers][NofDisks];
576 TGeoCombiTrans *HLayersCombi [NofHLayers][NofDisks];
578 TGeoShape *RiddleShapeTubeA ;
579 TGeoShape *RiddleShapeTubeB ;
580 TGeoShape *RiddleShapeCone ;
581 TGeoShape *RiddleShapeTubeC ;
582 TGeoShape *RiddleShapeTubeD ;
583 TGeoShape *RiddleShapeTubeE ;
584 TGeoShape *RiddleShapeTubeF ;
585 TGeoSubtraction *RiddleSubtr ;
586 TGeoCompositeShape *RiddleShapecompos;
587 TGeoVolume *RiddleVolcomp ;
588 TGeoTranslation *RiddleTrans ;
589 TGeoTranslation *RiddleTransTubeA ;
590 TGeoTranslation *RiddleTransCone ;
591 TGeoTranslation *RiddleTransTubeC ;
592 TGeoTranslation *RiddleTransTubeD ;
593 TGeoTranslation *RiddleTransTubeE ;
594 TGeoCombiTrans *RiddleCombi ;
595 TGeoTranslation *RiddleTransTubeF[4][100] ;
596 TGeoCombiTrans *RiddleCombiTranshole[4][100] ;
597 TGeoRotation *RiddleRothole[4][100] ;
599 TString outParFileName = Form(
"%s/macro/params/gem_3Stations_realistic_v2.digi.par",vmcWorkdir.Data());
602 cout <<
"parameter file = \"" << outParFileName.Data() <<
"\"" << endl;
604 ofstream pout(outParFileName.Data());
605 pout.setf(ios::fixed);
607 pout <<
"#################################################################" << endl;
608 pout <<
"# Digitization parameters for GEM " << endl;
609 pout <<
"# with 3 Stations " << endl;
610 pout <<
"# Format: " << endl;
611 pout <<
"# Description of parameters: " << endl;
612 pout <<
"# [PndGemDetectors] " << endl;
613 pout <<
"# parameters:d station_number, ZPos, rotation_angle, number_of_sensors, \\" << endl;
614 pout <<
"# sensor_number, sensor_type, pos_x, pos_y, pos_z, rotAngle, inn_rad, out_rad, thick, str_ang_0, str_ang_1, barWidth, pitch_0, pitch_1, \\" << endl;
615 pout <<
"# sensor_number, ...." << endl;
616 pout <<
"# station_number, ..." << endl;
617 pout <<
"#################################################################" << endl;
618 pout <<
"[PndGemDetectors]" << setprecision(4) << endl;
620 pout <<
"parameters:Double_t \\" << endl;
622 for ( Int_t istat = 0 ; istat < NofDisks ; istat++ ) {
625 pout <<
" " << istat+1 <<
", "
626 << setw(9) << DiskZPosition[istat]
627 <<
", 0.0, " << 2 <<
", \\" << endl;
630 DiskShape[istat] =
new TGeoTube (Form(
"disk%dshape",istat+1),DiskVolInnerRadius[istat],DiskVolOuterRadius[istat],HalfStationThickness);
631 DiskVol [istat] =
new TGeoVolume(Form(
"Gem_Disk%d_Volume",istat+1),DiskShape[istat],gGeoMan->GetMedium(
"GEMmixture"));
632 DiskTrans[istat] =
new TGeoTranslation(0.,0.,DiskZPosition[istat]);
633 cout <<
"station " << DiskVolInnerRadius[istat] <<
" " << DiskVolOuterRadius[istat] <<
" at " << DiskZPosition[istat] << endl;
635 DiskCombi[istat] =
new TGeoCombiTrans(*DiskTrans[istat],*dummyrot);
638 DiskRotat[istat] =
new TGeoRotation(Form(
"disk%drotat"), 0.0, 180.0, 0.0);
639 DiskCombi[istat] =
new TGeoCombiTrans(*DiskTrans[istat],*DiskRotat[istat]);
642 DiskCombi[istat]->SetName(Form(
"Gem_Disk%d_Volume",istat+1));
643 DiskCombi[istat]->RegisterYourself();
644 DiskVol[istat]->SetLineColor(kYellow);
647 carbonRingShape[istat] =
new TGeoTube (Form(
"carbonRing%dshape",istat+1),carbonRingInnerRadius[istat],carbonRingOuterRadius[istat],carbonRingHalfThickness);
648 carbonRingVol [istat] =
new TGeoVolume(Form(
"Gem_carbonRing%d_Volume",istat+1),carbonRingShape[istat],gGeoMan->GetMedium(
"carbon"));
649 carbonRingTrans[istat] =
new TGeoTranslation(0.,0.,-1.61);
650 cout <<
"carbonRing " << carbonRingInnerRadius[istat] <<
" " << carbonRingOuterRadius[istat] << endl;
651 carbonRingCombi[istat] =
new TGeoCombiTrans(*carbonRingTrans[istat],*dummyrot);
652 carbonRingCombi[istat]->SetName(Form(
"Gem_carbonRing%d_Volume",istat+1));
653 carbonRingCombi[istat]->RegisterYourself();
654 carbonRingVol[istat]->SetLineColor(kMagenta);
656 DiskVol[istat]->AddNode(carbonRingVol[istat],0,carbonRingCombi[istat]);
659 copperRingShape[istat] =
new TGeoTube (Form(
"copperRing%dshape",istat+1),copperRingInnerRadius[istat],copperRingOuterRadius[istat],copperRingHalfThickness);
660 copperRingVol [istat] =
new TGeoVolume(Form(
"Gem_copperRing%d_Volume",istat+1),copperRingShape[istat],gGeoMan->GetMedium(
"copper"));
661 copperRingTrans[istat] =
new TGeoTranslation(0.,0.,3.853);
662 cout <<
"copperRing " << copperRingInnerRadius[istat] <<
" " << copperRingOuterRadius[istat] << endl;
663 copperRingCombi[istat] =
new TGeoCombiTrans(*copperRingTrans[istat],*dummyrot);
664 copperRingCombi[istat]->SetName(Form(
"Gem_copperRing%d_Volume",istat+1));
665 copperRingCombi[istat]->RegisterYourself();
666 copperRingVol[istat]->SetLineColor(kYellow-5);
668 DiskVol[istat]->AddNode(copperRingVol[istat],0,copperRingCombi[istat]);
671 Double_t segmentAngularSize = SegmentHalfThickness/AlRingInnerRadius[istat]*360.;
672 for ( Int_t isegm = 0 ; isegm < NofSegments ; isegm++ ) {
673 cout <<
" Segment " << isegm <<
" with name " << newsegment[isegm] <<
" will be put at " << FirstSegmentAngle+isegm*SegmentDeltaAngle <<
" (in fact from " << FirstSegmentAngle+isegm*SegmentDeltaAngle-segmentAngularSize/2. <<
" to " << FirstSegmentAngle+isegm*SegmentDeltaAngle+segmentAngularSize/2. <<
")" << endl;
674 AlRingShape[istat][isegm] =
new TGeoTubeSeg (Form(
"AlRing%dshape",istat+1,isegm+1),AlRingInnerRadius[istat],AlRingOuterRadius[istat],AlRingHalfThickness,FirstSegmentAngle+isegm*SegmentDeltaAngle-segmentAngularSize/2.,FirstSegmentAngle+isegm*SegmentDeltaAngle+segmentAngularSize/2. );
675 AlRingVol[istat][isegm] =
new TGeoVolume (Form(
"Gem_AlRing%d_Volume",istat+1,isegm+1),AlRingShape[istat][isegm],gGeoMan->GetMedium(
"aluminium"));
676 AlRingTrans[istat][isegm] =
new TGeoTranslation (0.,0.,3.853);
677 cout <<
"AlRing " << AlRingInnerRadius[istat] <<
" " << AlRingOuterRadius[istat] << endl;
678 AlRingCombi[istat][isegm] =
new TGeoCombiTrans (*AlRingTrans[istat][isegm],*dummyrot);
679 AlRingCombi[istat][isegm]->SetName(Form(
"Gem_AlRing%d_Volume",istat+1,isegm+1));
680 AlRingCombi[istat][isegm]->RegisterYourself();
681 AlRingVol[istat][isegm]->SetLineColor(kCyan-9);
683 DiskVol[istat]->AddNode(AlRingVol[istat][isegm],0,AlRingCombi[istat][isegm]);
688 Double_t modulesegmentAngularSize = moduleSegmentHalfThickness/moduleRingInnerRadius[istat]*360.;
689 for ( Int_t imodulesegm = 0 ; imodulesegm < NofmoduleSegments ; imodulesegm++ ) {
690 cout <<
" moduleSegment " << imodulesegm <<
" with name " << newmodulesegment[imodulesegm] <<
" will be put at " << FirstmoduleSegmentAngle+imodulesegm*moduleSegmentDeltaAngle <<
" (in fact from " << FirstmoduleSegmentAngle+imodulesegm*moduleSegmentDeltaAngle-modulesegmentAngularSize/2. <<
" to " << FirstmoduleSegmentAngle+imodulesegm*moduleSegmentDeltaAngle+modulesegmentAngularSize/2. <<
")" << endl;
691 moduleRingShape[istat][imodulesegm] =
new TGeoTubeSeg (Form(
"moduleRing%dshape",istat+1,imodulesegm+1),moduleRingInnerRadius[istat],moduleRingOuterRadius[istat],moduleRingHalfThickness,FirstmoduleSegmentAngle+imodulesegm*moduleSegmentDeltaAngle-modulesegmentAngularSize/2.,FirstmoduleSegmentAngle+imodulesegm*moduleSegmentDeltaAngle+modulesegmentAngularSize/2. );
692 moduleRingVol[istat][imodulesegm] =
new TGeoVolume (Form(
"Gem_moduleRing%d_Volume",istat+1,imodulesegm+1),moduleRingShape[istat][imodulesegm],gGeoMan->GetMedium(
"copper"));
693 moduleRingTrans[istat][imodulesegm] =
new TGeoTranslation (0.,0.,3.853);
694 cout <<
"moduleRing " << moduleRingInnerRadius[istat] <<
" " << moduleRingOuterRadius[istat] << endl;
695 moduleRingCombi[istat][imodulesegm] =
new TGeoCombiTrans (*moduleRingTrans[istat][imodulesegm],*dummyrot);
696 moduleRingCombi[istat][imodulesegm]->SetName(Form(
"Gem_moduleRing%d_Volume",istat+1,imodulesegm+1));
697 moduleRingCombi[istat][imodulesegm]->RegisterYourself();
698 moduleRingVol[istat][imodulesegm]->SetLineColor(kGreen);
700 DiskVol[istat]->AddNode(moduleRingVol[istat][imodulesegm],0,moduleRingCombi[istat][imodulesegm]);
704 AlumiRingShape[istat] =
new TGeoTube (Form(
"AlumiRing%dshape",istat+1),AlumiRingInnerRadius[istat],AlumiRingOuterRadius[istat],AlumiRingHalfThickness);
705 AlumiRingVol [istat] =
new TGeoVolume(Form(
"Gem_AlumiRing%d_Volume",istat+1),AlumiRingShape[istat],gGeoMan->GetMedium(
"aluminium"));
706 AlumiRingTrans[istat] =
new TGeoTranslation(0.,0.,3.853);
707 cout <<
"AlumiRing " << AlumiRingInnerRadius[istat] <<
" " << AlumiRingOuterRadius[istat] << endl;
708 AlumiRingCombi[istat] =
new TGeoCombiTrans(*AlumiRingTrans[istat],*dummyrot);
709 AlumiRingCombi[istat]->SetName(Form(
"Gem_AlumiRing%d_Volume",istat+1));
710 AlumiRingCombi[istat]->RegisterYourself();
711 AlumiRingVol[istat]->SetLineColor(kCyan-9);
713 DiskVol[istat]->AddNode(AlumiRingVol[istat],0,AlumiRingCombi[istat]);
716 coverRingShape[istat] =
new TGeoTube (Form(
"coverRing%dshape",istat+1),coverRingInnerRadius[istat],coverRingOuterRadius[istat],coverRingHalfThickness);
717 coverRingVol [istat] =
new TGeoVolume(Form(
"Gem_coverRing%d_Volume",istat+1),coverRingShape[istat],gGeoMan->GetMedium(
"GlassFiber"));
718 coverRingTrans[istat] =
new TGeoTranslation(0.,0.,7.803);
719 cout <<
"coverRing " << coverRingInnerRadius[istat] <<
" " << coverRingOuterRadius[istat] << endl;
720 coverRingCombi[istat] =
new TGeoCombiTrans(*coverRingTrans[istat],*dummyrot);
721 coverRingCombi[istat]->SetName(Form(
"Gem_coverRing%d_Volume",istat+1));
722 coverRingCombi[istat]->RegisterYourself();
723 coverRingVol[istat]->SetLineColor(kGreen+3);
725 DiskVol[istat]->AddNode(coverRingVol[istat],0,coverRingCombi[istat]);
742 for ( Int_t jlay = 0 ; jlay < NofHLayers ; jlay++ ) {
744 cout <<
"doing Hlayers " << jlay << endl;
756 cout <<
" got Hlayer " << HLayersName[jlay].Data() << endl;
758 HLayersShapeTube[jlay][istat] =
new TGeoTube (Form(
"T%dT%s",istat+1,HLayersName[jlay].Data()),HInnerRadius[jlay][istat],HOuterRadius[jlay][istat],HLayersThick[jlay]/2.);
759 HLayersShapeHT[jlay][istat] =
new TGeoTube (Form(
"H%dH%s",istat+1,HLayersName[jlay].Data()),0.0,5.00,HLayersThick[jlay]/2.);
760 HLayersShapeHTM[jlay][istat] =
new TGeoTube (Form(
"HTM%dHTM%s",istat+1,HLayersName[jlay].Data()),0.0,4.50,HLayersThick[jlay]/2.+0.0002);
761 HLayersShapeHTD[jlay][istat] =
new TGeoTube (Form(
"HTD%dHTD%s",istat+1,HLayersName[jlay].Data()),0.0,1.90,HLayersThick[jlay]/2.+0.0001);
762 cout <<
"Tube name is " << HLayersShapeTube[jlay][istat]->GetName() << endl;
764 HLayersShapeBox[jlay][istat] =
new TGeoBBox(Form(
"B%dB%s",istat+1,HLayersName[jlay].Data()),HXBoxWidth,HOuterRadius[jlay][istat],HLayersThick[jlay]/2.);
765 HLayersShapePlate[jlay][istat] =
new TGeoBBox(Form(
"P%dP%s",istat+1,HLayersName[jlay].Data()),HXPlateWidth,HYPlateWidth,HLayersThick[jlay]/2.+0.0001);
767 HLayersTranstA[jlay][istat] =
new TGeoTranslation(
"tA",HTX,HTY[jlay][istat],HTZ);
768 HLayersTranstA[jlay][istat] ->RegisterYourself();
769 HLayersTranstB[jlay][istat] =
new TGeoTranslation(
"tB",HTX,-HTY[jlay][istat],HTZ);
770 HLayersTranstB[jlay][istat] ->RegisterYourself();
771 HLayersTranstC[jlay][istat] =
new TGeoTranslation(
"tC",HTX,HTY[jlay][istat]+9.0,HTZ);
772 HLayersTranstC[jlay][istat] ->RegisterYourself();
773 HLayersTranstD[jlay][istat] =
new TGeoTranslation(
"tD",HTX,HTY[jlay][istat]-9.0,HTZ);
774 HLayersTranstD[jlay][istat] ->RegisterYourself();
775 HLayersTranstE[jlay][istat] =
new TGeoTranslation(
"tE",HTX,-HTY[jlay][istat]+9.0,HTZ);
776 HLayersTranstE[jlay][istat] ->RegisterYourself();
777 HLayersTranstF[jlay][istat] =
new TGeoTranslation(
"tF",HTX,-HTY[jlay][istat]-9.0,HTZ);
778 HLayersTranstF[jlay][istat] ->RegisterYourself();
780 HLayersShapecompos[jlay][istat] =
new TGeoCompositeShape(Form(
"compos%dcompos%s",istat+1,HLayersName[jlay].Data()),
781 Form(
"T%dT%s+B%dB%s+H%dH%s-HTM%dHTM%s-(P%dP%s:tA)-(HTD%dHTD%s:tC)-(HTD%dHTD%s:tD)-(P%dP%s:tB)-(HTD%dHTD%s:tE)-(HTD%dHTD%s:tF)",
782 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),
783 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),
784 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data()));
786 cout <<
"composite name is " << HLayersShapecompos[jlay][istat] -> GetName() << endl;
788 TString HlayersMaterial = HLayersName[jlay].Data();
789 HlayersMaterial.Remove(0,HlayersMaterial.Last(
'_')+1);
790 cout <<
"THE HMATERIAL IS \"" << HlayersMaterial.Data() <<
"\"" << endl;
791 HLayersVolcomp[jlay][istat] =
new TGeoVolume(Form(
"GEMHLayersCOMP%dGEMHLayersCOMP%s",istat+1,HLayersName[jlay].Data()),HLayersShapecompos[jlay][istat],gGeoMan->GetMedium(HlayersMaterial.Data()));
792 cout <<
"COMP name is " << HLayersVolcomp[jlay][istat] -> GetName() << endl;
793 cout <<
"Hlayersmaterial = " << HlayersMaterial.Data() << endl;
795 if ( HlayersMaterial.Contains(
"carbon" ) )
797 if ( HlayersMaterial.Contains(
"GlassFiber" ) )
800 cout <<
"STATION " << istat <<
" LAYER " << jlay <<
" POSITION " << HZPosition[jlay][istat] << endl;
802 HLayersTrans[jlay][istat] =
new TGeoTranslation(0.0,0.0,HZPosition[jlay][istat]);
803 HLayersCombi[jlay][istat] =
new TGeoCombiTrans(*HLayersTrans[jlay][istat],*dummyrot);
804 HLayersCombi[jlay][istat]->SetName(Form(
"GEMHLayersCOMP%dGEMHLayersCOMP%s",istat+1,HLayersName[jlay].Data()));
805 HLayersCombi[jlay][istat]->RegisterYourself();
806 DiskVol[istat]->AddNode( HLayersVolcomp[jlay][istat],0,HLayersCombi[jlay][istat] );
811 Int_t sensorNumber = 0;
813 for ( Int_t slay = 0 ; slay < NofSensLayers ; slay++ ) {
814 cout <<
"doing Senslayer " << slay << endl;
816 if ( SensLayerName[slay].Contains(
"space") && SensLayerThick[slay] > 0.0 ) {
817 cout <<
"***** THE THICK SPACE SensLAYER IS AT " << SensZPosition[slay][istat] << endl;
819 if ( SensLayerName[slay].Contains(
"space") && SensLayerName[slay].Length() == 5 ) {
824 cout <<
" got layer : " << SensLayerName[slay].Data() << endl;
829 cout <<
"will do loop over segments" << endl;
831 for ( Int_t iseg = 0 ; iseg < 1 ; iseg++ ) {
832 cout <<
"segment " << iseg << endl;
833 SensDiskLayersShapeA[slay][istat][iseg] =
new TGeoTube(Form(
"sdisk%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
834 SensInnerRadius[slay][istat],SensOuterRadius[slay][istat],
835 SensLayerThick[slay]/2.);
836 SensDiskLayersShapeB[slay][istat][iseg] =
new TGeoBBox(Form(
"srobo%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
837 sMiddleROBarHfTh[istat],
838 SensOuterRadius[slay][istat],
839 SensLayerThick[slay]);
840 SensDiskLayersSubtr[slay][istat][iseg] =
new TGeoSubtraction(SensDiskLayersShapeA[slay][istat][iseg],
841 SensDiskLayersShapeB[slay][istat][iseg]);
843 SensDiskLayersShapeC[slay][istat][iseg] =
new TGeoCompositeShape(Form(
"scomp%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
844 SensDiskLayersSubtr[slay][istat][iseg]);
845 segBegin += segPhiSpan;
846 cout <<
" segBegin " << segBegin << endl;
848 SensDiskLayersShapeHole[slay][istat][iseg] =
new TGeoTube(Form(
"sHole%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),0.0,3.80,SensLayerThick[slay]+0.01);
850 SensDiskLayersTranshA[slay][istat][iseg] =
new TGeoTranslation(
"shA",sHoleTX,sHoleTY,sHoleTZ);
851 SensDiskLayersTranshA[slay][istat][iseg] ->RegisterYourself();
852 SensDiskLayersTranshB[slay][istat][iseg] =
new TGeoTranslation(
"shB",sHoleTX,-sHoleTY,sHoleTZ);
853 SensDiskLayersTranshB[slay][istat][iseg] ->RegisterYourself();
855 SensDiskLayersShapecompos[slay][istat][iseg] =
new TGeoCompositeShape(Form(
"scompos%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
856 Form(
"scomp%dseg%d%sshape-(sHole%dseg%d%sshape:shA)-(sHole%dseg%d%sshape:shB)",
857 istat+1,iseg+1,SensLayerName[slay].Data(),istat+1,iseg+1,SensLayerName[slay].Data(),istat+1,iseg+1,SensLayerName[slay].Data()));
858 TString SenslayerMaterial = SensLayerName[slay].Data();
859 SenslayerMaterial.Remove(0,SenslayerMaterial.Last(
'_')+1);
860 cout <<
"THE MATERIAL IS \"" << SenslayerMaterial.Data() <<
"\"" << endl;
861 SensDiskLayersVol[slay][istat][iseg] =
new TGeoVolume(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,iseg+1,SensLayerName[slay].Data()),
862 SensDiskLayersShapecompos[slay][istat][iseg],
863 gGeoMan->GetMedium(SenslayerMaterial.Data()));
865 cout <<
"Senslayer material = " << SenslayerMaterial.Data() << endl;
866 if ( SenslayerMaterial.Contains(
"GEMmixture" ) )
867 SensDiskLayersVol[slay][istat][iseg]->
SetLineColor(kYellow);
869 SensDiskLayersTrans[slay][istat][iseg] =
new TGeoTranslation(0.,0.,SensZPosition[slay][istat]);
870 SensDiskLayersCombi[slay][istat][iseg] =
new TGeoCombiTrans(*SensDiskLayersTrans[slay][istat][iseg],*dummyrot);
871 SensDiskLayersCombi[slay][istat][iseg]->SetName(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,iseg+1,SensLayerName[slay].Data()));
872 SensDiskLayersCombi[slay][istat][iseg]->RegisterYourself();
873 DiskVol[istat]->AddNode(SensDiskLayersVol[slay][istat][iseg],0,SensDiskLayersCombi[slay][istat][iseg]);
876 cout <<
"Svolume " << SensLayerName[slay] <<
" from "
877 << setprecision(10) << DiskZPosition[istat]+SensZPosition[slay][istat]-SensLayerThick[slay]/2. <<
" to "
878 << setprecision(10) << DiskZPosition[istat]+SensZPosition[slay][istat]+SensLayerThick[slay]/2. << endl;
880 if ( SensLayerName[slay].Contains(
"Gem") && SensLayerName[slay].Contains(
"Sensor") ) {
881 Double_t newRadius = SensInnerRadius[slay][istat];
884 cout <<
"srad = " << SensInnerRadius[slay][istat] <<
" pitch = " << SensorStripPitch[sensorNumber][0] <<
" for sensor " << sensorNumber << endl;
885 if ( SensorStripType[sensorNumber] != 2 ) {
886 nofStrips = TMath::Ceil(2.*
TMath::Pi()*SensInnerRadius[slay][istat]/SensorStripPitch[sensorNumber][0]);
887 newRadius = nofStrips*SensorStripPitch[sensorNumber][0]/2./
TMath::Pi();
889 cout <<
"!!!! " << istat <<
" " << slay <<
" > there shall be " << nofStrips <<
" strips here so the radius should be " << newRadius << endl;
890 pout <<
" " << sensorNumber+1 <<
", " << SensorStripType[sensorNumber] <<
", "
891 << setw(9) << 0. <<
", "
892 << setw(9) << 0. <<
", "
893 << setw(9) << DiskZPosition[istat]+SensZPosition[slay][istat] <<
", "
894 << setw(9) << 0. <<
", "
895 << setw(9) << newRadius <<
", "
896 << setw(9) << SensOuterRadius[slay][istat] <<
", "
897 << setw(9) << SensLayerThick[slay] <<
", "
898 << setw(9) << SensorStripAngle[sensorNumber][0] <<
", "
900 << setw(9) << 2.*sMiddleROBarHfTh[istat] <<
", "
901 << setw(9) << SensorStripPitch[sensorNumber][0] <<
", "
902 << setw(9) << SensorStripPitch[sensorNumber][1] << ((istat==NofDisks-1 && sensorNumber==1)?
"":
", \\")
912 Double_t layerPosition = firstLayerOffset;
914 Int_t msensorNumber = 0;
916 for ( Int_t ilay = 0 ; ilay < NofLayers ; ilay++ ) {
917 cout <<
"doing layer " << ilay << endl;
918 layerPosition += LayerThick[ilay]/2.;
919 if ( LayerName[ilay].Contains(
"space") && LayerThick[ilay] > 0.0 ) {
920 cout <<
"***** THE THICK SPACE LAYER IS AT " << layerPosition << endl;
922 if ( LayerName[ilay].Contains(
"space") && LayerName[ilay].Length() == 5 ) {
923 layerPosition += LayerThick[ilay]/2.;
927 cout <<
" got layer : " << LayerName[ilay].Data() << endl;
931 cout <<
"will do loop over segments" << endl;
932 for ( Int_t miseg = 0 ; miseg < 1 ; miseg++ ) {
933 cout <<
"segment " << miseg << endl;
934 DiskLayersShapeA[ilay][istat][miseg] =
new TGeoTube(Form(
"disk%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
935 DiskInnerRadius[ilay][istat],DiskOuterRadius[ilay][istat],
936 LayerThick[ilay]/2.);
937 DiskLayersShapeB[ilay][istat][miseg] =
new TGeoBBox (Form(
"robo%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
938 MiddleROBarHfTh[istat],
939 DiskOuterRadius[ilay][istat],
941 DiskLayersSubtr[ilay][istat][miseg] =
new TGeoSubtraction(DiskLayersShapeA[ilay][istat][miseg],
942 DiskLayersShapeB[ilay][istat][miseg]);
944 DiskLayersShapeC[ilay][istat][miseg] =
new TGeoCompositeShape(Form(
"comp%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
945 DiskLayersSubtr[ilay][istat][miseg]);
946 msegBegin += msegPhiSpan;
947 cout <<
" msegBegin " << msegBegin << endl;
949 DiskLayersShapeHole[ilay][istat][miseg] =
new TGeoTube(Form(
"Hole%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),0.0,3.80,LayerThick[ilay]+0.01);
951 DiskLayersTranshA[ilay][istat][miseg] =
new TGeoTranslation(
"hA",HoleTX,HoleTY,HoleTZ);
952 DiskLayersTranshA[ilay][istat][miseg] ->RegisterYourself();
953 DiskLayersTranshB[ilay][istat][miseg] =
new TGeoTranslation(
"hB",HoleTX,-HoleTY,HoleTZ);
954 DiskLayersTranshB[ilay][istat][miseg] ->RegisterYourself();
956 DiskLayersShapecompos[ilay][istat][miseg] =
new TGeoCompositeShape(Form(
"compos%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
957 Form(
"comp%dseg%d%sshape-(Hole%dseg%d%sshape:hA)-(Hole%dseg%d%sshape:hB)",
958 istat+1,miseg+1,LayerName[ilay].Data(),istat+1,miseg+1,LayerName[ilay].Data(),istat+1,miseg+1,LayerName[ilay].Data()));
961 TString layerMaterial = LayerName[ilay].Data();
962 layerMaterial.Remove(0,layerMaterial.Last(
'_')+1);
963 cout <<
"THE MATERIAL IS \"" << layerMaterial.Data() <<
"\"" << endl;
964 DiskLayersVol[ilay][istat][miseg] =
new TGeoVolume(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,miseg+1,LayerName[ilay].Data()),
965 DiskLayersShapecompos[ilay][istat][miseg],
966 gGeoMan->GetMedium(layerMaterial.Data()));
968 cout <<
"layer material = " << layerMaterial.Data() << endl;
969 if ( layerMaterial.Contains(
"air" ) )
970 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kWhite);
971 if ( layerMaterial.Contains(
"copper" ) )
972 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kOrange+1);
973 if ( layerMaterial.Contains(
"kapton" ) )
974 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kOrange+2);
975 if ( layerMaterial.Contains(
"aluminium" ) )
976 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kCyan-9);
977 if ( layerMaterial.Contains(
"GEMmixture" ) )
978 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kYellow);
979 if ( layerMaterial.Contains(
"carbon" ) )
981 if ( layerMaterial.Contains(
"GlassFiber" ) )
982 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kGreen+3);
984 DiskLayersTrans[ilay][istat][miseg] =
new TGeoTranslation(0.,0.,layerPosition);
985 DiskLayersCombi[ilay][istat][miseg] =
new TGeoCombiTrans(*DiskLayersTrans[ilay][istat][miseg],*dummyrot);
986 DiskLayersCombi[ilay][istat][miseg]->SetName(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,miseg+1,LayerName[ilay].Data()));
987 DiskLayersCombi[ilay][istat][miseg]->RegisterYourself();
988 DiskVol[istat]->AddNode(DiskLayersVol[ilay][istat][miseg],0,DiskLayersCombi[ilay][istat][miseg]);
992 cout <<
"mvolume " << LayerName[ilay] <<
" from "
993 << setprecision(10) << DiskZPosition[istat]+layerPosition-LayerThick[ilay]/2. <<
" to "
994 << setprecision(10) << DiskZPosition[istat]+layerPosition+LayerThick[ilay]/2. << endl;
996 if ( LayerName[ilay].Contains(
"Gem") && LayerName[ilay].Contains(
"Sensor") ) {
997 Double_t mnewRadius = DiskInnerRadius[ilay][istat];
1000 cout <<
"mrad = " << DiskInnerRadius[ilay][istat] <<
" pitch = " << SensorStripPitch[msensorNumber][0] <<
" for sensor " << msensorNumber << endl;
1001 if ( SensorStripType[msensorNumber] != 2 ) {
1002 mnofStrips = TMath::Ceil(2.*
TMath::Pi()*DiskInnerRadius[ilay][istat]/SensorStripPitch[msensorNumber][0]);
1003 mnewRadius = mnofStrips*SensorStripPitch[msensorNumber][0]/2./
TMath::Pi();
1005 cout <<
"!!!! " << istat <<
" " << ilay <<
" > there shall be " << mnofStrips <<
" strips here so the radius should be " << mnewRadius << endl;
1006 pout <<
" " << msensorNumber+1 <<
", " << SensorStripType[msensorNumber] <<
", "
1007 << setw(9) << 0. <<
", "
1008 << setw(9) << 0. <<
", "
1009 << setw(9) << DiskZPosition[istat]+layerPosition <<
", "
1010 << setw(9) << 0. <<
", "
1011 << setw(9) << mnewRadius <<
", "
1012 << setw(9) << DiskOuterRadius[ilay][istat] <<
", "
1013 << setw(9) << LayerThick[ilay] <<
", "
1014 << setw(9) << SensorStripAngle[msensorNumber][0] <<
", "
1016 << setw(9) << MiddleROBarHfTh[istat] <<
", "
1017 << setw(9) << SensorStripPitch[msensorNumber][0] <<
", "
1018 << setw(9) << SensorStripPitch[msensorNumber][1] << ((istat==NofDisks-1&&msensorNumber==1)?
"":
", \\")
1023 layerPosition += LayerThick[ilay]/2.;
1026 SubunitVol->AddNode(DiskVol[istat],0,DiskCombi[istat]);
1030 pout <<
"TrackFinderOnHits_ParThetaA: Double_t 59.4" << endl
1031 <<
"TrackFinderOnHits_ParThetaB: Double_t -0.02" << endl
1032 <<
"TrackFinderOnHits_ParTheta0: Double_t 56.1372" << endl
1033 <<
"TrackFinderOnHits_ParTheta1: Double_t -0.000564362" << endl
1034 <<
"TrackFinderOnHits_ParTheta2: Double_t -0.181828" << endl
1035 <<
"TrackFinderOnHits_ParTheta3: Double_t 0.284289" << endl
1036 <<
"TrackFinderOnHits_ParRadPhi0:Double_t 0.9944432" << endl
1037 <<
"TrackFinderOnHits_ParRadPhi2:Double_t -0.000590706" << endl
1038 <<
"TrackFinderOnHits_ParMat0: Double_t \\" << endl
1040 <<
" -2.35034328e-6, 0.0006810756, 0.10335768" << endl
1041 <<
"TrackFinderOnHits_ParMat1: Double_t \\" << endl
1043 <<
" -7.58793504e-10, -6.7763136e-7, 0.000748458752" << endl
1044 <<
"##########################################################################################" << flush;
1050 RiddleShapeTubeA =
new TGeoTube (
"TubeA" , 43.3, 44.9, 0.10 );
1051 RiddleShapeTubeB =
new TGeoTube (
"TubeB" , 44.8, 44.9, 9.10 );
1052 RiddleShapeCone =
new TGeoCone (
"Cone" , 18.2, 44.8, 44.9, 69.0, 69.1 );
1053 RiddleShapeTubeC =
new TGeoTube (
"TubeC" , 69.0, 75.4, 0.10 );
1054 RiddleShapeTubeD =
new TGeoTube (
"TubeD" , 75.4, 75.5, 10.4 );
1055 RiddleShapeTubeE =
new TGeoTube (
"TubeE" , 72.5, 75.4, 0.10 );
1056 RiddleShapeTubeF =
new TGeoTube (
"TubeF" , 0.00, 8.00, 5.00 );
1058 RiddleTransTubeA =
new TGeoTranslation(
"trA",0.0,0.0,9.20);
1059 RiddleTransTubeA ->RegisterYourself();
1060 RiddleTransCone =
new TGeoTranslation(
"trB",0.0,0.0,36.5);
1061 RiddleTransCone ->RegisterYourself();
1062 RiddleTransTubeC =
new TGeoTranslation(
"trC",0.0,0.0,54.6);
1063 RiddleTransTubeC ->RegisterYourself();
1064 RiddleTransTubeD =
new TGeoTranslation(
"trD",0.0,0.0,64.5);
1065 RiddleTransTubeD ->RegisterYourself();
1066 RiddleTransTubeE =
new TGeoTranslation(
"trE",0.0,0.0,74.4);
1067 RiddleTransTubeE ->RegisterYourself();
1073 const Int_t NofHoles = 16.0;
1075 const Int_t NofHolesRows = 4;
1077 Double_t holePosR[4] = {44,52,64,75};
1078 Double_t holePosD[4] = {90,-60,-60,90};
1079 Double_t holePosZ[4] = {9,28,45,65};
1081 TString RiddleshapeFormula =
"TubeA+(TubeB:trA)+(Cone:trB)+(TubeC:trC)+(TubeD:trD)+(TubeE:trE)" ;
1084 for ( Int_t irow = 0 ; irow < NofHolesRows ; irow++ ) {
1085 for ( Int_t ihole= 0 ; ihole < NofHoles ; ihole++ ) {
1087 Double_t holePosA = ihole*rotDeltaAngle;
1091 RiddleTransTubeF[irow][ihole] =
new TGeoTranslation(Form(
"trF%d_%d",irow+1, ihole+1) , holePosX, holePosY,holePosZ[irow]);
1092 RiddleTransTubeF[irow][ihole] ->RegisterYourself();
1094 RiddleRothole[irow][ihole] =
new TGeoRotation(Form(
"ro%d_%d" , irow+1, ihole+1) ,holePosA+90, holePosD[irow],20);
1095 RiddleRothole[irow][ihole] ->RegisterYourself();
1097 RiddleCombiTranshole[irow][ihole] =
new TGeoCombiTrans( *RiddleTransTubeF[irow][ihole] , *RiddleRothole[irow][ihole] );
1099 RiddleCombiTranshole[irow][ihole] ->SetName(Form(
"TR%d_%d",irow+1, ihole+1));
1100 RiddleCombiTranshole[irow][ihole] ->RegisterYourself();
1102 RiddleshapeFormula += Form(
"-(TubeF:TR%d_%d)" , irow+1,ihole+1 );
1106 cout<<
" RiddleshapeFormula = \"" <<RiddleshapeFormula.Data()<<
"\""<< endl;
1108 RiddleShapecompos =
new TGeoCompositeShape(
"riddle", RiddleshapeFormula );
1112 RiddleVolcomp =
new TGeoVolume(
"GEMriddleCOMP", RiddleShapecompos,gGeoMan->GetMedium(
"carbon"));
1115 RiddleTrans =
new TGeoTranslation(0.0,0.0,116.8);
1116 RiddleCombi =
new TGeoCombiTrans(*RiddleTrans,*dummyrot);
1117 RiddleCombi->SetName(
"GEMriddleCOMP");
1118 RiddleCombi->RegisterYourself();
1119 RiddleVolcomp->SetLineColor(kGray+1);
1120 SubunitVol->AddNode(RiddleVolcomp,0,RiddleCombi);
1123 tAcopperbarShape =
new TGeoPara (
"tAcopperbarshape",lcopperbarx,lcopperbary,lcopperbarHalfThickness, 0.0, 0.0, 0.0);
1124 tAcopperbarVol =
new TGeoVolume(
"GEM_tAcopperbarVolume",tAcopperbarShape,gGeoMan->GetMedium(
"copper"));
1125 tAcopperbarTrans =
new TGeoTranslation(0.,41.7,131.55);
1126 tAcopperbarRot =
new TGeoRotation(
"tAcopperbarrot",-90.0,0.0,0.0);
1127 tAcopperbarRot ->RegisterYourself();
1128 tAcopperbarCombi =
new TGeoCombiTrans(*tAcopperbarTrans,*tAcopperbarRot);
1129 tAcopperbarCombi->SetName(
"GEM_tAcopperbar_Volume");
1130 tAcopperbarCombi->RegisterYourself();
1131 tAcopperbarVol->SetLineColor(kOrange+1);
1132 SubunitVol->AddNode(tAcopperbarVol,0,tAcopperbarCombi);
1134 tMcopperbarShape =
new TGeoPara (
"tMcopperbarshape",mcopperbarx,mcopperbary,mcopperbarHalfThickness, 0.0, -32.0, 0.0);
1135 tMcopperbarVol =
new TGeoVolume(
"GEM_tMcopperbarVolume",tMcopperbarShape,gGeoMan->GetMedium(
"copper"));
1136 tMcopperbarTrans =
new TGeoTranslation(0.,47.8,145.35);
1137 tMcopperbarRot =
new TGeoRotation(
"tMcopperbarrot",-90.0,0.0,0.0);
1138 tMcopperbarRot ->RegisterYourself();
1139 tMcopperbarCombi =
new TGeoCombiTrans(*tMcopperbarTrans,*tMcopperbarRot);
1140 tMcopperbarCombi->SetName(
"GEM_tMcopperbar_Volume");
1141 tMcopperbarCombi->RegisterYourself();
1142 tMcopperbarVol->SetLineColor(kOrange+1);
1143 SubunitVol->AddNode(tMcopperbarVol,0,tMcopperbarCombi);
1145 tBcopperbarShape =
new TGeoPara (
"tBcopperbarshape",rcopperbarx,rcopperbary,rcopperbarHalfThickness, 0.0, -45.0, 0.0);
1146 tBcopperbarVol =
new TGeoVolume(
"GEM_tBcopperbarVolume",tBcopperbarShape,gGeoMan->GetMedium(
"copper"));
1147 tBcopperbarTrans =
new TGeoTranslation(0.,61.8,171.9);
1148 tBcopperbarRot =
new TGeoRotation(
"tBcopperbarrot",-90.0,0.0,0.0);
1149 tBcopperbarRot ->RegisterYourself();
1150 tBcopperbarCombi =
new TGeoCombiTrans(*tBcopperbarTrans,*tBcopperbarRot);
1151 tBcopperbarCombi->SetName(
"GEM_tBcopperbar_Volume");
1152 tBcopperbarCombi->RegisterYourself();
1153 tBcopperbarVol->SetLineColor(kOrange+1);
1154 SubunitVol->AddNode(tBcopperbarVol,0,tBcopperbarCombi);
1156 dAcopperbarShape =
new TGeoPara (
"dAcopperbarshape",lcopperbarx,lcopperbary,lcopperbarHalfThickness, 0.0, 0.0, 0.0);
1157 dAcopperbarVol =
new TGeoVolume(
"GEM_dAcopperbarVolume",dAcopperbarShape,gGeoMan->GetMedium(
"copper"));
1158 dAcopperbarTrans =
new TGeoTranslation(0.,-41.7,131.55);
1159 dAcopperbarRot =
new TGeoRotation(
"dAcopperbarrot",90.0,0.0,0.0);
1160 dAcopperbarRot ->RegisterYourself();
1161 dAcopperbarCombi =
new TGeoCombiTrans(*dAcopperbarTrans,*dAcopperbarRot);
1162 dAcopperbarCombi->SetName(
"GEM_dAcopperbar_Volume");
1163 dAcopperbarCombi->RegisterYourself();
1164 dAcopperbarVol->SetLineColor(kOrange+1);
1165 SubunitVol->AddNode(dAcopperbarVol,0,dAcopperbarCombi);
1167 dMcopperbarShape =
new TGeoPara (
"dMcopperbarshape",mcopperbarx,mcopperbary,mcopperbarHalfThickness, 0.0, -32.0, 0.0);
1168 dMcopperbarVol =
new TGeoVolume(
"GEM_dMcopperbarVolume",dMcopperbarShape,gGeoMan->GetMedium(
"copper"));
1169 dMcopperbarTrans =
new TGeoTranslation(0.,-47.8,145.35);
1170 dMcopperbarRot =
new TGeoRotation(
"dMcopperbarrot",90.0,0.0,0.0);
1171 dMcopperbarRot ->RegisterYourself();
1172 dMcopperbarCombi =
new TGeoCombiTrans(*dMcopperbarTrans,*dMcopperbarRot);
1173 dMcopperbarCombi->SetName(
"GEM_dMcopperbar_Volume");
1174 dMcopperbarCombi->RegisterYourself();
1175 dMcopperbarVol->SetLineColor(kOrange+1);
1176 SubunitVol->AddNode(dMcopperbarVol,0,dMcopperbarCombi);
1178 dBcopperbarShape =
new TGeoPara (
"dBcopperbarshape",rcopperbarx,rcopperbary,rcopperbarHalfThickness, 0.0, -45.0, 0.0);
1179 dBcopperbarVol =
new TGeoVolume(
"GEM_dBcopperbarVolume",dBcopperbarShape,gGeoMan->GetMedium(
"copper"));
1180 dBcopperbarTrans =
new TGeoTranslation(0.,-61.8,171.9);
1181 dBcopperbarRot =
new TGeoRotation(
"dBcopperbarrot",90.0,0.0,0.0);
1182 dBcopperbarRot ->RegisterYourself();
1183 dBcopperbarCombi =
new TGeoCombiTrans(*dBcopperbarTrans,*dBcopperbarRot);
1184 dBcopperbarCombi->SetName(
"GEM_dBcopperbar_Volume");
1185 dBcopperbarCombi->RegisterYourself();
1186 dBcopperbarVol->SetLineColor(kOrange+1);
1187 SubunitVol->AddNode(dBcopperbarVol,0,dBcopperbarCombi);
1190 top->AddNode(SubunitVol,0,
new TGeoCombiTrans());
1205 gGeoMan->CloseGeometry();
FairGeoMedium * CbmMediumCarbon
TGeoManager * gGeoManager
FairGeoMedium * CbmMediumAluminium
FairGeoBuilder * geobuild
FairGeoMedium * CbmMediumAir
FairGeoMedium * CbmMediumPWO
FairGeoInterface * geoFace
vDisk SetLineColor(colYellow)
Int_t create3StationsGem_v2_1()