Skip to content

Commit 742b14c

Browse files
committed
ITS3: define alignable volumes
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 19803f6 commit 742b14c

File tree

5 files changed

+54
-24
lines changed

5 files changed

+54
-24
lines changed

Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
314314
static const char* getITS3PixelArrayPattern(int layer) { return Form("%s%d", getITS3PixelArrayPatternRaw(), layer); };
315315

316316
/// sym name of the layer
317-
static const char* composeSymNameITS(bool isITS3 = false);
317+
static const char* composeSymNameITS();
318318
/// sym name of the layer
319319
static const char* composeSymNameLayer(int lr, bool isITS3 = false);
320320

Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,8 @@ bool GeometryTGeo::getChipId(int index, int& lay, int& hba, int& sta, int& hsta,
290290
}
291291

292292
//__________________________________________________________________________
293-
const char* GeometryTGeo::composeSymNameITS(bool isITS3)
293+
const char* GeometryTGeo::composeSymNameITS()
294294
{
295-
if (isITS3) {
296-
#ifdef ENABLE_UPGRADES
297-
return o2::detectors::DetID(o2::detectors::DetID::IT3).getName();
298-
#endif
299-
}
300-
301295
return o2::detectors::DetID(o2::detectors::DetID::ITS).getName();
302296
}
303297

Detectors/ITSMFT/ITS/simulation/src/Detector.cxx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ void Detector::addAlignableVolumes() const
11061106

11071107
TString detName = GetName();
11081108
TString path = Form("/cave_1/barrel_1/%s_2", GeometryTGeo::getITSVolPattern());
1109-
TString sname = GeometryTGeo::composeSymNameITS((detName == "IT3"));
1109+
TString sname = GeometryTGeo::composeSymNameITS();
11101110

11111111
LOG(debug) << sname << " <-> " << path;
11121112

@@ -1119,13 +1119,13 @@ void Detector::addAlignableVolumes() const
11191119
if (lr < mNumberInnerLayers) {
11201120
if (detName == "ITS") {
11211121
((DescriptorInnerBarrelITS2*)mDescriptorIB.get())->addAlignableVolumesLayer(lr, mWrapperLayerId[lr], path, lastUID);
1122+
} else {
1123+
((DescriptorInnerBarrelITS3*)mDescriptorIB.get())->addAlignableVolumesLayer(lr, mWrapperLayerId[lr], path, lastUID);
11221124
}
11231125
} else {
11241126
addAlignableVolumesLayer(lr, path, lastUID);
11251127
}
11261128
}
1127-
1128-
return;
11291129
}
11301130

11311131
void Detector::addAlignableVolumesLayer(int lr, TString& parent, Int_t& lastUID) const
@@ -1148,8 +1148,6 @@ void Detector::addAlignableVolumesLayer(int lr, TString& parent, Int_t& lastUID)
11481148
for (Int_t hb = start; hb < nhbarrel; hb++) {
11491149
addAlignableVolumesHalfBarrel(lr, hb, path, lastUID);
11501150
}
1151-
1152-
return;
11531151
}
11541152

11551153
void Detector::addAlignableVolumesHalfBarrel(Int_t lr, Int_t hb, TString& parent, Int_t& lastUID) const
@@ -1177,8 +1175,6 @@ void Detector::addAlignableVolumesHalfBarrel(Int_t lr, Int_t hb, TString& parent
11771175
for (int st = 0; st < nstaves; st++) {
11781176
addAlignableVolumesStave(lr, hb, st, path, lastUID);
11791177
}
1180-
1181-
return;
11821178
}
11831179

11841180
void Detector::addAlignableVolumesStave(Int_t lr, Int_t hb, Int_t st, TString& parent, Int_t& lastUID) const
@@ -1205,8 +1201,6 @@ void Detector::addAlignableVolumesStave(Int_t lr, Int_t hb, Int_t st, TString& p
12051201
for (Int_t sst = start; sst < nhstave; sst++) {
12061202
addAlignableVolumesHalfStave(lr, hb, st, sst, path, lastUID);
12071203
}
1208-
1209-
return;
12101204
}
12111205

12121206
void Detector::addAlignableVolumesHalfStave(Int_t lr, Int_t hb, Int_t st, Int_t hst, TString& parent, Int_t& lastUID) const
@@ -1236,8 +1230,6 @@ void Detector::addAlignableVolumesHalfStave(Int_t lr, Int_t hb, Int_t st, Int_t
12361230
for (Int_t md = start; md < nmodules; md++) {
12371231
addAlignableVolumesModule(lr, hb, st, hst, md, path, lastUID);
12381232
}
1239-
1240-
return;
12411233
}
12421234

12431235
void Detector::addAlignableVolumesModule(Int_t lr, Int_t hb, Int_t st, Int_t hst, Int_t md, TString& parent, Int_t& lastUID) const
@@ -1266,8 +1258,6 @@ void Detector::addAlignableVolumesModule(Int_t lr, Int_t hb, Int_t st, Int_t hst
12661258
for (Int_t ic = 0; ic < nchips; ic++) {
12671259
addAlignableVolumesChip(lr, hb, st, hst, md, ic, path, lastUID);
12681260
}
1269-
1270-
return;
12711261
}
12721262

