14#include <TGeoVolume.h>
15#include <TGeoMatrix.h>
19#include <TGeoCompositeShape.h>
23#include "TGeoManager.h"
33static std::vector<VDSensorDesc> gVDSensors;
40 gVDSensors.push_back({volName, petal, region,
type, idx});
43static inline std::string makeSensorName(
const std::string& layerName,
int layerNumber)
52inline bool isSolidToCut(
const TGeoVolume*
v)
54 const char* nm =
v->GetName();
55 const char* med =
v->GetMedium() ?
v->GetMedium()->GetName() :
"";
57 if (med && strcmp(med,
"TRK_SILICON$") == 0) {
61 if (TString(nm).BeginsWith(
"VD_InnerWallArc")) {
64 if (TString(nm).BeginsWith(
"VD_OuterWallArc")) {
67 if (TString(nm).BeginsWith(
"VD_SideWall")) {
70 if (TString(nm).BeginsWith(
"VD_InnerWallCyl")) {
73 if (TString(nm).BeginsWith(
"VD_OuterWallCyl")) {
76 if (TString(nm).Contains(
"_Coldplate")) {
79 if (TString(nm).BeginsWith(
"IRIS_Service_Neg")) {
82 if (TString(nm).BeginsWith(
"IRIS_Service_Pos_InVac")) {
89inline const char* ensureShapeName(TGeoVolume*
v)
91 auto* sh =
v->GetShape();
92 TString nm = sh->GetName();
93 if (nm.IsNull() || nm.BeginsWith(
"TGeo")) {
94 TString wanted = TString(
v->GetName()) +
"_sh";
97 TString cand = wanted;
98 auto* shapes = gGeoManager ? gGeoManager->GetListOfShapes() :
nullptr;
99 while (shapes && shapes->FindObject(cand)) {
100 cand = Form(
"%s_%d", wanted.Data(), ++k);
103 if (shapes && !shapes->FindObject(cand)) {
107 return sh->GetName();
111static TString gPetalSolidsFormula;
112static int gLocalTrIdx = 0;
115inline void appendLocalTerm(
const char* shapeName,
const TGeoHMatrix& H)
117 auto* ct =
new TGeoCombiTrans(H);
118 ct->SetName(Form(
"IRIS_LOC_TR_%d", gLocalTrIdx++));
119 ct->RegisterYourself();
120 if (!gPetalSolidsFormula.IsNull()) {
121 gPetalSolidsFormula +=
"+";
123 gPetalSolidsFormula += TString::Format(
"%s:%s", shapeName, ct->GetName());
127void traversePetalLocal(TGeoVolume* vol,
const TGeoHMatrix& prefix)
129 auto*
nodes = vol->GetNodes();
133 for (
int i = 0;
i <
nodes->GetEntriesFast(); ++
i) {
135 auto* childV =
node->GetVolume();
136 TGeoHMatrix H(prefix);
137 if (
auto*
m =
node->GetMatrix()) {
141 if (isSolidToCut(childV)) {
142 const char* shapeName = ensureShapeName(childV);
143 appendLocalTerm(shapeName, H);
145 traversePetalLocal(childV, H);
150inline void buildPetalSolidsComposite(TGeoVolume* petalAsm)
153 if (gGeoManager && gGeoManager->GetListOfShapes() && gGeoManager->GetListOfShapes()->FindObject(
"IRIS_PETAL_SOLIDSsh")) {
157 gPetalSolidsFormula.Clear();
161 traversePetalLocal(petalAsm, I);
163 if (gPetalSolidsFormula.IsNull()) {
164 LOGP(error,
"IRIS_PETAL_SOLIDSsh formula is empty; did not find solids in petal.");
168 LOGP(info,
"IRIS_PETAL_SOLIDSsh formula: {}", gPetalSolidsFormula.Data());
169 new TGeoCompositeShape(
"IRIS_PETAL_SOLIDSsh", gPetalSolidsFormula.Data());
173inline void buildIrisCutoutFromPetalSolid(
int nPetals)
175 auto* shps = gGeoManager->GetListOfShapes();
176 auto* base = shps ?
dynamic_cast<TGeoShape*
>(shps->FindObject(
"IRIS_PETAL_SOLIDSsh")) : nullptr;
178 LOGP(error,
"IRIS cutout: shape 'IRIS_PETAL_SOLIDSsh' not found.");
186 if (shps->FindObject(
"IRIS_CUTOUTsh")) {
189 LOGP(warning,
"IRIS cutout: 'IRIS_CUTOUTsh' already exists; overwriting by clone name reuse may be unsafe.");
192 auto* cut =
dynamic_cast<TGeoShape*
>(base->Clone(
"IRIS_CUTOUTsh"));
194 LOGP(error,
"IRIS cutout: failed to clone 'IRIS_PETAL_SOLIDSsh' to 'IRIS_CUTOUTsh'.");
198 LOGP(info,
"IRIS_CUTOUTsh created as clone of IRIS_PETAL_SOLIDSsh (nPetals=1).");
204 for (
int p = 0;
p < nPetals; ++
p) {
205 const double phi = (360.0 / nPetals) * (p + 0.5);
206 auto*
R =
new TGeoRotation();
208 auto*
RT =
new TGeoCombiTrans(0, 0, 0,
R);
209 RT->SetName(Form(
"IRIS_PETAL_ROT_%d", p));
210 RT->RegisterYourself();
215 cutFormula += Form(
"IRIS_PETAL_SOLIDSsh:%s",
RT->GetName());
218 LOGP(info,
"IRIS_CUTOUTsh formula: {}", cutFormula.Data());
219 auto* cut =
new TGeoCompositeShape(
"IRIS_CUTOUTsh", cutFormula.Data());
223 auto* cutCheck =
dynamic_cast<TGeoCompositeShape*
>(shps->FindObject(
"IRIS_CUTOUTsh"));
224 if (!cutCheck || !cutCheck->GetBoolNode()) {
225 LOGP(error,
"IRIS cutout sanity: IRIS_CUTOUTsh exists but parsing failed (no BoolNode).");
227 LOGP(info,
"IRIS cutout sanity: OK ({} petals).", nPetals);
234static constexpr double kX2X0 = 0.001f;
235static constexpr double kLenZ_cm = 50.0f;
238static constexpr double rL0_cm = 0.5f;
239static constexpr double rL1_cm = 1.2f;
240static constexpr double rL2_cm = 2.5f;
243static constexpr double kL0RectHeight_cm = 0.5f;
244static constexpr double kL0RectWidth_cm = 0.83f;
247static constexpr double diskRin_cm = 0.5f;
248static constexpr double diskRout_cm = 2.5f;
249static const double diskZ_cm[6] = {-34.0f, -30.0f, -26.0f, 26.0f, 30.0f, 34.0f};
252static constexpr double kPetalZ_cm = 70.0f;
253static constexpr double kWallThick_cm = 0.015f;
254static constexpr double kInnerWallRadius_cm = 0.48f;
255static constexpr double kOuterWallRadius_cm = 3.0f;
256static constexpr double kEps_cm = 1.e-4f;
259static constexpr double kColdplateRadius_cm = 2.6f;
260static constexpr double kColdplateThickness_cm = 0.15f;
261static constexpr double kColdplateZ_cm = 50.0f;
268inline double degFromArc(
double arc,
double radius)
271 return (radius > 0.f) ? (arc / radius) * TMath::RadToDeg() : 0.f;
281inline double phiSpanFromGap(
int nPetals,
double gap,
double radius)
283 if (nPetals <= 0 || radius <= 0.f) {
286 const double petalPhiDeg = 360.f / nPetals;
287 const double phi = petalPhiDeg - degFromArc(gap, radius);
288 return phi > 0.f ?
phi : 0.f;
295inline double phiSpanFromArc(
double arcLen,
double radius)
297 return (arcLen > 0.f && radius > 0.f) ? degFromArc(arcLen, radius) : 0.f;
300inline TGeoCombiTrans rotZ(
double phiDeg)
302 auto*
r =
new TGeoRotation();
303 r->RotateZ(
static_cast<Double_t
>(phiDeg));
304 return TGeoCombiTrans(0., 0., 0.,
r);
311static void addPetalWalls(TGeoVolume* petalAsm,
313 double outerRadius_cm = kOuterWallRadius_cm,
314 bool withSideWalls =
true,
315 bool fullCylindricalRadialWalls =
false)
318 LOGP(error,
"addPetalWalls: petalAsm is null");
323 const TGeoMedium* med = matmgr.getTGeoMedium(
"ALICE3_TRKSERVICES_ALUMINIUM5083");
326 LOGP(warning,
"Petal walls: ALICE3_TRKSERVICES_ALUMINIUM5083$ not found, walls not created.");
330 const double halfZ = 0.5 * kPetalZ_cm;
333 const double halfPhi = fullCylindricalRadialWalls ? 180.0 : 0.5 * (360.0 /
static_cast<double>(nPetals));
336 if (fullCylindricalRadialWalls) {
337 auto*
s =
new TGeoTube(
static_cast<Double_t
>(kInnerWallRadius_cm),
338 static_cast<Double_t
>(kInnerWallRadius_cm + kWallThick_cm),
339 static_cast<Double_t
>(halfZ));
340 auto*
v =
new TGeoVolume(
"VD_InnerWallCyl", s, med);
341 v->SetLineColor(kGray + 2);
342 v->SetTransparency(70);
343 petalAsm->AddNode(
v, 1);
345 auto*
s =
new TGeoTubeSeg(
static_cast<Double_t
>(kInnerWallRadius_cm),
346 static_cast<Double_t
>(kInnerWallRadius_cm + kWallThick_cm),
347 static_cast<Double_t
>(halfZ),
348 static_cast<Double_t
>(-halfPhi),
349 static_cast<Double_t
>(+halfPhi));
350 auto*
v =
new TGeoVolume(
"VD_InnerWallArc", s, med);
351 v->SetLineColor(kGray + 2);
352 v->SetTransparency(70);
353 petalAsm->AddNode(
v, 1);
357 if (fullCylindricalRadialWalls) {
358 auto*
s =
new TGeoTube(
static_cast<Double_t
>(outerRadius_cm),
359 static_cast<Double_t
>(outerRadius_cm + kWallThick_cm),
360 static_cast<Double_t
>(halfZ));
361 auto*
v =
new TGeoVolume(
"VD_OuterWallCyl", s, med);
362 v->SetLineColor(kGray + 2);
363 v->SetTransparency(70);
364 petalAsm->AddNode(
v, 1);
366 auto*
s =
new TGeoTubeSeg(
static_cast<Double_t
>(outerRadius_cm),
367 static_cast<Double_t
>(outerRadius_cm + kWallThick_cm),
368 static_cast<Double_t
>(halfZ),
369 static_cast<Double_t
>(-halfPhi),
370 static_cast<Double_t
>(+halfPhi));
371 auto*
v =
new TGeoVolume(
"VD_OuterWallArc", s, med);
372 v->SetLineColor(kGray + 2);
373 v->SetTransparency(70);
374 petalAsm->AddNode(
v, 1);
378 if (!withSideWalls) {
383 const double radialLen = (outerRadius_cm - (kInnerWallRadius_cm + kWallThick_cm));
384 auto* sideS =
new TGeoBBox(
static_cast<Double_t
>(0.5f * radialLen),
385 static_cast<Double_t
>(0.5f * kWallThick_cm),
386 static_cast<Double_t
>(halfZ));
387 auto* sideV =
new TGeoVolume(
"VD_SideWall", sideS, med);
388 sideV->SetLineColor(kGray + 2);
389 sideV->SetTransparency(70);
391 for (
int sgn : {-1, +1}) {
392 const double phi = sgn * halfPhi;
393 const double rMid = kInnerWallRadius_cm + kWallThick_cm + 0.5f * radialLen;
394 const double rad =
static_cast<double>(TMath::DegToRad());
395 const double x = rMid * std::cos(phi * rad);
396 const double y = rMid * std::sin(phi * rad);
397 auto* rot =
new TGeoRotation();
398 rot->RotateZ(
static_cast<Double_t
>(phi));
399 auto* tr =
new TGeoCombiTrans(
static_cast<Double_t
>(
x),
400 static_cast<Double_t
>(
y),
402 petalAsm->AddNode(sideV, (sgn < 0 ? 1 : 2), tr);
408static void addBarrelLayers(TGeoVolume* petalAsm,
int nPetals,
int petalID,
bool rectangularL0,
bool fullCylinders)
411 LOGP(error,
"addBarrelLayers: petalAsm is null");
416 constexpr double gapL0_cm = 0.163f;
417 constexpr double gapL1L2_cm = 0.12f;
418 constexpr double arcL0_cm = 0.6247f;
421 const double phiL0_deg = fullCylinders ? 360.0 : phiSpanFromGap(nPetals, gapL0_cm, rL0_cm);
422 const double phiL1_deg = fullCylinders ? 360.0 : phiSpanFromGap(nPetals, gapL1L2_cm, rL1_cm);
423 const double phiL2_deg = fullCylinders ? 360.0 : phiSpanFromGap(nPetals, gapL1L2_cm, rL2_cm);
425 const std::string nameL0 =
429 if (!fullCylinders && rectangularL0) {
430 VDRectangularLayer L0(0,
432 kX2X0, kL0RectWidth_cm, kLenZ_cm, kLenZ_cm);
435 double x = kL0RectHeight_cm + L0.getChipThickness() / 2.;
436 LOGP(info,
"Placing rectangular L0 at r={:.3f} cm (half-width={:.3f} cm)",
x, 0.5f * kL0RectWidth_cm);
441 auto* rot =
new TGeoRotation();
444 auto* tr =
new TGeoCombiTrans(
x,
y,
z, rot);
445 L0.createLayer(petalAsm, tr);
448 VDCylindricalLayer L0(0,
450 kX2X0, rL0_cm, phiL0_deg, kLenZ_cm, kLenZ_cm);
451 L0.createLayer(petalAsm,
nullptr);
455 const std::string nameL1 =
459 VDCylindricalLayer L1(1,
461 kX2X0, rL1_cm, phiL1_deg, kLenZ_cm, kLenZ_cm);
462 L1.createLayer(petalAsm,
nullptr);
465 const std::string nameL2 =
469 VDCylindricalLayer L2(2,
471 kX2X0, rL2_cm, phiL2_deg, kLenZ_cm, kLenZ_cm);
472 L2.createLayer(petalAsm,
nullptr);
477static void addColdPlate(TGeoVolume* petalAsm,
int nPetals,
int petalId,
bool fullCylinders =
false)
480 LOGP(error,
"addColdPlate: petalAsm is null");
485 const TGeoMedium* med = gGeoManager->GetMedium(
"ALICE3_TRKSERVICES_CERAMIC");
487 LOGP(error,
"addColdPlate: can't find the medium.");
491 constexpr double gapL1L2_cm = 0.12f;
494 const double phiSpanColdplate_deg =
495 fullCylinders ? 360.0 : phiSpanFromGap(nPetals, gapL1L2_cm, rL2_cm);
496 const double halfPhiDeg = 0.5 * phiSpanColdplate_deg;
497 const double startPhi = -halfPhiDeg;
498 const double endPhi = +halfPhiDeg;
501 auto* shape =
new TGeoTubeSeg(
static_cast<Double_t
>(kColdplateRadius_cm),
502 static_cast<Double_t
>(kColdplateRadius_cm + kColdplateThickness_cm),
503 static_cast<Double_t
>(0.5 * kColdplateZ_cm),
504 static_cast<Double_t
>(startPhi),
505 static_cast<Double_t
>(endPhi));
507 TString volName = TString::Format(
"Petal%d_Coldplate", petalId);
508 auto* coldVol =
new TGeoVolume(volName, shape, med);
509 coldVol->SetLineColor(kAzure - 3);
510 coldVol->SetTransparency(10);
513 petalAsm->AddNode(coldVol, 1);
515 LOGP(info,
"Adding cold plate {} r={:.3f} cm t={:.3f} cm Lz={:.3f} cm φ=[{:.3f}, {:.3f}]",
516 volName.Data(), kColdplateRadius_cm, kColdplateThickness_cm, kColdplateZ_cm, startPhi, endPhi);
521static void addIRISServiceModules(TGeoVolume* petalAsm,
int nPetals)
524 LOGP(error,
"addIRISServiceModules: petalAsm is null");
528 auto* matAl =
new TGeoMaterial(
"ALUMINUM", 26.9815, 13, 2.70);
529 const TGeoMedium* med =
new TGeoMedium(
"ALUMINUM", 4, matAl);
532 LOGP(error,
"addIRISServiceModules: ALUMINUM medium not found.");
536 constexpr double radius = 3.2;
538 constexpr double halfLength = 19.5;
539 const double rIn = radius;
543 const double halfPhi_deg = 0.5 * (360.0 / double(nPetals));
546 auto* segSh =
new TGeoTubeSeg(
547 "IRIS_SERVICE_SEGsh",
550 -halfPhi_deg, halfPhi_deg);
553 TString namePos =
"IRIS_Service_Pos";
554 auto* volPos =
new TGeoVolume(namePos, segSh, med);
555 volPos->SetLineColor(kRed + 2);
556 volPos->SetTransparency(50);
559 TString nameNeg =
"IRIS_Service_Neg";
560 auto* volNeg =
new TGeoVolume(nameNeg, segSh, med);
561 volNeg->SetLineColor(kRed + 2);
562 volNeg->SetTransparency(50);
565 const double zpos = 36.0 + halfLength;
566 auto* transPos =
new TGeoTranslation(0.0, 0.0,
static_cast<Double_t
>(zpos));
567 auto* transNeg =
new TGeoTranslation(0.0, 0.0,
static_cast<Double_t
>(-zpos));
570 petalAsm->AddNode(volPos, 1, transPos);
571 petalAsm->AddNode(volNeg, 2, transNeg);
573 LOGP(info,
"Added IRIS service modules at z = ±{} cm, r=[{}, {}] cm", zpos, rIn, rOut);
577static void addIRISServiceModulesSegmented(TGeoVolume* petalAsm,
int nPetals)
580 LOGP(error,
"addIRISServiceModulesSegmented: petalAsm is null");
585 constexpr double rIn = 3.2;
588 constexpr double halfLen = 19.5;
589 constexpr double z0 = 36.0 + halfLen;
590 const double zMinA = z0 - halfLen;
591 const double zMaxA = z0 + halfLen;
595 constexpr double vacuumVesselLength = 76.0;
596 constexpr double vacuumVesselThickness = 0.08;
597 const double halfVess = 0.5 * vacuumVesselLength;
598 const double gapStart = halfVess;
599 const double gapEnd = halfVess + vacuumVesselThickness;
602 const double halfPhi = 0.5 * (360.0 / double(nPetals));
604 auto* matAl =
new TGeoMaterial(
"ALUMINUM", 26.9815, 13, 2.70);
605 const TGeoMedium* med =
new TGeoMedium(
"ALUMINUM", 4, matAl);
608 LOGP(error,
"addIRISServiceModules: ALUMINUM medium not found.");
616 auto* sh =
new TGeoTubeSeg(rIn, rOut, halfLen, -halfPhi, +halfPhi);
617 auto* vN =
new TGeoVolume(
"IRIS_Service_Neg", sh, med);
618 vN->SetLineColor(kRed + 2);
619 vN->SetTransparency(55);
620 petalAsm->AddNode(vN, 1,
new TGeoTranslation(0., 0., -(z0)));
627 const double L_inVac = std::max(0.0, std::min(zMaxA, gapStart) - zMinA);
629 const double dz = 0.5 * L_inVac;
630 const double zc = zMinA + dz;
631 auto* sh =
new TGeoTubeSeg(rIn, rOut, dz, -halfPhi, halfPhi);
632 sh->SetName(
"IRIS_SERVICE_POS_INVACsh");
633 auto* vP =
new TGeoVolume(
"IRIS_Service_Pos_InVac", sh, med);
634 vP->SetLineColor(kRed + 2);
635 vP->SetTransparency(55);
636 petalAsm->AddNode(vP, 1,
new TGeoTranslation(0., 0., zc));
637 LOGP(info,
"IRIS A-side (InVac): z=[{:.3f},{:.3f}] cm, len={:.3f} cm",
638 zc - dz, zc + dz, 2 * dz);
640 LOGP(warning,
"IRIS A-side (InVac): no overlap with vacuum (L_inVac<=0)");
646 const double L_outVac = std::max(0.0, zMaxA - std::max(zMinA, gapEnd));
648 const double dz = 0.5 * L_outVac;
649 const double zc = std::max(zMinA, gapEnd) + dz;
650 auto* sh =
new TGeoTubeSeg(rIn, rOut, dz, -halfPhi, +halfPhi);
651 sh->SetName(
"IRIS_SERVICE_POS_OUTVACsh");
652 auto* vP =
new TGeoVolume(
"IRIS_Service_Pos_OutVac", sh, med);
653 vP->SetLineColor(kRed + 1);
654 vP->SetTransparency(70);
655 petalAsm->AddNode(vP, 2,
new TGeoTranslation(0., 0., +zc));
656 LOGP(info,
"IRIS A-side (OutVac): z=[{:.3f},{:.3f}] cm, len={:.3f} cm",
657 zc - dz, zc + dz, 2 * dz);
659 LOGP(warning,
"IRIS A-side (OutVac): no upper piece (L_outVac<=0)");
665static void addDisks(TGeoVolume* petalAsm,
int nPetals,
int petalID,
bool fullCylinders)
669 LOGP(error,
"addDisks: petalAsm is null");
673 const double phiDisk_deg = fullCylinders ? 360.0 : phiSpanFromGap(nPetals, 2 * kWallThick_cm, diskRin_cm);
675 for (
int i = 0;
i < 6; ++
i) {
676 const std::string nameD =
682 kX2X0, diskRin_cm, diskRout_cm, phiDisk_deg, diskZ_cm[
i]);
685 auto* tr =
new TGeoTranslation(0.0, 0.0,
static_cast<Double_t
>(disk.getZPosition()));
686 disk.createLayer(petalAsm, tr);
694static void addPetalEndCaps(TGeoVolume* petalAsm,
703 LOGP(error,
"addPetalEndCaps: petalAsm is null");
708 const TGeoMedium* med =
709 matmgr.getTGeoMedium(
"ALICE3_TRKSERVICES_ALUMINIUM5083");
713 "addPetalEndCaps: ALICE3_TRKSERVICES_ALUMINIUM5083 not found, caps not created.");
717 const double halfT = 0.5 * capThick_cm;
719 auto* sh =
new TGeoTube(
static_cast<Double_t
>(rIn_cm),
720 static_cast<Double_t
>(rOut_cm),
721 static_cast<Double_t
>(halfT));
723 TString vname = Form(
"Petal%d_ZCap", petalId);
724 auto*
v =
new TGeoVolume(vname, sh, med);
725 v->SetLineColor(kGray + 2);
726 v->SetTransparency(70);
728 auto* trMin =
new TGeoTranslation(0.0, 0.0,
729 static_cast<Double_t
>(zMin_cm + halfT));
730 auto* trMax =
new TGeoTranslation(0.0, 0.0,
731 static_cast<Double_t
>(zMax_cm - halfT));
733 petalAsm->AddNode(
v, 1, trMin);
734 petalAsm->AddNode(
v, 2, trMax);
738static TGeoVolume* buildPetalAssembly(
int nPetals,
744 auto* petalAsm =
new TGeoVolumeAssembly(Form(
"PETAL_%d", petalID));
747 addPetalWalls(petalAsm, nPetals, kOuterWallRadius_cm,
751 addBarrelLayers(petalAsm, nPetals, petalID, rectangularL0, fullCylinders);
752 addDisks(petalAsm, nPetals, petalID, fullCylinders);
754 addColdPlate(petalAsm, nPetals, petalID,
false);
755 addIRISServiceModulesSegmented(petalAsm, nPetals);
760static TGeoVolume* buildFullCylAssembly(
int petalID,
bool withDisks)
763 auto* petalAsm =
new TGeoVolumeAssembly(Form(
"PETAL_%d", petalID));
766 addPetalWalls(petalAsm,
774 const double zMin = -0.5 * kLenZ_cm;
775 const double zMax = +0.5 * kLenZ_cm;
776 const double rIn = kInnerWallRadius_cm;
777 const double rOut = kOuterWallRadius_cm + kWallThick_cm;
779 addPetalEndCaps(petalAsm,
789 addBarrelLayers(petalAsm,
795 addColdPlate(petalAsm, 1, petalID,
true);
796 addIRISServiceModulesSegmented(petalAsm, 1);
814 LOGP(error,
"createIRIS4Geometry: motherVolume is null");
820 constexpr int nPetals = 4;
821 for (
int p = 0; p < nPetals; ++p) {
822 auto* petal = buildPetalAssembly(nPetals, p,
false,
827 buildPetalSolidsComposite(petal);
829 const double phiDeg = (360.0 / double(nPetals)) * (
double(p) + 0.5);
830 auto*
R =
new TGeoRotation();
832 auto* T =
new TGeoCombiTrans(0, 0, 0,
R);
833 motherVolume->AddNode(petal, p + 1, T);
835 buildIrisCutoutFromPetalSolid(nPetals);
841 LOGP(error,
"createIRIS5Geometry: motherVolume is null");
847 constexpr int nPetals = 4;
848 for (
int p = 0; p < nPetals; ++p) {
849 auto* petal = buildPetalAssembly(nPetals, p,
true,
854 buildPetalSolidsComposite(petal);
856 const double phiDeg = (360.0 / double(nPetals)) * (
double(p) + 0.5);
857 auto*
R =
new TGeoRotation();
859 auto* T =
new TGeoCombiTrans(0, 0, 0,
R);
860 motherVolume->AddNode(petal, p + 1, T);
862 buildIrisCutoutFromPetalSolid(nPetals);
868 LOGP(error,
"createIRIS4aGeometry: motherVolume is null");
874 constexpr int nPetals = 3;
875 for (
int p = 0; p < nPetals; ++p) {
876 auto* petal = buildPetalAssembly(nPetals, p,
false,
881 buildPetalSolidsComposite(petal);
883 const double phiDeg = (360.0 / double(nPetals)) * (
double(p) + 0.5);
884 auto*
R =
new TGeoRotation();
886 auto* T =
new TGeoCombiTrans(0, 0, 0,
R);
887 motherVolume->AddNode(petal, p + 1, T);
889 buildIrisCutoutFromPetalSolid(nPetals);
895 LOGP(error,
"createIRISGeometryFullCyl: motherVolume is null");
901 constexpr int nPetals = 1;
902 constexpr int petalID = 0;
904 auto* petal = buildFullCylAssembly(petalID,
false);
905 motherVolume->AddNode(petal, 1,
nullptr);
907 buildPetalSolidsComposite(petal);
908 buildIrisCutoutFromPetalSolid(nPetals);
914 LOGP(error,
"createIRISGeometryFullCylDisks: motherVolume is null");
920 constexpr int nPetals = 1;
921 constexpr int petalID = 0;
923 auto* petal = buildFullCylAssembly(petalID,
true);
924 motherVolume->AddNode(petal, 1,
nullptr);
927 buildPetalSolidsComposite(petal);
928 buildIrisCutoutFromPetalSolid(nPetals);
933 auto* petal = buildPetalAssembly(nPetals, petalID, rectangularL0,
false,
true);
936 const double phiDeg = (360.f /
static_cast<double>(nPetals)) * (
static_cast<double>(petalID) + 0.5f);
937 auto*
R =
new TGeoCombiTrans(0, 0, 0,
new TGeoRotation(
"", phiDeg, 0, 0));
938 motherVolume->AddNode(petal, 1,
R);
940 LOGP(info,
"Debug: Added Petal{} to {}", petalID, motherVolume->GetName());
std::unique_ptr< expressions::Node > node
static MaterialManager & Instance()
static const char * getTRKPetalDiskPattern()
static const char * getTRKSensorPattern()
static const char * getTRKPetalLayerPattern()
static const char * getTRKPetalPattern()
GLint GLint GLsizei GLint GLenum GLenum type
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
constexpr double thickness
std::vector< VDSensorDesc > & vdSensorRegistry()
void createSinglePetalDebug(TGeoVolume *motherVolume, int petalID=0, int nPetals=4, bool rectangularL0=false)
void createIRISGeometryFullCyl(TGeoVolume *motherVolume)
void createIRIS4aGeometry(TGeoVolume *motherVolume)
void createIRIS4Geometry(TGeoVolume *motherVolume)
void createIRISGeometryFullCylwithDisks(TGeoVolume *motherVolume)
void registerSensor(const std::string &volName, int petal, VDSensorDesc::Region region, VDSensorDesc::Type type, int idx)
void createIRIS5Geometry(TGeoVolume *motherVolume)
void clearVDSensorRegistry()
std::string to_string(gsl::span< T, Size > span)