Skip to content

Commit 478932f

Browse files
sawenzelclaude
andcommitted
Fix wrong field-free media assignment in the beam pipe
This fixes a problem in the beam pipe media assignment, diagnosed with the o2-sim-geometry-doctor tool (#15683). 22 volumes of the RB24 warm module, its ion pump and its B1 bellow, and the air shell at r = 79-80 cm, carried media labelled out-of-field, whereas their placements at z = 400-490 cm are inside the 4.2-4.6 kGauss solenoid fringe field. Geant4 honours the label and moved particles through these volumes on straight lines, about 171000 steps per min-bias event. This is now fixed by assigning the in-field counterpart media at the construction site of these volumes. After the change no step in a field-free volume sees a non-zero field. The same volumes are also placed far down the beam line where the field really is zero. These placements now integrate the field too, which is correct but slower. A follow-up gives them cloned volumes of their own and restores the shortcut. Related tickets: https://its.cern.ch/jira/browse/O2-174 https://its.cern.ch/jira/browse/O2-175 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178JHAQ2biaX5ac9ThppBXi
1 parent c76360f commit 478932f

1 file changed

Lines changed: 37 additions & 26 deletions

File tree

Detectors/Passive/src/Pipe.cxx

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -897,17 +897,25 @@ void Pipe::ConstructGeometry()
897897
z = kRB24B1L - shRB24B1BellowM->GetZ(0);
898898
shRB24B1BellowM->DefineSection(11, z, 0., kRB24B1RFlangeRou);
899899

900-
TGeoVolume* voRB24B1BellowM = new TGeoVolume("RB24B1BellowM", shRB24B1BellowM, kMedVacNF);
900+
// This module and the warm module below are installed both inside the barrel,
901+
// where the solenoid fringe is still 4.2-4.6 kGauss, and past the solenoid
902+
// where there is no field at all. They were built entirely from the field-free
903+
// media, which is right for the far placements and wrong for the near ones:
904+
// a 1-2 GeV secondary crossing them at z ~ 480 cm was being transported in a
905+
// straight line through several kGauss. One logical volume can only carry one
906+
// answer, and it has to be the field-carrying one: integrating a zero field is
907+
// merely slower than skipping it, while skipping a real one is wrong.
908+
TGeoVolume* voRB24B1BellowM = new TGeoVolume("RB24B1BellowM", shRB24B1BellowM, kMedVac);
901909
voRB24B1BellowM->SetVisibility(0);
902910
//
903911
// End Parts (connection tube)
904912
TGeoVolume* voRB24B1CT =
905-
new TGeoVolume("RB24B1CT", new TGeoTube(kRB24B1ConTubeRin, kRB24B1ConTubeRou, kRB24B1ConTubeL / 2.), kMedSteelNF);
913+
new TGeoVolume("RB24B1CT", new TGeoTube(kRB24B1ConTubeRin, kRB24B1ConTubeRou, kRB24B1ConTubeL / 2.), kMedSteel);
906914
//
907915
// Protection Tube
908916
TGeoVolume* voRB24B1PT = new TGeoVolume(
909917
"RB24B1PT", new TGeoTube(kRB24B1BellowRo, kRB24B1BellowRo + kRB24B1ProtTubeThickness, kRB24B1ProtTubeLength / 2.),
910-
kMedSteelNF);
918+
kMedSteel);
911919

912920
z = kRB24B1ConTubeL / 2. + (kRB24B1RFlangeL - kRB24B1RFlangeRecess);
913921

@@ -947,7 +955,7 @@ void Pipe::ConstructGeometry()
947955
z += kRB24B1RFlangeLO;
948956
shRB24B1RFlange->DefineSection(9, z, kRB24B1RFlangeRO, kRB24B1RFlangeRou);
949957

950-
TGeoVolume* voRB24B1RFlange = new TGeoVolume("RB24B1RFlange", shRB24B1RFlange, kMedSteelNF);
958+
TGeoVolume* voRB24B1RFlange = new TGeoVolume("RB24B1RFlange", shRB24B1RFlange, kMedSteel);
951959

