39 double phiSpanDeg,
double lengthZ,
double lengthSensZ)
40 :
VDLayer(layerNumber, layerName, layerX2X0), mRadius(radius), mPhiSpanDeg(phiSpanDeg), mLengthZ(lengthZ), mLengthSensZ(lengthSensZ)
42 LOGP(info,
"Creating VD cylindrical layer: id: {} name: {} x2X0: {} radius: {} phiSpanDeg: {} lengthZ: {} lengthSensZ: {} chipThickness = {} cm",
48 double width,
double lengthZ,
double lengthSensZ)
49 :
VDLayer(layerNumber, layerName, layerX2X0), mWidth(
width), mLengthZ(lengthZ), mLengthSensZ(lengthSensZ)
52 if (mLengthSensZ <= 0 || mLengthSensZ > mLengthZ) {
53 LOGP(fatal,
"Invalid sensor length: sensZ={} layerZ={}", mLengthSensZ, mLengthZ);
55 LOGP(info,
"Creating VD rectangular layer: id: {} name: {} x2X0: {} width: {} lengthZ: {} lengthSensZ: {} chipThickness = {} cm",
61 double phiSpanDeg,
double zPos)
62 :
VDLayer(layerNumber, layerName, layerX2X0), mRMin(rMin), mRMax(rMax), mPhiSpanDeg(phiSpanDeg), mZPos(zPos)
65 LOGP(info,
"Creating VD disk layer: id: {} name: {} x2X0: {} rMin: {} rMax: {} phiSpanDeg: {} zPos: {} chipThickness = {} cm",
76 LOGP(error,
"gGeoManager is null");
79 auto* medSi = gGeoManager->GetMedium(
"TRK_SILICON$");
81 LOGP(error,
"Missing medium TRK_SILICON$");
85 const double rIn = mRadius;
87 const double halfZ = 0.5 * mLengthSensZ;
88 const double halfPhi = 0.5 * mPhiSpanDeg;
89 auto* shape =
new TGeoTubeSeg(rIn, rOut, halfZ, -halfPhi, +halfPhi);
90 auto* vol =
new TGeoVolume(sensName.c_str(), shape, medSi);
91 vol->SetLineColor(kYellow);
92 vol->SetTransparency(30);
99 LOGP(error,
"gGeoManager is null");
102 auto* medSi = gGeoManager->GetMedium(
"TRK_SILICON$");
104 LOGP(error,
"Missing medium TRK_SILICON$");
108 const double hx = 0.5 * mWidth;
110 const double hz = 0.5 * mLengthSensZ;
112 auto* shape =
new TGeoBBox(hx, hy, hz);
113 auto* vol =
new TGeoVolume(sensName.c_str(), shape, medSi);
114 vol->SetLineColor(kYellow);
115 vol->SetTransparency(30);
123 LOGP(error,
"gGeoManager is null");
126 TGeoMedium* medSi = gGeoManager->GetMedium(
"TRK_SILICON$");
128 LOGP(error,
"Missing medium TRK_SILICON$");
131 if (mRMin < 0 || mRMax <= mRMin ||
mChipThickness <= 0 || mPhiSpanDeg <= 0 || mPhiSpanDeg > 360.0) {
132 LOGP(error,
"Invalid disk sensor dims: rMin={}, rMax={}, t={}, phiSpanDeg={}",
138 const double halfPhi = 0.5 * mPhiSpanDeg;
141 auto* shape =
new TGeoTubeSeg(mRMin, mRMax, halfThickness, -halfPhi, +halfPhi);
143 auto* sensVol =
new TGeoVolume(sensName.c_str(), shape, medSi);
144 sensVol->SetLineColor(kYellow);
145 sensVol->SetTransparency(30);
157 if (!motherVolume || !gGeoManager) {
158 LOGP(error,
"Null motherVolume or gGeoManager");
161 TGeoMedium* medAir = gGeoManager->GetMedium(
"TRK_AIR$");
163 LOGP(error,
"Missing TRK_AIR$");
169 mPhiSpanDeg <= 0 || mPhiSpanDeg > 360.0 ||
170 mLengthSensZ <= 0 || mLengthSensZ > mLengthZ) {
171 LOGP(error,
"Invalid cylindrical dimensions: r={}, t={}, Z={}, phi={}, sensZ={}",
177 const double rIn = mRadius;
179 const double halfZ = 0.5 * mLengthZ;
180 const double halfPhi = 0.5 * mPhiSpanDeg;
182 auto* layerShape =
new TGeoTubeSeg(rIn, rOut, halfZ, -halfPhi, +halfPhi);
183 auto* layerVol =
new TGeoVolume(
mLayerName.c_str(), layerShape, medAir);
184 layerVol->SetLineColor(kYellow);
185 layerVol->SetTransparency(30);
190 LOGP(error,
"VDCylindricalLayer::createSensor() returned null");
193 LOGP(info,
"Inserting {} in {} ", sensorVol->GetName(), layerVol->GetName());
194 layerVol->AddNode(sensorVol, 1,
nullptr);
207 motherVolume->AddNode(layerVol, 1, combiTrans);
213 if (!motherVolume || !gGeoManager) {
214 LOGP(error,
"Null motherVolume or gGeoManager");
217 TGeoMedium* medAir = gGeoManager->GetMedium(
"TRK_AIR$");
219 LOGP(error,
"Missing TRK_AIR$");
224 mLengthSensZ <= 0 || mLengthSensZ > mLengthZ) {
225 LOGP(error,
"Invalid rectangular dims: W={}, t={}, Z={}, sensZ={}",
231 const double hx = 0.5 * mWidth;
233 const double hz = 0.5 * mLengthZ;
235 auto* layerShape =
new TGeoBBox(hx, hy, hz);
236 auto* layerVol =
new TGeoVolume(
mLayerName.c_str(), layerShape, medAir);
237 layerVol->SetLineColor(kYellow);
238 layerVol->SetTransparency(30);
243 LOGP(error,
"VDRectangularLayer::createSensor() returned null");
247 LOGP(info,
"Inserting {} in {} ", sensorVol->GetName(), layerVol->GetName());
248 layerVol->AddNode(sensorVol, 1,
nullptr);
261 motherVolume->AddNode(layerVol, 1, combiTrans);
267 if (!motherVolume || !gGeoManager) {
268 LOGP(error,
"Null motherVolume or gGeoManager");
271 TGeoMedium* medAir = gGeoManager->GetMedium(
"TRK_AIR$");
273 LOGP(error,
"Missing TRK_AIR$");
278 mPhiSpanDeg <= 0 || mPhiSpanDeg > 360.0) {
279 LOGP(error,
"Invalid disk dims: rMin={}, rMax={}, t={}, phi={}",
286 const double halfPhi = 0.5 * mPhiSpanDeg;
289 auto* layerShape =
new TGeoTubeSeg(mRMin, mRMax, halfThickness, -halfPhi, +halfPhi);
290 auto* layerVol =
new TGeoVolume(
mLayerName.c_str(), layerShape, medAir);
291 layerVol->SetLineColor(kYellow);
292 layerVol->SetTransparency(30);
297 LOGP(error,
"VDDiskLayer::createSensor() returned null");
302 layerVol->AddNode(sensorVol, 1,
nullptr);
304 TGeoTranslation tz(0.0, 0.0, mZPos);
305 motherVolume->AddNode(layerVol, 1, combiTrans ? combiTrans : &tz);
VDCylindricalLayer(int layerNumber, const std::string &layerName, double layerX2X0, double radius, double phiSpanDeg, double lengthZ, double lengthSensZ)
VDDiskLayer(int layerNumber, const std::string &layerName, double layerX2X0, double rMin, double rMax, double phiSpanDeg, double zPos)