Skip to content

Commit c81d651

Browse files
committed
ITS3: split longerons, improving stepping speed
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent bf8a402 commit c81d651

File tree

3 files changed

+37
-38
lines changed

3 files changed

+37
-38
lines changed

Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace carbonfoam
104104
// TODO: Waiting for the further information from WP5(Corrado)
105105
constexpr double HringLength{6.0 * mm}; // from blueprint
106106
constexpr double longeronsWidth{2.0 * mm}; // what is the height of the longerons?
107-
constexpr double longeronsLength{segment::length - 2 * HringLength}; // 263mm from blueprint; overrriden to be consitent
107+
constexpr double longeronsLength{segment::length - (2 * HringLength)}; // 263mm from blueprint; overrriden to be consitent
108108
constexpr double edgeBetwChipAndFoam{1.0 * mm}; // from blueprint but not used cause forms are already overlapping
109109
constexpr double gapBetwHringsLongerons{0.05 * mm}; // from blueprint
110110
constexpr std::array<int, 3> nHoles{11, 11, 11}; // how many holes for each layer?

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace o2::its3
2626
{
2727

2828
/// This class defines the geometry for the ITS3 IB layers.
29-
class ITS3Layer
29+
class ITS3Layer final
3030
{
3131
// The hierarchy will be the following:
3232
// ITS2 -> ITS3
@@ -76,7 +76,6 @@ class ITS3Layer
7676
void buildPartial(TGeoVolume* motherVolume, TGeoMatrix* mat = nullptr, BuildLevel level = BuildLevel::kAll, bool createMaterials = false);
7777

7878
private:
79-
bool mBuilt{false};
8079
TGeoMedium* mSilicon{nullptr};
8180
TGeoMedium* mAir{nullptr};
8281
TGeoMedium* mCarbon{nullptr};
@@ -91,7 +90,7 @@ class ITS3Layer
9190
void createSegment();
9291
void createChip();
9392
void createCarbonForm();
94-
TGeoCompositeShape* getHringShape(TGeoTubeSeg* Hring);
93+
TGeoCompositeShape* getHringShape(TGeoTubeSeg* Hring) const;
9594
void createLayerImpl();
9695

9796
uint8_t mNLayer{0}; // Layer number

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ void ITS3Layer::createLayer(TGeoVolume* motherVolume)
6767
// Create one layer of ITS3 and attach it to the motherVolume.
6868
getMaterials();
6969
createLayerImpl();
70-
mBuilt = true;
7170

7271
if (motherVolume == nullptr) {
7372
return;
7473
}
74+
7575
// Add it to motherVolume
7676
auto* trans = new TGeoTranslation(0, 0, -constants::segment::lengthSensitive / 2.);
7777
motherVolume->AddNode(mLayer, 0, trans);
@@ -122,18 +122,18 @@ void ITS3Layer::createTile()
122122
mTile->AddNode(mPixelArray, 0, phiRotPixelArray);
123123

124124
// Biasing
125-
double biasPhi1 = constants::pixelarray::width / mR * o2m::Rad2Deg + readoutPhi2;
126-
double biasPhi2 = biasing::width / mR * o2m::Rad2Deg + biasPhi1;
125+
double biasPhi1 = (constants::pixelarray::width / mR * o2m::Rad2Deg) + readoutPhi2;
126+
double biasPhi2 = (biasing::width / mR * o2m::Rad2Deg) + biasPhi1;
127127
auto biasing = new TGeoTubeSeg(mRmin, mRmax, biasing::length / 2, biasPhi1, biasPhi2);
128128
auto biasingVol = new TGeoVolume(Form("biasing%d", mNLayer), biasing, mSilicon);
129129
biasingVol->SetLineColor(biasing::color);
130130
biasingVol->RegisterYourself();
131131
mTile->AddNode(biasingVol, 0);
132132

133133
// Power Switches are on the side right side of the pixel array and biasing.
134-
auto zMovePowerSwitches = new TGeoTranslation(0, 0, +powerswitches::length / 2. + constants::pixelarray::length / 2.);
134+
auto zMovePowerSwitches = new TGeoTranslation(0, 0, (+powerswitches::length / 2.) + (constants::pixelarray::length / 2.));
135135
double powerPhi1 = readoutPhi2;
136-
double powerPhi2 = powerswitches::width / mR * o2m::Rad2Deg + powerPhi1;
136+
double powerPhi2 = (powerswitches::width / mR * o2m::Rad2Deg) + powerPhi1;
137137
auto powerSwitches = new TGeoTubeSeg(mRmin, mRmax, powerswitches::length / 2, powerPhi1, powerPhi2);
138138
auto powerSwitchesVol = new TGeoVolume(Form("powerswitches%d", mNLayer), powerSwitches, mSilicon);
139139
powerSwitchesVol->SetLineColor(powerswitches::color);
@@ -166,7 +166,7 @@ void ITS3Layer::createRSU()
166166
// Lower Left
167167
auto zMoveLL1 = new TGeoTranslation(0, 0, constants::tile::length);
168168
auto zMoveLL2 = new TGeoTranslation(0, 0, constants::tile::length * 2.);
169-
auto zMoveLLDB = new TGeoTranslation(0, 0, -databackbone::length / 2. - constants::pixelarray::length / 2.);
169+
auto zMoveLLDB = new TGeoTranslation(0, 0, (-databackbone::length / 2.) - (constants::pixelarray::length / 2.));
170170
// Lets attach the tiles to the QS.
171171
mRSU->AddNode(mTile, nCopyRSU++, nullptr);
172172
mRSU->AddNode(mTile, nCopyRSU++, zMoveLL1);
@@ -175,9 +175,9 @@ void ITS3Layer::createRSU()
175175

176176
// Lower Right
177177
auto zMoveLR0 = new TGeoTranslation(0, 0, +length / 2.);
178-
auto zMoveLR1 = new TGeoTranslation(0, 0, constants::tile::length + length / 2.);
179-
auto zMoveLR2 = new TGeoTranslation(0, 0, constants::tile::length * 2. + length / 2.);
180-
auto zMoveLRDB = new TGeoTranslation(0, 0, -databackbone::length / 2. + length / 2. - constants::pixelarray::length / 2.);
178+
auto zMoveLR1 = new TGeoTranslation(0, 0, constants::tile::length + (length / 2.));
179+
auto zMoveLR2 = new TGeoTranslation(0, 0, (constants::tile::length * 2.) + (length / 2.));
180+
auto zMoveLRDB = new TGeoTranslation(0, 0, (-databackbone::length / 2.) + (length / 2.) - (constants::pixelarray::length / 2.));
181181
// Lets attach the tiles to the QS.
182182
mRSU->AddNode(mTile, nCopyRSU++, zMoveLR0);
183183
mRSU->AddNode(mTile, nCopyRSU++, zMoveLR1);
@@ -192,7 +192,7 @@ void ITS3Layer::createRSU()
192192
// Upper Left
193193
auto zMoveUL1 = new TGeoCombiTrans(0, 0, constants::tile::length, rot);
194194
auto zMoveUL2 = new TGeoCombiTrans(0, 0, constants::tile::length * 2., rot);
195-
auto zMoveULDB = new TGeoCombiTrans(0, 0, -databackbone::length / 2. - constants::pixelarray::length / 2., rot);
195+
auto zMoveULDB = new TGeoCombiTrans(0, 0, (-databackbone::length / 2.) - (constants::pixelarray::length / 2.), rot);
196196
// Lets attach the tiles to the QS.
197197
mRSU->AddNode(mTile, nCopyRSU++, rot);
198198
mRSU->AddNode(mTile, nCopyRSU++, zMoveUL1);
@@ -201,9 +201,9 @@ void ITS3Layer::createRSU()
201201

202202
// Upper Right
203203
auto zMoveUR0 = new TGeoCombiTrans(0, 0, +length / 2., rot);
204-
auto zMoveUR1 = new TGeoCombiTrans(0, 0, constants::tile::length + length / 2., rot);
205-
auto zMoveUR2 = new TGeoCombiTrans(0, 0, constants::tile::length * 2. + length / 2., rot);
206-
auto zMoveURDB = new TGeoCombiTrans(0, 0, -databackbone::length / 2. + length / 2. - constants::pixelarray::length / 2., rot);
204+
auto zMoveUR1 = new TGeoCombiTrans(0, 0, constants::tile::length + (length / 2.), rot);
205+
auto zMoveUR2 = new TGeoCombiTrans(0, 0, (constants::tile::length * 2.) + (length / 2.), rot);
206+
auto zMoveURDB = new TGeoCombiTrans(0, 0, (-databackbone::length / 2.) + (length / 2.) - (constants::pixelarray::length / 2.), rot);
207207
// Lets attach the tiles to the QS.
208208
mRSU->AddNode(mTile, nCopyRSU++, zMoveUR0);
209209
mRSU->AddNode(mTile, nCopyRSU++, zMoveUR1);
@@ -225,9 +225,9 @@ void ITS3Layer::createSegment()
225225
mSegment = new TGeoVolumeAssembly(its3TGeo::getITS3SegmentPattern(mNLayer));
226226
mSegment->VisibleDaughters();
227227

228-
for (size_t i{0}; i < nRSUs; ++i) {
229-
auto zMove = new TGeoTranslation(0, 0, +i * constants::rsu::length + constants::rsu::databackbone::length + constants::pixelarray::length / 2.);
230-
mSegment->AddNode(mRSU, i, zMove);
228+
for (unsigned int i{0}; i < nRSUs; ++i) {
229+
auto zMove = new TGeoTranslation(0, 0, (i * constants::rsu::length) + constants::rsu::databackbone::length + (constants::pixelarray::length / 2.));
230+
mSegment->AddNode(mRSU, (int)i, zMove);
231231
}
232232

233233
// LEC
@@ -242,7 +242,7 @@ void ITS3Layer::createSegment()
242242
mSegment->AddNode(lecVol, 0, zMoveLEC);
243243

244244
// REC; reuses lecPhi1,2
245-
auto zMoveREC = new TGeoTranslation(0, 0, nRSUs * constants::rsu::length + rec::length / 2.);
245+
auto zMoveREC = new TGeoTranslation(0, 0, (nRSUs * constants::rsu::length) + (rec::length / 2.));
246246
auto rec =
247247
new TGeoTubeSeg(mRmin, mRmax, rec::length / 2., lecPhi1, lecPhi2);
248248
auto recVol = new TGeoVolume(Form("rec%d", mNLayer), rec, mSilicon);
@@ -266,11 +266,11 @@ void ITS3Layer::createChip()
266266
auto phiOffset = constants::segment::width / mR * o2m::Rad2Deg;
267267
for (unsigned int i{0}; i < constants::nSegments[mNLayer]; ++i) {
268268
auto rot = new TGeoRotation(Form("its3PhiSegmentOffset_%d_%d", mNLayer, i), 0, 0, phiOffset * i);
269-
mChip->AddNode(mSegment, i, rot);
269+
mChip->AddNode(mSegment, (int)i, rot);
270270
}
271271

272272
// Add metal stack positioned radially outward
273-
auto zMoveMetal = new TGeoTranslation(0, 0, constants::metalstack::length / 2. - constants::segment::lec::length);
273+
auto zMoveMetal = new TGeoTranslation(0, 0, (constants::metalstack::length / 2.) - constants::segment::lec::length);
274274
auto metal = new TGeoTubeSeg(mRmax, mRmax + constants::metalstack::thickness, constants::metalstack::length / 2., 0, constants::nSegments[mNLayer] * phiOffset);
275275
auto metalVol = new TGeoVolume(Form("metal%d", mNLayer), metal, mCopper);
276276
metalVol->SetLineColor(constants::metalstack::color);
@@ -296,7 +296,7 @@ void ITS3Layer::createCarbonForm()
296296
dRadius = constants::carbonfoam::thicknessOuterFoam; // TODO: lack of carbon foam radius for layer 2, use 0.7 cm as a temporary value
297297
}
298298
double phiSta = edgeBetwChipAndFoam / (0.5 * constants::radii[mNLayer + 1] + constants::radii[mNLayer]) * o2m::Rad2Deg;
299-
double phiEnd = (constants::nSegments[mNLayer] * constants::segment::width) / constants::radii[mNLayer] * o2m::Rad2Deg - phiSta;
299+
double phiEnd = ((constants::nSegments[mNLayer] * constants::segment::width) / constants::radii[mNLayer] * o2m::Rad2Deg) - phiSta;
300300
double phiLongeronsCover = longeronsWidth / (0.5 * constants::radii[mNLayer + 1] + constants::radii[mNLayer]) * o2m::Rad2Deg;
301301

302302
// H-rings foam
@@ -308,35 +308,37 @@ void ITS3Layer::createCarbonForm()
308308
HringCVol->SetLineColor(color);
309309
auto HringAVol = new TGeoVolume(Form("hringA%d", mNLayer), HringAWithHoles, mCarbon);
310310
HringAVol->SetLineColor(color);
311-
auto zMoveHringC = new TGeoTranslation(0, 0, -constants::segment::lec::length + HringLength / 2.);
312-
auto zMoveHringA = new TGeoTranslation(0, 0, -constants::segment::lec::length + HringLength / 2. + constants::segment::length - HringLength);
311+
auto zMoveHringC = new TGeoTranslation(0, 0, -constants::segment::lec::length + (HringLength / 2.));
312+
auto zMoveHringA = new TGeoTranslation(0, 0, -constants::segment::lec::length + (HringLength / 2.) + constants::segment::length - HringLength);
313313

314314
// Longerons are made by same material
315+
// added separately to make navigation faster
315316
[[maybe_unused]] auto longeronR = new TGeoTubeSeg(Form("longeronR%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2., phiSta, phiSta + phiLongeronsCover);
316317
[[maybe_unused]] auto longeronL = new TGeoTubeSeg(Form("longeronL%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2., phiEnd - phiLongeronsCover, phiEnd);
317-
TString nameLongerons = Form("longeronR%d + longeronL%d", mNLayer, mNLayer);
318-
auto longerons = new TGeoCompositeShape(nameLongerons);
319-
auto longeronsVol = new TGeoVolume(Form("longerons%d", mNLayer), longerons, mCarbon);
320-
longeronsVol->SetLineColor(color);
321-
auto zMoveLongerons = new TGeoTranslation(0, 0, -constants::segment::lec::length + constants::segment::length / 2.);
318+
auto longeronRVol = new TGeoVolume(Form("longeronR%d", mNLayer), longeronR, mCarbon);
319+
longeronRVol->SetLineColor(color);
320+
auto longeronLVol = new TGeoVolume(Form("longeronL%d", mNLayer), longeronL, mCarbon);
321+
longeronLVol->SetLineColor(color);
322+
auto zMoveLongerons = new TGeoTranslation(0, 0, -constants::segment::lec::length + (constants::segment::length / 2.));
322323

323324
mCarbonForm->AddNode(HringCVol, 0, zMoveHringC);
324325
mCarbonForm->AddNode(HringAVol, 0, zMoveHringA);
325-
mCarbonForm->AddNode(longeronsVol, 0, zMoveLongerons);
326+
mCarbonForm->AddNode(longeronRVol, 0, zMoveLongerons);
327+
mCarbonForm->AddNode(longeronLVol, 0, zMoveLongerons);
326328
mCarbonForm->AddNode(mChip, 0);
327329
}
328330

329-
TGeoCompositeShape* ITS3Layer::getHringShape(TGeoTubeSeg* Hring)
331+
TGeoCompositeShape* ITS3Layer::getHringShape(TGeoTubeSeg* Hring) const
330332
{
331333
// Function to dig holes in H-rings
332334
using namespace constants::carbonfoam;
333335
double stepPhiHoles = (Hring->GetPhi2() - Hring->GetPhi1()) / (nHoles[mNLayer]);
334-
double phiHolesSta = Hring->GetPhi1() + stepPhiHoles / 2.;
336+
double phiHolesSta = Hring->GetPhi1() + (stepPhiHoles / 2.);
335337
double radiusHring = 0.5 * (Hring->GetRmin() + Hring->GetRmax());
336338
TGeoCompositeShape* HringWithHoles = nullptr;
337339
TString nameAllHoles = "";
338340
for (int iHoles = 0; iHoles < nHoles[mNLayer]; iHoles++) {
339-
double phiHole = phiHolesSta + stepPhiHoles * iHoles;
341+
double phiHole = phiHolesSta + (stepPhiHoles * iHoles);
340342
TString nameHole = Form("hole_%d_%d", iHoles, mNLayer);
341343
[[maybe_unused]] auto hole = new TGeoTube(nameHole, 0, radiusHoles[mNLayer], 3 * Hring->GetDz());
342344
// move hole to the hring radius
@@ -376,9 +378,7 @@ void ITS3Layer::createLayerImpl()
376378

377379
void ITS3Layer::buildPartial(TGeoVolume* motherVolume, TGeoMatrix* mat, BuildLevel level, bool createMaterials)
378380
{
379-
if (!mBuilt) {
380-
getMaterials(createMaterials);
381-
}
381+
getMaterials(createMaterials);
382382
switch (level) {
383383
case BuildLevel::kPixelArray:
384384
createPixelArray();

0 commit comments

Comments
 (0)