952960
z = kRB24B1L - kRB24B1RFlangeL;
953961
voRB24B1BellowM->AddNode(voRB24B1RFlange, 1, new TGeoTranslation(0., 0., z));
@@ -972,7 +980,7 @@ void Pipe::ConstructGeometry()
972980
shRB24B1RCTFlange->DefineSection(4, z, kRB24B1RCTFlangeRin, 11.16 / 2.);
973981
z += 0.25;
974982
shRB24B1RCTFlange->DefineSection(5, z, kRB24B1RCTFlangeRin, 11.16 / 2.);
975-
TGeoVolume* voRB24B1RCTFlange = new TGeoVolume("RB24B1RCTFlange", shRB24B1RCTFlange, kMedCuNF);
983+
TGeoVolume* voRB24B1RCTFlange = new TGeoVolume("RB24B1RCTFlange", shRB24B1RCTFlange, kMedCu);
976984
z = kRB24B1L - kRB24B1RCTFlangeL;
977985

978986
voRB24B1BellowM->AddNode(voRB24B1RCTFlange, 1, new TGeoTranslation(0., 0., z));
@@ -994,7 +1002,7 @@ void Pipe::ConstructGeometry()
9941002
z = kRB24B1RCTL - 0.03;
9951003
shRB24B1RCT->DefineSection(2, z, kRB24B1RCTRin, kRB24B1RCTRin + kRB24B1RCTd);
9961004

997-
TGeoVolume* voRB24B1RCT = new TGeoVolume("RB24B1RCT", shRB24B1RCT, kMedCuNF);
1005+
TGeoVolume* voRB24B1RCT = new TGeoVolume("RB24B1RCT", shRB24B1RCT, kMedCu);
9981006
z = kRB24B1L - kRB24B1RCTL - 0.45;
9991007
voRB24B1BellowM->AddNode(voRB24B1RCT, 1, new TGeoTranslation(0., 0., z));
10001008

@@ -1020,7 +1028,7 @@ void Pipe::ConstructGeometry()
10201028
// Transition Tube
10211029
z += 3.75;
10221030
shRB24B1TTF->DefineSection(6, z, 8.05 / 2., 8.45 / 2.);
1023-
TGeoVolume* voRB24B1TTF = new TGeoVolume("RB24B1TTF", shRB24B1TTF, kMedSteelNF);
1031+
TGeoVolume* voRB24B1TTF = new TGeoVolume("RB24B1TTF", shRB24B1TTF, kMedSteel);
10241032
z = 0.;
10251033
voRB24B1BellowM->AddNode(voRB24B1TTF, 1, new TGeoTranslation(0., 0., z));
10261034

@@ -1097,17 +1105,17 @@ void Pipe::ConstructGeometry()
10971105
Float_t kRB24IpSTTRi = 5.80 / 2.; // Inner Radius
10981106
Float_t kRB24IpSTTRo = 6.00 / 2.; // Outer Radius
10991107
TGeoVolume* voRB24IpSTT =
1100-
new TGeoVolume("RB24IpSTT", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTTL / 2.), kMedSteelNF);
1108+
new TGeoVolume("RB24IpSTT", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTTL / 2.), kMedSteel);
11011109
// Screen
11021110
Float_t kRB24IpSTCL = 0.4; // Lenth of the crochet detail
11031111
// Length of the screen
11041112
Float_t kRB24IpSTSL = 9.00 - 2. * kRB24IpSTCL;
11051113
// Rel. position of the screen
11061114
Float_t kRB24IpSTSZ = 7.00 + kRB24IpSTCL;
11071115
TGeoVolume* voRB24IpSTS =
1108-
new TGeoVolume("RB24IpSTS", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTSL / 2.), kMedSteelNF);
1116+
new TGeoVolume("RB24IpSTS", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTSL / 2.), kMedSteel);
11091117
// Vacuum
1110-
TGeoVolume* voRB24IpSTV = new TGeoVolume("RB24IpSTV", new TGeoTube(0., kRB24IpSTTRi, kRB24AIpML / 2.), kMedVacNF);
1118+
TGeoVolume* voRB24IpSTV = new TGeoVolume("RB24IpSTV", new TGeoTube(0., kRB24IpSTTRi, kRB24AIpML / 2.), kMedVac);
11111119
//
11121120
voRB24IpSTT->AddNode(voRB24IpSTS, 1, new TGeoTranslation(0., 0., kRB24IpSTSZ - kRB24IpSTTL / 2. + kRB24IpSTSL / 2.));
11131121

