diff --git a/sim/detectors/rich/geo/RichGeoCreator.cxx b/sim/detectors/rich/geo/RichGeoCreator.cxx index be988e22f421b5a0d7e9b78f9dac30f042d55d9f..4306d7c9a328d7feeb68739b0bf78eb46131ea3b 100644 --- a/sim/detectors/rich/geo/RichGeoCreator.cxx +++ b/sim/detectors/rich/geo/RichGeoCreator.cxx @@ -1,11 +1,12 @@ -/* Copyright (C) 2022-2023 UGiessen/GSI, Giessen/Darmstadt +/* Copyright (C) 2022-2024 UGiessen/GSI, Giessen/Darmstadt SPDX-License-Identifier: GPL-3.0-only - Authors: Semen Lebedev [committer], Eoin Clerkin*/ + Authors: Semen Lebedev [committer], Eoin Clerkin, Simon Neuhaus*/ + #include "RichGeoCreator.h" #include "Logger.h" - +#include "RichGeoMaterials.h" #include "TGeoArb8.h" #include "TGeoBBox.h" #include "TGeoBoolNode.h" @@ -17,11 +18,20 @@ #include "TGeoTube.h" #include "TGeoVolume.h" -#include "RichGeoMaterials.h" +#include <TMath.h> +#include <iostream> using namespace std; +// using TMath::ACos; +using TMath::ASin; +using TMath::ATan; +using TMath::Cos; +using TMath::Sin; +using TMath::Tan; +const double pi = TMath::Pi(); + RichGeoCreator::RichGeoCreator() {} RichGeoCreator::~RichGeoCreator() {} @@ -86,15 +96,15 @@ TGeoVolume* RichGeoCreator::CreatePmt() TGeoBBox* pmtPB = new TGeoBBox("pmt_PB", pmtSizeHalf, pmtSizeHalf, pmtDepthHalf); TGeoVolume* pixel = new TGeoVolume("pmt_pixel", pixelPB, medCsI); - if (fSetVolumeColors) pixel->SetLineColor(kRed - 9); + //if (fSetVolumeColors) pixel->SetLineColor(kRed - 9); TGeoVolume* pixelCorner = new TGeoVolume("pmt_pixel_corner", pixelCornerPB, medCsI); - if (fSetVolumeColors) pixelCorner->SetLineColor(kRed); + //if (fSetVolumeColors) pixelCorner->SetLineColor(kRed); TGeoVolume* pixelY = new TGeoVolume("pmt_pixel_y", pixelYPB, medCsI); - if (fSetVolumeColors) pixelY->SetLineColor(kRed - 5); + //if (fSetVolumeColors) pixelY->SetLineColor(kRed - 5); TGeoVolume* pixelX = new TGeoVolume("pmt_pixel_x", pixelXPB, medCsI); - if (fSetVolumeColors) pixelX->SetLineColor(kRed + 3); + //if (fSetVolumeColors) pixelX->SetLineColor(kRed + 3); TGeoVolume* pmt = new TGeoVolume("pmt", pmtPB, fMaterials.GetMedium("RICHgas_CO2_dis")); - if (fSetVolumeColors) pmt->SetLineColor(kRed + 1); + //if (fSetVolumeColors) pmt->SetLineColor(kRed + 1); double edgePxPos = 3. * fPixelSize + pxSizeEdgeHalf; double zC = pmtDepthHalf - pxThicknessHalf; @@ -123,7 +133,7 @@ TGeoVolume* RichGeoCreator::CreatePmt() TGeoBBox* pmtContPB = new TGeoBBox("pmt_cont_PB", pmtSizeHalf, pmtSizeHalf, pmtDepthHalf); TGeoVolume* pmtCont = new TGeoVolume("pmt_cont", pmtContPB, fMaterials.GetMedium("RICHgas_CO2_dis")); pmtCont->AddNode(pmt, 1, MakeTrans(0., 0., 0.)); - if (fSetVolumeColors) pmtCont->SetLineColor(kRed - 4); + //if (fSetVolumeColors) pmtCont->SetLineColor(kRed - 4); return pmtCont; } @@ -138,7 +148,7 @@ TGeoVolume* RichGeoCreator::CreateCameraModule() (2. * fPmtSize + fCameraGap) / 2., fPmtDepth / 2.); TGeoVolume* camModule = new TGeoVolume("camera_module", camModulePB, fMaterials.GetMedium("RICHgas_CO2_dis")); - if (fSetVolumeColors) camModule->SetLineColor(kRed - 1); + //if (fSetVolumeColors) camModule->SetLineColor(kRed - 1); camModule->AddNode(pmt, 1, MakeTrans(-pmtSizeGap, pmtSizeGap / 2., 0.)); camModule->AddNode(pmt, 2, MakeTrans(0., pmtSizeGap / 2., 0.)); camModule->AddNode(pmt, 3, MakeTrans(pmtSizeGap, pmtSizeGap / 2., 0.)); @@ -166,9 +176,9 @@ TGeoVolume* RichGeoCreator::CreateCameraStrip() TGeoCompositeShape* camStripPB = MakeUnion("camera_strip_PB", op0, op1, nullptr, tr); TGeoVolume* aluFrame = new TGeoVolume("alu_frame", aluFramePB, fMaterials.GetMedium("aluminium")); - if (fSetVolumeColors) aluFrame->SetLineColor(kBlue - 4); + //if (fSetVolumeColors) aluFrame->SetLineColor(kBlue - 4); TGeoVolume* camStrip = new TGeoVolume("camera_strip", camStripPB, fMaterials.GetMedium("RICHgas_CO2_dis")); - if (fSetVolumeColors) camStrip->SetLineColor(kOrange + 9); + //if (fSetVolumeColors) camStrip->SetLineColor(kOrange + 9); int copyNum = 1; for (int i = -6; i <= 6; i += 2) { camStrip->AddNode(camModule, copyNum, MakeTrans(0., static_cast<double>(i) * pmtSizeGap, 0.)); @@ -212,51 +222,51 @@ TGeoVolumeAssembly* RichGeoCreator::CreateMirror() TGeoTranslation* tr0 = MakeTrans(0., 0., -fMirrorOriginY - 10.); TGeoCompositeShape* mType0 = MakeSubtraction("mirror_tile_type0_PB", op00, op01, nullptr, tr0); TGeoVolume* mVolType0 = new TGeoVolume("mirror_tile_type0", mType0, medGlass); - if (fSetVolumeColors) mVolType0->SetLineColor(kYellow + 1); + //if (fSetVolumeColors) mVolType0->SetLineColor(kYellow + 1); // Mirror tile type 1 double theta1 = mRot90 + fMirrorThetaGap / 2.; TGeoSphere* mType1 = new TGeoSphere("mirror_tile_type1_PB", mRadius, mRadius2, theta1, theta1 + dTheta, phi1, phi2); TGeoVolume* mVolType1 = new TGeoVolume("mirror_tile_type1", mType1, medGlass); - if (fSetVolumeColors) mVolType1->SetLineColor(kYellow + 2); + //if (fSetVolumeColors) mVolType1->SetLineColor(kYellow + 2); // Mirror tile type 2 double theta2 = mRot90 - fAlpha / 2. + fMirrorThetaGap / 4.; TGeoSphere* mType2 = new TGeoSphere("mirror_tile_type2_PB", mRadius, mRadius2, theta2, theta2 + dTheta, phi1, phi2); TGeoVolume* mVolType2 = new TGeoVolume("mirror_tile_type2", mType2, medGlass); - if (fSetVolumeColors) mVolType2->SetLineColor(kYellow + 3); + //if (fSetVolumeColors) mVolType2->SetLineColor(kYellow + 3); // Mirror tile type 3 double theta3 = mRot90 - fAlpha; TGeoSphere* mType3 = new TGeoSphere("mirror_tile_type3_PB", mRadius, mRadius2, theta3, theta3 + dTheta, phi1, phi2); TGeoVolume* mVolType3 = new TGeoVolume("mirror_tile_type3", mType3, medGlass); - if (fSetVolumeColors) mVolType3->SetLineColor(kYellow - 1); + //if (fSetVolumeColors) mVolType3->SetLineColor(kYellow - 1); // Mirror tile type 4 double theta4 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; TGeoSphere* op4_0 = new TGeoSphere("mirror_tile_type4_PB_op0", mRadius, mRadius2, theta4, theta4 + dTheta, phi1, phi2); - TGeoBBox* op4_1 = new TGeoBBox("mirror_tile_type4_PB_op1", 500., fRichWidth / 2., 10.); - TGeoTranslation* tr4_1 = MakeTrans(0., 0., -fMirrorOriginY - 10.); - TGeoCompositeShape* op4_01 = MakeSubtraction("mirror_tile_type4_PB_op01", op4_0, op4_1, nullptr, tr4_1); - TGeoTubeSeg* op4_2 = new TGeoTubeSeg("mirror_tile_type4_PB_op2", 0., 80., 320., -90., 45.); - TGeoMatrix* mat4 = MakeCombiTrans(0., 0., -mRadius * sin(ToRad(fMirrorRot + fAlpha)), 90., 0., 90.); - TGeoCompositeShape* mType4 = MakeSubtraction("mirror_tile_type4_PB", op4_01, op4_2, nullptr, mat4); + TGeoBBox* op4_1 = new TGeoBBox("mirror_tile_type4_cutoff", 30, 40, 25); + TGeoCombiTrans* tr4_1 = + MakeCombiTrans(mRadius * Sin((theta4 + dTheta / 2) * pi / 180) * Cos((phi1 + phi2) / 2 * pi / 180), + mRadius * Sin((theta4 + dTheta / 2) * pi / 180) * Sin((phi1 + phi2) / 2 * pi / 180) + 15, + mRadius * Cos((theta4 + dTheta / 2) * pi / 180) - 22, 45, 0, 0); + TGeoCompositeShape* mType4 = MakeSubtraction("mirror_tile_type4_PB", op4_0, op4_1, nullptr, tr4_1); TGeoVolume* mVolType4 = new TGeoVolume("mirror_tile_type4", mType4, medGlass); - if (fSetVolumeColors) mVolType4->SetLineColor(kYellow - 2); + //if (fSetVolumeColors) mVolType4->SetLineColor(kYellow - 2); // Mirror tile type 5 double theta5 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; TGeoSphere* op5_0 = new TGeoSphere("mirror_tile_type5_PB_op0", mRadius, mRadius2, theta5, theta5 + dTheta, phi1, phi2); - TGeoBBox* op5_1 = new TGeoBBox("mirror_tile_type5_PB_op1", 500., fRichWidth / 2., 10.); - TGeoTranslation* tr5_1 = MakeTrans(0., 0., -fMirrorOriginY - 10.); - TGeoCompositeShape* op5_01 = MakeSubtraction("mirror_tile_type5_PB_op01", op5_0, op5_1, nullptr, tr5_1); - TGeoTubeSeg* op5_2 = new TGeoTubeSeg("mirror_tile_type5_PB_op2", 0., 80., 320., 135., 270.); - TGeoMatrix* mat5 = MakeCombiTrans(0., 0., -mRadius * sin(ToRad(fMirrorRot + fAlpha)), 90., 0., 90.); - TGeoCompositeShape* mType5 = MakeSubtraction("mirror_tile_type5_PB", op5_01, op5_2, nullptr, mat5); + TGeoBBox* op5_1 = new TGeoBBox("mirror_tile_type5_cutoff", 20, 30, 40); + TGeoCombiTrans* tr5_1 = + MakeCombiTrans(mRadius * Sin((theta5 + dTheta / 2) * pi / 180) * Cos((phi1 + phi2) / 2 * pi / 180), + mRadius * Sin((theta5 + dTheta / 2) * pi / 180) * Sin((phi1 + phi2) / 2 * pi / 180) - 20, + mRadius * Cos((theta5 + dTheta / 2) * pi / 180) - 22, 45, 0, 0); + TGeoCompositeShape* mType5 = MakeSubtraction("mirror_tile_type5_PB", op5_0, op5_1, nullptr, tr5_1); TGeoVolume* mVolType5 = new TGeoVolume("mirror_tile_type5", mType5, medGlass); - if (fSetVolumeColors) mVolType5->SetLineColor(kYellow - 3); + //if (fSetVolumeColors) mVolType5->SetLineColor(kYellow - 3); TGeoVolumeAssembly* mHalf = new TGeoVolumeAssembly("mirror_half"); @@ -282,28 +292,93 @@ TGeoVolumeAssembly* RichGeoCreator::CreateMirror() return mHalf; } +TGeoVolume* RichGeoCreator::CreateStuds(double ypos, double lenHalf, double angle) +{ + TGeoMedium* medGas = fMaterials.GetMedium("RICHgas_CO2_dis"); + TGeoMedium* medAl = fMaterials.GetMedium("aluminium"); + + double StudsSizeHalf = 5.; + double StudsSizeHalfGas = 4.8; + double lenHalf1 = lenHalf + Tan(angle * pi / 180) * StudsSizeHalf / 2; + double lenHalf2 = lenHalf - Tan(angle * pi / 180) * StudsSizeHalf / 2; + double alpha1 = angle / 2; + + TGeoTrap* StudsGas = new TGeoTrap("StudsGas_Trap", StudsSizeHalfGas, 0, 0, StudsSizeHalfGas, lenHalf1, lenHalf2, + alpha1, StudsSizeHalfGas, lenHalf1, lenHalf2, alpha1); + TGeoTrap* Studs = new TGeoTrap("Studs_Trap", StudsSizeHalf, 0, 0, StudsSizeHalf, lenHalf1, lenHalf2, alpha1, + StudsSizeHalf, lenHalf1, lenHalf2, alpha1); + TGeoVolume* volStudsGas = new TGeoVolume("StudsGas", StudsGas, medGas); + TGeoVolume* volStuds = new TGeoVolume("Studs", Studs, medAl); + + volStuds->AddNode(volStudsGas, 1); + TGeoVolume* returnVol = new TGeoVolumeAssembly("Stud"); + returnVol->AddNode(volStuds, 1, MakeCombiTrans(0, ypos, lenHalf, 0, 90, 0)); + return returnVol; +} + +TGeoVolume* RichGeoCreator::CreatePillarConnection() +{ + TGeoMedium* medGas = fMaterials.GetMedium("RICHgas_CO2_dis"); + TGeoMedium* medAl = fMaterials.GetMedium("aluminium"); + + double lenHalf = 79 / 2; + double widthHalf = 3.0; + double hightHalf = 1.25; + double thickness = 0.2; + double lendiff = widthHalf * Tan(8.5 * pi / 180); + + TGeoTrap* PillarConnectionGas = + new TGeoTrap("PillarConnectionGas_Trap", hightHalf - thickness, 0, 0, widthHalf - thickness, lenHalf + lendiff, + lenHalf - lendiff, 0, widthHalf - thickness, lenHalf + lendiff, lenHalf - lendiff, 0); + TGeoTrap* PillarConnection = new TGeoTrap("PillarConnection_Trap", hightHalf, 0, 0, widthHalf, lenHalf + lendiff, + lenHalf - lendiff, 0, widthHalf, lenHalf + lendiff, lenHalf - lendiff, 0); + TGeoVolume* volPillarConnectionGas = new TGeoVolume("PillarConnectionGas", PillarConnectionGas, medGas); + TGeoVolume* volPillarConnection = new TGeoVolume("PillarConnection", PillarConnection, medAl); + volPillarConnection->AddNode(volPillarConnectionGas, 1); + TGeoVolume* returnVol = new TGeoVolumeAssembly("PillarConnection"); + returnVol->AddNode(volPillarConnection, 1, MakeCombiTrans(0, 0, 0, -90, 0, 0)); + return returnVol; +} + TGeoVolumeAssembly* RichGeoCreator::CreateMirrorSupportPillars() { TGeoMedium* medGas = fMaterials.GetMedium("RICHgas_CO2_dis"); TGeoMedium* medAl = fMaterials.GetMedium("aluminium"); - TGeoBBox* pbGas = new TGeoBBox("mirror_support_pillar_gas_PB", 4.8, 176., 4.8); - TGeoBBox* pb = new TGeoBBox("mirror_support_pillar_PB", 5., 176., 5.); + TGeoBBox* pbGas = new TGeoBBox("mirror_support_pillar_gas_PB", 4.8, (fRichHeight / 2.) - 10.5, 4.8); + TGeoBBox* pb = new TGeoBBox("mirror_support_pillar_PB", 5., (fRichHeight / 2.) - 10.5, 5.); TGeoVolume* volGas = new TGeoVolume("mirror_support_pillar_gas", pbGas, medGas); TGeoVolume* vol = new TGeoVolume("mirror_support_pillar", pb, medAl); - if (fSetVolumeColors) volGas->SetLineColor(kAzure + 5); - if (fSetVolumeColors) vol->SetLineColor(kAzure + 5); + //if (fSetVolumeColors) volGas->SetLineColor(kAzure + 5); + //if (fSetVolumeColors) vol->SetLineColor(kAzure + 5); vol->AddNode(volGas, 1); + TGeoVolumeAssembly* StudsHalf = new TGeoVolumeAssembly("Studs_Half"); + StudsHalf->AddNode(CreateStuds(16.4, 30.03 / 2., 24.2), 1); + StudsHalf->AddNode(CreateStuds(57.8, 14.86 / 2., 15.9), 2); + StudsHalf->AddNode(CreateStuds(101.05, 5.74 / 2., 7.7), 3); + StudsHalf->AddNode(CreateStuds(145.4, 2.9 / 2., -0.5), 4); + + vol->AddNode(StudsHalf, 1, MakeCombiTrans(0, 0., -5, 0, 180, 0)); + vol->AddNode(StudsHalf, 2, MakeCombiTrans(0, 0., -5, 0, 180, 180)); + + TGeoVolume* PillarConnection = CreatePillarConnection(); + double dZ = 41.; - TGeoVolumeAssembly* pillars = new TGeoVolumeAssembly("mirror_support_pillar"); - pillars->AddNode(vol, 1, MakeCombiTrans(210.7759, 0., -29.5298 + dZ, 0., 42., 0.)); - pillars->AddNode(vol, 2, MakeCombiTrans(134.1222, 0., 21.3989 + dZ, 0., 25.2, 0.)); - pillars->AddNode(vol, 3, MakeCombiTrans(46.015, 0., 48. + dZ, 0., 8.4, 0.)); - pillars->AddNode(vol, 4, MakeCombiTrans(-46.015, 0., 48. + dZ, 0., -8.4, 0.)); - pillars->AddNode(vol, 5, MakeCombiTrans(-134.1222, 0., 21.3989 + dZ, 0., -25.2, 0.)); - pillars->AddNode(vol, 6, MakeCombiTrans(-210.7759, 0., -29.5298 + dZ, 0., -42., 0.)); + TGeoVolumeAssembly* pillars = new TGeoVolumeAssembly("mirror_support_pillars"); + pillars->AddNode(vol, 1, MakeCombiTrans(210.7759 - 2.035, 0., -29.5298 + dZ - 12.4346, 0., 42., 0.)); + pillars->AddNode(PillarConnection, 1, MakeCombiTrans(170.7323, 0., -15.9069 + dZ, 0., 33.6, 0.)); + pillars->AddNode(vol, 2, MakeCombiTrans(134.1222 - 1.3985, 0., 21.3989 + dZ - 11.2483, 0., 25.2, 0.)); + pillars->AddNode(PillarConnection, 2, MakeCombiTrans(89.097, 0., 23.74 + dZ, 0., 16.8, 0.)); + pillars->AddNode(vol, 3, MakeCombiTrans(46.015 - 0.545, 0., 48. + dZ - 10.6668, 0., 8.4, 0.)); + pillars->AddNode(PillarConnection, 3, MakeCombiTrans(0., 38.75, 37.34 + dZ, 0., 0., 0.)); + pillars->AddNode(PillarConnection, 4, MakeCombiTrans(0., -38.75, 37.34 + dZ, 0., 0., 0.)); + pillars->AddNode(vol, 4, MakeCombiTrans(-46.015 + 0.545, 0., 48. + dZ - 10.6668, 0., -8.4, 0.)); + pillars->AddNode(PillarConnection, 5, MakeCombiTrans(-89.097, 0., 23.74 + dZ, 0., -16.8, 0.)); + pillars->AddNode(vol, 5, MakeCombiTrans(-134.1222 + 1.3985, 0., 21.3989 + dZ - 11.2483, 0., -25.2, 0.)); + pillars->AddNode(PillarConnection, 6, MakeCombiTrans(-170.7323, 0., -15.9069 + dZ, 0., -33.6, 0.)); + pillars->AddNode(vol, 6, MakeCombiTrans(-210.7759 + 2.035, 0., -29.5298 + dZ - 12.4346, 0., -42., 0.)); return pillars; } @@ -317,32 +392,32 @@ TGeoVolumeAssembly* RichGeoCreator::CreateBeltAssembly() TGeoBBox* pb1 = new TGeoBBox("belt1_PB", 1.5, 10.6, 1.4); TGeoVolume* volGas1 = new TGeoVolume("belt1_gas", pbGas1, medGas); TGeoVolume* vol1 = new TGeoVolume("belt1", pb1, medAl); - if (fSetVolumeColors) volGas1->SetLineColor(kViolet + 8); - if (fSetVolumeColors) vol1->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) volGas1->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) vol1->SetLineColor(kViolet + 8); vol1->AddNode(volGas1, 1, MakeTrans(0., 0., 0.233)); TGeoBBox* pbGas2 = new TGeoBBox("belt2_gas_PB", 4.7835, 1.25, 1.167); TGeoBBox* pb2 = new TGeoBBox("belt2_PB", 4.9, 1.5, 1.4); TGeoVolume* volGas2 = new TGeoVolume("belt2_gas", pbGas2, medGas); TGeoVolume* vol2 = new TGeoVolume("belt2", pb2, medAl); - if (fSetVolumeColors) volGas2->SetLineColor(kViolet + 8); - if (fSetVolumeColors) vol2->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) volGas2->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) vol2->SetLineColor(kViolet + 8); vol2->AddNode(volGas2, 1, MakeTrans(0.1165, 0., 0.233)); TGeoBBox* pbGas3 = new TGeoBBox("belt3_gas_PB", 11.6135, 1.25, 1.167); TGeoBBox* pb3 = new TGeoBBox("belt3_PB", 11.73, 1.5, 1.4); TGeoVolume* volGas3 = new TGeoVolume("belt3_gas", pbGas3, medGas); TGeoVolume* vol3 = new TGeoVolume("belt3", pb3, medAl); - if (fSetVolumeColors) volGas3->SetLineColor(kViolet + 8); - if (fSetVolumeColors) vol3->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) volGas3->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) vol3->SetLineColor(kViolet + 8); vol3->AddNode(volGas3, 1, MakeTrans(0.1165, 0., 0.233)); TGeoTrap* pbGas4 = new TGeoTrap("belt4_gas_PB", 0.7, 16.22, 90., 10.97, 1.3, 1.3, 0., 9.5, 1.3, 1.3, 0.); TGeoTrap* pb4 = new TGeoTrap("belt4_PB", 0.9, 16.22, 90., 11.378, 1.4, 1.4, 0., 9.5, 1.4, 1.4, 0.); TGeoVolume* volGas4 = new TGeoVolume("belt4_gas", pbGas4, medGas); TGeoVolume* vol4 = new TGeoVolume("belt4", pb4, medAl); - if (fSetVolumeColors) volGas4->SetLineColor(kViolet + 8); - if (fSetVolumeColors) vol4->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) volGas4->SetLineColor(kViolet + 8); + //if (fSetVolumeColors) vol4->SetLineColor(kViolet + 8); vol4->AddNode(volGas4, 1, MakeTrans(0.1, 0., 0.)); TGeoVolumeAssembly* belt = new TGeoVolumeAssembly("belt"); @@ -375,56 +450,50 @@ TGeoVolumeAssembly* RichGeoCreator::CreateMirrorSupportBelts() MakeSubtraction("belt_type0_PB", sphere0, box0, nullptr, MakeTrans(0., 0., -fMirrorOriginY - 10.)); TGeoVolume* volType0 = new TGeoVolume("belt_type0", pbType0, medGas); volType0->AddNode(beltAssembly, 1, MakeCombiTrans(275.5, -13.23, -124.7, 65., 0., -90.)); - if (fSetVolumeColors) volType0->SetLineColor(kGreen); + //if (fSetVolumeColors) volType0->SetLineColor(kGreen); // Type 1 double theta1 = mRot90 + fMirrorThetaGap / 2.; TGeoSphere* pbType1 = new TGeoSphere("belt_type1_PB", mRadius2, mRadius3, theta1, theta1 + dTheta, phi1, phi2); TGeoVolume* volType1 = new TGeoVolume("belt_type1", pbType1, medGas); volType1->AddNode(beltAssembly, 1, MakeCombiTrans(290.4, -13.23, -84.0, 73., 0., -90.)); - if (fSetVolumeColors) volType1->SetLineColor(kGreen - 1); + //if (fSetVolumeColors) volType1->SetLineColor(kGreen - 1); // Type 2 double theta2 = mRot90 - fAlpha / 2. + fMirrorThetaGap / 4.; TGeoSphere* pbType2 = new TGeoSphere("belt_type2_PB", mRadius2, mRadius3, theta2, theta2 + dTheta, phi1, phi2); TGeoVolume* volType2 = new TGeoVolume("belt_type2", pbType2, medGas); volType2->AddNode(beltAssembly, 1, MakeCombiTrans(299.4, -13.23, -41.5, 82., 0., -90.)); - if (fSetVolumeColors) volType2->SetLineColor(kGreen - 2); + //if (fSetVolumeColors) volType2->SetLineColor(kGreen - 2); // Type 3 double theta3 = mRot90 - fAlpha; TGeoSphere* pbType3 = new TGeoSphere("belt_type3_PB", mRadius2, mRadius3, theta3, theta3 + dTheta, phi1, phi2); TGeoVolume* volType3 = new TGeoVolume("belt_type3", pbType3, medGas); volType3->AddNode(beltAssembly, 1, MakeCombiTrans(302.5, -13.23, 1.97, 91., 0., -90.)); - if (fSetVolumeColors) volType3->SetLineColor(kGreen - 3); - - // Type 4 - double theta4 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; - TGeoSphere* sphere4 = new TGeoSphere("belt_type4_PB_op0", mRadius2, mRadius3, theta4, theta4 + dTheta, phi1, phi2); - TGeoTubeSeg* tube4 = new TGeoTubeSeg("belt_type4_PB_op1", 0., fPipeOuterRadiusExit, 400., 0., 360.); - TGeoCompositeShape* sub4_1 = - MakeSubtraction("belt_type4_PB_op01", sphere4, tube4, nullptr, - MakeCombiTrans(0., 0., -fMirrorOriginY, 90., 0., 90. + fMirrorPhiStep * 0.5)); - TGeoBBox* box4 = new TGeoBBox("belt_type4_PB_op2", 500., richWidthHalf, 10.); - TGeoCompositeShape* pbType4 = - MakeSubtraction("belt_type4_PB", sub4_1, box4, nullptr, MakeTrans(0., 0., -fMirrorOriginY - 10.)); - TGeoVolume* volType4 = new TGeoVolume("belt_type4", pbType4, medGas); - volType4->AddNode(beltAssembly, 1, MakeCombiTrans(281.0, 0., -113.0, 0., -66., 0.)); - if (fSetVolumeColors) volType4->SetLineColor(kGreen + 1); - - // Type 5 - double theta5 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; - TGeoSphere* sphere5 = new TGeoSphere("belt_type5_PB_op0", mRadius2, mRadius3, theta5, theta5 + dTheta, phi1, phi2); - TGeoTubeSeg* tube5 = new TGeoTubeSeg("belt_type5_PB_op1", 0., fPipeOuterRadiusExit, 400., 0., 360.); - TGeoCompositeShape* sub5_1 = - MakeSubtraction("belt_type5_PB_op01", sphere5, tube5, nullptr, - MakeCombiTrans(0., 0., -fMirrorOriginY, 90., 0., 90. - fMirrorPhiStep * 0.5)); - TGeoBBox* box5 = new TGeoBBox("belt_type5_PB_op2", 500., richWidthHalf, 10.); - TGeoCompositeShape* pbType5 = - MakeSubtraction("belt_type5_PB", sub5_1, box5, nullptr, MakeTrans(0., 0., -fMirrorOriginY - 10.)); - TGeoVolume* volType5 = new TGeoVolume("belt_type5", pbType5, medGas); - volType5->AddNode(beltAssembly, 1, MakeCombiTrans(281., 0., -113., 0., -114., 180.)); - if (fSetVolumeColors) volType5->SetLineColor(kGreen + 2); + //if (fSetVolumeColors) volType3->SetLineColor(kGreen - 3); + + //// Type 4 + //double theta4 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; + //TGeoSphere* sphere4 = new TGeoSphere("belt_type4_PB_op0", mRadius2, mRadius3, theta4, theta4 + dTheta, phi1, phi2); + //TGeoTubeSeg* tube4 = new TGeoTubeSeg("belt_type4_PB_op1", 0., fPipeOuterRadiusExit, 400., 0., 360.); + //TGeoCompositeShape* sub4_1 = MakeSubtraction("belt_type4_PB_op01", sphere4, tube4, nullptr, MakeCombiTrans(0., 0., -fMirrorOriginY, 90., 0., 90. + fMirrorPhiStep * 0.5)); + //TGeoBBox* box4 = new TGeoBBox("belt_type4_PB_op2", 500., richWidthHalf, 10.); + //TGeoCompositeShape* pbType4 = MakeSubtraction("belt_type4_PB", sub4_1, box4, nullptr, MakeTrans(0., 0., -fMirrorOriginY - 10.)); + //TGeoVolume* volType4 = new TGeoVolume("belt_type4", pbType4, medGas); + //volType4->AddNode(beltAssembly, 1, MakeCombiTrans(281.0, 0., -113.0, 0., -66., 0.)); + ////if (fSetVolumeColors) volType4->SetLineColor(kGreen + 1); + // + //// Type 5 + //double theta5 = mRot90 + fAlpha / 2. + fMirrorThetaGap * 3. / 4.; + //TGeoSphere* sphere5 = new TGeoSphere("belt_type5_PB_op0", mRadius2, mRadius3, theta5, theta5 + dTheta, phi1, phi2); + //TGeoTubeSeg* tube5 = new TGeoTubeSeg("belt_type5_PB_op1", 0., fPipeOuterRadiusExit, 400., 0., 360.); + //TGeoCompositeShape* sub5_1 = MakeSubtraction("belt_type5_PB_op01", sphere5, tube5, nullptr, MakeCombiTrans(0., 0., -fMirrorOriginY, 90., 0., 90. - fMirrorPhiStep * 0.5)); + //TGeoBBox* box5 = new TGeoBBox("belt_type5_PB_op2", 500., richWidthHalf, 10.); + //TGeoCompositeShape* pbType5 = MakeSubtraction("belt_type5_PB", sub5_1, box5, nullptr, MakeTrans(0., 0., -fMirrorOriginY - 10.)); + //TGeoVolume* volType5 = new TGeoVolume("belt_type5", pbType5, medGas); + //volType5->AddNode(beltAssembly, 1, MakeCombiTrans(281., 0., -113., 0., -114., 180.)); + ////if (fSetVolumeColors) volType5->SetLineColor(kGreen + 2); TGeoVolumeAssembly* contHalf = new TGeoVolumeAssembly("mirror_support_belts_half"); for (int t = 0; t < 4; t++) { @@ -438,7 +507,7 @@ TGeoVolumeAssembly* RichGeoCreator::CreateMirrorSupportBelts() if (t == 0) { mVol = volType0; if (i == 4 || i == 5) { // special case for the 2 middle belts - mVol = (i == 4) ? volType5 : volType4; + continue; //mVol = (i == 4) ? volType5 : volType4; copyNum = 1; } } @@ -456,116 +525,206 @@ TGeoVolumeAssembly* RichGeoCreator::CreateMainFrame() double frameSizeHalf = 5.; double frameSizeHalfGas = 4.3; double richHeightHalf = fRichHeight / 2.; + double richLengthHalf = fRichLength / 2.; + double richWidthHalf = fRichWidth / 2.; double coverThickness = fRichCoveringThickness; + + //double posY = richHeightHalf - coverThickness - frameSizeHalf; + double rotX = 90 - fCameraFullRotX; + double lenHalf2 = 23.2919390; + double lenHalf3 = 20.; + double lenHalf5 = richHeightHalf - Tan(rotX * pi / 180.0) * lenHalf3 * 2.0; + double lenHalf6 = richLengthHalf - lenHalf2 - lenHalf3; + double lenHalf8 = (richWidthHalf - 229.3 / 2) / 2; // the 229.3 are the width of the shieldingbox + double posY = richHeightHalf - coverThickness - frameSizeHalf; - double rotY = 31.991651; + double posY2 = 90; + double posY3 = posY - Tan(rotX * pi / 180.0) * lenHalf3 * 2.0; + double posZ1 = -147.779439; + double posZ2 = posZ1 + lenHalf2 + 2 * lenHalf3; + double posZ3 = posZ1 + 2 * lenHalf2 + 2 * lenHalf3; + double posZ4 = posZ1 + fRichLength; + double posX1 = 134.6; + double posX2 = (posX1 + richWidthHalf) / 2; + double posX3 = richWidthHalf - frameSizeHalf; + + TGeoBBox* crossingbox = + new TGeoBBox("crossing", frameSizeHalf, frameSizeHalf, + frameSizeHalf); // to cutoff parts of the frames where they would overlap each other TGeoVolumeAssembly* mainFrame = new TGeoVolumeAssembly("mainframe"); - TGeoBBox* pbGas1 = new TGeoBBox("mainframe1_gas_PB", 139.5, frameSizeHalfGas, frameSizeHalfGas); - TGeoBBox* pb1 = new TGeoBBox("mainframe1_PB", 139.5, frameSizeHalf, frameSizeHalf); + // parts along x-axis + TGeoBBox* pbGas1 = + new TGeoBBox("mainframe1_gas_PB", richWidthHalf - frameSizeHalf * 2, frameSizeHalfGas, frameSizeHalfGas); + TGeoBBox* pb1 = new TGeoBBox("mainframe1_PB", richWidthHalf - frameSizeHalf * 2, frameSizeHalf, frameSizeHalf); TGeoVolume* volGas1 = new TGeoVolume("mainframe1_gas", pbGas1, medGas); TGeoVolume* vol1 = new TGeoVolume("mainframe1", pb1, medAlum); - if (fSetVolumeColors) vol1->SetLineColor(kBlue); - if (fSetVolumeColors) volGas1->SetLineColor(kBlue); + //if (fSetVolumeColors) vol1->SetLineColor(kBlue); + //if (fSetVolumeColors) volGas1->SetLineColor(kBlue); vol1->AddNode(volGas1, 1); - mainFrame->AddNode(vol1, 1, MakeTrans(0, 100., -128.279439)); - mainFrame->AddNode(vol1, 2, MakeTrans(0, -100., -128.279439)); - mainFrame->AddNode(vol1, 3, MakeTrans(0, posY, -147.779439)); - mainFrame->AddNode(vol1, 4, MakeTrans(0, -posY, -147.779439)); - - double posZ2 = -99.4875; - double posX2 = 134.5; - TGeoBBox* pbGas2 = new TGeoBBox("mainframe2_gas_PB", frameSizeHalfGas, frameSizeHalfGas, 43.2919390); - TGeoBBox* pb2 = new TGeoBBox("mainframe2_PB", frameSizeHalf, frameSizeHalf, 43.2919390); + mainFrame->AddNode(vol1, 1, MakeTrans(0, posY2, posZ1)); + mainFrame->AddNode(vol1, 2, MakeTrans(0, -posY2, posZ1)); + mainFrame->AddNode(vol1, 3, MakeTrans(0., posY, posZ4)); + mainFrame->AddNode(vol1, 4, MakeTrans(0., posY, posZ3)); + mainFrame->AddNode(vol1, 5, MakeTrans(0., -posY, posZ4)); + mainFrame->AddNode(vol1, 6, MakeTrans(0., -posY, posZ3)); + + // first parts along z-axis (short) + TGeoBBox* pbGas2 = new TGeoBBox("mainframe2_gas_PB", frameSizeHalfGas, frameSizeHalfGas, lenHalf2 - frameSizeHalf); + TGeoBBox* pb2 = new TGeoBBox("mainframe2_PB", frameSizeHalf, frameSizeHalf, lenHalf2 - frameSizeHalf); TGeoVolume* volGas2 = new TGeoVolume("mainframe2_gas", pbGas2, medGas); TGeoVolume* vol2 = new TGeoVolume("mainframe2", pb2, medAlum); - if (fSetVolumeColors) vol2->SetLineColor(kBlue + 1); - if (fSetVolumeColors) volGas2->SetLineColor(kBlue + 1); + //if (fSetVolumeColors) vol2->SetLineColor(kBlue + 1); + //if (fSetVolumeColors) volGas2->SetLineColor(kBlue + 1); vol2->AddNode(volGas2, 1); - mainFrame->AddNode(vol2, 1, MakeTrans(-posX2, posY, posZ2)); - mainFrame->AddNode(vol2, 2, MakeTrans(-posX2, -posY, posZ2)); - mainFrame->AddNode(vol2, 3, MakeTrans(posX2, posY, posZ2)); - mainFrame->AddNode(vol2, 4, MakeTrans(posX2, -posY, posZ2)); - - double posX3 = 196.4811997; - double posZ3 = -91.7898222; - TGeoTrap* pbGas3 = new TGeoTrap("mainframe3_gas_PB", frameSizeHalfGas, -26.016698, 0., frameSizeHalfGas, 71.9697521, - 71.9697521, 0., frameSizeHalfGas, 62.4, 62.4, 0.); - TGeoTrap* pb3 = new TGeoTrap("mainframe3_PB", frameSizeHalf, -26.016698, 0., frameSizeHalf, 72.7486842, 72.7486842, - 0., frameSizeHalf, 61.6210827, 61.6210827, 0.); + mainFrame->AddNode(vol2, 1, MakeTrans(-posX1, posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 2, MakeTrans(-posX1, -posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 3, MakeTrans(posX1, posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 4, MakeTrans(posX1, -posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 5, MakeTrans(posX3, posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 6, MakeTrans(posX3, -posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 7, MakeTrans(-posX3, posY, posZ2 - frameSizeHalf / 2)); + mainFrame->AddNode(vol2, 8, MakeTrans(-posX3, -posY, posZ2 - frameSizeHalf / 2)); + + // diagonal parts (y-z) + TGeoTrap* pbGas3 = + new TGeoTrap("mainframe3_gas_PB", frameSizeHalfGas, 0, 0, lenHalf3 - frameSizeHalf - coverThickness, 6.3, 9.3, rotX, + lenHalf3 - frameSizeHalf - coverThickness, 6.3, 9.3, rotX); + TGeoTrap* pb3 = new TGeoTrap("mainframe3_PB", frameSizeHalf, 0, 0, lenHalf3 - frameSizeHalf, 7, 10, rotX, + lenHalf3 - frameSizeHalf, 7, 10, rotX); TGeoVolume* volGas3 = new TGeoVolume("mainframe3_gas", pbGas3, medGas); TGeoVolume* vol3 = new TGeoVolume("mainframe3", pb3, medAlum); - if (fSetVolumeColors) vol3->SetLineColor(kBlue + 2); - if (fSetVolumeColors) volGas3->SetLineColor(kBlue + 2); + TGeoRotation* rotup = new TGeoRotation(); + rotup->RotateX(-90 + rotX * pi / 180); + rotup->RotateZ(180); + rotup->RotateY(90); vol3->AddNode(volGas3, 1); - mainFrame->AddNode(vol3, 1, MakeCombiTrans(posX3, posY, posZ3, 0., -rotY, 0.)); - mainFrame->AddNode(vol3, 2, MakeCombiTrans(posX3, -posY, posZ3, 0., -rotY, 0.)); - mainFrame->AddNode(vol3, 3, MakeCombiTrans(-posX3, posY, posZ3, 0., -rotY, -180.0)); - mainFrame->AddNode(vol3, 4, MakeCombiTrans(-posX3, -posY, posZ3, 0., -rotY, -180.0)); + mainFrame->AddNode(vol3, 1, + new TGeoCombiTrans(*MakeTrans(-posX3, posY - Tan(rotX * pi / 180) * lenHalf3 + frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotup->Inverse())); + mainFrame->AddNode(vol3, 2, + new TGeoCombiTrans(*MakeTrans(-posX1, posY - Tan(rotX * pi / 180) * lenHalf3 + frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotup->Inverse())); + mainFrame->AddNode(vol3, 3, + new TGeoCombiTrans(*MakeTrans(posX1, posY - Tan(rotX * pi / 180) * lenHalf3 + frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotup->Inverse())); + mainFrame->AddNode(vol3, 4, + new TGeoCombiTrans(*MakeTrans(posX3, posY - Tan(rotX * pi / 180) * lenHalf3 + frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotup->Inverse())); + TGeoRotation* rotdown = new TGeoRotation(); + rotdown->RotateX(-90 + rotX * pi / 180); + rotdown->RotateY(90); + mainFrame->AddNode(vol3, 5, + new TGeoCombiTrans(*MakeTrans(-posX3, -posY + Tan(rotX * pi / 180) * lenHalf3 - frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotdown->Inverse())); + mainFrame->AddNode(vol3, 6, + new TGeoCombiTrans(*MakeTrans(-posX1, -posY + Tan(rotX * pi / 180) * lenHalf3 - frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotdown->Inverse())); + mainFrame->AddNode(vol3, 7, + new TGeoCombiTrans(*MakeTrans(posX1, -posY + Tan(rotX * pi / 180) * lenHalf3 - frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotdown->Inverse())); + mainFrame->AddNode(vol3, 8, + new TGeoCombiTrans(*MakeTrans(posX3, -posY + Tan(rotX * pi / 180) * lenHalf3 - frameSizeHalf, + posZ1 + lenHalf3 + frameSizeHalf / 2), + rotdown->Inverse())); + // long vertical parts - double posZ4 = 51.195561; - double pos4 = 257.9; - TGeoBBox* pbGas4 = new TGeoBBox("mainframe4_gas_PB", frameSizeHalfGas, - richHeightHalf - coverThickness - 2. * frameSizeHalf, frameSizeHalfGas); - TGeoBBox* pb4 = - new TGeoBBox("mainframe4_PB", frameSizeHalf, richHeightHalf - coverThickness - 2. * frameSizeHalf, frameSizeHalf); + TGeoBBox* pbGas4 = + new TGeoBBox("mainframe4_gas_PB", frameSizeHalfGas, richHeightHalf - coverThickness, frameSizeHalfGas); + TGeoBBox* pb4 = new TGeoBBox("mainframe4_PB", frameSizeHalf, richHeightHalf - coverThickness, frameSizeHalf); TGeoVolume* volGas4 = new TGeoVolume("mainframe4_gas", pbGas4, medGas); TGeoVolume* vol4 = new TGeoVolume("mainframe4", pb4, medAlum); - if (fSetVolumeColors) vol4->SetLineColor(kBlue + 3); - if (fSetVolumeColors) volGas4->SetLineColor(kBlue + 3); + //if (fSetVolumeColors) vol4->SetLineColor(kBlue + 3); + //if (fSetVolumeColors) volGas4->SetLineColor(kBlue + 3); vol4->AddNode(volGas4, 1); - mainFrame->AddNode(vol4, 1, MakeTrans(-pos4, 0., posZ4)); - mainFrame->AddNode(vol4, 2, MakeTrans(pos4, 0., posZ4)); - mainFrame->AddNode(vol4, 3, MakeTrans(-pos4, 0, -posZ4)); - mainFrame->AddNode(vol4, 4, MakeTrans(pos4, 0, -posZ4)); - mainFrame->AddNode(vol4, 5, MakeCombiTrans(215.1316481, 0, -80.1395071, 0., -rotY, 0.)); - mainFrame->AddNode(vol4, 6, MakeCombiTrans(178.111648, 0, -103.2646704, 0., -rotY, 0.)); - mainFrame->AddNode(vol4, 7, MakeCombiTrans(146.3896048, 0, -123.0803763, 0., -rotY, 0.)); - mainFrame->AddNode(vol4, 8, MakeCombiTrans(-215.1316481, 0, -80.1395071, 0., -rotY, 0.)); - mainFrame->AddNode(vol4, 9, MakeCombiTrans(-178.111648, 0, -103.2646704, 0., -rotY, 0.)); - mainFrame->AddNode(vol4, 10, MakeCombiTrans(-146.3896048, 0, -123.0803763, 0., -rotY, 0.)); - - TGeoBBox* pbGas5 = new TGeoBBox("mainframe5_gas_PB", 262.9, frameSizeHalfGas, frameSizeHalfGas); - TGeoBBox* pb5 = new TGeoBBox("mainframe5_PB", 262.9, frameSizeHalf, frameSizeHalf); - TGeoVolume* volGas5 = new TGeoVolume("mainframe5_gas", pbGas5, medGas); - TGeoVolume* vol5 = new TGeoVolume("mainframe5", pb5, medAlum); - if (fSetVolumeColors) vol5->SetLineColor(kBlue - 1); - if (fSetVolumeColors) volGas5->SetLineColor(kBlue - 1); + mainFrame->AddNode(vol4, 1, MakeTrans(-posX3, 0., posZ4)); + mainFrame->AddNode(vol4, 2, MakeTrans(posX3, 0., posZ4)); + mainFrame->AddNode(vol4, 3, MakeTrans(-posX3, 0, posZ3)); + mainFrame->AddNode(vol4, 4, MakeTrans(posX3, 0, posZ3)); + + // small vertical parts + TGeoTrap* pbGas5 = new TGeoTrap("mainframe5_gas_PB", frameSizeHalfGas, 0, 0, frameSizeHalfGas, + lenHalf5 - 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, + lenHalf5 + 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, 0, frameSizeHalfGas, + lenHalf5 - 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, + lenHalf5 + 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, 0); + TGeoTrap* pb5 = new TGeoTrap("mainframe5_PB", frameSizeHalf, 0, 0, frameSizeHalf, + lenHalf5 - 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, + lenHalf5 + 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, 0, frameSizeHalf, + lenHalf5 - 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, + lenHalf5 + 1 / Tan((90 - rotX) * pi / 180) * frameSizeHalf, 0); + TGeoCompositeShape* sub5_1 = + MakeUnion("subtraction_mainframe5", crossingbox, crossingbox, MakeTrans(posY2, 0, 0), MakeTrans(posY3, 0, 0)); + TGeoCompositeShape* sub5 = + MakeUnion("subtraction_mainframe5", sub5_1, sub5_1, nullptr, MakeCombiTrans(0, 0, 0, 0, 180, 0)); + TGeoVolume* volGas5 = + new TGeoVolume("mainframe5_gas", MakeSubtraction("mainframe5_gas_PB", pbGas5, sub5, nullptr, nullptr), medGas); + TGeoVolume* vol5 = + new TGeoVolume("mainframe5", MakeSubtraction("mainframe5_PB", pb5, sub5, nullptr, nullptr), medAlum); vol5->AddNode(volGas5, 1); - mainFrame->AddNode(vol5, 1, MakeTrans(0., posY, posZ4)); - mainFrame->AddNode(vol5, 2, MakeTrans(0., posY, -posZ4)); - mainFrame->AddNode(vol5, 3, MakeTrans(0., -posY, posZ4)); - mainFrame->AddNode(vol5, 4, MakeTrans(0., -posY, -posZ4)); + mainFrame->AddNode(vol5, 1, MakeCombiTrans(-posX1, 0., posZ1, 90, 0, 90)); + mainFrame->AddNode(vol5, 2, MakeCombiTrans(posX1, 0., posZ1, 90, 0, 90)); + mainFrame->AddNode(vol5, 3, MakeCombiTrans(-posX3, 0., posZ1, 90, 0, 90)); + mainFrame->AddNode(vol5, 4, MakeCombiTrans(posX3, 0., posZ1, 90, 0, 90)); // small horizontal parts - double lenHalf6 = 46.1955610; - TGeoBBox* pbGas6 = new TGeoBBox("mainframe6_gas_PB", frameSizeHalfGas, frameSizeHalfGas, lenHalf6); - TGeoBBox* pb6 = new TGeoBBox("mainframe6_PB", frameSizeHalf, frameSizeHalf, lenHalf6); + TGeoBBox* pbGas6 = new TGeoBBox("mainframe6_gas_PB", frameSizeHalfGas, frameSizeHalfGas, lenHalf6 - frameSizeHalf); + TGeoBBox* pb6 = new TGeoBBox("mainframe6_PB", frameSizeHalf, frameSizeHalf, lenHalf6 - frameSizeHalf); TGeoVolume* volGas6 = new TGeoVolume("mainframe6_gas", pbGas6, medGas); TGeoVolume* vol6 = new TGeoVolume("mainframe6", pb6, medAlum); - if (fSetVolumeColors) vol6->SetLineColor(kBlue - 2); - if (fSetVolumeColors) volGas6->SetLineColor(kBlue - 2); + //if (fSetVolumeColors) vol6->SetLineColor(kBlue - 2); + //if (fSetVolumeColors) volGas6->SetLineColor(kBlue - 2); vol6->AddNode(volGas6, 1); - mainFrame->AddNode(vol6, 1, MakeTrans(-pos4, posY, 0.)); - mainFrame->AddNode(vol6, 2, MakeTrans(-pos4, -posY, 0.)); - mainFrame->AddNode(vol6, 3, MakeTrans(pos4, posY, 0.)); - mainFrame->AddNode(vol6, 4, MakeTrans(pos4, -posY, 0.)); - mainFrame->AddNode(vol6, 5, MakeTrans(-134.5, posY, 0.)); - mainFrame->AddNode(vol6, 6, MakeTrans(-134.5, -posY, 0.)); - mainFrame->AddNode(vol6, 7, MakeTrans(134.5, posY, 0.)); - mainFrame->AddNode(vol6, 8, MakeTrans(134.5, -posY, 0.)); - mainFrame->AddNode(vol6, 9, MakeTrans(0., posY, 0.)); - mainFrame->AddNode(vol6, 10, MakeTrans(0., -posY, 0.)); - mainFrame->AddNode(vol6, 11, MakeTrans(pos4, 87.8, 0.)); - mainFrame->AddNode(vol6, 12, MakeTrans(pos4, -87.8, 0.)); - mainFrame->AddNode(vol6, 13, MakeTrans(-pos4, 87.8, 0.)); - mainFrame->AddNode(vol6, 14, MakeTrans(-pos4, -87.8, 0.)); - mainFrame->AddNode(vol6, 15, MakeTrans(-192.6, posY, 0.)); - mainFrame->AddNode(vol6, 16, MakeTrans(-192.6, -posY, 0.)); - mainFrame->AddNode(vol6, 17, MakeTrans(192.6, posY, 0.)); - mainFrame->AddNode(vol6, 18, MakeTrans(192.6, -posY, 0.)); + mainFrame->AddNode(vol6, 1, MakeTrans(-posX2, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 2, MakeTrans(-posX2, -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 3, MakeTrans(posX2, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 4, MakeTrans(posX2, -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 5, MakeTrans(-posX1, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 6, MakeTrans(-posX1, -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 7, MakeTrans(posX1, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 8, MakeTrans(posX1, -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 9, MakeTrans(0., posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 10, MakeTrans(0., -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 11, MakeTrans(posX3, posY2, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 12, MakeTrans(posX3, -posY2, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 13, MakeTrans(-posX3, posY2, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 14, MakeTrans(-posX3, -posY2, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 15, MakeTrans(-posX3, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 16, MakeTrans(-posX3, -posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 17, MakeTrans(posX3, posY, posZ4 - lenHalf6)); + mainFrame->AddNode(vol6, 18, MakeTrans(posX3, -posY, posZ4 - lenHalf6)); + + + // first parts along z-axis (long) + TGeoBBox* pbGas7 = new TGeoBBox("mainframe7_gas_PB", frameSizeHalfGas, frameSizeHalfGas, lenHalf2 + lenHalf3); + TGeoBBox* pb7 = new TGeoBBox("mainframe7_PB", frameSizeHalf, frameSizeHalf, lenHalf2 + lenHalf3); + TGeoVolume* volGas7 = new TGeoVolume("mainframe7_gas", pbGas7, medGas); + TGeoVolume* vol7 = new TGeoVolume("mainframe7", pb7, medAlum); + vol7->AddNode(volGas7, 1); + mainFrame->AddNode(vol7, 1, MakeTrans(posX3, posY2, posZ2 - lenHalf3 - frameSizeHalf)); + mainFrame->AddNode(vol7, 2, MakeTrans(posX3, -posY2, posZ2 - lenHalf3 - frameSizeHalf)); + mainFrame->AddNode(vol7, 3, MakeTrans(-posX3, posY2, posZ2 - lenHalf3 - frameSizeHalf)); + mainFrame->AddNode(vol7, 4, MakeTrans(-posX3, -posY2, posZ2 - lenHalf3 - frameSizeHalf)); + + // left & right of shieldingbox along x-axis + TGeoBBox* pbGas8 = new TGeoBBox("mainframe8_gas_PB", lenHalf8, frameSizeHalfGas, frameSizeHalfGas); + TGeoBBox* pb8 = new TGeoBBox("mainframe8_PB", lenHalf8, frameSizeHalf, frameSizeHalf); + TGeoVolume* volGas8 = new TGeoVolume("mainframe8_gas", pbGas8, medGas); + TGeoVolume* vol8 = new TGeoVolume("mainframe8", pb8, medAlum); + vol8->AddNode(volGas8, 1); + mainFrame->AddNode(vol8, 1, MakeTrans(posX3 - lenHalf8 + frameSizeHalf, posY3, posZ1)); + mainFrame->AddNode(vol8, 2, MakeTrans(-posX3 + lenHalf8 - frameSizeHalf, posY3, posZ1)); + mainFrame->AddNode(vol8, 3, MakeTrans(posX3 - lenHalf8 + frameSizeHalf, -posY3, posZ1)); + mainFrame->AddNode(vol8, 4, MakeTrans(-posX3 + lenHalf8 - frameSizeHalf, -posY3, posZ1)); return mainFrame; } @@ -577,9 +736,9 @@ TGeoVolume* RichGeoCreator::CreateGas() double richHeightHalf = fRichHeight / 2.; double x1 = richWidthHalf - fRichCoveringThickness; - double y1 = ((2. * richHeightHalf - fRichEntranceY) / 2. - 2. * fRichCoveringThickness) / 2.; + double y1 = ((2. * richHeightHalf - fRichEntranceHeight) / 2. - 2. * fRichCoveringThickness) / 2.; double z1 = fRichAddZ / 2. - fRichCoveringThickness / 2. + fRichEntranceThickness / 2.; - double y2 = (richHeightHalf + fRichEntranceY / 2.) / 2.; + double y2 = (richHeightHalf + fRichEntranceHeight / 2.) / 2.; double z2 = -richLenHalf - fRichAddZ / 2. + fRichCoveringThickness; TGeoBBox* op0 = new TGeoBBox("rich_gas_PB_op0", x1, richHeightHalf - fRichCoveringThickness, @@ -589,32 +748,32 @@ TGeoVolume* RichGeoCreator::CreateGas() TGeoBBox* op2 = new TGeoBBox("rich_gas_PB_op2", x1, y1, z1); TGeoCompositeShape* op012 = MakeUnion("rich_gas_PB_op012", op01, op2, nullptr, MakeTrans(0., -y2, z2)); - TGeoConeSeg* op3 = - new TGeoConeSeg("rich_gas_PB_op3", richLenHalf, 0., fPipeOuterRadiusEntrance, 0., fPipeOuterRadiusExit, 0., 360.); + TGeoConeSeg* op3 = new TGeoConeSeg("rich_gas_PB_op3", fPipeLength / 2., 0., fPipeOuterRadiusEntrance, 0., + fPipeOuterRadiusExit, 0., 360.); TGeoTranslation* tr = MakeTrans(0., 0., -(fRichEntranceThickness - fRichExitThickness) / 2.); TGeoCompositeShape* gasPB = MakeSubtraction("rich_gas_PB", op012, op3, nullptr, tr); TGeoVolume* gas = new TGeoVolume("rich_gas", gasPB, fMaterials.GetMedium("RICHgas_CO2_dis")); - if (fSetVolumeColors) gas->SetLineColor(kYellow - 10); + //if (fSetVolumeColors) gas->SetLineColor(kYellow - 10); return gas; } TGeoVolume* RichGeoCreator::CreateRichContainer() { - double y1 = (fRichHeight / 2. + fRichEntranceY / 2.) / 2.; + double y1 = (fRichHeight / 2. + fRichEntranceHeight / 2.) / 2.; double z1 = -fRichLength / 2. - fRichAddZ / 2.; - double y2 = (fRichHeight - fRichEntranceY) / 4.; + double y2 = (fRichHeight - fRichEntranceHeight) / 4.; TGeoBBox* op0 = new TGeoBBox("rich_cont_PB_op0", fRichWidth / 2., fRichHeight / 2., fRichLength / 2.); TGeoBBox* op1 = new TGeoBBox("rich_cont_PB_op1", fRichWidth / 2., y2, fRichAddZ / 2.); TGeoCompositeShape* op01 = MakeUnion("rich_cont_PB_op01", op0, op1, nullptr, MakeTrans(0., y1, z1)); TGeoBBox* op2 = new TGeoBBox("rich_cont_PB_op2", fRichWidth / 2., y2, fRichAddZ / 2.); TGeoCompositeShape* pb = MakeUnion("rich_cont_PB", op01, op2, nullptr, MakeTrans(0., -y1, z1)); - double richLenHalf = fRichLength / 2; + //double richLenHalf = fRichLength / 2; TGeoConeSeg* pipePB = - new TGeoConeSeg("rich_pipe_subtract", richLenHalf, 0, fPipeOuterRadiusEntrance - fPipeThicknessEntrance, 0, + new TGeoConeSeg("rich_pipe_subtract", fPipeLength / 2., 0, fPipeOuterRadiusEntrance - fPipeThicknessEntrance, 0, fPipeOuterRadiusExit - fPipeThicknessExit, 0., 360.); TGeoCompositeShape* pb2 = MakeSubtraction("rich_cont_PB2", pb, pipePB, nullptr, MakeTrans(0, 0, 0)); TGeoVolume* richCont = new TGeoVolume("rich_cont", pb2, fMaterials.GetMedium("aluminium")); - if (fSetVolumeColors) richCont->SetLineColor(kBlue - 10); + //if (fSetVolumeColors) richCont->SetLineColor(kBlue - 10); return richCont; } @@ -622,53 +781,64 @@ TGeoVolume* RichGeoCreator::CreateSensitivePlane() { double richLenHalf = fRichLength / 2.; TGeoBBox* op0 = new TGeoBBox("sens_plane_PB_op0", 170., 170., 0.05); - TGeoConeSeg* op1 = - new TGeoConeSeg("sens_plane_PB_op1", richLenHalf, 0., fPipeOuterRadiusEntrance, 0., fPipeOuterRadiusExit, 0., 360.); + TGeoTube* op1 = new TGeoTube(0, (fPipeOuterRadiusExit + fPipeOuterRadiusEntrance) / 2, richLenHalf + 0.5); TGeoTranslation* tr = MakeTrans(0., 0., (-fSensPlaneZ + (fRichExitThickness - fRichEntranceThickness) / 2.)); TGeoCompositeShape* sensPlanePB = MakeSubtraction("sens_plane_PB", op0, op1, nullptr, tr); TGeoVolume* sensPlane = new TGeoVolume("sens_plane", sensPlanePB, fMaterials.GetMedium("RICHgas_CO2_dis+")); - if (fSetVolumeColors) sensPlane->SetLineColor(kRed - 8); + //if (fSetVolumeColors) sensPlane->SetLineColor(kRed - 8); return sensPlane; } TGeoVolume* RichGeoCreator::CreateRichEntrance() { double richLenHalf = fRichLength / 2.; - double richWidthHalf = fRichWidth / 2.; - TGeoBBox* op0 = new TGeoBBox("rich_entrance_PB_op0", richWidthHalf, fRichEntranceY / 2., fRichEntranceThickness / 2.); - TGeoConeSeg* op1 = new TGeoConeSeg("rich_entrance_PB_op1", richLenHalf, 0., fPipeOuterRadiusEntrance, 0., - fPipeOuterRadiusExit, 0., 360.); + double richFlangeHalfThickness = 5.; + + TGeoBBox* op_flange = new TGeoBBox("rich_entrance_PB_flange_op0", fRichEntranceWidth / 2. + richFlangeHalfThickness, + fRichEntranceHeight / 2. + richFlangeHalfThickness, 1.); + TGeoBBox* op1_flange = + new TGeoBBox("rich_entrance_PB_flange_op1", fRichEntranceWidth / 2., fRichEntranceHeight / 2., 2.); + TGeoBBox* op0 = new TGeoBBox("rich_entrance_PB_op0", fRichEntranceWidth / 2., fRichEntranceHeight / 2., + fRichEntranceThickness / 2.); + TGeoTube* op1 = new TGeoTube(0, fPipeOuterRadiusEntrance, richLenHalf * 1.01); TGeoTranslation* tr = MakeTrans(0., 0., richLenHalf - fRichEntranceThickness / 2.); + TGeoCompositeShape* pb_flange = MakeSubtraction("rich_entrance_PB_flange", op_flange, op1_flange, nullptr, nullptr); TGeoCompositeShape* pb = MakeSubtraction("rich_entrance_PB", op0, op1, nullptr, tr); - TGeoVolume* entrance = new TGeoVolume("rich_entrance", pb, fMaterials.GetMedium("kapton")); - if (fSetVolumeColors) entrance->SetLineColor(kGreen - 5); + TGeoVolume* entrance = new TGeoVolume("rich_entrance", pb_flange, fMaterials.GetMedium("aluminium")); + TGeoVolume* entrance_kapton = new TGeoVolume("rich_entrance_kapton", pb, fMaterials.GetMedium("kapton")); + entrance->AddNode(entrance_kapton, 1); + //if (fSetVolumeColors) entrance->SetLineColor(kGreen - 5); return entrance; } TGeoVolume* RichGeoCreator::CreateRichExit() { - double richHeightHalf = fRichHeight / 2.; - double richWidthHalf = fRichWidth / 2.; double richLenHalf = fRichLength / 2.; - - TGeoBBox* op0 = new TGeoBBox("rich_exit_PB_op0", richWidthHalf, richHeightHalf, fRichExitThickness / 2.); - TGeoConeSeg* op1 = - new TGeoConeSeg("rich_exit_PB_op1", richLenHalf, 0., fPipeOuterRadiusEntrance, 0., fPipeOuterRadiusExit, 0., 360.); - TGeoTranslation* tr = MakeTrans(0., 0., -richLenHalf + fRichExitThickness / 2.); + double richFlangeHalfThickness = 5.; + + TGeoBBox* op_flange = new TGeoBBox("rich_exit_PB_flange_op0", fRichExitWidth / 2. + richFlangeHalfThickness, + fRichExitHeight / 2. + richFlangeHalfThickness, 1.); + TGeoBBox* op1_flange = new TGeoBBox("rich_exit_PB_flange_op1", fRichExitWidth / 2., fRichExitHeight / 2., 2.); + TGeoBBox* op0 = new TGeoBBox("rich_exit_PB_op0", fRichExitWidth / 2., fRichExitHeight / 2., fRichExitThickness / 2.); + TGeoTube* op1 = new TGeoTube(0, fPipeOuterRadiusExit, richLenHalf * 1.01); + TGeoTranslation* tr = MakeTrans(0., 0., -richLenHalf + fRichExitThickness / 2.); + TGeoCompositeShape* pb_flange = MakeSubtraction("rich_exit_PB_flange", op_flange, op1_flange, nullptr, nullptr); TGeoCompositeShape* pb = MakeSubtraction("rich_exit_PB", op0, op1, nullptr, tr); - TGeoVolume* exit = new TGeoVolume("rich_exit", pb, fMaterials.GetMedium("kapton")); - if (fSetVolumeColors) exit->SetLineColor(kGreen - 5); + TGeoVolume* exit = new TGeoVolume("rich_exit", pb_flange, fMaterials.GetMedium("aluminium")); + TGeoVolume* exit_innerpart = new TGeoVolume("rich_exit_innerpart", pb, fMaterials.GetMedium("Polycarbonat")); + exit->AddNode(exit_innerpart, 1); + //if (fSetVolumeColors) exit->SetLineColor(kGreen - 5); return exit; } -TGeoVolume* RichGeoCreator::CreatePipe() +TGeoVolume* RichGeoCreator::CreatePipe() // now used for the beampipe tunnel { - double richLenHalf = fRichLength / 2; - TGeoConeSeg* pipePB = new TGeoConeSeg("rich_pipe_PB", richLenHalf, fPipeOuterRadiusEntrance - fPipeThicknessEntrance, + double pipeLenHalf = fPipeLength / 2; + TGeoConeSeg* pipePB = new TGeoConeSeg("rich_pipe_PB", pipeLenHalf, fPipeOuterRadiusEntrance - fPipeThicknessEntrance, fPipeOuterRadiusEntrance, fPipeOuterRadiusExit - fPipeThicknessExit, fPipeOuterRadiusExit, 0., 360.); - TGeoVolume* pipe = new TGeoVolume("rich_pipe", pipePB, fMaterials.GetMedium("aluminium")); - if (fSetVolumeColors) pipe->SetLineColor(kSpring + 4); + TGeoVolume* pipe = new TGeoVolume("rich_pipe", pipePB, fMaterials.GetMedium("carbon")); + //if (fSetVolumeColors) pipe->SetLineColor(kSpring + 4); return pipe; } @@ -680,8 +850,8 @@ TGeoVolume* RichGeoCreator::CreatePipeCyl() new TGeoTubeSeg("rich_cyl_pipe_PB", 0., fPipeOuterRadiusEntrance, fPipeCylPartLen / 2., 0., 360.); TGeoVolume* pipeCylVac = new TGeoVolume("rich_cyl_pipe_vac", pipeCylVacPB, fMaterials.GetMedium("vacuum")); TGeoVolume* pipeCyl = new TGeoVolume("rich_cyl_pipe", pipeCylPB, fMaterials.GetMedium("aluminium")); - if (fSetVolumeColors) pipeCylVac->SetLineColor(kSpring + 5); - if (fSetVolumeColors) pipeCyl->SetLineColor(kSpring + 4); + //if (fSetVolumeColors) pipeCylVac->SetLineColor(kSpring + 5); + //if (fSetVolumeColors) pipeCyl->SetLineColor(kSpring + 4); pipeCyl->AddNode(pipeCylVac, 1); return pipeCyl; } @@ -716,22 +886,25 @@ void RichGeoCreator::CreateRich() rich_gas->AddNode(pillars, 1); TGeoVolume* sensPlane = CreateSensitivePlane(); - rich_gas->AddNode(sensPlane, 1, MakeTrans(0., 0., -30.)); + rich_gas->AddNode(sensPlane, 1, MakeTrans(0., 0., fSensPlaneZ)); //-30.)); TGeoVolumeAssembly* mainFrame = CreateMainFrame(); rich_gas->AddNode(mainFrame, 1, MakeTrans(0., 0., 38.541939)); if (fAddShieldingBox) { - TGeoVolumeAssembly* schieldingBox = CreateSchieldingBox(); - double schieldingBoxZ = -(fRichEntranceThickness - fRichExitThickness / 2. + fRichOrigZ + richLenHalf); - rich_gas->AddNode(schieldingBox, 1, MakeTrans(0., 0., schieldingBoxZ)); - rich_gas->AddNode(schieldingBox, 2, MakeCombiTrans(0., 0., schieldingBoxZ, 0., 0., 180.)); + TGeoVolumeAssembly* shieldingBox = CreateShieldingBox(); + double shieldingBoxZ = -(fRichEntranceThickness - fRichExitThickness / 2. + fRichOrigZ + richLenHalf); + rich_gas->AddNode(shieldingBox, 1, MakeTrans(0., 0., shieldingBoxZ)); + rich_gas->AddNode(shieldingBox, 2, MakeCombiTrans(0., 0., shieldingBoxZ, 0., 0., 180.)); } + rich_gas->AddNode(CreateRichEntrance(), 1, MakeTrans(0., 0., -richLenHalf + fRichExitThickness / 2.)); + rich_gas->AddNode(CreateRichExit(), 1, MakeTrans(0., 0., richLenHalf - fRichEntranceThickness / 2.)); + TGeoVolume* richCont = CreateRichContainer(); richCont->AddNode(rich_gas, 1, MakeTrans(0., 0., (fRichEntranceThickness - fRichExitThickness) / 2.)); - richCont->AddNode(CreateRichEntrance(), 1, MakeTrans(0., 0., -richLenHalf + fRichEntranceThickness / 2.)); - richCont->AddNode(CreateRichExit(), 1, MakeTrans(0., 0., richLenHalf - fRichExitThickness / 2.)); + //richCont->AddNode(CreateRichEntrance(), 1, MakeTrans(0., 0., -richLenHalf + fRichEntranceThickness / 2.)); + //richCont->AddNode(CreateRichExit(), 1, MakeTrans(0., 0., richLenHalf - fRichExitThickness / 2.)); richCont->AddNode(CreatePipe(), 1); TGeoVolumeAssembly* rich = new TGeoVolumeAssembly(fGeoName.c_str()); @@ -750,14 +923,14 @@ void RichGeoCreator::CreateRich() gGeoManager->Test(); string outputFile = fGeoName + ".geo.root"; - top->Export(outputFile.c_str()); + top->Export((outputFile + "?reproducible").c_str()); LOG(info) << "Geometry file: " << outputFile; - top->Draw("ogl"); + //top->Draw("ogl"); gGeoManager->SetVisLevel(7); } -TGeoVolumeAssembly* RichGeoCreator::CreateSchieldingBox() +TGeoVolumeAssembly* RichGeoCreator::CreateShieldingBox() { // When converting GDML to root please look https://root.cern.ch/root/html520/src/TGDMLParse.cxx.htm // Shielding box is created using a number of boolean operations with shapes @@ -789,7 +962,7 @@ TGeoVolumeAssembly* RichGeoCreator::CreateSchieldingBox() MakeSubtraction("box15", box13, box14, nullptr, MakeCombiTrans(0., 181.2639, -59.75, -41.3565, 0., 0.)); TGeoVolume* shBox = new TGeoVolume("shielding_box", box15, fMaterials.GetMedium("iron")); - if (fSetVolumeColors) shBox->SetLineColor(kBlue + 4); + //if (fSetVolumeColors) shBox->SetLineColor(kBlue + 4); // Wing part TGeoBBox* wing1 = new TGeoBBox("wing1", 117.0 / 2., 8.9571 / 2., 13.7221 / 2.); @@ -802,7 +975,7 @@ TGeoVolumeAssembly* RichGeoCreator::CreateSchieldingBox() MakeSubtraction("wing5", wing3, wing4, nullptr, MakeCombiTrans(-49.9989, 0., 3.206, 0., -18.90578, 0.)); TGeoVolume* wing = new TGeoVolume("shieling_wing", wing5, fMaterials.GetMedium("iron")); - if (fSetVolumeColors) wing->SetLineColor(kBlue - 1); + //if (fSetVolumeColors) wing->SetLineColor(kBlue - 1); TGeoVolumeAssembly* shBoxFinal = new TGeoVolumeAssembly("shielding_box"); shBoxFinal->AddNode(shBox, 1, MakeCombiTrans(0., 240.7246, 79.4162, 68.06551, 0., -180.0)); diff --git a/sim/detectors/rich/geo/RichGeoCreator.h b/sim/detectors/rich/geo/RichGeoCreator.h index 141861d22c195d230b8c1bf9de1be11c7c5b5340..ed8fa49d4af4be1c8d00dd19954fb84254a742ca 100644 --- a/sim/detectors/rich/geo/RichGeoCreator.h +++ b/sim/detectors/rich/geo/RichGeoCreator.h @@ -1,6 +1,11 @@ -/* Copyright (C) 2022-2022 UGiessen/GSI, Giessen/Darmstadt +/* Copyright (C) 2022-2024 UGiessen/GSI, Giessen/Darmstadt SPDX-License-Identifier: GPL-3.0-only - Authors: Semen Lebedev [committer] */ + Authors: Semen Lebedev [committer], Simon Neuhaus */ + +/* to generate geometry version v22a use version of this file and RichGeoCreator.cxx from commit bed4c932 + to generate geometry version v23a use version of this file and RichGeoCreator.cxx from commit c25124a0 + to generate geometry version v24a use version of this file and RichGeoCreator.cxx from commit current version (update at some point) +*/ #ifndef RICH_GEO_CREATOR #define RICH_GEO_CREATOR @@ -29,13 +34,13 @@ public: void Create(); void SetGeoName(const std::string& geoName) { fGeoName = geoName; } - void SetAddShieldingBox(bool addSchildingBox) { fAddShieldingBox = addSchildingBox; } + void SetAddShieldingBox(bool addShildingBox) { fAddShieldingBox = addShildingBox; } void SetVolumeColors(bool setVolumeColors) { fSetVolumeColors = setVolumeColors; } private: RichGeoMaterials fMaterials; - std::string fGeoName = "rich_v23a"; + std::string fGeoName = "rich_v24a"; bool fAddShieldingBox = true; bool fSetVolumeColors = false; @@ -43,21 +48,27 @@ private: double fDegToRad = 1.74532925199433E-02; double fRichOrigZ = 180.; //cm double fAccAngle = 25.; //deg - double fRichLength = 190.; //cm - double fRichHeight = 500.; //cm - double fRichWidth = 526.8; //cm - double fRichEntranceY = 180.; //cm + double fRichLength = 220.; //cm + double fRichHeight = 501.7; //cm + double fRichWidth = 600; //cm double fRichCoveringThickness = 0.5; //cm - double fRichEntranceThickness = 0.025; //cm - double fRichExitThickness = 0.5; //cm double fRichAddZ = 20.; //cm + // Entrance & Exit parameters + double fRichEntranceWidth = 260.; //cm + double fRichEntranceHeight = 175.; //cm + double fRichEntranceThickness = 0.025; //cm + double fRichExitWidth = 569.; //cm + double fRichExitHeight = 384.; //cm + double fRichExitThickness = 1; //cm + // Pipe parameters - double fPipeOuterRadiusEntrance = 7.42; //cm - double fPipeThicknessEntrance = 0.148; //cm - double fPipeOuterRadiusExit = 16.16; //cm - double fPipeThicknessExit = 0.32; //cm - double fPipeCylPartLen = 10.0; //cm + double fPipeOuterRadiusEntrance = 16.4; //cm + double fPipeThicknessEntrance = 0.3; //cm //in CAD 2mm with overlap regions with thickness 4.04mm + double fPipeOuterRadiusExit = 29.9; //cm + double fPipeThicknessExit = fPipeThicknessEntrance; //cm + double fPipeCylPartLen = 10.0; //cm + double fPipeLength = fRichLength + 0.5; //cm // Mirror parameters double fMirrorRadius = 300.; //cm @@ -70,7 +81,7 @@ private: double fMirrorThetaStep = 8.1625; //deg double fMirrorThetaGap = 0.0745; //deg double fMirrorSupportAdd = 4.5; //cm - double fMirrorGapY = 0.1; // cm + double fMirrorGapY = 0.1; //cm // PMT parameters int fNofPixels = 8; @@ -87,7 +98,7 @@ private: double fCameraTouchWidth = 15.75; //cm // Sensitive plane parameters - double fSensPlaneZ = -70.; //cm + double fSensPlaneZ = -30.; //70.; //cm // Calculated parameters. These parameters are calculated in CalculateParams() double fCameraFullRotX = 0.; @@ -115,10 +126,12 @@ private: TGeoVolume* CreateRichExit(); TGeoVolume* CreatePipe(); TGeoVolume* CreatePipeCyl(); - TGeoVolumeAssembly* CreateSchieldingBox(); + TGeoVolumeAssembly* CreateShieldingBox(); TGeoVolumeAssembly* CreateBeltAssembly(); TGeoVolumeAssembly* CreateMirrorSupportBelts(); TGeoVolumeAssembly* CreateMirrorSupportPillars(); + TGeoVolume* CreateStuds(double zpos, double lenHalf, double angle); + TGeoVolume* CreatePillarConnection(); void CreateRich(); diff --git a/sim/detectors/rich/geo/RichGeoMaterials.h b/sim/detectors/rich/geo/RichGeoMaterials.h index fb6845c2539ac636e2f5e48449d598dc7b0c1a76..472edd8c12cb0c7b160d4acf1d187136f31621a9 100644 --- a/sim/detectors/rich/geo/RichGeoMaterials.h +++ b/sim/detectors/rich/geo/RichGeoMaterials.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2022-2022 UGiessen/GSI, Giessen/Darmstadt +/* Copyright (C) 2022-2024 UGiessen/GSI, Giessen/Darmstadt SPDX-License-Identifier: GPL-3.0-only - Authors: Semen Lebedev [committer] */ + Authors: Semen Lebedev [committer], Simon Neuhaus */ #ifndef RICH_GEO_MATERIALS #define RICH_GEO_MATERIALS @@ -43,6 +43,8 @@ public: fMediums["kapton"] = InitMedium("kapton"); fMediums["iron"] = InitMedium("iron"); fMediums["RICHgas_CO2_dis+"] = InitMedium("RICHgas_CO2_dis+"); + fMediums["Polycarbonat"] = InitMedium("RICH_Polycarbonat"); + fMediums["carbon"] = InitMedium("carbon"); } TGeoMedium* GetMedium(const std::string& name)