Skip to content

Commit c867f09

Browse files
committed
Add CAD specifications
1 parent b546038 commit c867f09

File tree

4 files changed

+70
-49
lines changed

4 files changed

+70
-49
lines changed

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Layer.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class Layer
2525
{
2626
public:
2727
Layer() = default;
28-
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, int layout = kBarrel, int nSegments = 0);
28+
Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0,
29+
int layout = kBarrel, int nSegments = 0, float segmentSize = 0.0, int nSensorsPerSegment = 0, double tiltAngle = 0.0);
2930
~Layer() = default;
3031

3132
auto getInnerRadius() const { return mInnerRadius; }
@@ -52,9 +53,11 @@ class Layer
5253
float mZOffset{0.f}; // Of use when fwd layers
5354
float mX2X0;
5455
float mChipThickness;
55-
int mLayout{kBarrel};
56+
int mLayout{kBarrel}; // Identifier of the type of layer layout (barrel, disk, barrel segmented, disk segmented)
5657
// To be used only in case of the segmented layout, to define the number of segments in phi (for barrel) or in r (for disk)
57-
int mSegments{0};
58+
std::pair<int, float> mSegments{0, 0.0f}; // Number and size of segments in phi (for barrel) or in r (for disk) in case of segmented layout
59+
int mSensorsPerSegment{0}; // Number of sensors along a segment
60+
double mTiltAngle{0.0}; // Tilt angle in degrees to be applied as a rotation around the local center of the segment
5861
};
5962

6063
class ITOFLayer : public Layer

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
6666
float lengthOuterTof = 680.f;
6767
std::pair<float, float> radiusRangeDiskTof = {15.f, 100.f};
6868
float zForwardTof = 370.f;
69+
LOG(info) << "Configuring IOTOF layers with '" << pattern << "' pattern";
6970
if (pattern == "") {
71+
LOG(info) << "Default pattern";
7072
} else if (pattern == "v3b") {
71-
LOG(info) << "Configuring IOTOF layers with v3b pattern";
7273
ftof = false;
7374
btof = false;
7475
} else if (pattern == "v3b1a") {
@@ -96,13 +97,15 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
9697
}
9798
if (itof) {
9899
if (itofSegmented)
99-
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrelSegmented, 236); // iTOF
100+
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrelSegmented,
101+
24, 5.42, 80, 10); // iTOF
100102
else
101103
mITOFLayer = ITOFLayer(std::string{GeometryTGeo::getITOFLayerPattern()}, radiusInnerTof, 0.f, lengthInnerTof, 0.f, 0.02f, ITOFLayer::kBarrel); // iTOF
102104
}
103105
if (otof) {
104106
if (otofSegmented)
105-
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrelSegmented, 124); // oTOF
107+
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrelSegmented,
108+
62, 9.74, 432, 5); // oTOF
106109
else
107110
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, radiusOuterTof, 0.f, lengthOuterTof, 0.f, 0.02f, OTOFLayer::kBarrel); // oTOF
108111
}

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx

Lines changed: 58 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ namespace o2
2727
{
2828
namespace iotof
2929
{
30-
Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, int layout, int nSegments)
31-
: mLayerName(layerName), mInnerRadius(rInn), mOuterRadius(rOut), mZLength(zLength), mZOffset(zOffset), mX2X0(layerX2X0), mLayout(layout), mSegments(nSegments)
30+
Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0, int layout, int nSegments, float segmentSize, int nSensorsPerSegment, double tiltAngle)
31+
: mLayerName(layerName),
32+
mInnerRadius(rInn),
33+
mOuterRadius(rOut),
34+
mZLength(zLength),
35+
mZOffset(zOffset),
36+
mX2X0(layerX2X0),
37+
mLayout(layout),
38+
mSegments(nSegments, segmentSize),
39+
mSensorsPerSegment(nSensorsPerSegment),
40+
mTiltAngle(tiltAngle)
3241
{
3342
float Si_X0 = 9.5f;
3443
mChipThickness = mX2X0 * Si_X0;
@@ -47,14 +56,22 @@ Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float
4756
default:
4857
LOG(fatal) << "Invalid layout " << layout;
4958
}
50-
if (mInnerRadius > mOuterRadius) {
51-
LOG(fatal) << "Invalid layer dimensions: rInner " << mInnerRadius << " cm is larger than rOuter " << mOuterRadius << " cm";
52-
}
53-
if (mSegments != 0 && (layout != kBarrelSegmented && layout != kDiskSegmented)) {
54-
LOG(fatal) << "Invalid configuration: number of segments " << mSegments << " is set for non-segmented layout " << layout;
55-
}
56-
if (mSegments <= 1 && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
57-
LOG(fatal) << "Invalid configuration: number of segments " << mSegments << " must be positive for segmented layout " << layout;
59+
if (1) { // Sanity checks
60+
if (mInnerRadius > mOuterRadius) {
61+
LOG(fatal) << "Invalid layer dimensions: rInner " << mInnerRadius << " cm is larger than rOuter " << mOuterRadius << " cm";
62+
}
63+
if ((mSegments.first != 0 || mSegments.second != 0.0f) && (layout != kBarrelSegmented && layout != kDiskSegmented)) {
64+
LOG(fatal) << "Invalid configuration: number of segments " << mSegments.first << " is set for non-segmented layout " << layout;
65+
}
66+
if ((mSegments.first <= 1 || mSegments.second <= 0.0f) && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
67+
LOG(fatal) << "Invalid configuration: number of segments " << mSegments.first << " must be positive for segmented layout " << layout;
68+
}
69+
if (mSensorsPerSegment <= 0 && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
70+
LOG(fatal) << "Invalid configuration: number of sensors per segment " << mSensorsPerSegment << " must be positive for segmented layout " << layout;
71+
}
72+
if (std::abs(mTiltAngle) > 0.1 && (layout != kBarrelSegmented && layout != kDiskSegmented)) {
73+
LOG(fatal) << "Invalid configuration: tilt angle " << mTiltAngle << " is set for non-segmented layout " << layout;
74+
}
5875
}
5976

6077
LOGP(info, "TOF: Creating {} layer: rInner: {} (cm) rOuter: {} (cm) zLength: {} (cm) zOffset: {} x2X0: {}", name.c_str(), mInnerRadius, mOuterRadius, mZLength, mZOffset, mX2X0);
@@ -63,8 +80,8 @@ Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float
6380
std::vector<std::string> ITOFLayer::mRegister;
6481
void ITOFLayer::createLayer(TGeoVolume* motherVolume)
6582
{
66-
std::string chipName = o2::iotof::GeometryTGeo::getITOFChipPattern(),
67-
sensName = o2::iotof::GeometryTGeo::getITOFSensorPattern();
83+
const std::string chipName = o2::iotof::GeometryTGeo::getITOFChipPattern();
84+
const std::string sensName = o2::iotof::GeometryTGeo::getITOFSensorPattern();
6885

6986
TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$");
7087
TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$");
@@ -96,50 +113,50 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
96113
}
97114
case kBarrelSegmented: {
98115
const double circumference = TMath::TwoPi() * 0.5 * (mInnerRadius + mOuterRadius);
99-
const double segmentSize = circumference / mSegments;
116+
const double segmentSize = mSegments.second; // cm circumference / mSegments;
100117
const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
118+
TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
119+
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
120+
layerVol->SetLineColor(kRed + 3);
101121

102-
for (int i = 0; i < mSegments; ++i) {
103-
LOGP(info, "TOF: Creating segment {}/{} with size {} and thickness {}cm", i + 1, mSegments, segmentSize, (mOuterRadius - mInnerRadius));
122+
for (int i = 0; i < mSegments.first; ++i) {
123+
LOGP(info, "iTOF: Creating segment {}/{} with size {} and thickness {}cm", i + 1, mSegments.first, segmentSize, (mOuterRadius - mInnerRadius));
104124
const double hx = 0.5 * segmentSize;
105125
const double hy = 0.5 * (mOuterRadius - mInnerRadius);
106126
const double hz = 0.5 * mZLength;
107127
TGeoBBox* sensor = new TGeoBBox(hy, hx, hz);
108128
TGeoBBox* chip = new TGeoBBox(hy, hx, hz);
109-
TGeoBBox* layer = new TGeoBBox(hy, hx, hz);
110129
const std::string segmentTag = Form("segment%d", i + 1);
111130
TGeoVolume* sensVol = new TGeoVolume(Form("%s_%s", sensName.c_str(), segmentTag.c_str()), sensor, medSi);
112131
TGeoVolume* chipVol = new TGeoVolume(Form("%s_%s", chipName.c_str(), segmentTag.c_str()), chip, medSi);
113-
TGeoVolume* layerVol = new TGeoVolume(Form("%s_%s", mLayerName.c_str(), segmentTag.c_str()), layer, medAir);
114132
sensVol->SetLineColor(kRed + 3);
115133
chipVol->SetLineColor(kRed + 3);
116-
layerVol->SetLineColor(kRed + 3);
117134

118-
LOGP(info, "Inserting Barrel {} in {} ", sensVol->GetName(), chipVol->GetName());
135+
LOGP(info, " Inserting Barrel {} in {} ", sensVol->GetName(), chipVol->GetName());
119136
ITOFLayer::mRegister.push_back(sensVol->GetName());
120137
chipVol->AddNode(sensVol, 1, nullptr);
121138

122-
LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
123-
layerVol->AddNode(chipVol, 1, nullptr);
139+
const double phi = TMath::TwoPi() * i / mSegments.first;
124140

125-
// Position segment around the barrel
126-
const double phi = TMath::TwoPi() * i / mSegments;
127-
LOG(info) << "Tilting angle for segment " << i + 1 << ": " << phi * TMath::RadToDeg() << " deg";
141+
LOG(info) << " Tilting angle for segment " << i + 1 << ": " << phi * TMath::RadToDeg() << " degrees";
128142
const double x = avgRadius * TMath::Cos(phi);
129143
const double y = avgRadius * TMath::Sin(phi);
130-
auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg(), 0, 0);
144+
auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg() + mTiltAngle, 0, 0);
131145
auto* transformation = new TGeoCombiTrans(x, y, 0, rotation);
132146

133-
LOGP(info, "Inserting Barrel {} in {} at phi={} deg", layerVol->GetName(), motherVolume->GetName(), phi * TMath::RadToDeg());
134-
motherVolume->AddNode(layerVol, i + 1, transformation);
147+
LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
148+
layerVol->AddNode(chipVol, 1 + i, transformation);
135149
}
150+
LOGP(info, "Inserting Barrel {} in {} at r={} cm", layerVol->GetName(), motherVolume->GetName(), avgRadius);
151+
motherVolume->AddNode(layerVol, 1, nullptr);
136152
return;
137153
}
138154
default:
139155
LOG(fatal) << "Invalid layout " << mLayout;
140156
}
141157
}
142158