@@ -1322,7 +1330,7 @@ void Pipe::ConstructGeometry()
13221330
// Lower inforcement
13231331
TGeoVolume* voRB24VMABCRBT12 = new TGeoVolume(
13241332
"RB24VMABCRBT12", new TGeoTubeSeg(kRB24VMABCRBT1Ro, kRB24VMABCRBT1Ro + 0.3, kRB24VMABCRBT1L2 / 2., 220., 320.),
1325-
kMedSteelNF);
1333+
kMedSteel);
13261334
//
13271335
// Tube 2
13281336
const Float_t kRB24VMABCRBT2Ri = 6.0 / 2.;
@@ -1339,14 +1347,14 @@ void Pipe::ConstructGeometry()
13391347
tRBT2->RegisterYourself();
13401348
TGeoCompositeShape* shRB24VMABCRBT2c =
13411349
new TGeoCompositeShape("shRB24VMABCRBT2c", "RB24VMABCRBT2:tRBT2-RB24VMABCRBT1o");
1342-
TGeoVolume* voRB24VMABCRBT2 = new TGeoVolume("shRB24VMABCRBT2", shRB24VMABCRBT2c, kMedSteelNF);
1350+
TGeoVolume* voRB24VMABCRBT2 = new TGeoVolume("shRB24VMABCRBT2", shRB24VMABCRBT2c, kMedSteel);
13431351
// Flange
13441352
// Pos 1.4 Flange DN63 LHCVBU__0008
13451353
TGeoVolume* voRB24VMABCRBF2 =
1346-
new TGeoVolume("RB24VMABCRBF2", new TGeoTube(kRB24VMABCRBT2Ro, kRB24VMABCRBF2Ro, kRB24VMABCRBF2L / 2.), kMedSteelNF);
1354+
new TGeoVolume("RB24VMABCRBF2", new TGeoTube(kRB24VMABCRBT2Ro, kRB24VMABCRBF2Ro, kRB24VMABCRBF2L / 2.), kMedSteel);
13471355
// DN63 Blank Flange (my best guess)
13481356
TGeoVolume* voRB24VMABCRBF2B =
1349-
new TGeoVolume("RB24VMABCRBF2B", new TGeoTube(0., kRB24VMABCRBF2Ro, kRB24VMABCRBF2L / 2.), kMedSteelNF);
1357+
new TGeoVolume("RB24VMABCRBF2B", new TGeoTube(0., kRB24VMABCRBF2Ro, kRB24VMABCRBF2L / 2.), kMedSteel);
13501358
//
13511359
// Tube 3
13521360
const Float_t kRB24VMABCRBT3Ri = 3.5 / 2.;
@@ -1367,7 +1375,7 @@ void Pipe::ConstructGeometry()
13671375
// Flange
13681376
// Pos 1.4 Flange DN35 LHCVBU__0007
13691377
TGeoVolume* voRB24VMABCRBF3 =
1370-
new TGeoVolume("RB24VMABCRBF3", new TGeoTube(kRB24VMABCRBT3Ro, kRB24VMABCRBF3Ro, kRB24VMABCRBF3L / 2.), kMedSteelNF);
1378+
new TGeoVolume("RB24VMABCRBF3", new TGeoTube(kRB24VMABCRBT3Ro, kRB24VMABCRBF3Ro, kRB24VMABCRBF3L / 2.), kMedSteel);
13711379
//
13721380
// Tube 4
13731381
const Float_t kRB24VMABCRBT4Ri = 6.0 / 2.;
@@ -1380,10 +1388,10 @@ void Pipe::ConstructGeometry()
13801388
tRBT4->RegisterYourself();
13811389
TGeoCompositeShape* shRB24VMABCRBT4c =
13821390
new TGeoCompositeShape("shRB24VMABCRBT4c", "RB24VMABCRBT4:tRBT4-RB24VMABCRBT1o2");
1383-
TGeoVolume* voRB24VMABCRBT4 = new TGeoVolume("shRB24VMABCRBT4", shRB24VMABCRBT4c, kMedSteelNF);
1391+
TGeoVolume* voRB24VMABCRBT4 = new TGeoVolume("shRB24VMABCRBT4", shRB24VMABCRBT4c, kMedSteel);
13841392
TGeoCompositeShape* shRB24VMABCRB =
13851393
new TGeoCompositeShape("shRB24VMABCRB", "RB24VMABCRBT1-(RB24VMABCRBT2i:tRBT2+RB24VMABCRBT3i:tRBT3)");
1386-
TGeoVolume* voRB24VMABCRBI = new TGeoVolume("RB24VMABCRBI", shRB24VMABCRB, kMedSteelNF);
1394+
TGeoVolume* voRB24VMABCRBI = new TGeoVolume("RB24VMABCRBI", shRB24VMABCRB, kMedSteel);
13871395
//
13881396
// Plate
13891397
const Float_t kRB24VMABCRBBx = 16.0;
@@ -1397,7 +1405,7 @@ void Pipe::ConstructGeometry()
13971405
const Float_t kRB24VMABCPy = -12.5;
13981406

