Skip to content

Commit ddf23e4

Browse files
sawenzelclaude
andcommitted
Use field-free media for the L3 magnet and the compensator
This changes the media of volumes that sit outside the field map, diagnosed with the geometry doctor. 17 volumes were built from media that declare a magnetic field, whereas the field there is always zero. This is now fixed by switching five media in place, and by giving a field-free variant to the three volumes whose medium is shared with volumes that do reach the field. The new copper medium also needs its own line in simcuts_COMP.dat, because Geant4 assigns cuts per material and it would otherwise take the default ones. #15683 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 61350cd commit ddf23e4

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

Detectors/Passive/data/simcuts_COMP.dat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ COMP 50 1.e-3 1.e-2 1.e-3 1.e-3
2727
* GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA ANNI BREM COMP DCAY DRAY HADR LOSS MULS PAIR PHOT RAYL STRA
2828
*COMP 17 1.e-3 1.e-3 1.e-3 1.e-3 1.e-3 1.e-3 1.e-3 -1. -1. -1. -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
2929
COMP 17 1.e-1 1.e-1 1.e0 1.e0 1.e-2 1.e-1 1.e-1 -1. -1. -1. -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
30+
* field-free twin of the above, same cuts
31+
COMP 18 1.e-1 1.e-1 1.e0 1.e0 1.e-2 1.e-1 1.e-1 -1. -1. -1. -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
3032
* shielded
3133
COMP 37 1.e-3 1.e-2 1.e-3 1.e-3
3234
* very shielded

Detectors/Passive/src/Compensator.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ void Compensator::createMaterials()
7575

