Skip to content

Commit 9a60a4e

Browse files
committed
Clean
Format UpdateMag
1 parent caafee4 commit 9a60a4e

4 files changed

Lines changed: 67 additions & 79 deletions

File tree

Detectors/Upgrades/ALICE3/MID/simulation/src/Detector.cxx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ void Detector::InitializeO2Detector()
106106
}
107107
}
108108
LOGP(info, "Total MI3 sensitive volumes registered: {}", registered.size());
109-
110109
}
111110

112111
void Detector::EndOfEvent() { Reset(); }
@@ -153,20 +152,20 @@ void Detector::createGeometry()
153152
// Module step: layer0=99.8cm (2x49.9), layer1=104cm (2x52=2xsumWidth)
154153
// Central segment: Rmax_abso=290 -> Layer0=301, Layer1=311, nMod=6, semi-dz=299.4/312 at Z=0
155154
// External segments: Rmax_abso=265 -> Layer0=276, Layer1=286, nMod=2, semi-dz=99.8/104 at Z=+-400
156-
constexpr float kAbsGap = 11.f;
157-
constexpr float kPitch = 10.f;
158-
constexpr float kRCen0 = 290.f + kAbsGap; // 301 cm
159-
constexpr float kRCen1 = kRCen0 + kPitch; // 311 cm
160-
constexpr float kRExt0 = 265.f + kAbsGap; // 276 cm
161-
constexpr float kRExt1 = kRExt0 + kPitch; // 286 cm
155+
constexpr float kAbsGap = 11.f;
156+
constexpr float kPitch = 10.f;
157+
constexpr float kRCen0 = 290.f + kAbsGap; // 301 cm
158+
constexpr float kRCen1 = kRCen0 + kPitch; // 311 cm
159+
constexpr float kRExt0 = 265.f + kAbsGap; // 276 cm
160+
constexpr float kRExt1 = kRExt0 + kPitch; // 286 cm
162161
mLayers.resize(6);
163162
// length = semi-length = nModulesZ x step (layer0: step=49.9cm, layer1: step=52cm)
164-
mLayers[0] = MIDLayer(0, "MIDLayer0_central", kRCen0, 299.4f, 16, 0.f, 6); // 6 modules x 49.9 cm step
165-
mLayers[1] = MIDLayer(1, "MIDLayer1_central", kRCen1, 312.f, 16, 0.f, 6); // 6 modules x 52 cm step
166-
mLayers[2] = MIDLayer(2, "MIDLayer0_forward", kRExt0, 99.8f, 16, +400.f, 2, -1.f, 21); // 2 modules x 49.9 cm step, nBars=21 for R=276 cm
167-
mLayers[3] = MIDLayer(3, "MIDLayer1_forward", kRExt1, 104.f, 16, +405.f, 2); // 2 modules x 52 cm step, +5 cm offset to clear absorber transition
168-
mLayers[4] = MIDLayer(4, "MIDLayer0_backward", kRExt0, 99.8f, 16, -400.f, 2, -1.f, 21); // 2 modules x 49.9 cm step, nBars=21 for R=276 cm
169-
mLayers[5] = MIDLayer(5, "MIDLayer1_backward", kRExt1, 104.f, 16, -405.f, 2); // 2 modules x 52 cm step, -5 cm offset to clear absorber transition
163+
mLayers[0] = MIDLayer(0, "MIDLayer0_central", kRCen0, 299.4f, 16, 0.f, 6); // 6 modules x 49.9 cm step
164+
mLayers[1] = MIDLayer(1, "MIDLayer1_central", kRCen1, 312.f, 16, 0.f, 6); // 6 modules x 52 cm step
165+
mLayers[2] = MIDLayer(2, "MIDLayer0_forward", kRExt0, 99.8f, 16, +400.f, 2, -1.f, 21); // 2 modules x 49.9 cm step, nBars=21 for R=276 cm
166+
mLayers[3] = MIDLayer(3, "MIDLayer1_forward", kRExt1, 104.f, 16, +405.f, 2); // 2 modules x 52 cm step, +5 cm offset to clear absorber transition
167+
mLayers[4] = MIDLayer(4, "MIDLayer0_backward", kRExt0, 99.8f, 16, -400.f, 2, -1.f, 21); // 2 modules x 49.9 cm step, nBars=21 for R=276 cm
168+
mLayers[5] = MIDLayer(5, "MIDLayer1_backward", kRExt1, 104.f, 16, -405.f, 2); // 2 modules x 52 cm step, -5 cm offset to clear absorber transition
170169
} else {
171170
mLayers.resize(2);
172171
mLayers[0] = MIDLayer(0, GeometryTGeo::composeSymNameLayer(0), 266.f, 500.f);
@@ -176,7 +175,6 @@ void Detector::createGeometry()
176175
for (auto& layer : mLayers) {
177176
layer.createLayer(vMID);
178177
}
179-
180178
}
181179

