Skip to content

Commit f951649

Browse files
sawenzelclaude
andcommitted
Give the two HMPID absorber plates distinct names
This gives each HMPID absorber plate its own volume name and copy number. - createAbsorber was called twice, so both plates became a volume named Habs placed with copy number 0. - GetVolume("Habs") returned only the 40 mm plate, and both node paths were /cave_1/barrel_1/Habs_0, so the 80 mm plate could not be addressed at all. - The GDML export had to invent Habs0x2, Habs0x3 and Habs_00x1 for it. - The plates are now Habs2 and Habs4, with copy numbers 2 and 4. - The geometry is unchanged: same shapes, same media, same placements. https://its.cern.ch/jira/browse/O2-4136 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent fd9939a commit f951649

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Detectors/HMPID/simulation/include/HMPIDSimulation/Detector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Detector : public o2::base::DetImpl<Detector>
5555
void EndOfEvent() override { Reset(); }
5656

5757
// for the geometry sub-parts
58-
TGeoVolume* createAbsorber(float tickness);
58+
TGeoVolume* createAbsorber(int chamber, float tickness);
5959
TGeoVolume* createChamber(int number);
6060
TGeoVolume* CreateCradle();
6161
TGeoVolume* CradleBaseVolume(TGeoMedium* med, double l[7], const char* name);

Detectors/HMPID/simulation/src/Detector.cxx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,15 @@ void Detector::createMaterials()
538538
Medium(kAr, "Ar", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
539539
}
540540
//**************************************************************************************************
541-
TGeoVolume* Detector::createAbsorber(float tickness)
541+
TGeoVolume* Detector::createAbsorber(int chamber, float tickness)
542542
{
543543
double cm = 1, mm = 0.1 * cm, um = 0.001 * mm; // default is cm
544544
auto& matmgr = o2::base::MaterialManager::Instance();
545545
TGeoMedium* al = matmgr.getTGeoMedium("HMP_Al");
546-
TGeoVolume* abs = gGeoManager->MakeBox("Habs", al, tickness * mm / 2, 1300.00 * mm / 2, 1300 * mm / 2);
546+
// one volume per chamber: the two plates differ in thickness, so a shared name
547+
// would leave two different volumes answering to "Habs" and two placements whose
548+
// node paths are both /cave_1/barrel_1/Habs_0
549+
TGeoVolume* abs = gGeoManager->MakeBox(Form("Habs%d", chamber), al, tickness * mm / 2, 1300.00 * mm / 2, 1300 * mm / 2);
547550
return abs;
548551
}
549552
//**************************************************************************************************
@@ -1260,8 +1263,8 @@ void Detector::ConstructGeometry()
12601263

12611264
TGeoVolume* hmpcradle = CreateCradle();
12621265

1263-
TGeoVolume* hmpidabs_cham2 = createAbsorber(40.0);
1264-
TGeoVolume* hmpidabs_cham4 = createAbsorber(80.0);
1266+
TGeoVolume* hmpidabs_cham2 = createAbsorber(2, 40.0);
1267+
TGeoVolume* hmpidabs_cham4 = createAbsorber(4, 80.0);
12651268

12661269
double theta = 33.5;
12671270

@@ -1270,14 +1273,14 @@ void Detector::ConstructGeometry()
12701273
pMatrixAbs2->SetTranslation(trans2);
12711274
pMatrixAbs2->RotateZ(theta);
12721275

1273-
gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham2, 0, pMatrixAbs2);
1276+
gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham2, 2, pMatrixAbs2);
12741277

12751278
TGeoHMatrix* pMatrixAbs4 = new TGeoHMatrix;
12761279
const double trans4[] = {435., 0., 155.};
12771280
pMatrixAbs4->SetTranslation(trans4);
12781281
pMatrixAbs4->RotateZ(theta);
12791282

1280-
gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham4, 0, pMatrixAbs4);
1283+
gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham4, 4, pMatrixAbs4);
12811284

12821285
for (Int_t iCh = 0; iCh <= 6; iCh++) { // place 7 chambers
12831286
TGeoVolume* hmpid = createChamber(iCh);

0 commit comments

Comments
 (0)