Skip to content

Commit 29f50a7

Browse files
committed
ITS3: modify layer geo
Signed-off-by: Felix Schlepper <[email protected]>
1 parent 5331c4e commit 29f50a7

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020
#include <TGeoTube.h>
2121
#include <TGeoVolume.h>
2222

23-
#include "Framework/Logger.h"
24-
#include <fmt/core.h>
23+
#include "ITS3Base/SpecsV2.h"
2524

2625
namespace o2::its3
2726
{
2827

29-
/// This class defines the Geometry for the ITS3 using TGeo.
28+
/// This class defines the geometry for the ITS3 IB layers.
3029
class ITS3Layer
3130
{
3231
// The hierarchy will be the following:
@@ -56,11 +55,10 @@ class ITS3Layer
5655
return mNames[static_cast<size_t>((b == BuildLevel::kAll) ? BuildLevel::kLayer : b)];
5756
}
5857

59-
explicit ITS3Layer(int layer = 0) : mNLayer(layer)
60-
{
61-
LOGP(debug, "Called on {} layer {}", layer, mNLayer);
62-
init();
63-
}
58+
explicit ITS3Layer(int layer = 0) : mNLayer(layer),
59+
mR(o2::its3::constants::radii[mNLayer]),
60+
mRmin(o2::its3::constants::radiiInner[mNLayer]),
61+
mRmax(o2::its3::constants::radiiOuter[mNLayer]) {}
6462

6563
explicit ITS3Layer(TGeoVolume* motherVolume, int layer = 0) : ITS3Layer(layer)
6664
{
@@ -101,7 +99,9 @@ class ITS3Layer
10199
double mRmin{}; // Minimum Radius
102100
double mRmax{0}; // Maximum Radius
103101

104-
// Individual Pieces
102+
// Individual pieces
103+
// since TGeo manages the resources itself one should not use these pointers
104+
// after initializition anymore!
105105
TGeoVolume* mPixelArray{nullptr};
106106
TGeoVolumeAssembly* mTile{nullptr};
107107
TGeoVolumeAssembly* mRSU{nullptr};

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "TGeoVolume.h"
1919
#include "TGeoCompositeShape.h"
2020

21+
#include "Framework/Logger.h"
2122
#include "CommonConstants/MathConstants.h"
2223
#include "ITSBase/GeometryTGeo.h"
2324
#include "ITS3Base/SpecsV2.h"
2425
#include "ITS3Simulation/ITS3Layer.h"
25-
#include "fairlogger/Logger.h"
2626

2727
namespace o2m = o2::constants::math;
2828
namespace its3c = o2::its3::constants;
@@ -31,13 +31,6 @@ namespace o2::its3
3131
{
3232
using its3TGeo = o2::its::GeometryTGeo;
3333

34-
void ITS3Layer::init()
35-
{
36-
mR = its3c::radii[mNLayer];
37-
mRmin = its3c::radiiInner[mNLayer];
38-
mRmax = its3c::radiiOuter[mNLayer];
39-
}
40-
4134
void ITS3Layer::getMaterials(bool create)
4235
{
4336
if (gGeoManager == nullptr) {
@@ -59,11 +52,11 @@ TGeoMedium* ITS3Layer::getMaterial(const char* matName, bool create)
5952
} else { // create dummy
6053
auto matDummy = gGeoManager->GetMaterial("MAT_DUMMY$");
6154
if (matDummy == nullptr) {
62-
LOGP(info, "Created Dummy material");
55+
LOGP(warn, "Created Dummy material");
6356
matDummy = new TGeoMaterial("MAT_DUMMY$", 26.98, 13, 2.7);
6457
}
6558
mat = new TGeoMedium(matName, 1, matDummy);
66-
LOGP(info, "Created medium {}", matName);
59+
LOGP(warn, "Created medium {}", matName);
6760
}
6861
}
6962
return mat;
@@ -76,12 +69,10 @@ void ITS3Layer::createLayer(TGeoVolume* motherVolume)
7669
createLayerImpl();
7770
mBuilt = true;
7871

79-
LOGP(debug, "ITS3-Layer: Created Layer {} with mR={} (minR={}, maxR={})", mNLayer, mR, mRmin, mRmax);
8072
if (motherVolume == nullptr) {
8173
return;
8274
}
8375
// Add it to motherVolume
84-
LOGP(debug, " `-> Attaching to motherVolume '{}'", motherVolume->GetName());
8576
auto* trans = new TGeoTranslation(0, 0, -constants::segment::lengthSensitive / 2.);
8677
motherVolume->AddNode(mLayer, 0, trans);
8778
}

0 commit comments

Comments
 (0)