13991407
TGeoVolume* voRB24VMABCRBP = new TGeoVolume(
1400-
"RB24VMABCRBP", new TGeoBBox(kRB24VMABCRBBx / 2., kRB24VMABCRBBy / 2., kRB24VMABCRBBz / 2.), kMedSteelNF);
1408+
"RB24VMABCRBP", new TGeoBBox(kRB24VMABCRBBx / 2., kRB24VMABCRBBy / 2., kRB24VMABCRBBz / 2.), kMedSteel);
14011409
//
14021410
// Pirani Gauge (my best guess)
14031411
//
@@ -1430,7 +1438,7 @@ void Pipe::ConstructGeometry()
14301438
shRB24VMABCPirani->DefineSection(13, z, 0.00, 0.75);
14311439
z += 0.5;
14321440
shRB24VMABCPirani->DefineSection(14, z, 0.00, 0.75);
1433-
TGeoVolume* voRB24VMABCPirani = new TGeoVolume("RB24VMABCPirani", shRB24VMABCPirani, kMedSteelNF);
1441+
TGeoVolume* voRB24VMABCPirani = new TGeoVolume("RB24VMABCPirani", shRB24VMABCPirani, kMedSteel);
14341442
//
14351443
//
14361444
//
@@ -1488,15 +1496,15 @@ void Pipe::ConstructGeometry()
14881496
shRB24VMABBEBellowM->DefineSection(4, z, kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou);
14891497
z += kRB24VMABBEConTubeL2;
14901498
shRB24VMABBEBellowM->DefineSection(5, z, kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou);
1491-
TGeoVolume* voRB24VMABBEBellowM = new TGeoVolume("RB24VMABBEBellowM", shRB24VMABBEBellowM, kMedVacNF);
1499+
TGeoVolume* voRB24VMABBEBellowM = new TGeoVolume("RB24VMABBEBellowM", shRB24VMABBEBellowM, kMedVac);
14921500
voRB24VMABBEBellowM->SetVisibility(0);
14931501

