43 const std::string motherName)
44 : mNTiles{nTilesPhi}, mPosId{rPosId}, mRadThickness{radThick}
46 TGeoManager* geoManager = gGeoManager;
47 TGeoVolume* motherVolume = geoManager->GetVolume(motherName.c_str());
48 TGeoMedium* medAerogel = gGeoManager->GetMedium(
"RCH_AEROGEL$");
50 LOGP(fatal,
"RICH: Aerogel medium not found");
52 TGeoMedium* medSi = gGeoManager->GetMedium(
"RCH_SILICON$");
54 LOGP(fatal,
"RICH: Silicon medium not found");
56 TGeoMedium* medAr = gGeoManager->GetMedium(
"RCH_ARGON$");
58 LOGP(fatal,
"RICH: Argon medium not found");
60 std::vector<TGeoArb8*> radiatorTiles(nTilesPhi), photoTiles(nTilesPhi), argonSectors(nTilesPhi);
61 LOGP(info,
"Creating ring: id: {} with {} tiles. ", rPosId, nTilesPhi);
62 LOGP(info,
"Rmin: {} Rmax: {} RadThick: {} RadYmin: {} RadYmax: {} RadZ: {} PhotThick: {} PhotYmin: {} PhotYmax: {} PhotZ: {}, zTransRad: {}, zTransPhot: {}, ThetaB: {}",
63 rMin, rMax, radThick, radYmin, radYmax, radZ, photThick, photYmin, photYmax, photZ, radRad0, photR0, thetaB);
65 float deltaPhiDeg = 360.0 / nTilesPhi;
66 float thetaBDeg = thetaB * 180.0 / TMath::Pi();
67 int radTileCount{0}, photTileCount{0}, argSectorsCount{0};
69 for (
auto& radiatorTile : radiatorTiles) {
74 radiatorTile =
new TGeoArb8(radThick / 2);
75 radiatorTile->SetVertex(0, radZ / 2, -radYmin / 2);
76 radiatorTile->SetVertex(1, -radZ / 2, -radYmax / 2);
77 radiatorTile->SetVertex(2, -radZ / 2, radYmax / 2);
78 radiatorTile->SetVertex(3, radZ / 2, radYmin / 2);
79 radiatorTile->SetVertex(4, radZ / 2, -radYmin / 2);
80 radiatorTile->SetVertex(5, -radZ / 2, -radYmax / 2);
81 radiatorTile->SetVertex(6, -radZ / 2, radYmax / 2);
82 radiatorTile->SetVertex(7, radZ / 2, radYmin / 2);
84 TGeoVolume* radiatorTileVol =
new TGeoVolume(Form(
"radTile_%d_%d", rPosId, radTileCount), radiatorTile, medAerogel);
85 radiatorTileVol->SetLineColor(kOrange - 8);
86 radiatorTileVol->SetLineWidth(1);
88 auto* rotRadiator =
new TGeoRotation(Form(
"radTileRotation_%d_%d", radTileCount, rPosId));
89 rotRadiator->RotateY(90.0 - thetaBDeg);
90 rotRadiator->RotateZ(radTileCount * deltaPhiDeg);
92 auto* rotTransRadiator =
new TGeoCombiTrans(radRad0 * TMath::Cos(radTileCount * TMath::Pi() / (nTilesPhi / 2)),
93 radRad0 * TMath::Sin(radTileCount * TMath::Pi() / (nTilesPhi / 2)),
94 radRad0 * TMath::Tan(thetaB),
97 motherVolume->AddNode(radiatorTileVol, 1, rotTransRadiator);
102 for (
auto& photoTile : photoTiles) {
104 photoTile =
new TGeoArb8(photThick / 2);
105 photoTile->SetVertex(0, photZ / 2, -photYmin / 2);
106 photoTile->SetVertex(1, -photZ / 2, -photYmax / 2);
107 photoTile->SetVertex(2, -photZ / 2, photYmax / 2);
108 photoTile->SetVertex(3, photZ / 2, photYmin / 2);
109 photoTile->SetVertex(4, photZ / 2, -photYmin / 2);
110 photoTile->SetVertex(5, -photZ / 2, -photYmax / 2);
111 photoTile->SetVertex(6, -photZ / 2, photYmax / 2);
112 photoTile->SetVertex(7, photZ / 2, photYmin / 2);
115 photoTileVol->SetLineColor(kOrange - 8);
116 photoTileVol->SetLineWidth(1);
118 auto* rotPhoto =
new TGeoRotation(Form(
"photoTileRotation_%d_%d", photTileCount, rPosId));
119 rotPhoto->RotateY(90.0 - thetaBDeg);
120 rotPhoto->RotateZ(photTileCount * deltaPhiDeg);
121 auto* rotTransPhoto =
new TGeoCombiTrans(photR0 * TMath::Cos(photTileCount * TMath::Pi() / (nTilesPhi / 2)),
122 photR0 * TMath::Sin(photTileCount * TMath::Pi() / (nTilesPhi / 2)),
123 photR0 * TMath::Tan(thetaB),
126 motherVolume->AddNode(photoTileVol, 1, rotTransPhoto);
131 for (
auto& argonSector : argonSectors) {
132 float separation{(aerDetDistance - radThick - photThick)};
133 auto* radiator = radiatorTiles[argSectorsCount];
134 auto* photosensor = photoTiles[argSectorsCount];
135 argonSector =
new TGeoArb8(separation / 2);
137 argonSector->SetVertex(0, -photZ / 2, -photYmin / 2);
138 argonSector->SetVertex(1, -photZ / 2, photYmin / 2);
139 argonSector->SetVertex(2, photZ / 2, photYmax / 2);
140 argonSector->SetVertex(3, photZ / 2, -photYmax / 2);
141 argonSector->SetVertex(4, -radZ / 2, -radYmin / 2);
142 argonSector->SetVertex(5, -radZ / 2, radYmin / 2);
143 argonSector->SetVertex(6, radZ / 2, radYmax / 2);
144 argonSector->SetVertex(7, radZ / 2, -radYmax / 2);
146 TGeoVolume* argonSectorVol =
new TGeoVolume(Form(
"argonSector_%d_%d", rPosId, argSectorsCount), argonSector, medAr);
147 argonSectorVol->SetVisibility(kTRUE);
148 argonSectorVol->SetLineColor(kOrange - 8);
149 argonSectorVol->SetLineWidth(1);
150 auto* rotArgon =
new TGeoRotation(Form(
"argonSectorRotation_%d_%d", argSectorsCount, rPosId));
151 rotArgon->RotateY(-90 - thetaBDeg);
152 rotArgon->RotateZ(argSectorsCount * deltaPhiDeg);
153 auto* rotTransArgon =
new TGeoCombiTrans((radRad0 + TMath::Cos(thetaB) * (separation + radThick) / 2) * TMath::Cos(argSectorsCount * TMath::Pi() / (nTilesPhi / 2)),
154 (radRad0 + TMath::Cos(thetaB) * (separation + radThick) / 2) * TMath::Sin(argSectorsCount * TMath::Pi() / (nTilesPhi / 2)),
155 radRad0 * TMath::Tan(thetaB) + TMath::Sin(thetaB) * (separation + radThick) / 2,
157 motherVolume->AddNode(argonSectorVol, 1, rotTransArgon);