12731263
void Detector::addAlignableVolumesChip(Int_t lr, Int_t hb, Int_t st, Int_t hst, Int_t md, Int_t ch, TString& parent,

Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/DescriptorInnerBarrelITS3.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ class DescriptorInnerBarrelITS3 : public o2::its::DescriptorInnerBarrel
4040
void createLayer(int idLayer, TGeoVolume* dest);
4141
void createServices(TGeoVolume* dest);
4242
void configure() {}
43+
void addAlignableVolumesLayer(int idLayer, int wrapperLayerId, TString& parentPath, int& lastUID) const;
4344

4445
protected:
45-
int mNumLayers{constants::nLayers};
46-
4746
// wrapper volume properties
4847
static constexpr double mTolerance{1e-3};
4948
static constexpr double mWrapperMinRadiusITS3{constants::radiiInner[0] - mTolerance};
5049
static constexpr double mWrapperMaxRadiusITS3{constants::services::radiusOuter + mTolerance};
51-
static constexpr double mWrapperZSpanITS3{constants::services::length * 2 + mTolerance}; // z length is divided in half
50+
static constexpr double mWrapperZSpanITS3{(constants::services::length * 2) + mTolerance}; // z length is divided in half
5251

5352
private:
53+
void addAlignableVolumesHalfBarrel(int idLayer, int iHB, TString& parentPath, int& lastUID) const;
54+
void addAlignableVolumesChips(int idLayer, int iHalfBarrel, TString& parentPath, int& lastUID) const;
55+
5456
std::array<std::unique_ptr<ITS3Layer>, constants::nLayers> mIBLayers;
5557
std::unique_ptr<ITS3Services> mServices;
5658

Detectors/Upgrades/ITS3/simulation/src/DescriptorInnerBarrelITS3.cxx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include "ITS3Simulation/DescriptorInnerBarrelITS3.h"
13+
#include "ITSBase/GeometryTGeo.h"
14+
#include "Framework/Logger.h"
1315

1416
using namespace o2::its3;
1517

@@ -26,3 +28,45 @@ void DescriptorInnerBarrelITS3::createServices(TGeoVolume* dest)
2628
mServices = std::make_unique<ITS3Services>();
2729
mServices->createCYSSAssembly(dest);
2830
}
31+
32+
void DescriptorInnerBarrelITS3::addAlignableVolumesLayer(int idLayer, int wrapperLayerId, TString& parentPath, int& lastUID) const
33+
{
34+
TString wrpV = wrapperLayerId != -1 ? Form("%s%d_1", its::GeometryTGeo::getITSWrapVolPattern(), wrapperLayerId) : "";
35+
TString path = Form("%s/%s/%s%d_0", parentPath.Data(), wrpV.Data(), its::GeometryTGeo::getITS3LayerPattern(), idLayer);
36+
TString sname = its::GeometryTGeo::composeSymNameLayer(idLayer, true);
37+
38+
for (int iHalfBarrel{0}; iHalfBarrel < 2; ++iHalfBarrel) {
39+
addAlignableVolumesHalfBarrel(idLayer, iHalfBarrel, path, lastUID);
40+
}
41+
}
42+
43+
void DescriptorInnerBarrelITS3::addAlignableVolumesHalfBarrel(int idLayer, int iHB, TString& parentPath, int& lastUID) const
44+
{
45+
// for ITS3 smallest alignable volume is the half-barrel (e.g., the carbon-form composite structure with the sensors)
46+
TString path = Form("%s/%s%d_%d", parentPath.Data(), its::GeometryTGeo::getITS3HalfBarrelPattern(), idLayer, iHB);
47+
TString sname = its::GeometryTGeo::composeSymNameHalfBarrel(idLayer, iHB, true);
48+
if (!gGeoManager->SetAlignableEntry(sname.Data(), path.Data())) {
49+
LOG(fatal) << "Unable to set alignable entry ! " << sname << " : " << path;
50+
}
51+
addAlignableVolumesChips(idLayer, iHB, path, lastUID);
52+
}
53+
54+
void DescriptorInnerBarrelITS3::addAlignableVolumesChips(int idLayer, int iHB, TString& parentPath, int& lastUID) const
55+
{
56+
for (int seg{0}; seg < constants::nSegments[idLayer]; ++seg) {
57+
for (int rsu{0}; rsu < constants::segment::nRSUs; ++rsu) {
58+
for (int tile{0}; tile < constants::rsu::nTiles; ++tile) {
59+
TString path = parentPath;
60+
path += Form("/%s_0/", its::GeometryTGeo::getITS3ChipPattern(idLayer));
61+
path += Form("%s_%d/", its::GeometryTGeo::getITS3SegmentPattern(idLayer), seg);
62+
path += Form("%s_%d/", its::GeometryTGeo::getITS3RSUPattern(idLayer), rsu);
63+
path += Form("%s_%d/", its::GeometryTGeo::getITS3TilePattern(idLayer), tile);
64+
TString sname = its::GeometryTGeo::composeSymNameChip(idLayer, iHB, 0, seg, rsu, tile, true);
65+
if (!gGeoManager->SetAlignableEntry(sname.Data(), path.Data())) {
66+
LOG(fatal) << "Unable to set alignable entry ! " << sname << " : " << path;
67+
}
68+
++lastUID;
69+
}
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)