236 const TString geoDetectorName =
"SSD";
237 const TString geoDetectorVersion = geoTag;
238 const TString geoFileName = gPath +
"/geometry/" + geoDetectorName +
"_" + geoDetectorVersion +
".root";
241 TString infoFileName = geoFileName;
244 infoFile.open(infoFileName.
Data(), fstream::out);
245 infoFile <<
"SSD geometry created with create_rootgeom_SSD_v17a.C" << endl << endl;
246 infoFile <<
"Global variables: " << endl;
248 infoFile <<
"Vertical gap in sensor chain = " <<
gkChainGapY <<
" cm" << endl;
249 infoFile <<
"Vertical overlap of sensors = " <<
gkSectorOverlapY <<
" cm" << endl;
250 infoFile <<
"Gap in z between neighbour sensors = " <<
gkSectorGapZ <<
" cm" << endl;
251 infoFile <<
"Horizontal overlap of sensors = " <<
gkLadderOverlapX <<
" cm" << endl;
252 infoFile <<
"Gap in z between neighbour ladders = " <<
gkLadderGapZ <<
" cm" << endl;
256 infoFile <<
"No cables" << endl;
258 infoFile <<
"Beam pipe: R1 = " <<
gkPipeR1 <<
" cm at z = " <<
gkPipeZ1 <<
" cm" << endl;
259 infoFile <<
"Beam pipe: R2 = " <<
gkPipeR2 <<
" cm at z = " <<
gkPipeZ2 <<
" cm" << endl;
260 infoFile <<
"Beam pipe: R3 = " <<
gkPipeR3 <<
" cm at z = " <<
gkPipeZ3 <<
" cm" << endl;
264 FairGeoLoader* geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
265 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
267 TString medFile = geoPath +
"/geometry/media.geo";
268 geoFace->setMediaFile(medFile);
269 geoFace->readMedia();
274 FairGeoMedia* geoMedia = geoFace->getMedia();
275 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
278 FairGeoMedium* mAir = geoMedia->getMedium(
"air");
280 Fatal(
"Main",
"FairMedium air not found");
281 geoBuild->createMedium(mAir);
284 Fatal(
"Main",
"Medium air not found");
287 FairGeoMedium* mSilicon = geoMedia->getMedium(
"silicon");
289 Fatal(
"Main",
"FairMedium silicon not found");
290 geoBuild->createMedium(mSilicon);
293 Fatal(
"Main",
"Medium silicon not found");
296 FairGeoMedium* mCarbon = geoMedia->getMedium(
"carbon");
298 Fatal(
"Main",
"FairMedium carbon not found");
299 geoBuild->createMedium(mCarbon);
302 Fatal(
"Main",
"Medium carbon not found");
305 FairGeoMedium* mSTScable = geoMedia->getMedium(
"STScable");
307 Fatal(
"Main",
"FairMedium STScable not found");
308 geoBuild->createMedium(mSTScable);
311 Fatal(
"Main",
"Medium STScable not found");
341 cout << endl << endl;
342 cout <<
"===> Creating sensors...." << endl << endl;
343 infoFile << endl <<
"Sensors: " << endl;
345 for (
Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
371 cout << endl << endl;
372 cout <<
"===> Creating sectors...." << endl;
373 infoFile << endl <<
"Sectors: " << endl;
375 for (
Int_t iSector = 1; iSector <= nSectors; iSector++) {
385 cout << endl << endl;
386 cout <<
"===> Creating ladders...." << endl;
387 infoFile << endl <<
"Ladders:" << endl;
389 for (
Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
403 Fatal(
"ConstructSmallCone",
"Volume Cone not found");
406 Fatal(
"ConstructBigCone",
"Volume Cone not found");
410 cout << endl << endl;
411 cout <<
"===> Creating stations...." << endl;
412 infoFile << endl <<
"Stations: ";
415 Int_t ladderTypes[16];
422 Int_t statPos[8] = {5, 15, 25, 40, 50, 60, 70, 80};
424 Double_t rHole[8] = {2.0, 2.0, 2.0, 2.9, 3.7, 3.7, 4.2, 4.2};
426 Int_t cone_size[8] = {0, 0, 0, 1, 1, 1, 1, 1};
428 Double_t cone_offset[2] = {0.305, 0.285};
430 Int_t allLadderTypes[8][16] = {
431 {0, 0, 0, 0, 10, 109, 9, 101, 1, 109, 9, 110, 0, 0, 0, 0},
432 {0, 0, 111, 10, 110, 9, 109, 2, 102, 9, 109, 10, 110, 11, 0, 0},
433 {0, 0, 14, 113, 12, 112, 12, 103, 3, 112, 12, 112, 13, 114, 0, 0},
434 {0, 15, 114, 13, 112, 12, 112, 4, 104, 12, 112, 12, 113, 14, 115, 0},
435 {0, 119, 18, 117, 17, 116, 16, 105, 5, 116, 16, 117, 17, 118, 19, 0},
436 {0, 19, 118, 17, 117, 16, 116, 6, 106, 16, 116, 17, 117, 18, 119, 0},
437 {21, 119, 18, 120, 20, 120, 20, 107, 7, 120, 20, 120, 20, 118, 19, 121},
438 {119, 17, 123, 22, 122, 22, 122, 8, 108, 22, 122, 22, 122, 23, 117, 19}};
440 Int_t allUnitTypes[16][16];
460 for (
Int_t iUnit = 0; iUnit < 16; iUnit++)
461 for (
Int_t iLadder = 0; iLadder < 16; iLadder++) {
462 allUnitTypes[iUnit][iLadder] = 0;
464 && (allLadderTypes[iUnit / 2][iLadder] < 100))
465 allUnitTypes[iUnit][iLadder] = allLadderTypes[iUnit / 2][iLadder];
467 && (allLadderTypes[iUnit / 2][iLadder] >= 100))
468 allUnitTypes[iUnit][iLadder] = allLadderTypes[iUnit / 2][iLadder];
472 for (
Int_t iUnit = 0; iUnit < 16; iUnit++) {
473 cout <<
"DE unitTypes[" << iUnit <<
"] = { ";
474 for (
Int_t iLadder = 0; iLadder < 16; iLadder++) {
475 cout << allUnitTypes[iUnit][iLadder];
485 for (
Int_t iStation = 0; iStation < 8; iStation++) {
490 if (allLadderTypes[iStation][
i] != 0) {
491 ladderTypes[nLadders] = allLadderTypes[iStation][
i];
492 cout <<
"DE ladderTypes[" << nLadders <<
"] = " << allLadderTypes[iStation][
i] <<
";" << endl;
495 mystation[iStation] =
ConstructStation(iStation, nLadders, ladderTypes, rHole[iStation]);
498 if (iStation % 2 == 0)
510 "conePosRot2", 0., 0., -coneDz - cone_offset[cone_size[iStation]] -
gkLadderGapZ / 2., coneRot11);
511 if (cone_size[iStation] == 0)
512 mystation[iStation]->
AddNode(coneSmallVolum, 1, conePosRot11);
514 mystation[iStation]->
AddNode(coneBigVolum, 1, conePosRot11);
522 "conePosRot1", 0., 0., coneDz + cone_offset[cone_size[iStation]] +
gkLadderGapZ / 2., coneRot12);
523 if (cone_size[iStation] == 0)
524 mystation[iStation]->
AddNode(coneSmallVolum, 2, conePosRot12);
526 mystation[iStation]->
AddNode(coneBigVolum, 2, conePosRot12);
533 infoFile <<
"Position z = " << statPos[iStation] << endl;
539 cout << endl << endl;
540 cout <<
"===> Creating STS...." << endl;
547 for (
Int_t iStation = 1; iStation <= 8; iStation++) {
553 cout <<
"Station " << iStation <<
": Y " << stsY << endl;
558 stsZ = (statPos[7] - statPos[0]) + stsBorder;
559 Double_t stsPosZ = 0.5 * (statPos[7] + statPos[0]);
562 new TGeoBBox(
"stsBox", stsX / 2., stsY / 2., stsZ / 2.);
563 cout <<
"size of STS box: x " << stsX <<
" - y " << stsY <<
" - z " << stsZ << endl;
567 Double_t z1 = statPos[0] - 0.5 * stsBorder;
569 Double_t z3 = statPos[7] + 0.5 * stsBorder;
578 cout << z1 <<
" " << r1 << endl;
579 cout << z2 <<
" " << r2 << endl;
580 cout << z3 <<
" " << r3 << endl;
596 new TGeoTrd2(
"stsCone1", r1, r2, r1, r2, (z2 - z1) / 2. + .1);
599 new TGeoTrd2(
"stsCone2", r2, r3, r2, r3, (z3 - z2) / 2. + .1);
620 for (
Int_t iStation = 1; iStation <= 3; iStation++) {
623 Double_t posZ = statPos[iStation - 1] - stsPosZ;
626 sts->
AddNode(station, 1, trans);
636 top->
AddNode(sts, 1, stsTrans);
638 cout << endl << endl;
640 cout << endl << endl;
642 gGeoMan->CheckOverlaps(0.0001);
648 TFile* geoFile =
new TFile(geoFileName,
"UPDATE");
650 sts_placement->
Write();
653 cout <<
"Geometry " << top->
GetName() <<
" written to " << geoFileName << endl;
757 TGeoBBox* shape_sensor01 =
new TGeoBBox(
"sensor01", xSize / 2., ySize / 2., zSize / 2.);
758 new TGeoVolume(
"Sensor01", shape_sensor01, silicon);
764 TGeoBBox* shape_sensor02 =
new TGeoBBox(
"sensor02", xSize / 2., ySize / 2., zSize / 2.);
765 new TGeoVolume(
"Sensor02", shape_sensor02, silicon);
771 TGeoBBox* shape_sensor03 =
new TGeoBBox(
"sensor03", xSize / 2., ySize / 2., zSize / 2.);
772 new TGeoVolume(
"Sensor03", shape_sensor03, silicon);
778 TGeoBBox* shape_sensor04 =
new TGeoBBox(
"sensor04", xSize / 2., ySize / 2., zSize / 2.);
779 new TGeoVolume(
"Sensor04", shape_sensor04, silicon);
787 TGeoBBox* shape_sensor05 =
new TGeoBBox(
"sensor05", xSize / 2., ySize / 2., zSize / 2.);
788 new TGeoVolume(
"Sensor05", shape_sensor05, silicon);
794 TGeoBBox* shape_sensor06 =
new TGeoBBox(
"sensor06", xSize / 2., ySize / 2., zSize / 2.);
795 new TGeoVolume(
"Sensor06", shape_sensor06, silicon);
801 TGeoBBox* shape_sensor07 =
new TGeoBBox(
"sensor07", xSize / 2., ySize / 2., zSize / 2.);
802 new TGeoVolume(
"Sensor07", shape_sensor07, silicon);
1595 frameVertPillarShp =
1597 TGeoVolume* frameVertPillarVol =
new TGeoVolume(name +
"_vertpillar", frameVertPillarShp, framesMaterial);
1603 frameVertPillarVol, 1,
1604 new TGeoCombiTrans(name +
"_vertpillar_pos_1", x - t, 0., -(x +
sqrt(2.) * t - 2. * t) / 2., xRot90));
1606 frameVertPillarVol, 2,
1607 new TGeoCombiTrans(name +
"_vertpillar_pos_2", -(x - t), 0., -(x +
sqrt(2.) * t - 2. * t) / 2., xRot90));
1613 frameBoxVol->
AddNode(frameVertPillarVol, 3,
1614 new TGeoCombiTrans(name +
"_vertpillar_pos_3", 0., 0., (x -
sqrt(2.) * t) / 2., vertRot));
1619 TGeoVolume* frameHorPillarVol =
new TGeoVolume(name +
"_horpillar", frameHorPillarShp, framesMaterial);
1621 frameBoxVol->
AddNode(frameHorPillarVol, 1,
1624 -(x +
sqrt(2.) * t - 2. * t) / 2.));
1632 TGeoVolume* frameSlopePillarVol =
new TGeoVolume(name +
"_slopepillar", frameSlopePillarShp, framesMaterial);
1636 new TGeoCombiTrans(name +
"_slopepillar_posrot_1", 0., 0., -(x +
sqrt(2.) * t - 2. * t) / 2., slopeRot);
1638 frameBoxVol->
AddNode(frameSlopePillarVol, 1, slopeTrRot);
1645 TGeoVolume* frameSubPillarVol =
new TGeoVolume(name +
"_subpillar", frameSubPillarShp, framesMaterial);
1653 new TGeoCombiTrans(name +
"_subpillar_posrot_1", -(-x / 2. + t - t / (2. *
sqrt(2.))), 1., posZ, subRot1);
1657 new TGeoCombiTrans(name +
"_subpillar_posrot_2", -(-x / 2. + t - t / (2. *
sqrt(2.))), -1., posZ, subRot2);
1662 new TGeoCombiTrans(name +
"_subpillar_posrot_3", -x / 2. + t - t / (2. *
sqrt(2.)), 1., posZ, subRot3);
1666 new TGeoCombiTrans(name +
"_subpillar_posrot_4", -x / 2. + t - t / (2. *
sqrt(2.)), -1., posZ, subRot4);
1668 frameBoxVol->
AddNode(frameSubPillarVol, 1, subTrRot1);
1669 frameBoxVol->
AddNode(frameSubPillarVol, 2, subTrRot2);
1670 frameBoxVol->
AddNode(frameSubPillarVol, 3, subTrRot3);
1671 frameBoxVol->
AddNode(frameSubPillarVol, 4, subTrRot4);