7676
// --- Define the various materials + tracking media for GEANT ---
7777
// Aluminum
78+
// ALU_C0 builds the coil supports only, and every one of them is placed
79+
// clear of the field, so they are tracked without one.
7880
matmgr.Material("COMP", 9, "ALUMINIUM0", 26.98, 13., 2.7, 8.9, 37.2);
79-
matmgr.Medium("COMP", 9, "ALU_C0", 9, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
81+
matmgr.Medium("COMP", 9, "ALU_C0", 9, 0, isxfld2, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
8082
matmgr.Material("COMP", 29, "ALUMINIUM1", 26.98, 13., 2.7, 8.9, 37.2);
8183
matmgr.Medium("COMP", 29, "ALU_C1", 29, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
8284
matmgr.Material("COMP", 49, "ALUMINIUM2", 26.98, 13., 2.7, 8.9, 37.2);
@@ -95,6 +97,12 @@ void Compensator::createMaterials()
9597
matmgr.Material("COMP", 37, "COPPER1", 63.55, 29., 8.96, 1.43, 15.1);
9698
matmgr.Material("COMP", 57, "COPPER2", 63.55, 29., 8.96, 1.43, 15.1);
9799
matmgr.Medium("COMP", 17, "Cu_C0", 17, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
100+
// The horizontal coils are the only copper that stays clear of the field. The
101+
// vertical ones reach the beam axis, where the machine compensators are, so
102+
// they keep Cu_C0. This medium needs its own line in simcuts_COMP.dat: cuts
103+
// are assigned per material, so without one both media fall back to the
104+
// default and the copper loses the cuts Cu_C0 relies on.
105+
matmgr.Medium("COMP", 18, "Cu_C0_NF", 17, 0, isxfld2, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
98106
matmgr.Medium("COMP", 37, "Cu_C1", 37, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
99107
matmgr.Medium("COMP", 57, "Cu_C2", 57, 0, isxfld1, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
100108
}
@@ -121,6 +129,7 @@ TGeoVolume* Compensator::createMagnetYoke()
121129
auto& matmgr = o2::base::MaterialManager::Instance();
122130
auto kMedAlu = matmgr.getTGeoMedium("COMP_ALU_C0");
123131
auto kMedCooper = matmgr.getTGeoMedium("COMP_Cu_C0");
132+
auto kMedCooperNF = matmgr.getTGeoMedium("COMP_Cu_C0_NF");
124133
auto kMedIron = matmgr.getTGeoMedium("COMP_FE_C0");
125134

126135
// we use a special optimized tracking medium for the inner part
@@ -170,7 +179,7 @@ TGeoVolume* Compensator::createMagnetYoke()
170179
}
171180

172181
// Make the coils:
173-
TGeoVolume* voCoilH = gGeoManager->MakeBox("voCoilH", kMedCooper, 12.64 / 2.0, 21.46 / 2.0, 310.5 / 2.0);
182+
TGeoVolume* voCoilH = gGeoManager->MakeBox("voCoilH", kMedCooperNF, 12.64 / 2.0, 21.46 / 2.0, 310.5 / 2.0);
174183
TGeoVolume* voCoilV = gGeoManager->MakeBox("voCoilV", kMedCooper, 12.64 / 2.0, 35.80 / 2.0, 26.9 / 2.0);
175184

176185
// Make the top coil supports:

Detectors/Passive/src/Magnet.cxx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ void Magnet::createMaterials()
6666
Int_t isxfld = 2.;
6767
Float_t sxmgmx = 10.;
6868
o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx);
69+
70+
// The coils, the yoke and the crown sit outside the region the field map
71+
// covers, so they are tracked without a field. The doors and the plugs are
72+
// the exception: they reach the beam axis inside the solenoid and keep it.
73+
Int_t isxfldNoField = 0;
6974
Float_t epsil, stmin, deemax, tmaxfd, stemax;
7075

7176
// --- Define the various materials for GEANT ---
@@ -117,19 +122,20 @@ void Magnet::createMaterials()
117122
matmgr.Medium("MAG", 30, "FE_C1", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
118123

119124
// ALUMINUM
120-
matmgr.Medium("MAG", 9, "ALU_C0", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
121-
matmgr.Medium("MAG", 29, "ALU_C1", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
125+
matmgr.Medium("MAG", 9, "ALU_C0", 9, 0, isxfldNoField, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
126+
matmgr.Medium("MAG", 29, "ALU_C1", 29, 0, isxfldNoField, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
122127

123128
// AIR
124129
matmgr.Medium("MAG", 15, "AIR_C0", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
125-
matmgr.Medium("MAG", 35, "AIR_C1", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
130+
matmgr.Medium("MAG", 35, "AIR_C1", 35, 0, isxfldNoField, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
126131

127132
// Steel
128133
matmgr.Medium("MAG", 19, "ST_C0", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
129134
matmgr.Medium("MAG", 39, "ST_C1", 39, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
135+
matmgr.Medium("MAG", 49, "ST_C1_NF", 39, 0, isxfldNoField, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
130136
matmgr.Medium("MAG", 59, "ST_C3", 59, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
131137
// WATER
132-
matmgr.Medium("MAG", 16, "WATER", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
138+
matmgr.Medium("MAG", 16, "WATER", 16, 0, isxfldNoField, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
133139
}
134140

135141
void Magnet::ConstructGeometry()
@@ -183,6 +189,7 @@ void Magnet::ConstructGeometry()
183189
auto medAlu = matmgr.getTGeoMedium("MAG_ALU_C1");
184190
auto medAluI = matmgr.getTGeoMedium("MAG_ALU_C0");
185191
auto medSteel = matmgr.getTGeoMedium("MAG_ST_C1");
192+
auto medSteelNF = matmgr.getTGeoMedium("MAG_ST_C1_NF");
186193
auto medWater = matmgr.getTGeoMedium("MAG_WATER");
187194
//
188195
// Offset between LHC and LEP axis
@@ -282,7 +289,7 @@ void Magnet::ConstructGeometry()
282289
shYoke->DefineSection(0, -kLYoke, kRYokeInner, kRYokeOuter);
283290
shYoke->DefineSection(1, +kLYoke, kRYokeInner, kRYokeOuter);
284291
//
285-
TGeoVolume* voYoke = new TGeoVolume("L3YO", shYoke, medSteel);
292+
TGeoVolume* voYoke = new TGeoVolume("L3YO", shYoke, medSteelNF);
286293
voBMother->AddNode(voYoke, 1, new TGeoTranslation(0., 0., 0.));
287294

288295
//
@@ -294,7 +301,7 @@ void Magnet::ConstructGeometry()
294301
shCrown->DefineSection(2, kLCrown2, kRCrownInner, kRCrownOuter);
295302
shCrown->DefineSection(3, kLCrown3, kRCrownInner, kRCrownOuter);
296303
//
297-
TGeoVolume* voCrown = new TGeoVolume("L3CR", shCrown, medSteel);
304+
TGeoVolume* voCrown = new TGeoVolume("L3CR", shCrown, medSteelNF);
298305

299306
//
300307
// Door including "Plug"

0 commit comments

Comments
 (0)