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);
236 TGeoTube* outerCircleEdge =
new TGeoTube(mOuterRadius + 3.3, mOuterRadius + 3.5, 0.01);
238 TGeoVolume* innerCircleVol =
new TGeoVolume((mLayerName +
"_InnerCircle").c_str(), innerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
239 TGeoVolume* outerCircleVol =
new TGeoVolume((mLayerName +
"_OuterCircle").c_str(), outerCircle, gGeoManager->GetMedium(
"FT3_AIR$"));
240 TGeoVolume* outerCircleEdgeVol =
new TGeoVolume((mLayerName +
"_OuterCircleEdge").c_str(), outerCircleEdge, gGeoManager->GetMedium(
"FT3_AIR$"));
242 innerCircleVol->SetLineColor(kRed);
243 outerCircleVol->SetLineColor(kBlue);
244 outerCircleEdgeVol->SetLineColor(kBlack);
246 double z_position = mDirection ? 0.5 : -0.5;
248 motherVolume->AddNode(innerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
249 motherVolume->AddNode(outerCircleVol, 1,
new TGeoTranslation(0, 0, z_position));
250 motherVolume->AddNode(outerCircleEdgeVol, 1,
new TGeoTranslation(0, 0, z_position));
257 if (mLayerNumber < 0) {
258 LOG(fatal) <<
"Invalid layer number " << mLayerNumber <<
" for FT3 layer.";
261 LOG(info) <<
"FT3: ft3Params.layoutFT3 = " << ft3Params.layoutFT3
262 <<
" Creating Layer " << mLayerNumber <<
" at z=" << mZ
263 <<
" with direction " << mDirection;
277 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
278 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
280 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
281 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
282 layerVol->SetLineColor(kGray);
284 const int NtrapezoidalSegments = ft3Params.nTrapezoidalSegments;
286 const double dz = mChipThickness / 2;
287 const double dzSensor = mSensorThickness / 2;
289 const double dphi = 2.0 * TMath::Pi() / NtrapezoidalSegments;
290 double innerRadiusTrapezoidCorner = mInnerRadius / sin((TMath::Pi() - dphi) / 2);
292 const double rc = 0.5 * (innerRadiusTrapezoidCorner + mOuterRadius) * TMath::Cos(0.5 * dphi);
293 const double h = 0.5 * (mOuterRadius - innerRadiusTrapezoidCorner) * TMath::Cos(0.5 * dphi);
296 const double bl = innerRadiusTrapezoidCorner * TMath::Sin(0.5 * dphi);
297 const double tl = mOuterRadius * TMath::Sin(0.5 * dphi);
300 for (
int iTr = 0; iTr < NtrapezoidalSegments; ++iTr) {
302 auto trdShapeChip =
new TGeoTrap(dz,
312 TGeoVolume* trapezoidChipVolume =
new TGeoVolume(chipName.c_str(), trdShapeChip, medSi);
313 trapezoidChipVolume->SetLineColor(kCyan);
314 trapezoidChipVolume->SetTransparency(50);
317 auto trdShapeSensor =
new TGeoTrap(dzSensor,
327 TGeoVolume* trapezoidSensorVolume =
new TGeoVolume(sensName.c_str(), trdShapeSensor, medSi);
328 trapezoidSensorVolume->SetLineColor(kYellow);
331 const double zSensorInChip = (dz - dzSensor) * (mZ < 0 ? 1 : -1);
332 TGeoCombiTrans* transSens =
new TGeoCombiTrans();
333 transSens->SetTranslation(0, 0, zSensorInChip);
334 trapezoidChipVolume->AddNode(trapezoidSensorVolume, iTr, transSens);
337 auto trdShapePassive =
new TGeoTrap(dz - dzSensor,
347 TGeoVolume* trapezoidPassiveVolume =
new TGeoVolume(passiveName.c_str(), trdShapePassive, medSi);
348 trapezoidPassiveVolume->SetLineColor(kGray);
351 const double zPassiveInChip = (-dzSensor) * (mZ < 0 ? 1 : -1);
352 TGeoCombiTrans* transPassive =
new TGeoCombiTrans();
353 transPassive->SetTranslation(0, 0, zPassiveInChip);
354 trapezoidChipVolume->AddNode(trapezoidPassiveVolume, iTr, transPassive);
357 const double phi_c = (iTr + 0.5) * dphi;
358 const double phi_deg = phi_c * 180.0 / TMath::Pi();
361 const double x = rc * TMath::Cos(phi_c);
362 const double y = rc * TMath::Sin(phi_c);
363 const double z = 0.0;
366 auto rot =
new TGeoRotation();
367 rot->RotateZ(phi_deg - 90.0);
368 auto transf =
new TGeoCombiTrans(
x,
y,
z, rot);
370 layerVol->AddNode(trapezoidChipVolume, iTr, transf);
373 LOG(info) <<
"Inserting " << NtrapezoidalSegments <<
" trapezoidal segments (Rmin="
374 << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z = " << mZ <<
"cm) inside " << layerVol->GetName();
376 auto* diskRotation =
new TGeoRotation(
"TrapezoidalDiskRotation", 0, 0, 0);
377 auto* diskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, diskRotation);
378 motherVolume->AddNode(layerVol, 1, diskCombiTrans);
384 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
385 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
386 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
388 TGeoMedium* medSi = gGeoManager->GetMedium(
"FT3_SILICON$");
389 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
391 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medSi);
392 sensVol->SetLineColor(kYellow);
393 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medSi);
394 chipVol->SetLineColor(kYellow);
395 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
396 layerVol->SetLineColor(kYellow);
398 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
399 chipVol->AddNode(sensVol, 1,
nullptr);
401 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
402 layerVol->AddNode(chipVol, 1,
nullptr);
405 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
406 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
408 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
409 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
410 }
else if (ft3Params.layoutFT3 ==
kSegmented ||
419 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
420 TGeoVolume* layerVol =
nullptr;
422 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.1, mOuterRadius + 0.1, 1.5);
423 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
424 layerVol->SetLineColor(kYellow + 2);
427 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "front", "rectangular", layerVol);
428 module.createModule(0, mLayerNumber, mDirection, mInnerRadius, mOuterRadius, 0., "back", "rectangular", layerVol);
431 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
433 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + 0, FwdDiskRotation);
435 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm) inside " << motherVolume->GetName();
436 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
446 TGeoMedium* medAir = gGeoManager->GetMedium(
"FT3_AIR$");
447 TGeoVolume* layerVol =
nullptr;
455 double z_layer_thickness =
465 double z_local_offset = z_layer_thickness / 2.0;
468 TGeoTube*
layer =
new TGeoTube(mInnerRadius - 0.2, mOuterRadius + 3.49, z_layer_thickness / 2);
469 layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
471 if (ft3Params.drawReferenceCircles) {
477 module.createModule_staveGeo(0., mLayerNumber, mDirection, mInnerRadius,
478 mOuterRadius, z_local_offset, staveConfig, layerVol);
480 auto* FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
482 double z_offset_directional = mDirection ? z_local_offset : -z_local_offset;
483 auto* FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ + z_offset_directional, FwdDiskRotation);
485 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" (Rmin=" << mInnerRadius <<
", Rmax=" << mOuterRadius <<
", z=" << mZ <<
"cm, segmented disk with staves) inside " << motherVolume->GetName();
487 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
489 LOG(fatal) <<
"Unknown FT3 layout option: " <<
static_cast<int>(ft3Params.layoutFT3);