14 const Int_t NofDisks = 3;
16 const Double_t DiskVolInnerRadius[NofDisks] = { 4.50, 4.50, 4.50 };
17 const Double_t DiskVolOuterRadius[NofDisks] = { 45.06, 56.06, 74.06 };
18 const Double_t DiskZPosition [NofDisks] = { 119.40, 155.40, 188.50 };
21 const Int_t DiskNFoils [NofDisks] = { 2 , 2 , 4 };
22 const Double_t MiddleROBarHfTh[NofDisks] = { 2.35, 2.35, 2.35 };
23 const Double_t HalfStationThickness = 8.003;
25 const Double_t carbonRingInnerRadius[NofDisks] = { 39.97, 50.97, 68.97 };
26 const Double_t carbonRingOuterRadius[NofDisks] = { 40.17, 51.17, 69.17 };
27 const Double_t carbonRingHalfThickness = 1.50;
29 const Double_t copperRingInnerRadius[NofDisks] = { 39.47, 50.47, 68.47 };
30 const Double_t copperRingOuterRadius[NofDisks] = { 39.67, 50.67, 68.67 };
31 const Double_t copperRingHalfThickness = 3.75;
33 const Double_t AlRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
34 const Double_t AlRingOuterRadius[NofDisks] = { 44.70, 55.70, 73.70 };
35 const Double_t AlRingHalfThickness = 3.75;
37 const Double_t SegmentHalfThickness = 0.25;
38 const Int_t NofSegments = 24;
40 const Double_t FirstSegmentAngle = 7.5;
41 const TString newsegment [NofSegments] = {
"seg1" ,
"seg2" ,
"seg3" ,
"seg4" ,
"seg5" ,
"seg6" ,
"seg7" ,
"seg8" ,
42 "seg9" ,
"seg10",
"seg11",
"seg12",
"seg13",
"seg14",
"seg15",
"seg16",
43 "seg17",
"seg18",
"seg19",
"seg20",
"seg21",
"seg22",
"seg23",
"seg24" };
45 const Double_t moduleRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
46 const Double_t moduleRingOuterRadius[NofDisks] = { 44.65, 55.65, 73.65 };
47 const Double_t moduleRingHalfThickness = 3.75;
49 const Double_t moduleSegmentHalfThickness = 1.30;
50 const Int_t NofmoduleSegments = 24;
52 const Double_t FirstmoduleSegmentAngle = 0.0 ;
53 const TString newmodulesegment [NofmoduleSegments] = {
"moduleseg1" ,
"moduleseg2" ,
"moduleseg3" ,
"moduleseg4" ,
"moduleseg5" ,
"moduleseg6" ,
"moduleseg7" ,
"moduleseg8" ,
54 "moduleseg9" ,
"moduleseg10",
"moduleseg11",
"moduleseg12",
"moduleseg13",
"moduleseg14",
"moduleseg15",
"moduleseg16",
55 "moduleseg17",
"moduleseg18",
"moduleseg19",
"moduleseg20",
"moduleseg21",
"moduleseg22",
"moduleseg23",
"moduleseg24" };
57 const Double_t AlumiRingInnerRadius[NofDisks] = { 44.7, 55.7, 73.7 };
58 const Double_t AlumiRingOuterRadius[NofDisks] = { 45.0, 56.0, 74.0 };
59 const Double_t AlumiRingHalfThickness = 3.75;
61 const Double_t coverRingInnerRadius[NofDisks] = { 39.70, 50.70, 68.70 };
62 const Double_t coverRingOuterRadius[NofDisks] = { 45.00, 56.00, 74.00 };
63 const Double_t coverRingHalfThickness = 0.2;
67 const Double_t rcopperbarHalfThickness = 8.40;
71 const Double_t lcopperbarHalfThickness = 13.80;
74 const Int_t NofLayers = 49;
76 const TString LayerName [NofLayers] = {
"space",
77 "window1_foil_out_aluminium",
"WindowF_kapton",
"window2_foil_out_aluminium",
79 "WindowF_aluminium",
"CathodeF_kapton",
"CathodeF_aluminium",
83 "Gem1F_copper",
"Gem1_kapton",
"Gem1B_copper",
85 "Gem2F_copper",
"Gem2_kapton",
"Gem2B_copper",
87 "Gem3F_copper",
"Gem3_kapton",
"Gem3B_copper",
90 "PadF_copper",
"Pad_kapton",
"PadB_copper",
93 "Gem4F_copper",
"Gem4_kapton",
"Gem4B_copper",
95 "Gem5F_copper",
"Gem5_kapton",
"Gem5B_copper",
97 "Gem6F_copper",
"Gem6_kapton",
"Gem6B_copper",
101 "CathodeB_aluminium",
"CathodeB_kapton",
"WindowB_aluminium",
103 "window1_foil_in_aluminium",
"WindowB_kapton",
"window2_foil_in_aluminium",
107 const Double_t LayerThick[NofLayers] = { 1.0,
108 0.0001, 0.0007, 0.0001,
110 0.0001, 0.0007, 0.0001,
114 0.0005, 0.0050, 0.0005,
116 0.0005, 0.0050, 0.0005,
118 0.0005, 0.0050, 0.0005,
124 0.0005, 0.0050, 0.0005,
126 0.0005, 0.0050, 0.0005,
128 0.0005, 0.0050, 0.0005,
132 0.0001, 0.0007, 0.0001,
134 0.0001, 0.0007, 0.0001,
138 const Double_t DiskOuterRadius[NofLayers][NofDisks] = { 39.90, 50.90, 68.90,
139 38.95, 49.95, 67.95, 39.40, 50.40, 68.40, 38.95, 49.95, 67.95,
141 38.45, 49.45, 67.45, 39.40, 50.40, 68.40, 38.45, 49.45, 67.45,
145 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
147 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
149 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
152 44.90, 55.90, 73.90, 44.90, 55.90, 73.90, 44.90, 55.90, 73.90,
155 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
157 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
159 38.10, 49.45, 67.45, 39.05, 50.05, 68.05, 38.10, 49.45, 67.45,
163 38.45, 49.45, 67.45, 39.40, 50.40, 68.40, 38.45, 49.45, 67.45,
165 39.40, 50.40, 68.40, 38.95, 49.45, 67.95, 39.40, 50.40, 68.40,
166 39.40, 50.40, 68.40 };
169 const Double_t DiskInnerRadius[NofLayers][NofDisks] = { 4.50, 4.50, 4.50,
170 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
172 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
176 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
178 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
180 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
183 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
186 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
188 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
190 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
194 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
196 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50, 4.50,
205 const Int_t NofSensLayers = 2;
207 const Double_t sMiddleROBarHfTh[NofDisks] = { 2.35, 2.35, 2.35 };
209 const TString SensLayerName[NofSensLayers] = {
"Gem1_Sensor_GEMmixture",
210 "Gem6_Sensor_GEMmixture" };
212 const Double_t SensLayerThick[NofSensLayers] = { 0.85,
215 const Double_t SensZPosition[NofSensLayers][NofDisks] = { -0.6942, -0.6942, -0.6942,
216 0.6948, 0.6948, 0.6948 };
218 const Double_t SensOuterRadius[NofSensLayers][NofDisks] = { 38.15, 49.15, 67.15,
219 38.15, 49.15, 67.15 };
221 const Double_t SensInnerRadius[NofSensLayers][NofDisks] = { 5.00, 5.00, 5.00,
229 const Int_t NofHLayers = 16;
231 const TString HLayersName [NofHLayers] = {
"windowF1_ring_carbon",
233 "windowF2_ring_carbon",
235 "cathodeF_ring_GlassFiber",
237 "gem_ring1_GlassFiber",
239 "gem_ring2_GlassFiber",
241 "gem_ring3_GlassFiber",
243 "gem_ring4_GlassFiber",
244 "padplaneF_support_GlassFiber",
246 "padplaneB_support_GlassFiber",
247 "gem_ring5_GlassFiber",
249 "gem_ring6_GlassFiber",
251 "gem_ring7_GlassFiber",
253 "gem_ring8_GlassFiber",
255 "cathodeB_ring_GlassFiber",
257 "windowB1_ring_carbon",
259 "windowB2_ring_carbon" };
261 const Double_t HLayersThick[NofHLayers] = { 1.00,
279 const Double_t HZPosition[NofHLayers][NofDisks] = { -2.6216, -2.6216, -2.6216,
280 -1.6201, -1.6201, -1.6201,
281 -0.7192, -0.7192, -0.7192,
282 -0.2942, -0.2942, -0.2942,
283 -0.2382, -0.2382, -0.2382,
284 -0.1822, -0.1822, -0.1822,
285 -0.1262, -0.1262, -0.1262,
286 -0.0512, -0.0512, -0.0512,
287 0.0518, 0.0518, 0.0518,
288 0.1268, 0.1268, 0.1268,
289 0.1828, 0.1828, 0.1828,
290 0.2388, 0.2388, 0.2388,
291 0.2948, 0.2948, 0.2948,
292 0.7198, 0.7198, 0.7198,
293 1.6207, 1.6207, 1.6207,
294 2.6216, 2.6216, 2.6216 };
297 const Double_t HOuterRadius[NofHLayers][NofDisks] = { 39.90, 50.90, 68.90,
312 39.40, 50.40, 68.40 };
314 const Double_t HInnerRadius[NofHLayers][NofDisks] = { 38.50, 49.50, 67.50,
329 38.00, 49.00, 67.00 };
337 const Double_t HTY[NofHLayers][NofDisks] = { 25.0, 45.0, 65.0,
356 const Int_t SensorStripType [2] = { 3 , 2 };
358 const Double_t SensorStripAngle[2][2] = { 0. , 0. , 0. , 0. };
359 const Double_t SensorStripPitch[2][2] = { 0.04, 0.04, 0.04, 0.04};
363 for ( Int_t ilayer = 0 ; ilayer < NofLayers ; ilayer++ ) {
364 cout << LayerName[ilayer].Data() <<
" -> " << LayerThick[ilayer] << endl;
365 firstLayerOffset += LayerThick[ilayer];
368 cout <<
"total thickness is " << firstLayerOffset << endl;
369 firstLayerOffset = firstLayerOffset/2.;
370 firstLayerOffset = -0.001*(TMath::Floor(1000.*firstLayerOffset));
371 cout <<
"first layer offset is " << firstLayerOffset << endl;
374 TString vmcWorkdir = getenv(
"VMCWORKDIR");
376 TString outfile=
"../../geometry/gem_3Stations_realistic_v2.root";
379 TFile*
fi =
new TFile(outfile,
"RECREATE");
381 cout <<
"created output file" << endl;
382 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
383 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
384 cout <<
"geoface setmediafile" << endl;
385 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
386 cout <<
"geoface readmedia" << endl;
387 geoFace->readMedia();
388 cout <<
"geoface print" << endl;
390 cout <<
"geoface done" << endl;
392 FairGeoMedia *
Media = geoFace->getMedia();
393 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
399 FairGeoMedium *CbmMediumCopper = Media->getMedium(
"copper");
400 FairGeoMedium *CbmMediumKapton = Media->getMedium(
"kapton");
401 FairGeoMedium *CbmMediumArCO2 = Media->getMedium(
"GEMmixture");
402 FairGeoMedium *CbmMediumUranium = Media->getMedium(
"uranium");
403 FairGeoMedium *CbmMediumGlassFiber= Media->getMedium(
"GlassFiber");
405 Int_t
nmed=geobuild->createMedium(CbmMediumAir);
406 nmed=geobuild->createMedium(CbmMediumPWO);
407 nmed=geobuild->createMedium(CbmMediumCarbon);
408 nmed=geobuild->createMedium(CbmMediumAluminium);
409 nmed=geobuild->createMedium(CbmMediumCopper);
410 nmed=geobuild->createMedium(CbmMediumKapton);
411 nmed=geobuild->createMedium(CbmMediumArCO2);
412 nmed=geobuild->createMedium(CbmMediumUranium);
413 nmed=geobuild->createMedium(CbmMediumGlassFiber);
416 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
418 TGeoVolume *
top =
new TGeoVolumeAssembly(
"Gem");
420 gGeoMan->SetTopVolume(top);
422 cout <<
"-------------------------------------------------------------------" << endl;
423 TList* mediaList = (TList*)gGeoMan->GetListOfMedia();
425 cout <<
"media known: " << mediaList->GetEntries() <<
"." << endl;
426 for ( Int_t itemp = 0 ; itemp < mediaList->GetEntries() ; itemp++ ) {
427 TGeoMedium*
medium = (TGeoMedium*)mediaList->At(itemp);
428 cout <<
"medium " << itemp <<
" name is " << medium->GetName() << endl;
430 cout <<
"-------------------------------------------------------------------" << endl;
432 TGeoRotation*
dummyrot =
new TGeoRotation();
434 TGeoVolumeAssembly*
SubunitVol =
new TGeoVolumeAssembly(
"Gem_Disks");
437 TGeoShape *DiskShape[NofDisks];
438 TGeoVolume *DiskVol [NofDisks];
439 TGeoRotation *DiskRotat[NofDisks];
440 TGeoTranslation *DiskTrans[NofDisks];
441 TGeoCombiTrans *DiskCombi[NofDisks];
443 TGeoShape *carbonRingShape[NofDisks];
444 TGeoVolume *carbonRingVol [NofDisks];
445 TGeoTranslation *carbonRingTrans[NofDisks];
446 TGeoCombiTrans *carbonRingCombi[NofDisks];
448 TGeoShape *copperRingShape[NofDisks];
449 TGeoVolume *copperRingVol [NofDisks];
450 TGeoTranslation *copperRingTrans[NofDisks];
451 TGeoCombiTrans *copperRingCombi[NofDisks];
453 TGeoShape *coverRingShape[NofDisks];
454 TGeoVolume *coverRingVol [NofDisks];
455 TGeoTranslation *coverRingTrans[NofDisks];
456 TGeoCombiTrans *coverRingCombi[NofDisks];
458 TGeoShape *tAcopperbarShape;
459 TGeoVolume *tAcopperbarVol ;
460 TGeoTranslation *tAcopperbarTrans;
461 TGeoRotation *tAcopperbarRot;
462 TGeoCombiTrans *tAcopperbarCombi;
464 TGeoShape *tBcopperbarShape;
465 TGeoVolume *tBcopperbarVol ;
466 TGeoTranslation *tBcopperbarTrans;
467 TGeoRotation *tBcopperbarRot;
468 TGeoCombiTrans *tBcopperbarCombi;
470 TGeoShape *dAcopperbarShape;
471 TGeoVolume *dAcopperbarVol ;
472 TGeoTranslation *dAcopperbarTrans;
473 TGeoRotation *dAcopperbarRot;
474 TGeoCombiTrans *dAcopperbarCombi;
476 TGeoShape *dBcopperbarShape;
477 TGeoVolume *dBcopperbarVol ;
478 TGeoTranslation *dBcopperbarTrans;
479 TGeoRotation *dBcopperbarRot;
480 TGeoCombiTrans *dBcopperbarCombi;
482 TGeoShape *AlRingShape[NofDisks][NofSegments];
483 TGeoVolume *AlRingVol [NofDisks][NofSegments];
484 TGeoTranslation *AlRingTrans[NofDisks][NofSegments];
485 TGeoCombiTrans *AlRingCombi[NofDisks][NofSegments];
487 TGeoShape *moduleRingShape[NofDisks][NofmoduleSegments];
488 TGeoVolume *moduleRingVol [NofDisks][NofmoduleSegments];
489 TGeoTranslation *moduleRingTrans[NofDisks][NofmoduleSegments];
490 TGeoCombiTrans *moduleRingCombi[NofDisks][NofmoduleSegments];
492 TGeoShape *AlumiRingShape[NofDisks];
493 TGeoVolume *AlumiRingVol [NofDisks];
494 TGeoTranslation *AlumiRingTrans[NofDisks];
495 TGeoCombiTrans *AlumiRingCombi[NofDisks];
497 TGeoShape *DiskLayersShapeA [NofLayers][NofDisks][4];
498 TGeoShape *DiskLayersShapeB [NofLayers][NofDisks][4];
499 TGeoSubtraction *DiskLayersSubtr [NofLayers][NofDisks][4];
500 TGeoShape *DiskLayersShapeC [NofLayers][NofDisks][4];
501 TGeoShape *DiskLayersShapeHole [NofLayers][NofDisks][4];
502 TGeoCompositeShape *DiskLayersShapecompos[NofLayers][NofDisks][4];
503 TGeoVolume *DiskLayersVol [NofLayers][NofDisks][4];
504 TGeoTranslation *DiskLayersTranshA [NofLayers][NofDisks][4];
505 TGeoTranslation *DiskLayersTranshB [NofLayers][NofDisks][4];
506 TGeoTranslation *DiskLayersTrans [NofLayers][NofDisks][4];
507 TGeoCombiTrans *DiskLayersCombi [NofLayers][NofDisks][4];
509 TGeoShape *SensDiskLayersShapeA [NofSensLayers][NofDisks][4];
510 TGeoShape *SensDiskLayersShapeB [NofSensLayers][NofDisks][4];
511 TGeoSubtraction *SensDiskLayersSubtr [NofSensLayers][NofDisks][4];
512 TGeoShape *SensDiskLayersShapeC [NofSensLayers][NofDisks][4];
513 TGeoShape *SensDiskLayersShapeHole [NofSensLayers][NofDisks][4];
514 TGeoCompositeShape *SensDiskLayersShapecompos[NofSensLayers][NofDisks][4];
515 TGeoVolume *SensDiskLayersVol [NofSensLayers][NofDisks][4];
516 TGeoTranslation *SensDiskLayersTranshA [NofSensLayers][NofDisks][4];
517 TGeoTranslation *SensDiskLayersTranshB [NofSensLayers][NofDisks][4];
518 TGeoTranslation *SensDiskLayersTrans [NofSensLayers][NofDisks][4];
519 TGeoCombiTrans *SensDiskLayersCombi [NofSensLayers][NofDisks][4];
521 TGeoShape *HLayersShapeTube [NofHLayers][NofDisks];
522 TGeoShape *HLayersShapeBox [NofHLayers][NofDisks];
523 TGeoShape *HLayersShapePlate [NofHLayers][NofDisks];
524 TGeoShape *HLayersShapeHT [NofHLayers][NofDisks];
525 TGeoShape *HLayersShapeHTM [NofHLayers][NofDisks];
526 TGeoShape *HLayersShapeHTD [NofHLayers][NofDisks];
527 TGeoCompositeShape *HLayersShapecompos[NofHLayers][NofDisks];
528 TGeoVolume *HLayersVolcomp [NofHLayers][NofDisks];
529 TGeoTranslation *HLayersTranstA [NofHLayers][NofDisks];
530 TGeoTranslation *HLayersTranstB [NofHLayers][NofDisks];
531 TGeoTranslation *HLayersTranstC [NofHLayers][NofDisks];
532 TGeoTranslation *HLayersTranstD [NofHLayers][NofDisks];
533 TGeoTranslation *HLayersTranstE [NofHLayers][NofDisks];
534 TGeoTranslation *HLayersTranstF [NofHLayers][NofDisks];
535 TGeoRotation *HLayersRotrA [NofHLayers][NofDisks];
536 TGeoShape *HLayersShape [NofHLayers][NofDisks];
537 TGeoVolume *HLayersVol [NofHLayers][NofDisks];
538 TGeoTranslation *HLayersTrans [NofHLayers][NofDisks];
539 TGeoCombiTrans *HLayersCombi [NofHLayers][NofDisks];
541 TGeoShape *RiddleShapeTubeA ;
542 TGeoShape *RiddleShapeTubeB ;
543 TGeoShape *RiddleShapeCone ;
544 TGeoShape *RiddleShapeTubeC ;
545 TGeoShape *RiddleShapeTubeD ;
546 TGeoShape *RiddleShapeTubeE ;
547 TGeoShape *RiddleShapeTubeF ;
548 TGeoSubtraction *RiddleSubtr ;
549 TGeoCompositeShape *RiddleShapecompos;
550 TGeoVolume *RiddleVolcomp ;
551 TGeoTranslation *RiddleTrans ;
552 TGeoTranslation *RiddleTransTubeA ;
553 TGeoTranslation *RiddleTransCone ;
554 TGeoTranslation *RiddleTransTubeC ;
555 TGeoTranslation *RiddleTransTubeD ;
556 TGeoTranslation *RiddleTransTubeE ;
557 TGeoCombiTrans *RiddleCombi ;
558 TGeoTranslation *RiddleTransTubeF[4][100] ;
559 TGeoCombiTrans *RiddleCombiTranshole[4][100] ;
560 TGeoRotation *RiddleRothole[4][100] ;
562 TString outParFileName = Form(
"%s/macro/params/gem_3Stations_realistic_v2.digi.par",vmcWorkdir.Data());
565 cout <<
"parameter file = \"" << outParFileName.Data() <<
"\"" << endl;
567 ofstream pout(outParFileName.Data());
568 pout.setf(ios::fixed);
570 pout <<
"#################################################################" << endl;
571 pout <<
"# Digitization parameters for GEM " << endl;
572 pout <<
"# with 3 Stations " << endl;
573 pout <<
"# Format: " << endl;
574 pout <<
"# Description of parameters: " << endl;
575 pout <<
"# [PndGemDetectors] " << endl;
576 pout <<
"# parameters:d station_number, ZPos, rotation_angle, number_of_sensors, \\" << endl;
577 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;
578 pout <<
"# sensor_number, ...." << endl;
579 pout <<
"# station_number, ..." << endl;
580 pout <<
"#################################################################" << endl;
581 pout <<
"[PndGemDetectors]" << setprecision(4) << endl;
583 pout <<
"parameters:Double_t \\" << endl;
585 for ( Int_t istat = 0 ; istat < NofDisks ; istat++ ) {
587 pout <<
" " << istat+1 <<
", "
588 << setw(9) << DiskZPosition[istat]
589 <<
", 0.0, " << 2 <<
", \\" << endl;
592 DiskShape[istat] =
new TGeoTube (Form(
"disk%dshape",istat+1),DiskVolInnerRadius[istat],DiskVolOuterRadius[istat],HalfStationThickness);
593 DiskVol [istat] =
new TGeoVolume(Form(
"Gem_Disk%d_Volume",istat+1),DiskShape[istat],gGeoMan->GetMedium(
"GEMmixture"));
594 DiskTrans[istat] =
new TGeoTranslation(0.,0.,DiskZPosition[istat]);
595 cout <<
"station " << DiskVolInnerRadius[istat] <<
" " << DiskVolOuterRadius[istat] <<
" at " << DiskZPosition[istat] << endl;
597 DiskCombi[istat] =
new TGeoCombiTrans(*DiskTrans[istat],*dummyrot);
600 DiskRotat[istat] =
new TGeoRotation(Form(
"disk%drotat"), 0.0, 180.0, 0.0);
601 DiskCombi[istat] =
new TGeoCombiTrans(*DiskTrans[istat],*DiskRotat[istat]);
604 DiskCombi[istat]->SetName(Form(
"Gem_Disk%d_Volume",istat+1));
605 DiskCombi[istat]->RegisterYourself();
606 DiskVol[istat]->SetLineColor(kYellow);
609 carbonRingShape[istat] =
new TGeoTube (Form(
"carbonRing%dshape",istat+1),carbonRingInnerRadius[istat],carbonRingOuterRadius[istat],carbonRingHalfThickness);
610 carbonRingVol [istat] =
new TGeoVolume(Form(
"Gem_carbonRing%d_Volume",istat+1),carbonRingShape[istat],gGeoMan->GetMedium(
"carbon"));
611 carbonRingTrans[istat] =
new TGeoTranslation(0.,0.,-1.61);
612 cout <<
"carbonRing " << carbonRingInnerRadius[istat] <<
" " << carbonRingOuterRadius[istat] << endl;
613 carbonRingCombi[istat] =
new TGeoCombiTrans(*carbonRingTrans[istat],*dummyrot);
614 carbonRingCombi[istat]->SetName(Form(
"Gem_carbonRing%d_Volume",istat+1));
615 carbonRingCombi[istat]->RegisterYourself();
616 carbonRingVol[istat]->SetLineColor(kMagenta);
618 DiskVol[istat]->AddNode(carbonRingVol[istat],0,carbonRingCombi[istat]);
621 copperRingShape[istat] =
new TGeoTube (Form(
"copperRing%dshape",istat+1),copperRingInnerRadius[istat],copperRingOuterRadius[istat],copperRingHalfThickness);
622 copperRingVol [istat] =
new TGeoVolume(Form(
"Gem_copperRing%d_Volume",istat+1),copperRingShape[istat],gGeoMan->GetMedium(
"copper"));
623 copperRingTrans[istat] =
new TGeoTranslation(0.,0.,3.853);
624 cout <<
"copperRing " << copperRingInnerRadius[istat] <<
" " << copperRingOuterRadius[istat] << endl;
625 copperRingCombi[istat] =
new TGeoCombiTrans(*copperRingTrans[istat],*dummyrot);
626 copperRingCombi[istat]->SetName(Form(
"Gem_copperRing%d_Volume",istat+1));
627 copperRingCombi[istat]->RegisterYourself();
628 copperRingVol[istat]->SetLineColor(kYellow-5);
630 DiskVol[istat]->AddNode(copperRingVol[istat],0,copperRingCombi[istat]);
633 Double_t segmentAngularSize = SegmentHalfThickness/AlRingInnerRadius[istat]*360.;
634 for ( Int_t isegm = 0 ; isegm < NofSegments ; isegm++ ) {
635 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;
636 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. );
637 AlRingVol[istat][isegm] =
new TGeoVolume (Form(
"Gem_AlRing%d_Volume",istat+1,isegm+1),AlRingShape[istat][isegm],gGeoMan->GetMedium(
"aluminium"));
638 AlRingTrans[istat][isegm] =
new TGeoTranslation (0.,0.,3.853);
639 cout <<
"AlRing " << AlRingInnerRadius[istat] <<
" " << AlRingOuterRadius[istat] << endl;
640 AlRingCombi[istat][isegm] =
new TGeoCombiTrans (*AlRingTrans[istat][isegm],*dummyrot);
641 AlRingCombi[istat][isegm]->SetName(Form(
"Gem_AlRing%d_Volume",istat+1,isegm+1));
642 AlRingCombi[istat][isegm]->RegisterYourself();
643 AlRingVol[istat][isegm]->SetLineColor(kCyan-9);
645 DiskVol[istat]->AddNode(AlRingVol[istat][isegm],0,AlRingCombi[istat][isegm]);
650 Double_t modulesegmentAngularSize = moduleSegmentHalfThickness/moduleRingInnerRadius[istat]*360.;
651 for ( Int_t imodulesegm = 0 ; imodulesegm < NofmoduleSegments ; imodulesegm++ ) {
652 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;
653 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. );
654 moduleRingVol[istat][imodulesegm] =
new TGeoVolume (Form(
"Gem_moduleRing%d_Volume",istat+1,imodulesegm+1),moduleRingShape[istat][imodulesegm],gGeoMan->GetMedium(
"copper"));
655 moduleRingTrans[istat][imodulesegm] =
new TGeoTranslation (0.,0.,3.853);
656 cout <<
"moduleRing " << moduleRingInnerRadius[istat] <<
" " << moduleRingOuterRadius[istat] << endl;
657 moduleRingCombi[istat][imodulesegm] =
new TGeoCombiTrans (*moduleRingTrans[istat][imodulesegm],*dummyrot);
658 moduleRingCombi[istat][imodulesegm]->SetName(Form(
"Gem_moduleRing%d_Volume",istat+1,imodulesegm+1));
659 moduleRingCombi[istat][imodulesegm]->RegisterYourself();
660 moduleRingVol[istat][imodulesegm]->SetLineColor(kGreen);
662 DiskVol[istat]->AddNode(moduleRingVol[istat][imodulesegm],0,moduleRingCombi[istat][imodulesegm]);
666 AlumiRingShape[istat] =
new TGeoTube (Form(
"AlumiRing%dshape",istat+1),AlumiRingInnerRadius[istat],AlumiRingOuterRadius[istat],AlumiRingHalfThickness);
667 AlumiRingVol [istat] =
new TGeoVolume(Form(
"Gem_AlumiRing%d_Volume",istat+1),AlumiRingShape[istat],gGeoMan->GetMedium(
"aluminium"));
668 AlumiRingTrans[istat] =
new TGeoTranslation(0.,0.,3.853);
669 cout <<
"AlumiRing " << AlumiRingInnerRadius[istat] <<
" " << AlumiRingOuterRadius[istat] << endl;
670 AlumiRingCombi[istat] =
new TGeoCombiTrans(*AlumiRingTrans[istat],*dummyrot);
671 AlumiRingCombi[istat]->SetName(Form(
"Gem_AlumiRing%d_Volume",istat+1));
672 AlumiRingCombi[istat]->RegisterYourself();
673 AlumiRingVol[istat]->SetLineColor(kCyan-9);
675 DiskVol[istat]->AddNode(AlumiRingVol[istat],0,AlumiRingCombi[istat]);
678 coverRingShape[istat] =
new TGeoTube (Form(
"coverRing%dshape",istat+1),coverRingInnerRadius[istat],coverRingOuterRadius[istat],coverRingHalfThickness);
679 coverRingVol [istat] =
new TGeoVolume(Form(
"Gem_coverRing%d_Volume",istat+1),coverRingShape[istat],gGeoMan->GetMedium(
"GlassFiber"));
680 coverRingTrans[istat] =
new TGeoTranslation(0.,0.,7.803);
681 cout <<
"coverRing " << coverRingInnerRadius[istat] <<
" " << coverRingOuterRadius[istat] << endl;
682 coverRingCombi[istat] =
new TGeoCombiTrans(*coverRingTrans[istat],*dummyrot);
683 coverRingCombi[istat]->SetName(Form(
"Gem_coverRing%d_Volume",istat+1));
684 coverRingCombi[istat]->RegisterYourself();
685 coverRingVol[istat]->SetLineColor(kGreen+3);
687 DiskVol[istat]->AddNode(coverRingVol[istat],0,coverRingCombi[istat]);
704 for ( Int_t jlay = 0 ; jlay < NofHLayers ; jlay++ ) {
706 cout <<
"doing Hlayers " << jlay << endl;
718 cout <<
" got Hlayer " << HLayersName[jlay].Data() << endl;
720 HLayersShapeTube[jlay][istat] =
new TGeoTube (Form(
"T%dT%s",istat+1,HLayersName[jlay].Data()),HInnerRadius[jlay][istat],HOuterRadius[jlay][istat],HLayersThick[jlay]/2.);
721 HLayersShapeHT[jlay][istat] =
new TGeoTube (Form(
"H%dH%s",istat+1,HLayersName[jlay].Data()),0.0,5.00,HLayersThick[jlay]/2.);
722 HLayersShapeHTM[jlay][istat] =
new TGeoTube (Form(
"HTM%dHTM%s",istat+1,HLayersName[jlay].Data()),0.0,4.50,HLayersThick[jlay]/2.+0.0002);
723 HLayersShapeHTD[jlay][istat] =
new TGeoTube (Form(
"HTD%dHTD%s",istat+1,HLayersName[jlay].Data()),0.0,1.90,HLayersThick[jlay]/2.+0.0001);
724 cout <<
"Tube name is " << HLayersShapeTube[jlay][istat]->GetName() << endl;
726 HLayersShapeBox[jlay][istat] =
new TGeoBBox(Form(
"B%dB%s",istat+1,HLayersName[jlay].Data()),HXBoxWidth,HOuterRadius[jlay][istat],HLayersThick[jlay]/2.);
727 HLayersShapePlate[jlay][istat] =
new TGeoBBox(Form(
"P%dP%s",istat+1,HLayersName[jlay].Data()),HXPlateWidth,HYPlateWidth,HLayersThick[jlay]/2.+0.0001);
729 HLayersTranstA[jlay][istat] =
new TGeoTranslation(
"tA",HTX,HTY[jlay][istat],HTZ);
730 HLayersTranstA[jlay][istat] ->RegisterYourself();
731 HLayersTranstB[jlay][istat] =
new TGeoTranslation(
"tB",HTX,-HTY[jlay][istat],HTZ);
732 HLayersTranstB[jlay][istat] ->RegisterYourself();
733 HLayersTranstC[jlay][istat] =
new TGeoTranslation(
"tC",HTX,HTY[jlay][istat]+9.0,HTZ);
734 HLayersTranstC[jlay][istat] ->RegisterYourself();
735 HLayersTranstD[jlay][istat] =
new TGeoTranslation(
"tD",HTX,HTY[jlay][istat]-9.0,HTZ);
736 HLayersTranstD[jlay][istat] ->RegisterYourself();
737 HLayersTranstE[jlay][istat] =
new TGeoTranslation(
"tE",HTX,-HTY[jlay][istat]+9.0,HTZ);
738 HLayersTranstE[jlay][istat] ->RegisterYourself();
739 HLayersTranstF[jlay][istat] =
new TGeoTranslation(
"tF",HTX,-HTY[jlay][istat]-9.0,HTZ);
740 HLayersTranstF[jlay][istat] ->RegisterYourself();
742 HLayersShapecompos[jlay][istat] =
new TGeoCompositeShape(Form(
"compos%dcompos%s",istat+1,HLayersName[jlay].Data()),
743 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)",
744 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),
745 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data(),
746 istat+1,HLayersName[jlay].Data(),istat+1,HLayersName[jlay].Data()));
748 cout <<
"composite name is " << HLayersShapecompos[jlay][istat] -> GetName() << endl;
750 TString HlayersMaterial = HLayersName[jlay].Data();
751 HlayersMaterial.Remove(0,HlayersMaterial.Last(
'_')+1);
752 cout <<
"THE HMATERIAL IS \"" << HlayersMaterial.Data() <<
"\"" << endl;
753 HLayersVolcomp[jlay][istat] =
new TGeoVolume(Form(
"GEMHLayersCOMP%dGEMHLayersCOMP%s",istat+1,HLayersName[jlay].Data()),HLayersShapecompos[jlay][istat],gGeoMan->GetMedium(HlayersMaterial.Data()));
754 cout <<
"COMP name is " << HLayersVolcomp[jlay][istat] -> GetName() << endl;
755 cout <<
"Hlayersmaterial = " << HlayersMaterial.Data() << endl;
757 if ( HlayersMaterial.Contains(
"carbon" ) )
759 if ( HlayersMaterial.Contains(
"GlassFiber" ) )
762 cout <<
"STATION " << istat <<
" LAYER " << jlay <<
" POSITION " << HZPosition[jlay][istat] << endl;
764 HLayersTrans[jlay][istat] =
new TGeoTranslation(0.0,0.0,HZPosition[jlay][istat]);
765 HLayersCombi[jlay][istat] =
new TGeoCombiTrans(*HLayersTrans[jlay][istat],*dummyrot);
766 HLayersCombi[jlay][istat]->SetName(Form(
"GEMHLayersCOMP%dGEMHLayersCOMP%s",istat+1,HLayersName[jlay].Data()));
767 HLayersCombi[jlay][istat]->RegisterYourself();
768 DiskVol[istat]->AddNode( HLayersVolcomp[jlay][istat],0,HLayersCombi[jlay][istat] );
773 Int_t sensorNumber = 0;
775 for ( Int_t slay = 0 ; slay < NofSensLayers ; slay++ ) {
776 cout <<
"doing Senslayer " << slay << endl;
778 if ( SensLayerName[slay].Contains(
"space") && SensLayerThick[slay] > 0.0 ) {
779 cout <<
"***** THE THICK SPACE SensLAYER IS AT " << SensZPosition[slay][istat] << endl;
781 if ( SensLayerName[slay].Contains(
"space") && SensLayerName[slay].Length() == 5 ) {
786 cout <<
" got layer : " << SensLayerName[slay].Data() << endl;
791 cout <<
"will do loop over segments" << endl;
793 for ( Int_t iseg = 0 ; iseg < 1 ; iseg++ ) {
794 cout <<
"segment " << iseg << endl;
795 SensDiskLayersShapeA[slay][istat][iseg] =
new TGeoTube(Form(
"sdisk%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
796 SensInnerRadius[slay][istat],SensOuterRadius[slay][istat],
797 SensLayerThick[slay]/2.);
798 SensDiskLayersShapeB[slay][istat][iseg] =
new TGeoBBox(Form(
"srobo%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
799 sMiddleROBarHfTh[istat],
800 SensOuterRadius[slay][istat],
801 SensLayerThick[slay]);
802 SensDiskLayersSubtr[slay][istat][iseg] =
new TGeoSubtraction(SensDiskLayersShapeA[slay][istat][iseg],
803 SensDiskLayersShapeB[slay][istat][iseg]);
805 SensDiskLayersShapeC[slay][istat][iseg] =
new TGeoCompositeShape(Form(
"scomp%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
806 SensDiskLayersSubtr[slay][istat][iseg]);
807 segBegin += segPhiSpan;
808 cout <<
" segBegin " << segBegin << endl;
810 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);
812 SensDiskLayersTranshA[slay][istat][iseg] =
new TGeoTranslation(
"shA",sHoleTX,sHoleTY,sHoleTZ);
813 SensDiskLayersTranshA[slay][istat][iseg] ->RegisterYourself();
814 SensDiskLayersTranshB[slay][istat][iseg] =
new TGeoTranslation(
"shB",sHoleTX,-sHoleTY,sHoleTZ);
815 SensDiskLayersTranshB[slay][istat][iseg] ->RegisterYourself();
817 SensDiskLayersShapecompos[slay][istat][iseg] =
new TGeoCompositeShape(Form(
"scompos%dseg%d%sshape",istat+1,iseg+1,SensLayerName[slay].Data()),
818 Form(
"scomp%dseg%d%sshape-(sHole%dseg%d%sshape:shA)-(sHole%dseg%d%sshape:shB)",
819 istat+1,iseg+1,SensLayerName[slay].Data(),istat+1,iseg+1,SensLayerName[slay].Data(),istat+1,iseg+1,SensLayerName[slay].Data()));
820 TString SenslayerMaterial = SensLayerName[slay].Data();
821 SenslayerMaterial.Remove(0,SenslayerMaterial.Last(
'_')+1);
822 cout <<
"THE MATERIAL IS \"" << SenslayerMaterial.Data() <<
"\"" << endl;
823 SensDiskLayersVol[slay][istat][iseg] =
new TGeoVolume(Form(
"GemSen_Disk%d_Seg%d_%s",istat+1,iseg+1,SensLayerName[slay].Data()),
824 SensDiskLayersShapecompos[slay][istat][iseg],
825 gGeoMan->GetMedium(SenslayerMaterial.Data()));
827 cout <<
"Senslayer material = " << SenslayerMaterial.Data() << endl;
828 if ( SenslayerMaterial.Contains(
"GEMmixture" ) )
829 SensDiskLayersVol[slay][istat][iseg]->
SetLineColor(kYellow);
831 SensDiskLayersTrans[slay][istat][iseg] =
new TGeoTranslation(0.,0.,SensZPosition[slay][istat]);
832 SensDiskLayersCombi[slay][istat][iseg] =
new TGeoCombiTrans(*SensDiskLayersTrans[slay][istat][iseg],*dummyrot);
833 SensDiskLayersCombi[slay][istat][iseg]->SetName(Form(
"GemSen_Disk%d_Seg%d_%s",istat+1,iseg+1,SensLayerName[slay].Data()));
834 SensDiskLayersCombi[slay][istat][iseg]->RegisterYourself();
835 DiskVol[istat]->AddNode(SensDiskLayersVol[slay][istat][iseg],0,SensDiskLayersCombi[slay][istat][iseg]);
838 cout <<
"Svolume " << SensLayerName[slay] <<
" from "
839 << setprecision(10) << DiskZPosition[istat]+SensZPosition[slay][istat]-SensLayerThick[slay]/2. <<
" to "
840 << setprecision(10) << DiskZPosition[istat]+SensZPosition[slay][istat]+SensLayerThick[slay]/2. << endl;
842 if ( SensLayerName[slay].Contains(
"Gem") && SensLayerName[slay].Contains(
"Sensor") ) {
843 Double_t newRadius = SensInnerRadius[slay][istat];
846 cout <<
"srad = " << SensInnerRadius[slay][istat] <<
" pitch = " << SensorStripPitch[sensorNumber][0] <<
" for sensor " << sensorNumber << endl;
847 if ( SensorStripType[sensorNumber] != 2 ) {
848 nofStrips = TMath::Ceil(2.*
TMath::Pi()*SensInnerRadius[slay][istat]/SensorStripPitch[sensorNumber][0]);
849 newRadius = nofStrips*SensorStripPitch[sensorNumber][0]/2./
TMath::Pi();
851 cout <<
"!!!! " << istat <<
" " << slay <<
" > there shall be " << nofStrips <<
" strips here so the radius should be " << newRadius << endl;
852 pout <<
" " << sensorNumber+1 <<
", " << SensorStripType[sensorNumber] <<
", "
853 << setw(9) << 0. <<
", "
854 << setw(9) << 0. <<
", "
855 << setw(9) << DiskZPosition[istat]+SensZPosition[slay][istat] <<
", "
856 << setw(9) << 0. <<
", "
857 << setw(9) << newRadius <<
", "
858 << setw(9) << SensOuterRadius[slay][istat] <<
", "
859 << setw(9) << SensLayerThick[slay] <<
", "
860 << setw(9) << SensorStripAngle[sensorNumber][0] <<
", "
862 << setw(9) << sMiddleROBarHfTh[istat] <<
", "
863 << setw(9) << SensorStripPitch[sensorNumber][0] <<
", "
864 << setw(9) << SensorStripPitch[sensorNumber][1] << ((istat==NofDisks-1 && sensorNumber==1)?
"":
", \\")
869 SensZPosition[slay][istat] ++ ;
874 Double_t layerPosition = firstLayerOffset;
876 Int_t msensorNumber = 0;
878 for ( Int_t ilay = 0 ; ilay < NofLayers ; ilay++ ) {
879 cout <<
"doing layer " << ilay << endl;
880 layerPosition += LayerThick[ilay]/2.;
881 if ( LayerName[ilay].Contains(
"space") && LayerThick[ilay] > 0.0 ) {
882 cout <<
"***** THE THICK SPACE LAYER IS AT " << layerPosition << endl;
884 if ( LayerName[ilay].Contains(
"space") && LayerName[ilay].Length() == 5 ) {
885 layerPosition += LayerThick[ilay]/2.;
889 cout <<
" got layer : " << LayerName[ilay].Data() << endl;
893 cout <<
"will do loop over segments" << endl;
894 for ( Int_t miseg = 0 ; miseg < 1 ; miseg++ ) {
895 cout <<
"segment " << miseg << endl;
896 DiskLayersShapeA[ilay][istat][miseg] =
new TGeoTube(Form(
"disk%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
897 DiskInnerRadius[ilay][istat],DiskOuterRadius[ilay][istat],
898 LayerThick[ilay]/2.);
899 DiskLayersShapeB[ilay][istat][miseg] =
new TGeoBBox (Form(
"robo%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
900 MiddleROBarHfTh[istat],
901 DiskOuterRadius[ilay][istat],
903 DiskLayersSubtr[ilay][istat][miseg] =
new TGeoSubtraction(DiskLayersShapeA[ilay][istat][miseg],
904 DiskLayersShapeB[ilay][istat][miseg]);
906 DiskLayersShapeC[ilay][istat][miseg] =
new TGeoCompositeShape(Form(
"comp%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
907 DiskLayersSubtr[ilay][istat][miseg]);
908 msegBegin += msegPhiSpan;
909 cout <<
" msegBegin " << msegBegin << endl;
911 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);
913 DiskLayersTranshA[ilay][istat][miseg] =
new TGeoTranslation(
"hA",HoleTX,HoleTY,HoleTZ);
914 DiskLayersTranshA[ilay][istat][miseg] ->RegisterYourself();
915 DiskLayersTranshB[ilay][istat][miseg] =
new TGeoTranslation(
"hB",HoleTX,-HoleTY,HoleTZ);
916 DiskLayersTranshB[ilay][istat][miseg] ->RegisterYourself();
918 DiskLayersShapecompos[ilay][istat][miseg] =
new TGeoCompositeShape(Form(
"compos%dseg%d%sshape",istat+1,miseg+1,LayerName[ilay].Data()),
919 Form(
"comp%dseg%d%sshape-(Hole%dseg%d%sshape:hA)-(Hole%dseg%d%sshape:hB)",
920 istat+1,miseg+1,LayerName[ilay].Data(),istat+1,miseg+1,LayerName[ilay].Data(),istat+1,miseg+1,LayerName[ilay].Data()));
923 TString layerMaterial = LayerName[ilay].Data();
924 layerMaterial.Remove(0,layerMaterial.Last(
'_')+1);
925 cout <<
"THE MATERIAL IS \"" << layerMaterial.Data() <<
"\"" << endl;
926 DiskLayersVol[ilay][istat][miseg] =
new TGeoVolume(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,miseg+1,LayerName[ilay].Data()),
927 DiskLayersShapecompos[ilay][istat][miseg],
928 gGeoMan->GetMedium(layerMaterial.Data()));
930 cout <<
"layer material = " << layerMaterial.Data() << endl;
931 if ( layerMaterial.Contains(
"air" ) )
932 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kWhite);kGray+1);
933 if ( layerMaterial.Contains(
"copper" ) )
934 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kOrange+1);
935 if ( layerMaterial.Contains(
"kapton" ) )
936 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kOrange+2);
937 if ( layerMaterial.Contains(
"aluminium" ) )
938 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kCyan-9);
939 if ( layerMaterial.Contains(
"GEMmixture" ) )
940 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kYellow);
941 if ( layerMaterial.Contains(
"carbon" ) )
943 if ( layerMaterial.Contains(
"GlassFiber" ) )
944 DiskLayersVol[ilay][istat][miseg]->
SetLineColor(kGreen+3);
946 DiskLayersTrans[ilay][istat][miseg] =
new TGeoTranslation(0.,0.,layerPosition);
947 DiskLayersCombi[ilay][istat][miseg] =
new TGeoCombiTrans(*DiskLayersTrans[ilay][istat][miseg],*dummyrot);
948 DiskLayersCombi[ilay][istat][miseg]->SetName(Form(
"Gem_Disk%d_Seg%d_%s",istat+1,miseg+1,LayerName[ilay].Data()));
949 DiskLayersCombi[ilay][istat][miseg]->RegisterYourself();
950 DiskVol[istat]->AddNode(DiskLayersVol[ilay][istat][miseg],0,DiskLayersCombi[ilay][istat][miseg]);
954 cout <<
"mvolume " << LayerName[ilay] <<
" from "
955 << setprecision(10) << DiskZPosition[istat]+layerPosition-LayerThick[ilay]/2. <<
" to "
956 << setprecision(10) << DiskZPosition[istat]+layerPosition+LayerThick[ilay]/2. << endl;
958 if ( LayerName[ilay].Contains(
"Gem") && LayerName[ilay].Contains(
"Sensor") ) {
959 Double_t mnewRadius = DiskInnerRadius[ilay][istat];
962 cout <<
"mrad = " << DiskInnerRadius[ilay][istat] <<
" pitch = " << SensorStripPitch[msensorNumber][0] <<
" for sensor " << msensorNumber << endl;
963 if ( SensorStripType[msensorNumber] != 2 ) {
964 mnofStrips = TMath::Ceil(2.*
TMath::Pi()*DiskInnerRadius[ilay][istat]/SensorStripPitch[msensorNumber][0]);
965 mnewRadius = mnofStrips*SensorStripPitch[msensorNumber][0]/2./
TMath::Pi();
967 cout <<
"!!!! " << istat <<
" " << ilay <<
" > there shall be " << mnofStrips <<
" strips here so the radius should be " << mnewRadius << endl;
968 pout <<
" " << msensorNumber+1 <<
", " << SensorStripType[msensorNumber] <<
", "
969 << setw(9) << 0. <<
", "
970 << setw(9) << 0. <<
", "
971 << setw(9) << DiskZPosition[istat]+layerPosition <<
", "
972 << setw(9) << 0. <<
", "
973 << setw(9) << mnewRadius <<
", "
974 << setw(9) << DiskOuterRadius[ilay][istat] <<
", "
975 << setw(9) << LayerThick[ilay] <<
", "
976 << setw(9) << SensorStripAngle[msensorNumber][0] <<
", "
978 << setw(9) << MiddleROBarHfTh[istat] <<
", "
979 << setw(9) << SensorStripPitch[msensorNumber][0] <<
", "
980 << setw(9) << SensorStripPitch[msensorNumber][1] << ((istat==NofDisks-1&&msensorNumber==1)?
"":
", \\")
985 layerPosition += LayerThick[ilay]/2.;
988 SubunitVol->AddNode(DiskVol[istat],0,DiskCombi[istat]);
992 pout <<
"TrackFinderOnHits_ParThetaA: Double_t 59.4" << endl
993 <<
"TrackFinderOnHits_ParThetaB: Double_t -0.02" << endl
994 <<
"TrackFinderOnHits_ParTheta0: Double_t 56.1372" << endl
995 <<
"TrackFinderOnHits_ParTheta1: Double_t -0.000564362" << endl
996 <<
"TrackFinderOnHits_ParTheta2: Double_t -0.181828" << endl
997 <<
"TrackFinderOnHits_ParTheta3: Double_t 0.284289" << endl
998 <<
"TrackFinderOnHits_ParRadPhi0:Double_t 0.9944432" << endl
999 <<
"TrackFinderOnHits_ParRadPhi2:Double_t -0.000590706" << endl
1000 <<
"TrackFinderOnHits_ParMat0: Double_t \\" << endl
1002 <<
" -2.35034328e-6, 0.0006810756, 0.10335768" << endl
1003 <<
"TrackFinderOnHits_ParMat1: Double_t \\" << endl
1005 <<
" -7.58793504e-10, -6.7763136e-7, 0.000748458752" << endl
1006 <<
"##########################################################################################" << flush;
1010 RiddleShapeTubeA =
new TGeoTube (
"TubeA" , 43.3, 46.3, 0.10 );
1011 RiddleShapeTubeB =
new TGeoTube (
"TubeB" , 46.2, 46.3, 9.10 );
1012 RiddleShapeCone =
new TGeoCone (
"Cone" , 18.2, 46.2, 46.3, 69.0, 69.1 );
1013 RiddleShapeTubeC =
new TGeoTube (
"TubeC" , 69.0, 75.4, 0.10 );
1014 RiddleShapeTubeD =
new TGeoTube (
"TubeD" , 75.4, 75.5, 10.4 );
1015 RiddleShapeTubeE =
new TGeoTube (
"TubeE" , 72.5, 75.4, 0.10 );
1016 RiddleShapeTubeF =
new TGeoTube (
"TubeF" , 0.00, 8.00, 5.00 );
1018 RiddleTransTubeA =
new TGeoTranslation(
"trA",0.0,0.0,9.20);
1019 RiddleTransTubeA ->RegisterYourself();
1020 RiddleTransCone =
new TGeoTranslation(
"trB",0.0,0.0,36.5);
1021 RiddleTransCone ->RegisterYourself();
1022 RiddleTransTubeC =
new TGeoTranslation(
"trC",0.0,0.0,54.6);
1023 RiddleTransTubeC ->RegisterYourself();
1024 RiddleTransTubeD =
new TGeoTranslation(
"trD",0.0,0.0,64.5);
1025 RiddleTransTubeD ->RegisterYourself();
1026 RiddleTransTubeE =
new TGeoTranslation(
"trE",0.0,0.0,74.4);
1027 RiddleTransTubeE ->RegisterYourself();
1033 const Int_t NofHoles = 16.0;
1035 const Int_t NofHolesRows = 4;
1037 Double_t holePosR[4] = {46,52,64,75};
1038 Double_t holePosD[4] = {90,-60,-60,90};
1039 Double_t holePosZ[4] = {9,28,45,65};
1041 TString RiddleshapeFormula =
"TubeA+(TubeB:trA)+(Cone:trB)+(TubeC:trC)+(TubeD:trD)+(TubeE:trE)" ;
1044 for ( Int_t irow = 0 ; irow < NofHolesRows ; irow++ ) {
1045 for ( Int_t ihole= 0 ; ihole < NofHoles ; ihole++ ) {
1047 Double_t holePosA = ihole*rotDeltaAngle;
1051 RiddleTransTubeF[irow][ihole] =
new TGeoTranslation(Form(
"trF%d_%d",irow+1, ihole+1) , holePosX, holePosY,holePosZ[irow]);
1052 RiddleTransTubeF[irow][ihole] ->RegisterYourself();
1054 RiddleRothole[irow][ihole] =
new TGeoRotation(Form(
"ro%d_%d" , irow+1, ihole+1) ,holePosA+90, holePosD[irow],20);
1055 RiddleRothole[irow][ihole] ->RegisterYourself();
1057 RiddleCombiTranshole[irow][ihole] =
new TGeoCombiTrans( *RiddleTransTubeF[irow][ihole] , *RiddleRothole[irow][ihole] );
1059 RiddleCombiTranshole[irow][ihole] ->SetName(Form(
"TR%d_%d",irow+1, ihole+1));
1060 RiddleCombiTranshole[irow][ihole] ->RegisterYourself();
1062 RiddleshapeFormula += Form(
"-(TubeF:TR%d_%d)" , irow+1,ihole+1 );
1066 cout<<
" RiddleshapeFormula = \"" <<RiddleshapeFormula.Data()<<
"\""<< endl;
1068 RiddleShapecompos =
new TGeoCompositeShape(
"riddle", RiddleshapeFormula );
1072 RiddleVolcomp =
new TGeoVolume(
"GEMriddleCOMP", RiddleShapecompos,gGeoMan->GetMedium(
"carbon"));
1075 RiddleTrans =
new TGeoTranslation(0.0,0.0,116.8);
1076 RiddleCombi =
new TGeoCombiTrans(*RiddleTrans,*dummyrot);
1077 RiddleCombi->SetName(
"GEMriddleCOMP");
1078 RiddleCombi->RegisterYourself();
1079 RiddleVolcomp->SetLineColor(kGray+1);
1080 SubunitVol->AddNode(RiddleVolcomp,0,RiddleCombi);
1083 tAcopperbarShape =
new TGeoPara (
"tAcopperbarshape",lcopperbarx,lcopperbary,lcopperbarHalfThickness, 0.0, -24.0, 0.0);
1084 tAcopperbarVol =
new TGeoVolume(
"GEM_tAcopperbarVolume",tAcopperbarShape,gGeoMan->GetMedium(
"copper"));
1085 tAcopperbarTrans =
new TGeoTranslation(0.,47.3,141.35);
1086 tAcopperbarRot =
new TGeoRotation(
"tAcopperbarrot",-90.0,0.0,0.0);
1087 tAcopperbarRot ->RegisterYourself();
1088 tAcopperbarCombi =
new TGeoCombiTrans(*tAcopperbarTrans,*tAcopperbarRot);
1089 tAcopperbarCombi->SetName(
"GEM_tAcopperbar_Volume");
1090 tAcopperbarCombi->RegisterYourself();
1091 tAcopperbarVol->SetLineColor(kOrange+1);
1092 SubunitVol->AddNode(tAcopperbarVol,0,tAcopperbarCombi);
1094 tBcopperbarShape =
new TGeoPara (
"tBcopperbarshape",rcopperbarx,rcopperbary,rcopperbarHalfThickness, 0.0, -45.0, 0.0);
1095 tBcopperbarVol =
new TGeoVolume(
"GEM_tBcopperbarVolume",tBcopperbarShape,gGeoMan->GetMedium(
"copper"));
1096 tBcopperbarTrans =
new TGeoTranslation(0.,61.8,171.9);
1097 tBcopperbarRot =
new TGeoRotation(
"tBcopperbarrot",-90.0,0.0,0.0);
1098 tBcopperbarRot ->RegisterYourself();
1099 tBcopperbarCombi =
new TGeoCombiTrans(*tBcopperbarTrans,*tBcopperbarRot);
1100 tBcopperbarCombi->SetName(
"GEM_tBcopperbar_Volume");
1101 tBcopperbarCombi->RegisterYourself();
1102 tBcopperbarVol->SetLineColor(kOrange+1);
1103 SubunitVol->AddNode(tBcopperbarVol,0,tBcopperbarCombi);
1105 dAcopperbarShape =
new TGeoPara (
"dAcopperbarshape",lcopperbarx,lcopperbary,lcopperbarHalfThickness, 0.0, -24.0, 0.0);
1106 dAcopperbarVol =
new TGeoVolume(
"GEM_dAcopperbarVolume",dAcopperbarShape,gGeoMan->GetMedium(
"copper"));
1107 dAcopperbarTrans =
new TGeoTranslation(0.,-47.3,141.35);
1108 dAcopperbarRot =
new TGeoRotation(
"dAcopperbarrot",90.0,0.0,0.0);
1109 dAcopperbarRot ->RegisterYourself();
1110 dAcopperbarCombi =
new TGeoCombiTrans(*dAcopperbarTrans,*dAcopperbarRot);
1111 dAcopperbarCombi->SetName(
"GEM_dAcopperbar_Volume");
1112 dAcopperbarCombi->RegisterYourself();
1113 dAcopperbarVol->SetLineColor(kOrange+1);
1114 SubunitVol->AddNode(dAcopperbarVol,0,dAcopperbarCombi);
1116 dBcopperbarShape =
new TGeoPara (
"dBcopperbarshape",rcopperbarx,rcopperbary,rcopperbarHalfThickness, 0.0, -45.0, 0.0);
1117 dBcopperbarVol =
new TGeoVolume(
"GEM_dBcopperbarVolume",dBcopperbarShape,gGeoMan->GetMedium(
"copper"));
1118 dBcopperbarTrans =
new TGeoTranslation(0.,-61.8,171.9);
1119 dBcopperbarRot =
new TGeoRotation(
"dBcopperbarrot",90.0,0.0,0.0);
1120 dBcopperbarRot ->RegisterYourself();
1121 dBcopperbarCombi =
new TGeoCombiTrans(*dBcopperbarTrans,*dBcopperbarRot);
1122 dBcopperbarCombi->SetName(
"GEM_dBcopperbar_Volume");
1123 dBcopperbarCombi->RegisterYourself();
1124 dBcopperbarVol->SetLineColor(kOrange+1);
1125 SubunitVol->AddNode(dBcopperbarVol,0,dBcopperbarCombi);
1128 top->AddNode(SubunitVol,0,
new TGeoCombiTrans());
1143 gGeoMan->CloseGeometry();
FairGeoMedium * CbmMediumCarbon
FairGeoMedium * CbmMediumAluminium
Int_t create3StationsGem_v2()
FairGeoBuilder * geobuild
FairGeoMedium * CbmMediumAir
FairGeoMedium * CbmMediumPWO
FairGeoInterface * geoFace
vDisk SetLineColor(colYellow)