14941502
// Connection tube left
14951503
TGeoVolume* voRB24VMABBECT1 = new TGeoVolume(
1496-
"RB24VMABBECT1", new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou, kRB24VMABBEConTubeL1 / 2.), kMedSteelNF);
1504+
"RB24VMABBECT1", new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou, kRB24VMABBEConTubeL1 / 2.), kMedSteel);
14971505
// Connection tube right
14981506
TGeoVolume* voRB24VMABBECT2 = new TGeoVolume(
1499-
"RB24VMABBECT2", new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou, kRB24VMABBEConTubeL2 / 2.), kMedSteelNF);
1507+
"RB24VMABBECT2", new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou, kRB24VMABBEConTubeL2 / 2.), kMedSteel);
15001508
z = kRB24VMABBEConTubeL1 / 2.;
15011509
voRB24VMABBEBellowM->AddNode(voRB24VMABBECT1, 1, new TGeoTranslation(0., 0., z));
15021510
z += kRB24VMABBEConTubeL1 / 2.;
@@ -1534,7 +1542,7 @@ void Pipe::ConstructGeometry()
15341542
shRB24VMABCTT->DefineSection(5, z, 6.3 / 2., 6.7 / 2.);
15351543
z += 0.63;
15361544
shRB24VMABCTT->DefineSection(6, z, 6.3 / 2., 6.7 / 2.);
1537-
TGeoVolume* voRB24VMABCTT = new TGeoVolume("RB24VMABCTT", shRB24VMABCTT, kMedSteelNF);
1545+
TGeoVolume* voRB24VMABCTT = new TGeoVolume("RB24VMABCTT", shRB24VMABCTT, kMedSteel);
15381546
voRB24VMABCRB->AddNode(voRB24VMABCTT, 1, new TGeoTranslation(0., 0., -kRB24VMABCRBT1L / 2. - 1.));
15391547

15401548
// Pos 3 RF Contact D63 LHCVSR__0057
@@ -1554,7 +1562,7 @@ void Pipe::ConstructGeometry()
15541562
shRB24VMABCCTFlange->DefineSection(4, z, kRB24VMABCCTFlangeRin, 11.16 / 2.);
15551563
z += 0.25;
15561564
shRB24VMABCCTFlange->DefineSection(5, z, kRB24VMABCCTFlangeRin, 11.16 / 2.);
1557-
TGeoVolume* voRB24VMABCCTFlange = new TGeoVolume("RB24VMABCCTFlange", shRB24VMABCCTFlange, kMedCuNF);
1565+
TGeoVolume* voRB24VMABCCTFlange = new TGeoVolume("RB24VMABCCTFlange", shRB24VMABCCTFlange, kMedCu);
15581566
//
15591567
// Pos 3.2 RF-Contact LHCVSR__0056
15601568
//
@@ -1573,7 +1581,7 @@ void Pipe::ConstructGeometry()
15731581
z = kRB24VMABCCTL;
15741582
shRB24VMABCCT->DefineSection(3, z, kRB24VMABCCTRin, kRB24VMABCCTRin + kRB24VMABCCTd);
15751583

1576-
TGeoVolume* voRB24VMABCCT = new TGeoVolume("RB24VMABCCT", shRB24VMABCCT, kMedCuNF);
1584+
TGeoVolume* voRB24VMABCCT = new TGeoVolume("RB24VMABCCT", shRB24VMABCCT, kMedCu);
15771585

15781586
TGeoVolumeAssembly* voRB24VMABRFCT = new TGeoVolumeAssembly("RB24VMABRFCT");
15791587
voRB24VMABRFCT->AddNode(voRB24VMABCCT, 1, gGeoIdentity);
@@ -2826,7 +2834,10 @@ void Pipe::createMaterials()
28262834
matmgr.Mixture("PIPE", 35, "AIR_HIGH$ ", aAir, zAir, dAir, 4, wAir);
28272835
matmgr.Mixture("PIPE", 55, "AIR_NF ", aAir, zAir, dAir, 4, wAir);
28282836
matmgr.Medium("PIPE", 15, "AIR", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2829-
matmgr.Medium("PIPE", 35, "AIR_HIGH", 35, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2837+
// AIR_HIGH raises the transport cuts; it says nothing about the field. It was
2838+
// nevertheless declared field-free, and its only user -- the r = 79-80 cm air
2839+
// shell around RB24 -- spans z = 489-865 cm, in up to 4.1 kGauss.
2840+
matmgr.Medium("PIPE", 35, "AIR_HIGH", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
28302841
matmgr.Medium("PIPE", 55, "AIR_NF", 55, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
28312842

28322843
// Insulation

0 commit comments

Comments
 (0)