Project
Loading...
Searching...
No Matches
Layer.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include "Framework/Logger.h"
16
17#include <TGeoBBox.h>
18#include <TGeoMatrix.h>
19#include <TGeoTube.h>
20#include <TGeoVolume.h>
21#include <TMath.h>
22
23#include <algorithm>
24#include <cmath>
25
26namespace o2
27{
28namespace iotof
29{
30Layer::Layer(std::string layerName, float rInn, float rOut, float zLength, float zOffset, float layerX2X0,
31 int layout, int nStaves, float staveSize, double staveTiltAngle, int modulesPerStave)
32 : mLayerName(layerName),
33 mInnerRadius(rInn),
34 mOuterRadius(rOut),
35 mZLength(zLength),
36 mZOffset(zOffset),
37 mX2X0(layerX2X0),
38 mLayout(layout),
39 mStaves(nStaves, staveSize),
40 mModulesPerStave(modulesPerStave),
41 mTiltAngle(staveTiltAngle)
42{
43 const float Si_X0 = 9.5f;
44 mChipThickness = mX2X0 * Si_X0;
45 std::string name = "";
46 switch (layout) {
47 case kBarrel:
49 name = "barrel";
51 break;
52 case kDisk:
53 case kDiskSegmented:
54 name = "forward";
56 break;
57 default:
58 LOG(fatal) << "Invalid layout " << layout;
59 }
60 // Sanity checks
62 LOG(fatal) << "Invalid layer dimensions: rInner " << mInnerRadius << " cm is larger than rOuter " << mOuterRadius << " cm";
63 }
64 if ((mStaves.first != 0 || mStaves.second != 0.0f) && (layout != kBarrelSegmented && layout != kDiskSegmented)) {
65 LOG(fatal) << "Invalid configuration: number of segments " << mStaves.first << " is set for non-segmented layout " << layout;
66 }
67 if ((mStaves.first <= 1 || mStaves.second <= 0.0f) && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
68 LOG(fatal) << "Invalid configuration: number of segments " << mStaves.first << " must be positive for segmented layout " << layout;
69 }
70 if (mModulesPerStave <= 0 && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
71 LOG(fatal) << "Invalid configuration: number of sensors per segment " << mModulesPerStave << " must be positive for segmented layout " << layout;
72 }
73 if (std::abs(mTiltAngle) > 0.1 && (layout != kBarrelSegmented && layout != kDiskSegmented)) {
74 LOG(fatal) << "Invalid configuration: tilt angle " << mTiltAngle << " is set for non-segmented layout " << layout;
75 }
76 if ((mTiltAngle < 0.0 || mTiltAngle > 90.0) && (layout == kBarrelSegmented || layout == kDiskSegmented)) {
77 LOG(fatal) << "Invalid configuration: tilt angle " << mTiltAngle << " is too large, it must be between 0 and 90 degrees";
78 }
79
80 LOGP(info, "TOF: Creating {} layer: rInner: {} (cm) rOuter: {} (cm) zLength: {} (cm) zOffset: {} x2X0: {}", name.c_str(), mInnerRadius, mOuterRadius, mZLength, mZOffset, mX2X0);
81}
82
83void setLayerStyle(TGeoVolume* obj)
84{
85 obj->SetLineColor(kRed - 7);
86 obj->SetFillColor(kRed - 7);
87 obj->SetLineWidth(1);
88 obj->SetTransparency(70);
89}
90void setStaveStyle(TGeoVolume* obj)
91{
92 obj->SetLineColor(kRed - 5);
93 obj->SetFillColor(kRed - 9);
94 obj->SetLineWidth(2);
95 obj->SetTransparency(45);
96}
97void setModuleStyle(TGeoVolume* obj)
98{
99 obj->SetLineColor(kRed - 3);
100 obj->SetFillColor(kRed - 8);
101 obj->SetLineWidth(2);
102 obj->SetTransparency(35);
103}
104void setChipStyle(TGeoVolume* obj)
105{
106 obj->SetLineColor(kOrange);
107 obj->SetFillColor(kOrange - 9);
108 obj->SetLineWidth(3);
109 obj->SetTransparency(15);
110}
111void setSensorStyle(TGeoVolume* obj)
112{
113 obj->SetLineColor(kRed);
114 obj->SetFillColor(kRed - 9);
115 obj->SetLineWidth(3);
116 obj->SetTransparency(5);
117}
118
119std::vector<std::string> ITOFLayer::mRegister;
120void ITOFLayer::createLayer(TGeoVolume* motherVolume)
121{
122 const char* chipName = o2::iotof::GeometryTGeo::getITOFChipPattern();
123 const char* sensName = o2::iotof::GeometryTGeo::getITOFSensorPattern();
124 const char* moduleName = o2::iotof::GeometryTGeo::getITOFModulePattern();
125 const char* staveName = o2::iotof::GeometryTGeo::getITOFStavePattern();
126
127 TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$");
128 TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$");
129 LOGP(info, "Media: {} {}", (void*)medSi, (void*)medAir);
130
131 switch (mLayout) {
132 case kBarrel: {
133 TGeoTube* sensor = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
134 TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
135 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
136
137 TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);
138 TGeoVolume* chipVol = new TGeoVolume(chipName, chip, medSi);
139 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
140 setSensorStyle(sensVol);
141 setChipStyle(chipVol);
142 setLayerStyle(layerVol);
143
144 LOGP(info, "Inserting Barrel {} in {} ", sensVol->GetName(), chipVol->GetName());
145 ITOFLayer::mRegister.push_back(sensVol->GetName());
146 chipVol->AddNode(sensVol, 1, nullptr);
147
148 LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
149 layerVol->AddNode(chipVol, 1, nullptr);
150
151 LOGP(info, "Inserting Barrel {} in {} ", layerVol->GetName(), motherVolume->GetName());
152 motherVolume->AddNode(layerVol, 1, nullptr);
153 return;
154 }
155 case kBarrelSegmented: {
156 // First we create the volume for the whole layer, which will be used as mother volume for the segments
157 const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
158 const double staveSizeX = mStaves.second; // cm
159 const double staveSizeY = mOuterRadius - mInnerRadius; // cm
160 const double staveSizeZ = mZLength; // cm
161 const double deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY); // we increase the size of the layer to account for the tilt of the staves
162 TGeoTube* layer = new TGeoTube(mInnerRadius - deltaForTilt, mOuterRadius + deltaForTilt, mZLength / 2);
163 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
164 setLayerStyle(layerVol);
165
166 // Now we create the volume for a single stave
167 TGeoBBox* stave = new TGeoBBox(staveSizeX * 0.5, staveSizeY * 0.5, staveSizeZ * 0.5);
168 TGeoVolume* staveVol = new TGeoVolume(staveName, stave, medAir);
169 setStaveStyle(staveVol);
170
171 // Now we create the volume for a single module (sensor + chip)
172 const int modulesPerStaveX = 1; // we assume that each stave is divided in 2 modules along the x direction
173 const double moduleSizeX = staveSizeX / modulesPerStaveX; // cm
174 const double moduleSizeY = staveSizeY; // cm
175 const double moduleSizeZ = staveSizeZ / mModulesPerStave; // cm
176 TGeoBBox* module = new TGeoBBox(moduleSizeX * 0.5, moduleSizeY * 0.5, moduleSizeZ * 0.5);
177 TGeoVolume* moduleVol = new TGeoVolume(moduleName, module, medAir);
178 setModuleStyle(moduleVol);
179
180 // Now we create the volume of the chip, which is the same for all modules
181 const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
182 const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
183 const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
184 const double chipSizeY = moduleSizeY; // cm
185 const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
186 TGeoBBox* chip = new TGeoBBox(chipSizeX * 0.5, chipSizeY * 0.5, chipSizeZ * 0.5);
187 TGeoVolume* chipVol = new TGeoVolume(chipName, chip, medSi);
188 setChipStyle(chipVol);
189
190 // Finally we create the volume of the sensor, which is the same for all chips
191 const int sensorsPerChipX = 2; // we assume that each chip is divided in 2 sensors along the x direction
192 const int sensorsPerChipZ = 2; // we assume that each chip is divided in 2 sensors along the z direction
193 const double sensorSizeX = chipSizeX / sensorsPerChipX; // cm
194 const double sensorSizeY = chipSizeY; // cm
195 const double sensorSizeZ = chipSizeZ / sensorsPerChipZ; // cm
196 TGeoBBox* sensor = new TGeoBBox(sensorSizeX * 0.5, sensorSizeY * 0.5, sensorSizeZ * 0.5);
197 TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);
198 setSensorStyle(sensVol);
199 ITOFLayer::mRegister.push_back(sensVol->GetName());
200
201 // Now we build a chip from sensors
202 for (int i = 0; i < sensorsPerChipX; ++i) {
203 for (int j = 0; j < sensorsPerChipZ; ++j) {
204 LOGP(info, "iTOF: Creating sensor {}/{} for chip {}/{}", i + 1, sensorsPerChipX, j + 1, sensorsPerChipZ);
205 auto* translation = new TGeoTranslation((i + 0.5) * sensorSizeX - 0.5 * chipSizeX,
206 0,
207 (j + 0.5) * sensorSizeZ - 0.5 * chipSizeZ);
208 chipVol->AddNode(sensVol, 1 + i * sensorsPerChipZ + j, translation);
209 }
210 }
211
212 // Now we build a module from chips
213 for (int i = 0; i < chipsPerModuleX; ++i) {
214 for (int j = 0; j < chipsPerModuleZ; ++j) {
215 LOGP(info, "iTOF: Creating chip {}/{} for module {}/{}", i + 1, chipsPerModuleX, j + 1, chipsPerModuleZ);
216 auto* translation = new TGeoTranslation((i + 0.5) * chipSizeX - 0.5 * moduleSizeX, 0, (j + 0.5) * chipSizeZ - 0.5 * moduleSizeZ);
217 moduleVol->AddNode(chipVol, 1 + i * chipsPerModuleZ + j, translation);
218 }
219 }
220
221 // Now we build a stave from modules
222 for (int i = 0; i < modulesPerStaveX; ++i) {
223 for (int j = 0; j < mModulesPerStave; ++j) {
224 LOGP(info, "iTOF: Creating module {}/{} for stave {}/{}", i + 1, modulesPerStaveX, j + 1, mModulesPerStave);
225 auto* translation = new TGeoTranslation((i + 0.5) * moduleSizeX - 0.5 * staveSizeX, 0, (j + 0.5) * moduleSizeZ - 0.5 * staveSizeZ);
226 staveVol->AddNode(moduleVol, 1 + i * mModulesPerStave + j, translation);
227 }
228 }
229
230 // We finally put all the staves in the layer
231 for (int i = 0; i < mStaves.first; ++i) {
232 LOGP(info, "iTOF: Creating stave {}/{} for layer {}", i + 1, mStaves.first, layerVol->GetName());
233 const double phi = TMath::TwoPi() * i / mStaves.first;
234 const double x = avgRadius * TMath::Cos(phi);
235 const double y = avgRadius * TMath::Sin(phi);
236 auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg() + 90 + mTiltAngle, 0, 0);
237 auto* transformation = new TGeoCombiTrans(x, y, 0, rotation);
238
239 LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
240 layerVol->AddNode(staveVol, 1 + i, transformation);
241 }
242 LOGP(info, "Inserting Barrel {} in {} at r={} cm", layerVol->GetName(), motherVolume->GetName(), avgRadius);
243 motherVolume->AddNode(layerVol, 1, nullptr);
244 return;
245 }
246 default:
247 LOG(fatal) << "Invalid layout " << mLayout;
248 }
249}
250
251std::vector<std::string> OTOFLayer::mRegister;
252void OTOFLayer::createLayer(TGeoVolume* motherVolume)
253{
254 const char* chipName = o2::iotof::GeometryTGeo::getOTOFChipPattern();
255 const char* sensName = o2::iotof::GeometryTGeo::getOTOFSensorPattern();
256 const char* moduleName = o2::iotof::GeometryTGeo::getOTOFModulePattern();
257 const char* staveName = o2::iotof::GeometryTGeo::getOTOFStavePattern();
258
259 TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$");
260 TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$");
261 LOGP(info, "Media: {} {}", (void*)medSi, (void*)medAir);
262
263 switch (mLayout) {
264 case kBarrel: {
265 TGeoTube* sensor = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
266 TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
267 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
268
269 TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);
270 TGeoVolume* chipVol = new TGeoVolume(chipName, chip, medSi);
271 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
272 setSensorStyle(sensVol);
273 setChipStyle(chipVol);
274 setLayerStyle(layerVol);
275
276 LOGP(info, "Inserting {} in {} ", sensVol->GetName(), chipVol->GetName());
277 OTOFLayer::mRegister.push_back(sensVol->GetName());
278 chipVol->AddNode(sensVol, 1, nullptr);
279
280 LOGP(info, "Inserting {} in {} ", chipVol->GetName(), layerVol->GetName());
281 layerVol->AddNode(chipVol, 1, nullptr);
282
283 LOGP(info, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName());
284 motherVolume->AddNode(layerVol, 1, nullptr);
285 return;
286 }
287 case kBarrelSegmented: {
288 // First we create the volume for the whole layer, which will be used as mother volume for the segments
289 const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
290 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
291 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
292 setLayerStyle(layerVol);
293
294 // Now we create the volume for a single stave
295 const double staveSizeX = mStaves.second; // cm
296 const double staveSizeY = mOuterRadius - mInnerRadius; // cm
297 const double staveSizeZ = mZLength; // cm
298 TGeoBBox* stave = new TGeoBBox(staveSizeX * 0.5, staveSizeY * 0.5, staveSizeZ * 0.5);
299 TGeoVolume* staveVol = new TGeoVolume(staveName, stave, medAir);
300 setStaveStyle(staveVol);
301
302 // Now we create the volume for a single module (sensor + chip)
303 const int modulesPerStaveX = 1; // we assume that each stave is divided in 2 modules along the x direction
304 const double moduleSizeX = staveSizeX / modulesPerStaveX; // cm
305 const double moduleSizeY = staveSizeY; // cm
306 const double moduleSizeZ = staveSizeZ / mModulesPerStave; // cm
307 TGeoBBox* module = new TGeoBBox(moduleSizeX * 0.5, moduleSizeY * 0.5, moduleSizeZ * 0.5);
308 TGeoVolume* moduleVol = new TGeoVolume(moduleName, module, medAir);
309 setModuleStyle(moduleVol);
310
311 // Now we create the volume of the chip, which is the same for all modules
312 const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
313 const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
314 const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
315 const double chipSizeY = moduleSizeY; // cm
316 const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
317 TGeoBBox* chip = new TGeoBBox(chipSizeX * 0.5, chipSizeY * 0.5, chipSizeZ * 0.5);
318 TGeoVolume* chipVol = new TGeoVolume(chipName, chip, medSi);
319 setChipStyle(chipVol);
320
321 // Finally we create the volume of the sensor, which is the same for all chips
322 const int sensorsPerChipX = 2; // we assume that each chip is divided in 2 sensors along the x direction
323 const int sensorsPerChipZ = 2; // we assume that each chip is divided in 2 sensors along the z direction
324 const double sensorSizeX = chipSizeX / sensorsPerChipX; // cm
325 const double sensorSizeY = chipSizeY; // cm
326 const double sensorSizeZ = chipSizeZ / sensorsPerChipZ; // cm
327 TGeoBBox* sensor = new TGeoBBox(sensorSizeX * 0.5, sensorSizeY * 0.5, sensorSizeZ * 0.5);
328 TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);
329 setSensorStyle(sensVol);
330 OTOFLayer::mRegister.push_back(sensVol->GetName());
331
332 // Now we build a chip from sensors
333 for (int i = 0; i < sensorsPerChipX; ++i) {
334 for (int j = 0; j < sensorsPerChipZ; ++j) {
335 LOGP(info, "oTOF: Creating sensor {}/{} for chip {}/{}", i + 1, sensorsPerChipX, j + 1, sensorsPerChipZ);
336 auto* translation = new TGeoTranslation((i + 0.5) * sensorSizeX - 0.5 * chipSizeX,
337 0,
338 (j + 0.5) * sensorSizeZ - 0.5 * chipSizeZ);
339 chipVol->AddNode(sensVol, 1 + i * sensorsPerChipZ + j, translation);
340 }
341 }
342
343 // Now we build a module from chips
344 for (int i = 0; i < chipsPerModuleX; ++i) {
345 for (int j = 0; j < chipsPerModuleZ; ++j) {
346 LOGP(info, "oTOF: Creating chip {}/{} for module {}/{}", i + 1, chipsPerModuleX, j + 1, chipsPerModuleZ);
347 auto* translation = new TGeoTranslation((i + 0.5) * chipSizeX - 0.5 * moduleSizeX, 0, (j + 0.5) * chipSizeZ - 0.5 * moduleSizeZ);
348 moduleVol->AddNode(chipVol, 1 + i * chipsPerModuleZ + j, translation);
349 }
350 }
351
352 // Now we build a stave from modules
353 for (int i = 0; i < modulesPerStaveX; ++i) {
354 for (int j = 0; j < mModulesPerStave; ++j) {
355 LOGP(info, "oTOF: Creating module {}/{} for stave {}/{}", i + 1, modulesPerStaveX, j + 1, mModulesPerStave);
356 auto* translation = new TGeoTranslation((i + 0.5) * moduleSizeX - 0.5 * staveSizeX, 0, (j + 0.5) * moduleSizeZ - 0.5 * staveSizeZ);
357 staveVol->AddNode(moduleVol, 1 + i * mModulesPerStave + j, translation);
358 }
359 }
360
361 // We finally put all the staves in the layer
362 for (int i = 0; i < mStaves.first; ++i) {
363 LOGP(info, "oTOF: Creating stave {}/{} for layer {}", i + 1, mStaves.first, layerVol->GetName());
364 const double phi = TMath::TwoPi() * i / mStaves.first;
365 const double x = avgRadius * TMath::Cos(phi);
366 const double y = avgRadius * TMath::Sin(phi);
367 auto* rotation = new TGeoRotation(Form("segmentRot%d", i + 1), phi * TMath::RadToDeg() + 90 + mTiltAngle, 0, 0);
368 auto* transformation = new TGeoCombiTrans(x, y, 0, rotation);
369
370 LOGP(info, "Inserting Barrel {} in {} ", chipVol->GetName(), layerVol->GetName());
371 layerVol->AddNode(staveVol, 1 + i, transformation);
372 }
373 LOGP(info, "Inserting Barrel {} in {} at r={} cm", layerVol->GetName(), motherVolume->GetName(), avgRadius);
374 motherVolume->AddNode(layerVol, 1, nullptr);
375 return;
376 }
377 default:
378 LOG(fatal) << "Invalid layout " << mLayout;
379 }
380}
381
382void FTOFLayer::createLayer(TGeoVolume* motherVolume)
383{
384 std::string chipName = o2::iotof::GeometryTGeo::getFTOFChipPattern(),
386
387 TGeoTube* sensor = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
388 TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
389 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
390
391 TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$");
392 TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$");
393
394 TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi);
395 TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi);
396 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
397 setSensorStyle(sensVol);
398 setChipStyle(chipVol);
399 setLayerStyle(layerVol);
400
401 LOGP(info, "Inserting {} in {} ", sensVol->GetName(), chipVol->GetName());
402 chipVol->AddNode(sensVol, 1, nullptr);
403
404 LOGP(info, "Inserting {} in {} ", chipVol->GetName(), layerVol->GetName());
405 layerVol->AddNode(chipVol, 1, nullptr);
406
407 auto* fwdTOFRotation = new TGeoRotation("fwdTOFRotation", 0, 0, 180);
408 auto* fwdTOFCombiTrans = new TGeoCombiTrans(0, 0, mZOffset, fwdTOFRotation);
409
410 LOGP(info, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName());
411 motherVolume->AddNode(layerVol, 1, fwdTOFCombiTrans);
412}
413
414void BTOFLayer::createLayer(TGeoVolume* motherVolume)
415{
416 std::string chipName = o2::iotof::GeometryTGeo::getBTOFChipPattern(),
418
419 TGeoTube* sensor = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
420 TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
421 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2);
422
423 TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$");
424 TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$");
425
426 TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi);
427 TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi);
428 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
429 setSensorStyle(sensVol);
430 setChipStyle(chipVol);
431 setLayerStyle(layerVol);
432
433 LOGP(info, "Inserting {} in {} ", sensVol->GetName(), chipVol->GetName());
434 chipVol->AddNode(sensVol, 1, nullptr);
435
436 LOGP(info, "Inserting {} in {} ", chipVol->GetName(), layerVol->GetName());
437 layerVol->AddNode(chipVol, 1, nullptr);
438
439 auto* bwdTOFRotation = new TGeoRotation("bwdTOFRotation", 0, 0, 180);
440 auto* fwdTOFCombiTrans = new TGeoCombiTrans(0, 0, mZOffset, bwdTOFRotation);
441
442 LOGP(info, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName());
443 motherVolume->AddNode(layerVol, 1, fwdTOFCombiTrans);
444}
445
446} // namespace iotof
447} // namespace o2
int32_t i
uint32_t j
Definition RawData.h:0
virtual void createLayer(TGeoVolume *motherVolume) override
Definition Layer.cxx:414
virtual void createLayer(TGeoVolume *motherVolume) override
Definition Layer.cxx:382
static const char * getITOFChipPattern()
static const char * getFTOFSensorPattern()
static const char * getFTOFChipPattern()
static const char * getBTOFChipPattern()
static const char * getOTOFModulePattern()
static const char * getITOFModulePattern()
static const char * getOTOFSensorPattern()
static const char * getITOFStavePattern()
static const char * getITOFSensorPattern()
static const char * getOTOFStavePattern()
static const char * getOTOFChipPattern()
static const char * getBTOFSensorPattern()
static std::vector< std::string > mRegister
Definition Layer.h:68
virtual void createLayer(TGeoVolume *motherVolume) override
Definition Layer.cxx:120
float mZOffset
Definition Layer.h:53
float mOuterRadius
Definition Layer.h:51
float mZLength
Definition Layer.h:52
int mModulesPerStave
Definition Layer.h:59
static constexpr int kBarrelSegmented
Definition Layer.h:43
static constexpr int kDisk
Definition Layer.h:42
float mChipThickness
Definition Layer.h:55
static constexpr int kBarrel
Definition Layer.h:41
static constexpr int kDiskSegmented
Definition Layer.h:44
std::pair< int, float > mStaves
Definition Layer.h:58
std::string mLayerName
Definition Layer.h:49
float mInnerRadius
Definition Layer.h:50
double mTiltAngle
Definition Layer.h:60
float mX2X0
Definition Layer.h:54
virtual void createLayer(TGeoVolume *motherVolume) override
Definition Layer.cxx:252
static std::vector< std::string > mRegister
Definition Layer.h:76
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint const GLchar * name
Definition glcorearb.h:781
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
void setLayerStyle(TGeoVolume *obj)
Definition Layer.cxx:83
void setModuleStyle(TGeoVolume *obj)
Definition Layer.cxx:97
void setChipStyle(TGeoVolume *obj)
Definition Layer.cxx:104
void setStaveStyle(TGeoVolume *obj)
Definition Layer.cxx:90
void setSensorStyle(TGeoVolume *obj)
Definition Layer.cxx:111
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
auto transformation
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"