Skip to content

Commit af76bd1

Browse files
bulukutluBerkin Ulukutlualibuildnjacazio
authored
[ALICE 3] FT3 fix magnetic field silently disabled when FT3 is active (#15828)
* ALICE3/FT3: fix magnetic field silently disabled when FT3 is active FT3Module::initialize_materials() registered its six support materials via raw `new TGeoMedium(name, id, mat), bypassing o2::base::MaterialManager. That 3-argument TGeoMedium constructor leaves all tracking parameters, including ifield, at 0, and since these ids were never coordinated with MaterialManager's auto-assigned global ids, they collided with other detectors' media -notably the CAVE air medium that fills the gaps between TRK's barrel layers. Route these six materials/media through MaterialManager instead. * Clean up comments on material registration process Removed commented-out code regarding material registration and its implications. * Please consider the following formatting changes * Update FT3Module.cxx --------- Co-authored-by: Berkin Ulukutlu <berkin.ulukutlu@cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch> Co-authored-by: Nicolò Jacazio <njacazio@users.noreply.github.com>
1 parent f3ebce3 commit af76bd1

1 file changed

Lines changed: 58 additions & 32 deletions

File tree

‎Detectors/Upgrades/ALICE3/TRKFT3/FT3/simulation/src/FT3Module.cxx‎

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "FT3Simulation/FT3Module.h"
1616
#include "FT3Base/FT3BaseParam.h"
17+
#include "DetectorsBase/MaterialManager.h"
18+
#include "DetectorsBase/Detector.h"
1719
#include <TGeoManager.h>
1820
#include <TGeoMaterial.h>
1921
#include <TGeoMedium.h>
@@ -54,42 +56,66 @@ void FT3Module::initialize_materials()
5456
return;
5557
}
5658

57-
TGeoManager* geoManager = gGeoManager;
58-
59-
auto* itsH = new TGeoElement("FT3_H", "Hydrogen", 1, 1.00794);
60-
auto* itsC = new TGeoElement("FT3_C", "Carbon", 6, 12.0107);
61-
auto* itsO = new TGeoElement("FT3_O", "Oxygen", 8, 15.994);
62-
63-
siliconMat = new TGeoMaterial("FT3_Silicon", 28.0855, 14, 2.33);
64-
siliconMed = new TGeoMedium("FT3_Silicon", 1, siliconMat);
65-
66-
copperMat = new TGeoMaterial("FT3_Copper", 63.546, 29, 8.96);
67-
copperMed = new TGeoMedium("FT3_Copper", 2, copperMat);
68-
69-
TGeoMixture* kaptonMat = new TGeoMixture("FT3_Kapton", 4, 1.346); // C22 H10 N2 O5
70-
71-
kaptonMat->DefineElement(0, 12.0107, 6, 0.5641); // Carbon
72-
kaptonMat->DefineElement(1, 1.00794, 1, 0.2564); // Hydrogen
73-
kaptonMat->DefineElement(2, 14.0067, 7, 0.0513); // Nitrogen
74-
kaptonMat->DefineElement(3, 15.999, 8, 0.1282); // Oxygen
75-
kaptonMed = new TGeoMedium("FT3_Kapton", 3, kaptonMat);
59+
auto& matmgr = o2::base::MaterialManager::Instance();
60+
61+
int ifield; // Initialized below
62+
float fieldm; // Initialized below
63+
o2::base::Detector::initFieldTrackingParams(ifield, fieldm);
64+
65+
float tmaxfdSi = 0.1;
66+
float stemaxSi = 0.0075;
67+
float deemaxSi = 0.1;
68+
float epsilSi = 1.0E-4;
69+
float stminSi = 0.0;
70+
71+
float tmaxfdPas = 0.1;
72+
float stemaxPas = 1.0;
73+
float deemaxPas = 0.1;
74+
float epsilPas = 1.0E-4;
75+
float stminPas = 0.0;
76+
77+
// FT3-local material/medium IDs: 10-15. Keep them distinct from IDs 1 and 3,
78+
// which are already used by FT3 Detector::createMaterials() for AIR and SILICON.
79+
// MaterialManager maps these local IDs to globally unique VMC medium IDs.
80+
matmgr.Material("FT3", 10, "Silicon", 28.0855, 14, 2.33, 0, 0);
81+
matmgr.Medium("FT3", 10, "Silicon", 10, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi);
82+
siliconMed = matmgr.getTGeoMedium("FT3", 10);
83+
siliconMat = siliconMed->GetMaterial();
84+
85+
matmgr.Material("FT3", 11, "Copper", 63.546, 29, 8.96, 0, 0);
86+
matmgr.Medium("FT3", 11, "Copper", 11, 0, ifield, fieldm, tmaxfdPas, stemaxPas, deemaxPas, epsilPas, stminPas);
87+
copperMed = matmgr.getTGeoMedium("FT3", 11);
88+
copperMat = copperMed->GetMaterial();
89+
90+
// Kapton: C22 H10 N2 O5, by weight fraction
91+
float aKapton[4] = {12.0107, 1.00794, 14.0067, 15.999};
92+
float zKapton[4] = {6., 1., 7., 8.};
93+
float wKapton[4] = {0.5641, 0.2564, 0.0513, 0.1282};
94+
matmgr.Mixture("FT3", 12, "Kapton", aKapton, zKapton, 1.346, 4, wKapton);
95+
matmgr.Medium("FT3", 12, "Kapton", 12, 0, ifield, fieldm, tmaxfdPas, stemaxPas, deemaxPas, epsilPas, stminPas);
96+
kaptonMed = matmgr.getTGeoMedium("FT3", 12);
97+
kaptonMat = dynamic_cast<TGeoMixture*>(kaptonMed->GetMaterial());
7698

7799
// TODO: Check with Rene the exact type of carbon fiber
78-
carbonFiberMat = new TGeoMaterial("FT3_Carbon", 12.0107, 6, 1.8);
79-
carbonFiberMed = new TGeoMedium("FT3_Carbon", 6, carbonFiberMat);
80-
81-
// Epoxy: C18 H19 O3
82-
auto* itsEpoxy = new TGeoMixture("FT3_Epoxy", 3);
83-
itsEpoxy->AddElement(itsC, 18);
84-
itsEpoxy->AddElement(itsH, 19);
85-
itsEpoxy->AddElement(itsO, 3);
86-
itsEpoxy->SetDensity(2.186);
87-
88-
epoxyMed = new TGeoMedium("FT3_Epoxy", 4, itsEpoxy);
100+
matmgr.Material("FT3", 13, "Carbon", 12.0107, 6, 1.8, 0, 0);
101+
matmgr.Medium("FT3", 13, "Carbon", 13, 0, ifield, fieldm, tmaxfdPas, stemaxPas, deemaxPas, epsilPas, stminPas);
102+
carbonFiberMed = matmgr.getTGeoMedium("FT3", 13);
103+
carbonFiberMat = carbonFiberMed->GetMaterial();
104+
105+
// Epoxy: C18 H19 O3, by atom count (negative nlmat)
106+
float aEpoxy[3] = {12.0107, 1.00794, 15.999};
107+
float zEpoxy[3] = {6., 1., 8.};
108+
float wEpoxy[3] = {18., 19., 3.};
109+
matmgr.Mixture("FT3", 14, "Epoxy", aEpoxy, zEpoxy, 2.186, -3, wEpoxy);
110+
matmgr.Medium("FT3", 14, "Epoxy", 14, 0, ifield, fieldm, tmaxfdPas, stemaxPas, deemaxPas, epsilPas, stminPas);
111+
epoxyMed = matmgr.getTGeoMedium("FT3", 14);
89112
epoxyMat = epoxyMed->GetMaterial();
90113

91-
AluminumMat = new TGeoMaterial("Aluminum", 26.98, 13, 2.7);
92-
AluminumMed = new TGeoMedium("Aluminum", 5, AluminumMat);
114+
matmgr.Material("FT3", 15, "Aluminum", 26.98, 13, 2.7, 0, 0);
115+
matmgr.Medium("FT3", 15, "Aluminum", 15, 0, ifield, fieldm, tmaxfdPas, stemaxPas, deemaxPas, epsilPas, stminPas);
116+
AluminumMed = matmgr.getTGeoMedium("FT3", 15);
117+
AluminumMat = AluminumMed->GetMaterial();
118+
93119
LOG(debug) << "FT3Module: done initialize_materials";
94120
}
95121

0 commit comments

Comments
 (0)