117 const double carbonFiberThickness = 0.01;
118 const double foamSpacingThickness = 0.5;
120 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
123 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
124 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
126 carbonFiberLayerVol1->SetLineColor(kGray + 2);
127 carbonFiberLayerVol2->SetLineColor(kGray + 2);
129 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
131 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, mZ - zSeparation));
132 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, mZ + zSeparation));
134 const double pipeOuterRadius = 0.20;
135 const double kaptonThickness = 0.0025;
136 const double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
137 const double pipeMaxLength = mOuterRadius * 2.0;
146 std::vector<double> X_pos = {-62.3168, -57.9836, -53.650400000000005, -49.317200000000014, -44.984000000000016, -40.65080000000002, -36.31760000000002, -31.984400000000026, -27.65120000000003, -23.318000000000037, -18.98480000000004, -14.651600000000043, -10.318400000000047, -5.98520000000005, -1.6520000000000519, 2.6811999999999445, 7.014399999999941, 11.347599999999936, 15.680799999999934, 20.01399999999993, 24.347199999999926, 28.68039999999992, 33.013599999999926, 37.34679999999992, 41.980000000000004, 46.613200000000006, 51.246399999999994, 55.87960000000001, 60.5128};
148 for (
double xPos : X_pos) {
150 double pipeLength = pipeMaxLength;
153 TGeoRotation* rotation =
new TGeoRotation();
154 rotation->RotateX(90);
156 if (std::abs(xPos) < mInnerRadius) {
157 double yInner = std::abs(y_circle(xPos, mInnerRadius));
158 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
163 double positiveYLength = yOuter - yInner;
165 TGeoVolume* kaptonPipePos =
new TGeoVolume((separationLayerName +
"_KaptonPipePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
166 kaptonPipePos->SetLineColor(kGray);
167 TGeoVolume* waterVolumePos =
new TGeoVolume((separationLayerName +
"_WaterVolumePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
168 waterVolumePos->SetLineColor(kBlue);
170 motherVolume->AddNode(waterVolumePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
172 TGeoVolume* kaptonPipeNeg =
new TGeoVolume((separationLayerName +
"_KaptonPipeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
173 kaptonPipeNeg->SetLineColor(kGray);
174 TGeoVolume* waterVolumeNeg =
new TGeoVolume((separationLayerName +
"_WaterVolumeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
175 waterVolumeNeg->SetLineColor(kBlue);
177 motherVolume->AddNode(waterVolumeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
179 motherVolume->AddNode(kaptonPipePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
180 motherVolume->AddNode(kaptonPipeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
184 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
188 TGeoVolume* kaptonPipe =
new TGeoVolume((separationLayerName +
"_KaptonPipe_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, pipeLength / 2),
kaptonMed);
189 kaptonPipe->SetLineColor(kGray);
190 TGeoVolume* waterVolume =
new TGeoVolume((separationLayerName +
"_WaterVolume_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, pipeLength / 2),
waterMed);
191 waterVolume->SetLineColor(kBlue);
193 motherVolume->AddNode(waterVolume, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
194 motherVolume->AddNode(kaptonPipe, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
206 constexpr double carbonFiberThickness = 0.01;
207 constexpr double foamSpacingThickness = 1.0;
209 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
210 TGeoTube* foamLayer =
new TGeoTube(mInnerRadius, mOuterRadius, foamSpacingThickness / 2);
213 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
214 TGeoVolume* foamLayerVol =
new TGeoVolume((separationLayerName +
"_Foam").c_str(), foamLayer,
medFoam);
215 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
217 carbonFiberLayerVol1->SetLineColor(kGray + 2);
218 foamLayerVol->SetLineColor(kBlack);
219 foamLayerVol->SetFillColorAlpha(kBlack, 1.0);
220 carbonFiberLayerVol2->SetLineColor(kGray + 2);
222 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
224 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, 0 - zSeparation));
225 motherVolume->AddNode(foamLayerVol, 1,
new TGeoTranslation(0, 0, 0));
226 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, 0 + zSeparation));
233 TGeoTube* innerCircle =
new TGeoTube(mInnerRadius - 0.1, mInnerRadius + 0.1, 0.01);
234 TGeoTube* outerCircle =
new TGeoTube(mOuterRadius - 0.1, mOuterRadius + 0.1, 0.01);
235 TGeoTube* outerCircleEdge =
new TGeoTube(mOuterRadius + 3.3, mOuterRadius + 3.5, 0.01);
237 TGeoVolume* innerCircleVol =
new TGeoVolume((mLayerName +
"_InnerCircle").c_str(), innerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
238 TGeoVolume* outerCircleVol =
new TGeoVolume((mLayerName +
"_OuterCircle").c_str(), outerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
239 TGeoVolume* outerCircleEdgeVol =
new TGeoVolume((mLayerName +
"_OuterCircleEdge").c_str(), outerCircleEdge, gGeoManager->GetMedium(
"FT3_AIR$"));
241 innerCircleVol->SetLineColor(kRed);
242 outerCircleVol->SetLineColor(kBlue);
243 outerCircleEdgeVol->SetLineColor(kBlack);
245 double z_position = mDirection ? 0.5 : -0.5;
247 motherVolume->AddNode(innerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
248 motherVolume->AddNode(outerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
249 motherVolume->AddNode(outerCircleEdgeVol, 1,
new TGeoTranslation(0, 0, z_position));
256 if (mLayerNumber < 0) {
257 LOG(fatal) <<
"Invalid layer number " << mLayerNumber <<
" for FT3 layer.";
260 LOG(info) <<
"FT3: ft3Params.layoutFT3 = " << ft3Params.layoutFT3
261 <<
" Creating Layer " << mLayerNumber <<
" at z=" << mZ
262 <<
" with direction " << mDirection;
276 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
277 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
279 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
280 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
281 layerVol->SetLineColor(kGray);
283 const int NtrapezoidalSegments = ft3Params.nTrapezoidalSegments;
285 const double dz = mChipThickness / 2;
286 const double dzSensor = mSensorThickness / 2;
288 const double dphi = 2.0 * TMath::Pi() / NtrapezoidalSegments;
289 double innerRadiusTrapezoidCorner = mInnerRadius / sin((TMath::Pi() - dphi) / 2);
291 const double rc = 0.5 * (innerRadiusTrapezoidCorner + mOuterRadius) * TMath::Cos(0.5 * dphi);
292 const double h = 0.5 * (mOuterRadius - innerRadiusTrapezoidCorner) * TMath::Cos(0.5 * dphi);
295 const double bl = innerRadiusTrapezoidCorner * TMath::Sin(0.5 * dphi);
296 const double tl = mOuterRadius * TMath::Sin(0.5 * dphi);
299 for (
int iTr = 0; iTr < NtrapezoidalSegments; ++iTr) {
301 auto trdShapeChip =
new TGeoTrap(dz,
311 TGeoVolume* trapezoidChipVolume =
new TGeoVolume(chipName.c_str(), trdShapeChip, medSi);
312 trapezoidChipVolume->SetLineColor(kCyan);
313 trapezoidChipVolume->SetTransparency(50);
316 auto trdShapeSensor =
new TGeoTrap(dzSensor,
326 TGeoVolume* trapezoidSensorVolume =
new TGeoVolume(sensName.c_str(), trdShapeSensor, medSi);
327 trapezoidSensorVolume->SetLineColor(kYellow);
330 const double zSensorInChip = (dz - dzSensor) * (mZ < 0 ? 1 : -1);
331 TGeoCombiTrans* transSens =
new TGeoCombiTrans();
332 transSens->SetTranslation(0, 0, zSensorInChip);
333 trapezoidChipVolume->AddNode(trapezoidSensorVolume, iTr, transSens);
336 auto trdShapePassive =
new TGeoTrap(dz - dzSensor,
346 TGeoVolume* trapezoidPassiveVolume =
new TGeoVolume(passiveName.c_str(), trdShapePassive, medSi);
347 trapezoidPassiveVolume->SetLineColor(kGray);
350 const double zPassiveInChip = (-dzSensor) * (mZ < 0 ? 1 : -1);
351 TGeoCombiTrans* transPassive =
new TGeoCombiTrans();
352 transPassive->SetTranslation(0, 0, zPassiveInChip);
353 trapezoidChipVolume->AddNode(trapezoidPassiveVolume, iTr, transPassive);
356 const double phi_c = (iTr + 0.5) * dphi;
357 const double phi_deg = phi_c * 180.0 / TMath::Pi();
360 const double x = rc * TMath::Cos(phi_c);
361 const double y = rc * TMath::Sin(phi_c);
362 const double z = 0.0;
365 auto rot =
new TGeoRotation();
366 rot->RotateZ(phi_deg - 90.0);
367 auto transf =
new TGeoCombiTrans(
x,
y,
z, rot);
369 layerVol->AddNode(trapezoidChipVolume, iTr, transf);
372 LOG(info) <<
"Inserting " << NtrapezoidalSegments <<
" trapezoidal segments (Rmin="
373 << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z = " << mZ <<
"cm) inside " << layerVol->GetName();
375 auto* diskRotation =
new TGeoRotation(
"TrapezoidalDiskRotation", 0, 0, 0);
376 auto* diskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, diskRotation);
377 motherVolume->AddNode(layerVol, 1, diskCombiTrans);
383 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
384 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
385 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
387 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
388 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
390 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medSi);
391 sensVol->SetLineColor(kYellow);
392 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medSi);
393 chipVol->SetLineColor(kYellow);
394 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
395 layerVol->SetLineColor(kYellow);
397 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
398 chipVol->AddNode(sensVol, 1,
nullptr);
400 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
401 layerVol->AddNode(chipVol, 1,
nullptr);
404 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
405 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
407 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
408 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
409 }
else if (ft3Params.layoutFT3 ==
kSegmented ||
418 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
419 TGeoVolume* layerVol =
nullptr;
421 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
422 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
423 layerVol->SetLineColor(kYellow + 2);
426 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
427 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
430 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
432 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + 0, FwdDiskRotation);
434 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm) inside " << motherVolume->GetName();
435 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
445 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
446 TGeoVolume* layerVol =
nullptr;
454 double z_layer_thickness =
464 double z_local_offset = z_layer_thickness / 2.0;
467 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.2, mOuterRadius + 3.49, z_layer_thickness / 2);
468 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
470 if (ft3Params.drawReferenceCircles) {
476 module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
477 mOuterRadius, z_local_offset, staveConfig, layerVol);
479 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
481 double z_offset_directional = mDirection ? z_local_offset : -z_local_offset;
482 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + z_offset_directional, FwdDiskRotation);
484 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm, segmented disk with staves) inside " << motherVolume->GetName();
486 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
488 LOG(fatal) <<
"Unknown FT3 layout option: " <<
static_cast<int>(ft3Params.layoutFT3);