182180
void Detector::Reset()
@@ -205,7 +203,9 @@ bool Detector::ProcessHits(FairVolume* vol)
205203
int physLay = -1;
206204
const char* volName = fMC->CurrentVolName();
207205
sscanf(volName, "MIDSensor_L%d", &physLay);
208-
if (physLay >= 0) physLay = physLay % 2;
206+
if (physLay >= 0) {
207+
physLay = physLay % 2;
208+
}
209209
bool startHit = false, stopHit = false;
210210
unsigned char status = 0;
211211
if (fMC->IsTrackEntering()) {
@@ -258,7 +258,10 @@ bool Detector::ProcessHits(FairVolume* vol)
258258
// name (MIDSensor_L<l>_S<s>_M<m>_B<b>) and can be decoded with sscanf if needed.
259259
// Left as future work for hit digitization.
260260

261-
if (physLay < 0) { return false; } // guard: sensor name did not match expected pattern
261+
if (physLay < 0) {
262+
LOGP(warn, "MID sensor name {} did not match expected pattern, cannot extract physical layer index", volName);
263+
return false;
264+
} // guard: sensor name did not match expected pattern
262265
Hit* p = addHit(stack->GetCurrentTrackNumber(), physLay, mTrackData.mPositionStart.Vect(), positionStop.Vect(),
263266
mTrackData.mMomentumStart.Vect(), mTrackData.mMomentumStart.E(), positionStop.T(),
264267
mTrackData.mEnergyLoss, mTrackData.mTrkStatusStart, status);

Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/PassiveBaseParam.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,24 @@ namespace passive
2424
// ** Parameters for Passive base configuration
2525
// **
2626

27-
enum MagnetLayout : int {
28-
AluminiumStabilizer = 0,
29-
CopperStabilizer = 1,
30-
WindingPack = 2,
31-
SuperconductingMagnet = 3
27+
enum MagnetType : int {
28+
AluminiumStabilizer = 0, // Using Aluminium stabilizer for the magnet
29+
CopperStabilizer = 1, // Using Copper stabilizer for the magnet
30+
WindingPack = 2, // Using Winding Pack for the magnet
31+
SuperconductingMagnet = 3 // Using Superconducting magnet (NbTi+Cu+Al) for the magnet
3232
};
3333

34-
enum DetLayout : int {
35-
StandardRadius = 0,
36-
ReducedRadius = 1,
37-
SteppedAbsorber = 2
34+
enum MagnetAbsorberLayout : int {
35+
StandardRadius = 0, // Using standard radius for the magnet and absorber
36+
ReducedRadius = 1, // Using reduced radius for the magnet and absorber
37+
SteppedAbsorber = 2 // Using stepped absorber for the magnet and absorber
3838
};
3939

4040
struct Alice3PassiveBaseParam : public o2::conf::ConfigurableParamHelper<Alice3PassiveBaseParam> {
4141
// Geometry Builder parameters
4242

43-
MagnetLayout mLayout = MagnetLayout::AluminiumStabilizer; // Magnet layout: Aluminium or Copper stabilizer
44-
// DetLayout mDetLayout = DetLayout::StandardRadius; // Detector layout: Standard or Reduced radius
45-
DetLayout mDetLayout = o2::passive::DetLayout::SteppedAbsorber; // Detector layout: Standard or Reduced radius
43+
MagnetType mMagType = MagnetType::AluminiumStabilizer; // Magnet type: as in MagnetType enum
44+
MagnetAbsorberLayout mMagLayout = o2::passive::MagnetAbsorberLayout::SteppedAbsorber; // Magnet and absorber layout: as in MagnetAbsorberLayout enum
4645

4746
O2ParamDef(Alice3PassiveBaseParam, "Alice3PassiveBase");
4847
};

Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ void Alice3Absorber::ConstructGeometry()
131131
}
132132

133133
auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
134-
int nSections = (passiveBaseParam.mDetLayout == o2::passive::DetLayout::SteppedAbsorber) ? 6 : 18;
135-
TGeoPcon* absorings = new TGeoPcon(0., 360., nSections);
136-
switch (passiveBaseParam.mDetLayout) {
137-
case o2::passive::DetLayout::StandardRadius:
134+
TGeoPcon* absorings = nullptr;
135+
switch (passiveBaseParam.mMagLayout) {
136+
case o2::passive::MagnetAbsorberLayout::StandardRadius:
137+
absorings = new TGeoPcon(0., 360., 18);
138138
absorings->DefineSection(0, 500, 236, 274);
139139
absorings->DefineSection(1, 400, 236, 274);
140140
absorings->DefineSection(2, 400, 232.5, 277.5);
@@ -154,8 +154,8 @@ void Alice3Absorber::ConstructGeometry()
154154
absorings->DefineSection(16, -400, 236, 274);
155155
absorings->DefineSection(17, -500, 236, 274);
156156
break;
157-
case o2::passive::DetLayout::ReducedRadius:
158-
case o2::passive::DetLayout::Version2:
157+
case o2::passive::MagnetAbsorberLayout::ReducedRadius:
158+
absorings = new TGeoPcon(0., 360., 18);
159159
absorings->DefineSection(0, 500, 201, 239);
160160
absorings->DefineSection(1, 400, 201, 239);
161161
absorings->DefineSection(2, 400, 197.5, 242.5);
@@ -175,18 +175,19 @@ void Alice3Absorber::ConstructGeometry()
175175
absorings->DefineSection(16, -400, 201, 239);
176176
absorings->DefineSection(17, -500, 201, 239);
177177
break;
178-
case o2::passive::DetLayout::SteppedAbsorber:
178+
case o2::passive::MagnetAbsorberLayout::SteppedAbsorber:
179179
// Geometria 6 (Ian/tesis): Rext=290 constante, escalon en Rmin.
180180
// Externas 45 cm (Rmin=245), central 70 cm (Rmin=220). Ref: Ian DetectorConstruction.cc abs_thickness={45,70,45}
181+
absorings = new TGeoPcon(0., 360., 6);
181182
absorings->DefineSection(0, -500, 245, 290);
182183
absorings->DefineSection(1, -300, 245, 290);
183184
absorings->DefineSection(2, -300, 220, 290);
184-
absorings->DefineSection(3, 300, 220, 290);
185-
absorings->DefineSection(4, 300, 245, 290);
186-
absorings->DefineSection(5, 500, 245, 290);
185+
absorings->DefineSection(3, 300, 220, 290);
186+
absorings->DefineSection(4, 300, 245, 290);
187+
absorings->DefineSection(5, 500, 245, 290);
187188
break;
188189
default:
189-
LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mDetLayout;
190+
LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mMagLayout;
190191
break;
191192
}
192193

Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,12 @@ void Alice3Magnet::ConstructGeometry()
119119
// Passive Base configuration parameters
120120
auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
121121

122-
const bool isVersion2 = (passiveBaseParam.mDetLayout == o2::passive::DetLayout::Version2);
123-
124-
switch (passiveBaseParam.mDetLayout) {
125-
case o2::passive::DetLayout::StandardRadius:
122+
switch (passiveBaseParam.mMagLayout) {
123+
case o2::passive::MagnetAbsorberLayout::StandardRadius:
126124
// Defined in the header file
127125
break;
128-
case o2::passive::DetLayout::SteppedAbsorber: // Ian absorber uses ReducedRadius magnet
129-
case o2::passive::DetLayout::ReducedRadius:
126+
case o2::passive::MagnetAbsorberLayout::SteppedAbsorber: // Ian absorber uses ReducedRadius magnet
127+
case o2::passive::MagnetAbsorberLayout::ReducedRadius:
130128
mInnerWrapInnerRadius = 125.f; // cm
131129
mInnerWrapThickness = 1.f; // cm
132130
mCoilInnerRadius = 145.f; // cm
@@ -137,60 +135,47 @@ void Alice3Magnet::ConstructGeometry()
137135
mOuterWrapThickness = 3.f; // cm
138136
mZLength = 800.f; // cm
139137
break;
140-
case o2::passive::DetLayout::Version2:
141-
// Engineering note 2026-05-06 baseline stack (radial):
142-
// inner wall 3 mm + winding pack 48 mm + support cylinder 20 mm + MLI 2 mm + outer wall 3 mm.
143-
mInnerWrapInnerRadius = 125.f; // cm
144-
mInnerWrapThickness = 0.3f; // cm
145-
mCoilInnerRadius = mInnerWrapInnerRadius + mInnerWrapThickness; // cm
146-
mCoilThickness = 4.8f; // cm
147-
mRestMaterialRadius = mCoilInnerRadius + mCoilThickness; // cm
148-
mRestMaterialThickness = 2.2f; // cm
149-
mOuterWrapInnerRadius = mRestMaterialRadius + mRestMaterialThickness; // cm
150-
mOuterWrapThickness = 0.3f; // cm
151-
mZLength = 800.f; // cm
152-
break;
153138
default:
154-
LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mDetLayout;
139+
LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mMagLayout;
155140
break;
156141
}
157142

158143
bool doCopperStabilizer = false;
159144
bool doWindingPack = false;
160-
switch (passiveBaseParam.mLayout) {
161-
case o2::passive::MagnetLayout::AluminiumStabilizer:
145+
switch (passiveBaseParam.mMagType) {
146+
case o2::passive::MagnetType::AluminiumStabilizer:
162147
// Handled in the header file
163148
break;
164-
case o2::passive::MagnetLayout::CopperStabilizer:
165-
if (isVersion2) {
166-
LOG(warn) << "Alice 3 magnet: CopperStabilizer override ignored for Version2 (engineering-note stack)";
167-
break;
168-
}
149+
case o2::passive::MagnetType::CopperStabilizer:
150+
// if (isVersion2) {
151+
// LOG(warn) << "Alice 3 magnet: CopperStabilizer override ignored for Version2 (engineering-note stack)";
152+
// break;
153+
// }
169154
doCopperStabilizer = true;
170155
mRestMaterialThickness -= 3.3; // cm Remove the Aluminium stabiliser
171156
mRestMaterialThickness += 2.2; // cm Add the Copper stabiliser
172157
LOG(debug) << "Alice 3 magnet: using Copper Stabilizer with thickness " << mRestMaterialThickness << " cm";
173158
break;
174-
case o2::passive::MagnetLayout::WindingPack:
159+
case o2::passive::MagnetType::WindingPack:
175160
doWindingPack = true;
176161
LOG(debug) << "Alice 3 magnet: using WindingPack (NbTi+Cu+Al) coil";
177162
break;
178-
case o2::passive::MagnetLayout::SuperconductingMagnet:
163+
case o2::passive::MagnetType::SuperconductingMagnet:
179164
// Ian Perez Garcia design (ICN-UNAM) — radios desde DetectorConstruction.cc
180-
doWindingPack = true; // usa WindingPack como material del coil
181-
mInnerWrapInnerRadius = 140.f; // cm — pared interna criostato
182-
mInnerWrapThickness = 1.0f; // cm — Al
183-
mCoilInnerRadius = 160.f; // cm — bobina (tras gap de vacío)
184-
mCoilThickness = 0.3f; // cm — NbTi/Cu
185-
mRestMaterialRadius = 160.3f;// cm — soporte bobina
186-
mRestMaterialThickness = 15.7f; // cm — Al
187-
mOuterWrapInnerRadius = 197.f; // cm — soporte restante (6 cm Al) + pared externa
188-
mOuterWrapThickness = 3.0f; // cm — pared externa Al, R=197-200
189-
mZLength = 800.f; // cm
165+
doWindingPack = true; // usa WindingPack como material del coil
166+
mInnerWrapInnerRadius = 140.f; // cm — pared interna criostato
167+
mInnerWrapThickness = 1.0f; // cm — Al
168+
mCoilInnerRadius = 160.f; // cm — bobina (tras gap de vacío)
169+
mCoilThickness = 0.3f; // cm — NbTi/Cu
170+
mRestMaterialRadius = 160.3f; // cm — soporte bobina
171+
mRestMaterialThickness = 15.7f; // cm — Al
172+
mOuterWrapInnerRadius = 197.f; // cm — soporte restante (6 cm Al) + pared externa
173+
mOuterWrapThickness = 3.0f; // cm — pared externa Al, R=197-200
174+
mZLength = 800.f; // cm
190175
LOG(debug) << "Alice 3 magnet: using Ian Perez Garcia design (ICN-UNAM)";
191176
break;
192177
default:
193-
LOG(fatal) << "Unknown magnet layout " << passiveBaseParam.mLayout;
178+
LOG(fatal) << "Unknown magnet layout " << passiveBaseParam.mMagType;
194179
break;
195180
}
196181

0 commit comments

Comments
 (0)