Skip to content

Commit d4b763c

Browse files
committed
VD sensor names, num of vols using registry
1 parent a1d7cd2 commit d4b763c

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void Alice3Pipe::ConstructGeometry()
123123
barrel->AddNode(pipeVolume, 1, new TGeoTranslation(0, 30.f, 0));
124124

125125
pipeVolume->SetLineColor(37);
126-
pipeVolume->SetTransparency(10);
126+
pipeVolume->SetTransparency(0);
127127
}
128128

129129
void Alice3Pipe::createMaterials()

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ namespace trk
3030
class Detector : public o2::base::DetImpl<Detector>
3131
{
3232
public:
33-
static constexpr Int_t mNumberOfVolumes = 44; /// hardcoded for the current geometry = 8 MLOT layers + 36 volumes in the VD. TODO: automatize or change according to the current geometry
34-
static constexpr Int_t mNumberOfVolumesVD = 36; /// hardcoded for the current geometry = 36 volumes in the VD. TODO: automatize or change according to the current geometry
35-
3633
Detector(bool active);
3734
Detector();
3835
~Detector();
@@ -79,6 +76,9 @@ class Detector : public o2::base::DetImpl<Detector>
7976
void createGeometry();
8077

8178
private:
79+
int mNumberOfVolumes;
80+
int mNumberOfVolumesVD;
81+
8282
// Transient data about track passing the sensor
8383
struct TrackData {
8484
bool mHitStarted; // hit creation started
@@ -90,7 +90,7 @@ class Detector : public o2::base::DetImpl<Detector>
9090
GeometryTGeo* mGeometryTGeo; //!
9191
std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
9292
std::vector<TRKLayer> mLayers;
93-
TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker
93+
TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker
9494

9595
std::vector<std::string> mFirstOrLastLayers; // Names of the first or last layers
9696
bool InsideFirstOrLastLayer(std::string layerName);

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,6 @@ Detector::Detector(bool active)
5656
configServices();
5757
}
5858

59-
mSensorName.resize(mNumberOfVolumes); // hardcoded. TODO: change size when a different naming scheme for VD is in place. Ideally could be 4 petals + 8 layers = 12
60-
int VDvolume = 0;
61-
for (int i = 0; i < 4; i++) { /// VD
62-
for (int j = 0; j < 3; j++) {
63-
mSensorName[VDvolume].Form("%s%d_%s%d_%s%d", GeometryTGeo::getTRKPetalPattern(), i, GeometryTGeo::getTRKPetalLayerPattern(), j, GeometryTGeo::getTRKSensorPattern(), j);
64-
VDvolume++;
65-
}
66-
for (int j = 0; j < 6; j++) {
67-
mSensorName[VDvolume].Form("%s%d_%s%d_%s%d", GeometryTGeo::getTRKPetalPattern(), i, GeometryTGeo::getTRKPetalDiskPattern(), j, GeometryTGeo::getTRKSensorPattern(), j);
68-
VDvolume++;
69-
}
70-
}
71-
72-
for (int i = 0; i < 8; i++) { /// MLOT
73-
mSensorName[VDvolume].Form("%s%d", GeometryTGeo::getTRKSensorPattern(), i);
74-
VDvolume++;
75-
}
76-
77-
for (auto vd : mSensorName) {
78-
std::cout << "Volume name: " << vd << std::endl;
79-
}
80-
8159
LOGP(info, "Summary of TRK configuration:");
8260
for (auto& layer : mLayers) {
8361
LOGP(info, "Layer: {} name: {} r: {} cm | z: {} cm | thickness: {} cm", layer.getNumber(), layer.getName(), layer.getInnerRadius(), layer.getZ(), layer.getChipThickness());
@@ -262,13 +240,35 @@ void Detector::createGeometry()
262240
mServices.createServices(vTRK);
263241

264242
// Build the VD using the petal builder
265-
o2::trk::clearVDSensorRegistry();
266-
267243
// Choose the VD design (here: IRIS4 by default).
268244
// You can wire this to a parameter in TRKBaseParam if desired.
269245
// Alternatives: createIRIS5Geometry(vTRK); createIRIS4aGeometry(vTRK);
246+
247+
o2::trk::clearVDSensorRegistry();
270248
o2::trk::createIRIS4Geometry(vTRK);
271249

250+
// Fill sensor names from registry right after geometry creation
251+
const auto& regs = o2::trk::vdSensorRegistry();
252+
mNumberOfVolumesVD = static_cast<int>(regs.size());
253+
mNumberOfVolumes = mNumberOfVolumesVD + mLayers.size();
254+
mSensorName.resize(mNumberOfVolumes);
255+
256+
// Fill VD sensor names from registry
257+
int VDvolume = 0;
258+
for (const auto& sensor : regs) {
259+
mSensorName[VDvolume] = sensor.name;
260+
VDvolume++;
261+
}
262+
263+
// Add MLOT sensor names
264+
for (int i = 0; i < mLayers.size(); i++) {
265+
mSensorName[VDvolume++].Form("%s%d", GeometryTGeo::getTRKSensorPattern(), i);
266+
}
267+
268+
for (auto vd : mSensorName) {
269+
std::cout << "Volume name: " << vd << std::endl;
270+
}
271+
272272
mServices.excavateFromVacuum("IRIS_CUTOUTsh");
273273
mServices.registerVacuum(vTRK);
274274
}
@@ -304,7 +304,7 @@ void Detector::defineSensitiveVolumes()
304304
LOGP(info, "Adding VD Sensitive Volume {}", v->GetName());
305305
AddSensitiveVolume(v);
306306
// Optionally track first/last layers for TR references:
307-
if (s.kind == o2::trk::VDSensorDesc::Kind::Barrel && (s.idx == 0 /*innermost*/)) {
307+
if (s.region == o2::trk::VDSensorDesc::Region::Barrel && (s.idx == 0 /*innermost*/)) {
308308
mFirstOrLastLayers.push_back(s.name);
309309
}
310310
}

Detectors/Upgrades/ALICE3/TRK/simulation/src/VDGeometryBuilder.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ std::vector<VDSensorDesc>& vdSensorRegistry() { return gVDSensors; }
3535

3636
void clearVDSensorRegistry() { gVDSensors.clear(); }
3737

38-
void registerSensor(const std::string& volName, int petal, VDSensorDesc::Kind kind, int idx)
38+
void registerSensor(const std::string& volName, int petal, VDSensorDesc::Region region, VDSensorDesc::Type type, int idx)
3939
{
40-
gVDSensors.push_back({volName, petal, kind, idx});
40+
gVDSensors.push_back({volName, petal, region, type, idx});
4141
}
4242

4343
static inline std::string makeSensorName(const std::string& layerName, int layerNumber)
@@ -208,7 +208,7 @@ inline void buildIrisCutoutFromPetalSolid(int nPetals)
208208
} // namespace
209209

