122 const double carbonFiberThickness = 0.01;
123 const double foamSpacingThickness = 0.5;
125 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
128 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
129 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
131 carbonFiberLayerVol1->SetLineColor(kGray + 2);
132 carbonFiberLayerVol2->SetLineColor(kGray + 2);
134 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
136 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, mZ - zSeparation));
137 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, mZ + zSeparation));
139 const double pipeOuterRadius = 0.20;
140 const double kaptonThickness = 0.0025;
141 const double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
142 const double pipeMaxLength = mOuterRadius * 2.0;
151 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};
153 for (
double xPos : X_pos) {
155 double pipeLength = pipeMaxLength;
158 TGeoRotation* rotation =
new TGeoRotation();
159 rotation->RotateX(90);
161 if (std::abs(xPos) < mInnerRadius) {
162 double yInner = std::abs(y_circle(xPos, mInnerRadius));
163 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
168 double positiveYLength = yOuter - yInner;
170 TGeoVolume* kaptonPipePos =
new TGeoVolume((separationLayerName +
"_KaptonPipePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
171 kaptonPipePos->SetLineColor(kGray);
172 TGeoVolume* waterVolumePos =
new TGeoVolume((separationLayerName +
"_WaterVolumePos_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
173 waterVolumePos->SetLineColor(kBlue);
175 motherVolume->AddNode(waterVolumePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
177 TGeoVolume* kaptonPipeNeg =
new TGeoVolume((separationLayerName +
"_KaptonPipeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, positiveYLength / 2),
kaptonMed);
178 kaptonPipeNeg->SetLineColor(kGray);
179 TGeoVolume* waterVolumeNeg =
new TGeoVolume((separationLayerName +
"_WaterVolumeNeg_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, positiveYLength / 2),
waterMed);
180 waterVolumeNeg->SetLineColor(kBlue);
182 motherVolume->AddNode(waterVolumeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
184 motherVolume->AddNode(kaptonPipePos, 1,
new TGeoCombiTrans(xPos, (yInner + yOuter) / 2.0, mZ, rotation));
185 motherVolume->AddNode(kaptonPipeNeg, 1,
new TGeoCombiTrans(xPos, -(yInner + yOuter) / 2.0, mZ, rotation));
189 double yOuter = std::abs(y_circle(xPos, mOuterRadius));
193 TGeoVolume* kaptonPipe =
new TGeoVolume((separationLayerName +
"_KaptonPipe_" +
std::to_string(name_it)).c_str(),
new TGeoTube(pipeInnerRadius, pipeOuterRadius, pipeLength / 2),
kaptonMed);
194 kaptonPipe->SetLineColor(kGray);
195 TGeoVolume* waterVolume =
new TGeoVolume((separationLayerName +
"_WaterVolume_" +
std::to_string(name_it)).c_str(),
new TGeoTube(0.0, pipeInnerRadius, pipeLength / 2),
waterMed);
196 waterVolume->SetLineColor(kBlue);
198 motherVolume->AddNode(waterVolume, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
199 motherVolume->AddNode(kaptonPipe, 1,
new TGeoCombiTrans(xPos, 0, mZ, rotation));
211 constexpr double carbonFiberThickness = 0.01;
212 constexpr double foamSpacingThickness = 1.0;
214 TGeoTube* carbonFiberLayer =
new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
215 TGeoTube* foamLayer =
new TGeoTube(mInnerRadius, mOuterRadius, foamSpacingThickness / 2);
218 TGeoVolume* carbonFiberLayerVol1 =
new TGeoVolume((separationLayerName +
"_CarbonFiber1").c_str(), carbonFiberLayer,
medCarbonFiber);
219 TGeoVolume* foamLayerVol =
new TGeoVolume((separationLayerName +
"_Foam").c_str(), foamLayer,
medFoam);
220 TGeoVolume* carbonFiberLayerVol2 =
new TGeoVolume((separationLayerName +
"_CarbonFiber2").c_str(), carbonFiberLayer,
medCarbonFiber);
222 carbonFiberLayerVol1->SetLineColor(kGray + 2);
223 foamLayerVol->SetLineColor(kBlack);
224 foamLayerVol->SetFillColorAlpha(kBlack, 1.0);
225 carbonFiberLayerVol2->SetLineColor(kGray + 2);
227 const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
229 motherVolume->AddNode(carbonFiberLayerVol1, 1,
new TGeoTranslation(0, 0, 0 - zSeparation));
230 motherVolume->AddNode(foamLayerVol, 1,
new TGeoTranslation(0, 0, 0));
231 motherVolume->AddNode(carbonFiberLayerVol2, 1,
new TGeoTranslation(0, 0, 0 + zSeparation));
238 TGeoTube* innerCircle =
new TGeoTube(mInnerRadius - 0.1, mInnerRadius + 0.1, 0.01);
239 TGeoTube* outerCircle =
new TGeoTube(mOuterRadius - 0.1, mOuterRadius + 0.1, 0.01);
240 TGeoTube* outerCircleEdge =
new TGeoTube(mOuterRadius + 3.3, mOuterRadius + 3.5, 0.01);
242 TGeoVolume* innerCircleVol =
new TGeoVolume((mLayerName +
"_InnerCircle").c_str(), innerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
243 TGeoVolume* outerCircleVol =
new TGeoVolume((mLayerName +
"_OuterCircle").c_str(), outerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
244 TGeoVolume* outerCircleEdgeVol =
new TGeoVolume((mLayerName +
"_OuterCircleEdge").c_str(), outerCircleEdge, gGeoManager->GetMedium(
"FT3_AIR$"));
246 innerCircleVol->SetLineColor(kRed);
247 outerCircleVol->SetLineColor(kBlue);
248 outerCircleEdgeVol->SetLineColor(kBlack);
250 double z_position = mDirection ? 0.5 : -0.5;
252 motherVolume->AddNode(innerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
253 motherVolume->AddNode(outerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
254 motherVolume->AddNode(outerCircleEdgeVol, 1,
new TGeoTranslation(0, 0, z_position));
261 if (mLayerNumber < 0) {
262 LOG(fatal) <<
"Invalid layer number " << mLayerNumber <<
" for FT3 layer.";
265 LOG(info) <<
"FT3: ft3Params.layoutFT3 = " << ft3Params.layoutFT3
266 <<
" Creating Layer " << mLayerNumber <<
" at z=" << mZ
267 <<
" with direction " << mDirection;
281 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
282 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
284 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
285 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
286 layerVol->SetLineColor(kGray);
288 const int NtrapezoidalSegments = ft3Params.nTrapezoidalSegments;
290 const double dz = mChipThickness / 2;
291 const double dzSensor = mSensorThickness / 2;
293 const double dphi = 2.0 * TMath::Pi() / NtrapezoidalSegments;
294 double innerRadiusTrapezoidCorner = mInnerRadius / sin((TMath::Pi() - dphi) / 2);
296 const double rc = 0.5 * (innerRadiusTrapezoidCorner + mOuterRadius) * TMath::Cos(0.5 * dphi);
297 const double h = 0.5 * (mOuterRadius - innerRadiusTrapezoidCorner) * TMath::Cos(0.5 * dphi);
300 const double bl = innerRadiusTrapezoidCorner * TMath::Sin(0.5 * dphi);
301 const double tl = mOuterRadius * TMath::Sin(0.5 * dphi);
304 for (
int iTr = 0; iTr < NtrapezoidalSegments; ++iTr) {
306 auto trdShapeChip =
new TGeoTrap(dz,
316 TGeoVolume* trapezoidChipVolume =
new TGeoVolume(chipName.c_str(), trdShapeChip, medSi);
317 trapezoidChipVolume->SetLineColor(kCyan);
318 trapezoidChipVolume->SetTransparency(50);
321 auto trdShapeSensor =
new TGeoTrap(dzSensor,
331 TGeoVolume* trapezoidSensorVolume =
new TGeoVolume(sensName.c_str(), trdShapeSensor, medSi);
332 trapezoidSensorVolume->SetLineColor(kYellow);
335 const double zSensorInChip = (dz - dzSensor) * (mZ < 0 ? 1 : -1);
336 TGeoCombiTrans* transSens =
new TGeoCombiTrans();
337 transSens->SetTranslation(0, 0, zSensorInChip);
338 trapezoidChipVolume->AddNode(trapezoidSensorVolume, iTr, transSens);
341 auto trdShapePassive =
new TGeoTrap(dz - dzSensor,
351 TGeoVolume* trapezoidPassiveVolume =
new TGeoVolume(passiveName.c_str(), trdShapePassive, medSi);
352 trapezoidPassiveVolume->SetLineColor(kGray);
355 const double zPassiveInChip = (-dzSensor) * (mZ < 0 ? 1 : -1);
356 TGeoCombiTrans* transPassive =
new TGeoCombiTrans();
357 transPassive->SetTranslation(0, 0, zPassiveInChip);
358 trapezoidChipVolume->AddNode(trapezoidPassiveVolume, iTr, transPassive);
361 const double phi_c = (iTr + 0.5) * dphi;
362 const double phi_deg = phi_c * 180.0 / TMath::Pi();
365 const double x = rc * TMath::Cos(phi_c);
366 const double y = rc * TMath::Sin(phi_c);
367 const double z = 0.0;
370 auto rot =
new TGeoRotation();
371 rot->RotateZ(phi_deg - 90.0);
372 auto transf =
new TGeoCombiTrans(
x,
y,
z, rot);
374 layerVol->AddNode(trapezoidChipVolume, iTr, transf);
377 LOG(info) <<
"Inserting " << NtrapezoidalSegments <<
" trapezoidal segments (Rmin="
378 << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z = " << mZ <<
"cm) inside " << layerVol->GetName();
380 auto* diskRotation =
new TGeoRotation(
"TrapezoidalDiskRotation", 0, 0, 0);
381 auto* diskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, diskRotation);
382 motherVolume->AddNode(layerVol, 1, diskCombiTrans);
388 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
389 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
390 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
392 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
393 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
395 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medSi);
396 sensVol->SetLineColor(kYellow);
397 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medSi);
398 chipVol->SetLineColor(kYellow);
399 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
400 layerVol->SetLineColor(kYellow);
402 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
403 chipVol->AddNode(sensVol, 1,
nullptr);
405 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
406 layerVol->AddNode(chipVol, 1,
nullptr);
409 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
410 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
412 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
413 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
414 }
else if (ft3Params.layoutFT3 ==
kSegmented ||
423 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
424 TGeoVolume* layerVol =
nullptr;
426 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
427 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
428 layerVol->SetLineColor(kYellow + 2);
431 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
432 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
435 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
437 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + 0, FwdDiskRotation);
439 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm) inside " << motherVolume->GetName();
440 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
450 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
451 TGeoVolume* layerVol =
nullptr;
459 double z_layer_thickness =
469 double z_local_offset = z_layer_thickness / 2.0;
473 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.2, mOuterRadius + 2.49, z_layer_thickness / 2);
474 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
476 if (ft3Params.drawReferenceCircles) {
482 module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
483 mOuterRadius, z_local_offset, staveConfig, layerVol);
485 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
487 double z_offset_directional = mDirection ? z_local_offset : -z_local_offset;
488 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + z_offset_directional, FwdDiskRotation);
490 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm, segmented disk with staves) inside " << motherVolume->GetName();
492 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
494 LOG(fatal) <<
"Unknown FT3 layout option: " <<
static_cast<int>(ft3Params.layoutFT3);