159+
std::vector<std::string> OTOFLayer::mRegister;
143160
void OTOFLayer::createLayer(TGeoVolume* motherVolume)
144161
{
145162
std::string chipName = o2::iotof::GeometryTGeo::getOTOFChipPattern(),
@@ -175,43 +192,42 @@ void OTOFLayer::createLayer(TGeoVolume* motherVolume)
175192
}
176193
case kBarrelSegmented: {
177194
const double circumference = TMath::TwoPi() * 0.5 * (mInnerRadius + mOuterRadius);
178-
const double segmentSize = circumference / mSegments;
195+
const double segmentSize = mSegments.second; // cm circumference / mSegments;
179196
const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
197+
TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
198+
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
199+
layerVol->SetLineColor(kRed + 3);
180200

181-
for (int i = 0; i < mSegments; ++i) {
182-
LOGP(info, "TOF: Creating segment {}/{} with size {} and thickness {}cm", i + 1, mSegments, segmentSize, (mOuterRadius - mInnerRadius));
201+
for (int i = 0; i < mSegments.first; ++i) {
202+
LOGP(info, "oTOF: Creating segment {}/{} with size {} and thickness {}cm", i + 1, mSegments.first, segmentSize, (mOuterRadius - mInnerRadius));
183203
const double hx = 0.5 * segmentSize;
184204
const double hy = 0.5 * (mOuterRadius - mInnerRadius);
185205
const double hz = 0.5 * mZLength;
186206
TGeoBBox* sensor = new TGeoBBox(hy, hx, hz);
187207
TGeoBBox* chip = new TGeoBBox(hy, hx, hz);
188-
TGeoBBox* layer = new TGeoBBox(hy, hx, hz);
189208
const std::string segmentTag = Form("segment%d", i + 1);
190209
TGeoVolume* sensVol = new TGeoVolume(Form("%s_%s", sensName.c_str(), segmentTag.c_str()), sensor, medSi);
191210
TGeoVolume* chipVol = new TGeoVolume(Form("%s_%s", chipName.c_str(), segmentTag.c_str()), chip, medSi);
192-
TGeoVolume* layerVol = new TGeoVolume(Form("%s_%s", mLayerName.c_str(), segmentTag.c_str()), layer, medAir);
193211
sensVol->SetLineColor(kRed + 3);
194212
chipVol->SetLineColor(kRed + 3);
195-
layerVol->SetLineColor(kRed + 3);
196213

197-
LOGP(info, "Inserting Barrel {} in {} ", sensVol->GetName(), chipVol->GetName());
214+
LOGP(info, " Inserting Barrel {} in {} ", sensVol->GetName(), chipVol->GetName());
198215
OTOFLayer::mRegister.push_back(sensVol->GetName());
199216
chipVol->AddNode(sensVol, 1, nullptr);
200217

201-
LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
202-
layerVol->AddNode(chipVol, 1, nullptr);
218+
const double phi = TMath::TwoPi() * i / mSegments.first;
203219

204-
// Position segment around the barrel
205-
const double phi = TMath::TwoPi() * i / mSegments;
206-
LOG(info) << "Tilting angle for segment " << i + 1 << ": " << phi * TMath::RadToDeg() << " deg";
220+
LOG(info) << " Tilting angle for segment " << i + 1 << ": " << phi * TMath::RadToDeg() << " degrees";
207221
const double x = avgRadius * TMath::Cos(phi);
208222
const double y = avgRadius * TMath::Sin(phi);
209-
auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg(), 0, 0);
223+
auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg() + mTiltAngle, 0, 0);
210224
auto* transformation = new TGeoCombiTrans(x, y, 0, rotation);
211225

212-
LOGP(info, "Inserting Barrel {} in {} at phi={} deg", layerVol->GetName(), motherVolume->GetName(), phi * TMath::RadToDeg());
213-
motherVolume->AddNode(layerVol, i + 1, transformation);
226+
LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
227+
layerVol->AddNode(chipVol, 1 + i, transformation);
214228
}
229+
LOGP(info, "Inserting Barrel {} in {} at r={} cm", layerVol->GetName(), motherVolume->GetName(), avgRadius);
230+
motherVolume->AddNode(layerVol, 1, nullptr);
215231
return;
216232
}
217233
default:

Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ void GeometryTGeo::Build(int loadTrans)
102102
mLastChipIndexMLOT.resize(mNumberOfLayersMLOT); /// ML and OT are part of TRK as the same detector, without disks
103103

104104
for (int i = 0; i < mNumberOfLayersMLOT; i++) {
105-
std::cout << "Layer MLOT: " << i << std::endl;
106105
mNumberOfStaves[i] = extractNumberOfStavesMLOT(i);
107106
mNumberOfHalfStaves[i] = extractNumberOfHalfStavesMLOT(i);
108107
mNumberOfModules[i] = extractNumberOfModulesMLOT(i);

0 commit comments

Comments
 (0)