210210
// =================== Specs & constants (ROOT units: cm) ===================
211-
static constexpr double kX2X0 = 100.e-4f; // all silicon
211+
static constexpr double kX2X0 = 0.001f; // 0.1% X0 per layer
212212
static constexpr double kLenZ_cm = 50.0f; // L0/L1/L2 Z length
213213

214214
// Radii (cm)
@@ -392,15 +392,15 @@ static void addBarrelLayers(TGeoVolume* petalAsm, int nPetals, int petalID, bool
392392

393393
auto* tr = new TGeoCombiTrans(x, y, z, rot);
394394
L0.createLayer(petalAsm, tr);
395+
registerSensor(makeSensorName(nameL0, 0), petalID, VDSensorDesc::Region::Barrel, VDSensorDesc::Type::Plane, /*idx*/ 0);
395396
} else {
396397
VDCylindricalLayer L0(0,
397398
nameL0,
398399
kX2X0, rL0_cm, phiL0_deg, kLenZ_cm, kLenZ_cm);
399400
L0.createLayer(petalAsm, nullptr);
401+
registerSensor(makeSensorName(nameL0, 0), petalID, VDSensorDesc::Region::Barrel, VDSensorDesc::Type::Curved, /*idx*/ 0);
400402
}
401403

402-
registerSensor(makeSensorName(nameL0, 0), petalID, VDSensorDesc::Kind::Barrel, /*idx*/ 0);
403-
404404
const std::string nameL1 =
405405
std::string(o2::trk::GeometryTGeo::getTRKPetalPattern()) + std::to_string(petalID) + "_" +
406406
std::string(o2::trk::GeometryTGeo::getTRKPetalLayerPattern()) + "1";
@@ -409,7 +409,7 @@ static void addBarrelLayers(TGeoVolume* petalAsm, int nPetals, int petalID, bool
409409
nameL1,
410410
kX2X0, rL1_cm, phiL1_deg, kLenZ_cm, kLenZ_cm);
411411
L1.createLayer(petalAsm, nullptr);
412-
registerSensor(makeSensorName(nameL1, 1), petalID, VDSensorDesc::Kind::Barrel, /*idx*/ 1);
412+
registerSensor(makeSensorName(nameL1, 1), petalID, VDSensorDesc::Region::Barrel, VDSensorDesc::Type::Curved, /*idx*/ 1);
413413

414414
const std::string nameL2 =
415415
std::string(o2::trk::GeometryTGeo::getTRKPetalPattern()) + std::to_string(petalID) + "_" +
@@ -419,7 +419,7 @@ static void addBarrelLayers(TGeoVolume* petalAsm, int nPetals, int petalID, bool
419419
nameL2,
420420
kX2X0, rL2_cm, phiL2_deg, kLenZ_cm, kLenZ_cm);
421421
L2.createLayer(petalAsm, nullptr);
422-
registerSensor(makeSensorName(nameL2, 2), petalID, VDSensorDesc::Kind::Barrel, /*idx*/ 2);
422+
registerSensor(makeSensorName(nameL2, 2), petalID, VDSensorDesc::Region::Barrel, VDSensorDesc::Type::Curved, /*idx*/ 2);
423423
}
424424

425425
// Build cold plate (cylindrical) in local coordinates, and add it to the petal assembly.
@@ -632,7 +632,7 @@ static void addDisks(TGeoVolume* petalAsm, int nPetals, int petalID)
632632
// Local Z placement only
633633
auto* tr = new TGeoTranslation(0.0, 0.0, static_cast<Double_t>(disk.getZPosition()));
634634
disk.createLayer(petalAsm, tr);
635-
registerSensor(makeSensorName(nameD, i), petalID, VDSensorDesc::Kind::Disk, /*idx*/ i);
635+
registerSensor(makeSensorName(nameD, i), petalID, VDSensorDesc::Region::Disk, VDSensorDesc::Type::Plane, /*idx*/ i);
636636
}
637637
}
638638

0 commit comments

Comments
 (0)