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) {
70 radiatorTile =
new TGeoArb8(radZ / 2);
71 radiatorTile->SetVertex(0, -radThick / 2, -radYmin / 2);
72 radiatorTile->SetVertex(1, -radThick / 2, radYmin / 2);
73 radiatorTile->SetVertex(2, radThick / 2, radYmin / 2);
74 radiatorTile->SetVertex(3, radThick / 2, -radYmin / 2);
75 radiatorTile->SetVertex(4, -radThick / 2, -radYmax / 2);
76 radiatorTile->SetVertex(5, -radThick / 2, radYmax / 2);
77 radiatorTile->SetVertex(6, radThick / 2, radYmax / 2);
78 radiatorTile->SetVertex(7, radThick / 2, -radYmax / 2);
80 TGeoVolume* radiatorTileVol =
new TGeoVolume(Form(
"radTile_%d_%d", rPosId, radTileCount), radiatorTile, medAerogel);
81 radiatorTileVol->SetLineColor(kOrange - 8);
82 radiatorTileVol->SetLineWidth(1);
84 auto* rotRadiator =
new TGeoRotation(Form(
"radTileRotation_%d_%d", radTileCount, rPosId));
85 rotRadiator->RotateY(-thetaBDeg);
86 rotRadiator->RotateZ(radTileCount * deltaPhiDeg);
88 auto* rotTransRadiator =
new TGeoCombiTrans(radRad0 * TMath::Cos(radTileCount * TMath::Pi() / (nTilesPhi / 2)),
89 radRad0 * TMath::Sin(radTileCount * TMath::Pi() / (nTilesPhi / 2)),
90 radRad0 * TMath::Tan(thetaB),
93 motherVolume->AddNode(radiatorTileVol, 1, rotTransRadiator);
98 for (
auto& photoTile : photoTiles) {
99 photoTile =
new TGeoArb8(photZ / 2);
100 photoTile->SetVertex(0, -photThick / 2, -photYmin / 2);
101 photoTile->SetVertex(1, -photThick / 2, photYmin / 2);
102 photoTile->SetVertex(2, photThick / 2, photYmin / 2);
103 photoTile->SetVertex(3, photThick / 2, -photYmin / 2);
104 photoTile->SetVertex(4, -photThick / 2, -photYmax / 2);
105 photoTile->SetVertex(5, -photThick / 2, photYmax / 2);
106 photoTile->SetVertex(6, photThick / 2, photYmax / 2);
107 photoTile->SetVertex(7, photThick / 2, -photYmax / 2);
109 TGeoVolume* photoTileVol =
new TGeoVolume(Form(
"photoTile_%d_%d", rPosId, photTileCount), photoTile, medSi);
110 photoTileVol->SetLineColor(kOrange - 8);
111 photoTileVol->SetLineWidth(1);
113 auto* rotPhoto =
new TGeoRotation(Form(
"photoTileRotation_%d_%d", photTileCount, rPosId));
114 rotPhoto->RotateY(-thetaBDeg);
115 rotPhoto->RotateZ(photTileCount * deltaPhiDeg);
116 auto* rotTransPhoto =
new TGeoCombiTrans(photR0 * TMath::Cos(photTileCount * TMath::Pi() / (nTilesPhi / 2)),
117 photR0 * TMath::Sin(photTileCount * TMath::Pi() / (nTilesPhi / 2)),
118 photR0 * TMath::Tan(thetaB),
121 motherVolume->AddNode(photoTileVol, 1, rotTransPhoto);
126 for (
auto& argonSector : argonSectors) {
127 float separation{(aerDetDistance - radThick - photThick)};
128 auto* radiator = radiatorTiles[argSectorsCount];
129 auto* photosensor = photoTiles[argSectorsCount];
130 argonSector =
new TGeoArb8(separation / 2);
132 argonSector->SetVertex(0, -photZ / 2, -photYmin / 2);
133 argonSector->SetVertex(1, -photZ / 2, photYmin / 2);
134 argonSector->SetVertex(2, photZ / 2, photYmax / 2);
135 argonSector->SetVertex(3, photZ / 2, -photYmax / 2);
136 argonSector->SetVertex(4, -radZ / 2, -radYmin / 2);
137 argonSector->SetVertex(5, -radZ / 2, radYmin / 2);
138 argonSector->SetVertex(6, radZ / 2, radYmax / 2);
139 argonSector->SetVertex(7, radZ / 2, -radYmax / 2);
141 TGeoVolume* argonSectorVol =
new TGeoVolume(Form(
"argonSector_%d_%d", rPosId, argSectorsCount), argonSector, medAr);
142 argonSectorVol->SetVisibility(kTRUE);
143 argonSectorVol->SetLineColor(kOrange - 8);
144 argonSectorVol->SetLineWidth(1);
145 auto* rotArgon =
new TGeoRotation(Form(
"argonSectorRotation_%d_%d", argSectorsCount, rPosId));
146 rotArgon->RotateY(-90 - thetaBDeg);
147 rotArgon->RotateZ(argSectorsCount * deltaPhiDeg);
148 auto* rotTransArgon =
new TGeoCombiTrans((radRad0 + TMath::Cos(thetaB) * (separation + radThick) / 2) * TMath::Cos(argSectorsCount * TMath::Pi() / (nTilesPhi / 2)),
149 (radRad0 + TMath::Cos(thetaB) * (separation + radThick) / 2) * TMath::Sin(argSectorsCount * TMath::Pi() / (nTilesPhi / 2)),
150 radRad0 * TMath::Tan(thetaB) + TMath::Sin(thetaB) * (separation + radThick) / 2,
152 motherVolume->AddNode(argonSectorVol, 1, rotTransArgon);