76 const float kDegRad = TMath::Pi() / 180.;
78 TGeoRotation* rot180 =
new TGeoRotation(
"rot180", 90., 180., 90., 90., 180., 0.);
79 TGeoRotation* rotyz =
new TGeoRotation(
"rotyz", 90., 180., 0., 180., 90., 90.);
80 TGeoRotation* rotxz =
new TGeoRotation(
"rotxz", 0., 0., 90., 90., 90., 180.);
87 const TGeoMedium* kMedBe = matmgr.getTGeoMedium(
"ALICE3_PIPE_BE");
88 const TGeoMedium* kMedVac = matmgr.getTGeoMedium(
"ALICE3_PIPE_VACUUM");
91 TGeoVolume*
top = gGeoManager->GetVolume(
"cave");
92 TGeoVolume* barrel = gGeoManager->GetVolume(
"barrel");
94 LOG(fatal) <<
"Could not find the top volume";
104 Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength;
105 Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength;
106 TGeoTube* vacuumBasePipe =
new TGeoTube(
"PIPEVACUUM_BASEsh", 0., mPipeRIn, mA3IPLength / 2.);
107 TGeoTube* vacuumBaseVacuumVessel =
new TGeoTube(
"VACUUM_VESSELVACUUM_BASEsh", mPipeRIn, mVacuumVesselRIn, pipeCSideLength / 2.);
109 TGeoTranslation* posPipeCSide =
new TGeoTranslation(
"PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength - pipeCSideLength / 2.);
110 posPipeCSide->RegisterYourself();
113 TGeoCompositeShape* vacuumComposite;
114 TGeoVolume* vacuumVolume;
115 TString compositeFormula{
"PIPEVACUUM_BASEsh+VACUUM_VESSELVACUUM_BASEsh:PIPE_CSIDE_POSITION"};
116 TString subtractorsFormula;
118 if (!mIsTRKActivated) {
119 std::vector<TGeoTube*> trkLayerShapes;
121 std::vector<std::array<float, 3>> layersQuotas = {std::array<float, 3>{0.5f, 50.f, 100.e-4},
122 std::array<float, 3>{1.2f, 50.f, 100.e-4},
123 std::array<float, 3>{2.5f, 50.f, 100.e-4}};
125 for (
auto iLayer{0}; iLayer < layersQuotas.size(); ++iLayer) {
126 auto& layerData = layersQuotas[iLayer];
127 trkLayerShapes.emplace_back(
new TGeoTube(Form(
"TRKLAYER_%dsh", iLayer), layerData[0], layerData[0] + layerData[2], layerData[1] / 2.));
129 subtractorsFormula +=
"+";
131 subtractorsFormula += Form(
"TRKLAYER_%dsh", iLayer);
135 float coldplateRIn = 2.6f;
136 float coldplateThick = 150.e-3;
137 float coldplateLength = 50.f;
138 float irisVacuumVesselInnerRIn = 0.48f;
139 float irisVacuumVesselOuterRIn = coldplateRIn + coldplateThick;
140 float irisVacuumVesselLength = 70.f;
141 float irisVacuumVesselThick = 150.e-4;
144 TGeoTube* coldPlate =
new TGeoTube(
"TRK_COLDPLATEsh", coldplateRIn, coldplateRIn + coldplateThick, coldplateLength / 2.);
145 subtractorsFormula +=
"+TRK_COLDPLATEsh";
147 TGeoTube* irisVacuumVesselInner =
new TGeoTube(
"TRK_IRISVACUUMVESSELINNERsh", irisVacuumVesselInnerRIn, irisVacuumVesselInnerRIn + irisVacuumVesselThick, irisVacuumVesselLength / 2.);
148 subtractorsFormula +=
"+TRK_IRISVACUUMVESSELINNERsh";
150 TGeoTube* irisVacuumVesselOuter =
new TGeoTube(
"TRK_IRISVACUUMVESSELOUTERsh", irisVacuumVesselOuterRIn, irisVacuumVesselOuterRIn + irisVacuumVesselThick, irisVacuumVesselLength / 2.);
151 subtractorsFormula +=
"+TRK_IRISVACUUMVESSELOUTERsh";
153 TGeoTube* irisVacuumVesselWall =
new TGeoTube(
"TRK_IRISVACUUMVESSELWALLsh", irisVacuumVesselInnerRIn, irisVacuumVesselOuterRIn + irisVacuumVesselThick, irisVacuumVesselThick / 2.);
154 TGeoTranslation* posIrisVacVWallNegZSide =
new TGeoTranslation(
"IRISWALLNEGZ", 0., 0., -irisVacuumVesselLength / 2. - irisVacuumVesselThick / 2.);
155 posIrisVacVWallNegZSide->RegisterYourself();
156 subtractorsFormula +=
"+TRK_IRISVACUUMVESSELWALLsh:IRISWALLNEGZ";
158 TGeoTranslation* posIrisVacVWallPosZSide =
new TGeoTranslation(
"IRISWALLPOSZ", 0., 0., irisVacuumVesselLength / 2. + irisVacuumVesselThick / 2.);
159 posIrisVacVWallPosZSide->RegisterYourself();
160 subtractorsFormula +=
"+TRK_IRISVACUUMVESSELWALLsh:IRISWALLPOSZ";
163 if (!mIsFT3Activated) {
164 std::vector<TGeoTube*> ft3DiscShapes;
165 std::vector<TGeoTranslation*> ft3DiscPositions;
167 std::vector<std::array<float, 4>> discsQuotas = {std::array<float, 4>{0.5f, 2.5f, 100.e-4, 26.},
168 std::array<float, 4>{0.5f, 2.5f, 100.e-4, 30.},
169 std::array<float, 4>{0.5f, 2.5f, 100.e-4, 34.},
170 std::array<float, 4>{0.5f, 2.5f, 100.e-4, -26.},
171 std::array<float, 4>{0.5f, 2.5f, 100.e-4, -30.},
172 std::array<float, 4>{0.5f, 2.5f, 100.e-4, -34.}};
173 TString tempSubtractorsFormula =
"";
174 if (!mIsTRKActivated) {
175 tempSubtractorsFormula =
"+";
177 for (
auto iDisc{0}; iDisc < discsQuotas.size(); ++iDisc) {
178 auto& discData = discsQuotas[iDisc];
179 ft3DiscShapes.emplace_back(
new TGeoTube(Form(
"FT3DISC_%dsh", iDisc), discData[0], discData[1], discData[2] / 2.));
180 ft3DiscPositions.emplace_back(
new TGeoTranslation(Form(
"t%d", iDisc), 0., 0., discData[3]));
181 ft3DiscPositions[iDisc]->RegisterYourself();
183 tempSubtractorsFormula +=
"+";
185 tempSubtractorsFormula += Form(
"FT3DISC_%dsh:t%d", iDisc, iDisc);
187 subtractorsFormula += tempSubtractorsFormula;
191 TGeoTube* pipeASide =
new TGeoTube(
"PIPE_Ash", mPipeRIn, mPipeRIn + mPipeThick, pipeASideLength / 2.);
192 TGeoTube* pipeCSide =
new TGeoTube(
"PIPE_Csh", mVacuumVesselRIn, mVacuumVesselRIn + mVacuumVesselThick, pipeCSideLength / 2.);
193 TGeoTube* vacuumVesselWall =
new TGeoTube(
"VACUUM_VESSEL_WALLsh", mPipeRIn, mVacuumVesselRIn + mVacuumVesselThick, mVacuumVesselThick / 2.);
196 TGeoTranslation* posVacuumVesselWall =
new TGeoTranslation(
"WALL_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick / 2.);
197 posVacuumVesselWall->RegisterYourself();
198 TGeoTranslation* posPipeASide =
new TGeoTranslation(
"PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick + pipeASideLength / 2.);
199 posPipeASide->RegisterYourself();
202 TString pipeCompositeFormula =
203 "VACUUM_VESSEL_WALLsh:WALL_POSITION"
204 "+PIPE_Ash:PIPE_ASIDE_POSITION"
205 "+PIPE_Csh:PIPE_CSIDE_POSITION";
207 if (subtractorsFormula.Length()) {
208 LOG(info) <<
"Subtractors formula before : " << subtractorsFormula;
209 subtractorsFormula = Form(
"-(%s)", subtractorsFormula.Data());
210 LOG(info) <<
"Subtractors formula after: " << subtractorsFormula;
212 vacuumComposite =
new TGeoCompositeShape(
"VACUUM_BASEsh", (compositeFormula + subtractorsFormula).Data());
213 vacuumVolume =
new TGeoVolume(
"VACUUM_BASE", vacuumComposite, kMedVac);
215 vacuumComposite =
new TGeoCompositeShape(
"VACUUM_BASEsh", compositeFormula.Data());
216 vacuumVolume =
new TGeoVolume(
"VACUUM_BASE", vacuumComposite, kMedVac);
219 TGeoCompositeShape* pipeComposite =
new TGeoCompositeShape(
"A3IPsh", pipeCompositeFormula);
220 TGeoVolume* pipeVolume =
new TGeoVolume(
"A3IP", pipeComposite, kMedBe);
223 barrel->AddNode(vacuumVolume, 1,
new TGeoTranslation(0, 30.f, 0));
224 barrel->AddNode(pipeVolume, 1,
new TGeoTranslation(0, 30.f, 0));
226 vacuumVolume->SetLineColor(kGreen + 3);
227 pipeVolume->SetLineColor(kGreen + 3);