118 const double carbonFiberThickness = 0.01;
119 const double foamSpacingThickness = 0.5;
121 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
124 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
125 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
127 carbonFiberLayerVol1->SetLineColor(kGray + 2);
128 carbonFiberLayerVol2->SetLineColor(kGray + 2);
130 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
132 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, mZ - zSeparation));
133 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, mZ + zSeparation));
135 const double pipeOuterRadius = 0.20;
136 const double kaptonThickness = 0.0025;
137 const double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
138 const double pipeMaxLength = mOuterRadius * 2.0;
147 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};
149 for (
double xPos : X_pos) {
151 double pipeLength = pipeMaxLength;
154 TGeoRotation* rotation =
new TGeoRotation();
155 rotation->RotateX(90);
157 if (std::abs(xPos) < mInnerRadius) {
158 double yInner = std::abs(y_circle(xPos, mInnerRadius));
159 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
164 double positiveYLength = yOuter - yInner;
166 TGeoVolume* kaptonPipePos =
new TGeoVolume((separationLayerName +
"_KaptonPipePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
167 kaptonPipePos->SetLineColor(kGray);
168 TGeoVolume* waterVolumePos =
new TGeoVolume((separationLayerName +
"_WaterVolumePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
169 waterVolumePos->SetLineColor(kBlue);
171 motherVolume->AddNode(waterVolumePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
173 TGeoVolume* kaptonPipeNeg =
new TGeoVolume((separationLayerName +
"_KaptonPipeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
174 kaptonPipeNeg->SetLineColor(kGray);
175 TGeoVolume* waterVolumeNeg =
new TGeoVolume((separationLayerName +
"_WaterVolumeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
176 waterVolumeNeg->SetLineColor(kBlue);
178 motherVolume->AddNode(waterVolumeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
180 motherVolume->AddNode(kaptonPipePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
181 motherVolume->AddNode(kaptonPipeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
185 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
189 TGeoVolume* kaptonPipe =
new TGeoVolume((separationLayerName +
"_KaptonPipe_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, pipeLength / 2),
kaptonMed);
190 kaptonPipe->SetLineColor(kGray);
191 TGeoVolume* waterVolume =
new TGeoVolume((separationLayerName +
"_WaterVolume_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, pipeLength / 2),
waterMed);
192 waterVolume->SetLineColor(kBlue);
194 motherVolume->AddNode(waterVolume, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
195 motherVolume->AddNode(kaptonPipe, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
207 constexpr double carbonFiberThickness = 0.01;
208 constexpr double foamSpacingThickness = 1.0;
210 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
211 TGeoTube* foamLayer =
new TGeoTube(mInnerRadius, mOuterRadius, foamSpacingThickness / 2);
214 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
215 TGeoVolume* foamLayerVol =
new TGeoVolume((separationLayerName +
"_Foam").c_str(), foamLayer,
medFoam);
216 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
218 carbonFiberLayerVol1->SetLineColor(kGray + 2);
219 foamLayerVol->SetLineColor(kBlack);
220 foamLayerVol->SetFillColorAlpha(kBlack, 1.0);
221 carbonFiberLayerVol2->SetLineColor(kGray + 2);
223 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
225 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, 0 - zSeparation));
226 motherVolume->AddNode(foamLayerVol, 1,
new TGeoTranslation(0, 0, 0));
227 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, 0 + zSeparation));
234 TGeoTube* innerCircle =
new TGeoTube(mInnerRadius - 0.1, mInnerRadius + 0.1, 0.01);
235 TGeoTube* outerCircle =
new TGeoTube(mOuterRadius - 0.1, mOuterRadius + 0.1, 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$"));
240 innerCircleVol->SetLineColor(kRed);
241 outerCircleVol->SetLineColor(kBlue);
243 double z_position = mDirection ? 0.5 : -0.5;
245 motherVolume->AddNode(innerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
246 motherVolume->AddNode(outerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
253 if (mLayerNumber < 0) {
254 LOG(fatal) <<
"Invalid layer number " << mLayerNumber <<
" for FT3 layer.";
257 LOG(info) <<
"FT3: ft3Params.layoutFT3 = " << ft3Params.layoutFT3
258 <<
" Creating Layer " << mLayerNumber <<
" at z=" << mZ
259 <<
" with direction " << mDirection;
273 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
274 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
276 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
277 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
278 layerVol->SetLineColor(kGray);
280 const int NtrapezoidalSegments = ft3Params.nTrapezoidalSegments;
282 const double dz = mChipThickness / 2;
283 const double dzSensor = mSensorThickness / 2;
285 const double dphi = 2.0 * TMath::Pi() / NtrapezoidalSegments;
286 double innerRadiusTrapezoidCorner = mInnerRadius / sin((TMath::Pi() - dphi) / 2);
288 const double rc = 0.5 * (innerRadiusTrapezoidCorner + mOuterRadius) * TMath::Cos(0.5 * dphi);
289 const double h = 0.5 * (mOuterRadius - innerRadiusTrapezoidCorner) * TMath::Cos(0.5 * dphi);
292 const double bl = innerRadiusTrapezoidCorner * TMath::Sin(0.5 * dphi);
293 const double tl = mOuterRadius * TMath::Sin(0.5 * dphi);
296 for (
int iTr = 0; iTr < NtrapezoidalSegments; ++iTr) {
298 auto trdShapeChip =
new TGeoTrap(dz,
308 TGeoVolume* trapezoidChipVolume =
new TGeoVolume(chipName.c_str(), trdShapeChip, medSi);
309 trapezoidChipVolume->SetLineColor(kCyan);
310 trapezoidChipVolume->SetTransparency(50);
313 auto trdShapeSensor =
new TGeoTrap(dzSensor,
323 TGeoVolume* trapezoidSensorVolume =
new TGeoVolume(sensName.c_str(), trdShapeSensor, medSi);
324 trapezoidSensorVolume->SetLineColor(kYellow);
327 const double zSensorInChip = (dz - dzSensor) * (mZ < 0 ? 1 : -1);
328 TGeoCombiTrans* transSens =
new TGeoCombiTrans();
329 transSens->SetTranslation(0, 0, zSensorInChip);
330 trapezoidChipVolume->AddNode(trapezoidSensorVolume, iTr, transSens);
333 auto trdShapePassive =
new TGeoTrap(dz - dzSensor,
343 TGeoVolume* trapezoidPassiveVolume =
new TGeoVolume(passiveName.c_str(), trdShapePassive, medSi);
344 trapezoidPassiveVolume->SetLineColor(kGray);
347 const double zPassiveInChip = (-dzSensor) * (mZ < 0 ? 1 : -1);
348 TGeoCombiTrans* transPassive =
new TGeoCombiTrans();
349 transPassive->SetTranslation(0, 0, zPassiveInChip);
350 trapezoidChipVolume->AddNode(trapezoidPassiveVolume, iTr, transPassive);
353 const double phi_c = (iTr + 0.5) * dphi;
354 const double phi_deg = phi_c * 180.0 / TMath::Pi();
357 const double x = rc * TMath::Cos(phi_c);
358 const double y = rc * TMath::Sin(phi_c);
359 const double z = 0.0;
362 auto rot =
new TGeoRotation();
363 rot->RotateZ(phi_deg - 90.0);
364 auto transf =
new TGeoCombiTrans(
x,
y,
z, rot);
366 layerVol->AddNode(trapezoidChipVolume, iTr, transf);
369 LOG(info) <<
"Inserting " << NtrapezoidalSegments <<
" trapezoidal segments (Rmin="
370 << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z = " << mZ <<
"cm) inside " << layerVol->GetName();
372 auto* diskRotation =
new TGeoRotation(
"TrapezoidalDiskRotation", 0, 0, 0);
373 auto* diskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, diskRotation);
374 motherVolume->AddNode(layerVol, 1, diskCombiTrans);
380 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
381 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
382 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
384 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
385 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
387 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medSi);
388 sensVol->SetLineColor(kYellow);
389 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medSi);
390 chipVol->SetLineColor(kYellow);
391 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
392 layerVol->SetLineColor(kYellow);
394 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
395 chipVol->AddNode(sensVol, 1,
nullptr);
397 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
398 layerVol->AddNode(chipVol, 1,
nullptr);
401 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
402 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
404 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
405 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
406 }
else if (ft3Params.layoutFT3 ==
kSegmented ||
415 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
416 TGeoVolume* layerVol =
nullptr;
418 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
419 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
420 layerVol->SetLineColor(kYellow + 2);
423 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
424 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
427 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
429 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + 0, FwdDiskRotation);
431 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm) inside " << motherVolume->GetName();
432 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
442 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
443 TGeoVolume* layerVol =
nullptr;
451 double z_layer_thickness =
461 double z_local_offset = z_layer_thickness / 2.0;
462 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.2, mOuterRadius + 2.5, z_layer_thickness / 2);
463 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
465 if (ft3Params.drawReferenceCircles) {
471 module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
472 mOuterRadius, z_local_offset, staveConfig, layerVol);
474 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
476 double z_offset_directional = mDirection ? z_local_offset : -z_local_offset;
477 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + z_offset_directional, FwdDiskRotation);
479 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm, segmented disk with staves) inside " << motherVolume->GetName();
481 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
483 LOG(fatal) <<
"Unknown FT3 layout option: " <<
static_cast<int>(ft3Params.layoutFT3);