20#include <fairlogger/Logger.h>
25#include <TGeoManager.h>
26#include <TGeoMatrix.h>
29#include <TGeoVolume.h>
42const Int_t V1Layer::sNumberOmInnerLayers = 3;
44const Double_t V1Layer::sDefaultSensorThick = 300 * sMicron;
45const Double_t V1Layer::sDefaultStaveThick = 1 * sCm;
48const Int_t V1Layer::sIBChipsPerRow = 9;
49const Int_t V1Layer::sIBNChipRows = 1;
52const Int_t V1Layer::sOBChipsPerRow = 7;
53const Int_t V1Layer::sOBNChipRows = 2;
55const Double_t V1Layer::sOBHalfStaveWidth = 3.01 * sCm;
56const Double_t V1Layer::sOBModuleWidth = sOBHalfStaveWidth;
57const Double_t V1Layer::sOBModuleGap = 0.01 * sCm;
58const Double_t V1Layer::sOBChipXGap = 0.01 * sCm;
59const Double_t V1Layer::sOBChipZGap = 0.01 * sCm;
60const Double_t V1Layer::sOBFlexCableAlThick = 0.005 * sCm;
61const Double_t V1Layer::sOBFlexCableKapThick = 0.01 * sCm;
62const Double_t V1Layer::sOBBusCableAlThick = 0.02 * sCm;
63const Double_t V1Layer::sOBBusCableKapThick = 0.02 * sCm;
64const Double_t V1Layer::sOBColdPlateThick = 0.012 * sCm;
65const Double_t V1Layer::sOBCarbonPlateThick = 0.012 * sCm;
66const Double_t V1Layer::sOBGlueThick = 0.03 * sCm;
67const Double_t V1Layer::sOBModuleZLength = 21.06 * sCm;
68const Double_t V1Layer::sOBHalfStaveYTrans = 1.76 * sMm;
69const Double_t V1Layer::sOBHalfStaveXOverlap = 4.3 * sMm;
70const Double_t V1Layer::sOBGraphiteFoilThick = 30.0 * sMicron;
71const Double_t V1Layer::sOBCoolTubeInnerD = 2.052 * sMm;
72const Double_t V1Layer::sOBCoolTubeThick = 32.0 * sMicron;
73const Double_t V1Layer::sOBCoolTubeXDist = 11.1 * sMm;
75const Double_t V1Layer::sOBSpaceFrameWidth = 42.0 * sMm;
76const Double_t V1Layer::sOBSpaceFrameTotHigh = 43.1 * sMm;
77const Double_t V1Layer::sOBSFrameBeamRadius = 0.6 * sMm;
78const Double_t V1Layer::sOBSpaceFrameLa = 3.0 * sMm;
79const Double_t V1Layer::sOBSpaceFrameHa = 0.721979 * sMm;
80const Double_t V1Layer::sOBSpaceFrameLb = 3.7 * sMm;
81const Double_t V1Layer::sOBSpaceFrameHb = 0.890428 * sMm;
82const Double_t V1Layer::sOBSpaceFrameL = 0.25 * sMm;
83const Double_t V1Layer::sOBSFBotBeamAngle = 56.5;
84const Double_t V1Layer::sOBSFrameBeamSidePhi = 65.0;
88#define SQ(A) (A) * (A)
106 mStaveModel(kIBModelDummy)
129 mStaveModel(kIBModelDummy)
152 mStaveModel(kIBModelDummy)
175 mStaveModel(kIBModelDummy)
184 mLayerNumber(s.mLayerNumber),
186 mLayerRadius(s.mLayerRadius),
187 mZLength(s.mZLength),
188 mSensorThickness(s.mSensorThickness),
189 mStaveThickness(s.mStaveThickness),
190 mStaveWidth(s.mStaveWidth),
191 mStaveTilt(s.mStaveTilt),
192 mNumberOfStaves(s.mNumberOfStaves),
193 mNumberOfModules(s.mNumberOfModules),
194 mNumberOfChips(s.mNumberOfChips),
195 mChipTypeID(s.mChipTypeID),
196 mIsTurbo(s.mIsTurbo),
197 mBuildLevel(s.mBuildLevel),
198 mStaveModel(s.mStaveModel)
201 mHierarchy[
i] = s.mHierarchy[
i];
211 mLayerNumber = s.mLayerNumber;
213 mLayerRadius = s.mLayerRadius;
214 mZLength = s.mZLength;
215 mSensorThickness = s.mSensorThickness;
216 mStaveThickness = s.mStaveThickness;
217 mStaveWidth = s.mStaveWidth;
218 mStaveTilt = s.mStaveTilt;
219 mNumberOfStaves = s.mNumberOfStaves;
220 mNumberOfModules = s.mNumberOfModules;
221 mNumberOfChips = s.mNumberOfChips;
222 mIsTurbo = s.mIsTurbo;
223 mChipTypeID = s.mChipTypeID;
224 mBuildLevel = s.mBuildLevel;
225 mStaveModel = s.mStaveModel;
227 mHierarchy[
i] = s.mHierarchy[
i];
238 Double_t xpos, ypos, zpos;
242 if (mLayerRadius <= 0) {
243 LOG(fatal) <<
"Wrong layer radius " << mLayerRadius;
247 LOG(fatal) <<
"Wrong layer length " << mZLength;
250 if (mNumberOfStaves <= 0) {
251 LOG(fatal) <<
"Wrong number of staves " << mNumberOfStaves;
254 if (mNumberOfChips <= 0) {
255 LOG(fatal) <<
"Wrong number of chips " << mNumberOfChips;
258 if (mLayerNumber >= sNumberOmInnerLayers && mNumberOfModules <= 0) {
259 LOG(fatal) <<
"Wrong number of modules " << mNumberOfModules;
262 if (mStaveThickness <= 0) {
263 LOG(info) <<
"Stave thickness wrong or not set " << mStaveThickness <<
" using default "
264 << sDefaultStaveThick;
265 mStaveThickness = sDefaultStaveThick;
268 if (mSensorThickness <= 0) {
269 LOG(info) <<
"Sensor thickness wrong or not set " << mSensorThickness <<
" using default "
270 << sDefaultSensorThick;
271 mSensorThickness = sDefaultSensorThick;
274 if (mSensorThickness > mStaveThickness) {
275 LOG(warning) <<
"Sensor thickness " << mSensorThickness <<
" is greater than stave thickness "
276 << mStaveThickness <<
" fixing";
277 mSensorThickness = mStaveThickness;
282 createLayerTurbo(motherVolume);
287 alpha = (360. / (2 * mNumberOfStaves)) * DegToRad();
292 TGeoVolume* layerVolume =
new TGeoVolumeAssembly(volumeName);
293 layerVolume->SetUniqueID(mChipTypeID);
296 layerVolume->SetVisibility(kTRUE);
297 layerVolume->SetLineColor(1);
299 TGeoVolume* stavVol = createStave();
302 alpha = 360. / mNumberOfStaves;
303 Double_t
r = mLayerRadius + ((TGeoBBox*)stavVol->GetShape())->GetDY();
304 for (Int_t
j = 0;
j < mNumberOfStaves;
j++) {
305 Double_t phi =
j *
alpha + mPhi0;
306 xpos =
r *
cosD(phi);
307 ypos =
r *
sinD(phi);
310 layerVolume->AddNode(stavVol,
j,
311 new TGeoCombiTrans(xpos, ypos, zpos,
new TGeoRotation(
"", phi, 0, 0)));
315 motherVolume->AddNode(layerVolume, 1,
nullptr);
321void V1Layer::createLayerTurbo(TGeoVolume* motherVolume)
324 Double_t xpos, ypos, zpos;
328 if (mStaveWidth <= 0) {
329 LOG(fatal) <<
"Wrong stave width " << mStaveWidth;
332 if (
Abs(mStaveTilt) > 45) {
333 LOG(warning) <<
"Stave tilt angle (" << mStaveTilt <<
") greater than 45deg";
337 TGeoVolume* layerVolume =
new TGeoVolumeAssembly(volumeName);
338 layerVolume->SetUniqueID(mChipTypeID);
339 layerVolume->SetVisibility(kTRUE);
340 layerVolume->SetLineColor(1);
341 TGeoVolume* stavVol = createStave();
344 alpha = 360. / mNumberOfStaves;
345 Double_t
r = mLayerRadius ;
346 for (Int_t
j = 0;
j < mNumberOfStaves;
j++) {
347 Double_t phi =
j *
alpha + mPhi0;
348 xpos =
r *
cosD(phi);
349 ypos =
r *
sinD(phi);
352 layerVolume->AddNode(
354 new TGeoCombiTrans(xpos, ypos, zpos,
new TGeoRotation(
"", phi - mStaveTilt, 0, 0)));
358 motherVolume->AddNode(layerVolume, 1,
nullptr);
363TGeoVolume* V1Layer::createStave(
const TGeoManager* )
367 Double_t xlen, ylen, zlen;
372 alpha = (360. / (2 * mNumberOfStaves)) * DegToRad();
377 xlen = 0.5 * mStaveWidth;
379 ylen = 0.5 * mStaveThickness;
380 zlen = 0.5 * mZLength;
382 Double_t yplus = 0.46;
383 auto* stave =
new TGeoXtru(2);
384 Double_t xv[5] = {xlen, xlen, 0, -xlen, -xlen};
385 Double_t yv[5] = {ylen + 0.09, -0.15, -yplus - mSensorThickness, -0.15, ylen + 0.09};
386 stave->DefinePolygon(5, xv, yv);
387 stave->DefineSection(0, -zlen, 0, 0, 1.);
388 stave->DefineSection(1, +zlen, 0, 0, 1.);
394 TGeoVolume* staveVol =
new TGeoVolumeAssembly(volumeName);
397 staveVol->SetVisibility(kTRUE);
398 staveVol->SetLineColor(2);
399 TGeoVolume* mechStaveVol =
nullptr;
402 if (mLayerNumber < sNumberOmInnerLayers) {
403 TGeoVolume* modVol = createStaveInnerB(xlen, ylen, zlen);
404 staveVol->AddNode(modVol, 0);
408 mechStaveVol = createStaveStructInnerB(xlen, zlen);
410 ypos = ((TGeoBBox*)(modVol->GetShape()))->GetDY() +
411 ((TGeoBBox*)(mechStaveVol->GetShape()))->GetDY();
412 staveVol->AddNode(mechStaveVol, 1,
413 new TGeoCombiTrans(0, -ypos, 0,
new TGeoRotation(
"", 0, 0, 180)));
416 TGeoVolume* hstaveVol = createStaveOuterB();
418 staveVol->AddNode(hstaveVol, 0);
421 xpos = ((TGeoBBox*)(hstaveVol->GetShape()))->GetDX() - sOBHalfStaveXOverlap / 2;
423 ypos = (sOBSpaceFrameTotHigh - sOBHalfStaveYTrans) / 2;
424 staveVol->AddNode(hstaveVol, 0,
new TGeoTranslation(-xpos, ypos, 0));
425 staveVol->AddNode(hstaveVol, 1,
new TGeoTranslation(xpos, ypos + sOBHalfStaveYTrans, 0));
427 mechStaveVol = createSpaceFrameOuterB();
430 staveVol->AddNode(mechStaveVol, 1,
431 new TGeoCombiTrans(0, 0, 0,
new TGeoRotation(
"", 180, 0, 0)));
439TGeoVolume* V1Layer::createStaveInnerB(
const Double_t xsta,
const Double_t ysta,
440 const Double_t zsta,
const TGeoManager* mgr)
442 Double_t xmod, ymod, zmod;
446 TGeoVolume* moduleVol = createModuleInnerB(xsta, ysta, zsta);
449 xmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDX();
450 ymod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDY();
451 zmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDZ();
453 auto* hstave =
new TGeoBBox(xmod, ymod, zmod);
455 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
458 auto* hstaveVol =
new TGeoVolume(volumeName, hstave, medAir);
461 hstaveVol->AddNode(moduleVol, 0);
468TGeoVolume* V1Layer::createModuleInnerB(Double_t xmod, Double_t ymod, Double_t zmod,
469 const TGeoManager* mgr)
476 zchip = zmod / sIBChipsPerRow;
477 TGeoVolume* chipVol = createChipInnerB(xmod, ymod, zchip);
480 auto*
module = new TGeoBBox(xmod, ymod, zmod);
482 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
485 auto* modVol =
new TGeoVolume(volumeName, module, medAir);
488 for (Int_t
j = 0;
j < sIBChipsPerRow;
j++) {
489 zpos = -zmod +
j * 2 * zchip + zchip;
490 modVol->AddNode(chipVol,
j,
new TGeoTranslation(0, 0, zpos));
497TGeoVolume* V1Layer::createStaveStructInnerB(
const Double_t xsta,
const Double_t zsta,
498 const TGeoManager* mgr)
500 TGeoVolume* mechStavVol =
nullptr;
502 switch (mStaveModel) {
504 mechStavVol = createStaveModelInnerBDummy(xsta, zsta, mgr);
507 mechStavVol = createStaveModelInnerB0(xsta, zsta, mgr);
510 mechStavVol = createStaveModelInnerB1(xsta, zsta, mgr);
513 mechStavVol = createStaveModelInnerB21(xsta, zsta, mgr);
516 mechStavVol = createStaveModelInnerB22(xsta, zsta, mgr);
519 mechStavVol = createStaveModelInnerB3(xsta, zsta, mgr);
522 LOG(fatal) <<
"Unknown stave model " << mStaveModel;
528TGeoVolume* V1Layer::createStaveModelInnerBDummy(
const Double_t,
const Double_t,
529 const TGeoManager*)
const
535TGeoVolume* V1Layer::createStaveModelInnerB0(
const Double_t xsta,
const Double_t zsta,
536 const TGeoManager* mgr)
539 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
540 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
542 TGeoMedium* medM60J3K = mgr->GetMedium(Form(
"%s_M60J3K$",
GetDetName()));
543 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
544 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
545 TGeoMedium* medFlexCable = mgr->GetMedium(Form(
"%s_FLEXCABLE$",
GetDetName()));
548 Double_t kConeOutRadius = 0.15 / 2;
549 Double_t kConeInRadius = 0.1430 / 2;
550 Double_t kStaveLength = zsta * 2;
551 Double_t kStaveWidth = xsta * 2 - kConeOutRadius * 2;
552 Double_t kWidth = kStaveWidth / 4;
553 Double_t kStaveHeight = 0.3;
554 Double_t kHeight = kStaveHeight / 2;
555 Double_t
kAlpha = 90 - 67;
556 Double_t kTheta =
kAlpha * TMath::DegToRad();
557 Double_t kS1 = kWidth / TMath::Sin(kTheta);
558 Double_t kL1 = kWidth / TMath::Tan(kTheta);
559 Double_t kS2 = TMath::Sqrt(kHeight * kHeight + kS1 * kS1);
560 Double_t kThe2 = TMath::ATan(kHeight / kS1);
561 Double_t kBeta = kThe2 * TMath::RadToDeg();
566 LOG(debug1) <<
"BuildLevel " << mBuildLevel;
572 Double_t
z = 0,
y = -0.011 + 0.0150,
x = 0;
574 TGeoVolume* mechStavVol =
nullptr;
576 if (mBuildLevel < 5) {
578 auto* mechStruct =
new TGeoXtru(2);
580 kStaveWidth / 2 + 0.1, kStaveWidth / 2 + 0.1, 0, -kStaveWidth / 2 - 0.1,
581 -kStaveWidth / 2 - 0.1};
582 Double_t yv[5] = {-kConeOutRadius * 2 - 0.07, 0, kStaveHeight, 0, -kConeOutRadius * 2 - 0.07};
583 mechStruct->DefinePolygon(5, xv, yv);
584 mechStruct->DefineSection(0, -kStaveLength - 0.1, 0, 0, 1.);
585 mechStruct->DefineSection(1, kStaveLength + 0.1, 0, 0, 1.);
587 mechStavVol =
new TGeoVolume(volumeName, mechStruct, medAir);
588 mechStavVol->SetLineColor(12);
589 mechStavVol->SetFillColor(12);
590 mechStavVol->SetVisibility(kTRUE);
594 auto* coolTube =
new TGeoTube(kConeInRadius, kConeOutRadius, kStaveLength / 2);
595 auto* volCoolTube =
new TGeoVolume(
"pipe", coolTube, medKapton);
596 volCoolTube->SetFillColor(35);
597 volCoolTube->SetLineColor(35);
598 mechStavVol->AddNode(volCoolTube, 0,
new TGeoTranslation(
x + (kStaveWidth / 2),
y - (kHeight - kConeOutRadius), 0));
599 mechStavVol->AddNode(volCoolTube, 1,
new TGeoTranslation(
x - (kStaveWidth / 2),
y - (kHeight - kConeOutRadius), 0));
602 if (mBuildLevel < 4) {
603 auto* coolTubeW =
new TGeoTube(0., kConeInRadius, kStaveLength / 2);
604 auto* volCoolTubeW =
new TGeoVolume(
"pipeWater", coolTubeW, medWater);
605 volCoolTubeW->SetFillColor(4);
606 volCoolTubeW->SetLineColor(4);
607 mechStavVol->AddNode(volCoolTubeW, 0,
new TGeoTranslation(
x + (kStaveWidth / 2),
y - (kHeight - kConeOutRadius), 0));
608 mechStavVol->AddNode(volCoolTubeW, 1,
new TGeoTranslation(
x - (kStaveWidth / 2),
y - (kHeight - kConeOutRadius), 0));
615 Int_t loop = (Int_t)(kStaveLength / (4 * kL1 /
n) + 2 /
n) - 1;
616 if (mBuildLevel < 3) {
618 auto* t2 =
new TGeoBBox(kS2, 0.007 / 2, 0.15 / 2);
619 auto* volT2 =
new TGeoVolume(
"TopFilament", t2, medM60J3K);
620 volT2->SetLineColor(12);
621 volT2->SetFillColor(12);
623 for (
int i = 1;
i < loop;
i++) {
624 mechStavVol->AddNode(
627 x + kWidth,
y + (2 * kConeOutRadius),
628 z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
629 new TGeoRotation(
"volT2", 90, 90 - kAlpha, 90 - kBeta)));
630 mechStavVol->AddNode(
633 x - kWidth,
y + (2 * kConeOutRadius),
634 z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
635 new TGeoRotation(
"volT2", 90, -90 + kAlpha, -90 + kBeta)));
636 mechStavVol->AddNode(
639 x + kWidth,
y + (2 * kConeOutRadius),
640 z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
641 new TGeoRotation(
"volT2", 90, -90 + kAlpha, 90 - kBeta)));
642 mechStavVol->AddNode(
645 x - kWidth,
y + (2 * kConeOutRadius),
646 z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
647 new TGeoRotation(
"volT2", 90, 90 - kAlpha, -90 + kBeta)));
651 auto*
t1 =
new TGeoBBox(0.007 / 2, 0.15 / 2, kS1);
652 auto* volT1 =
new TGeoVolume(
"CFRPBottom",
t1, medM60J3K);
653 volT1->SetLineColor(12);
654 volT1->SetFillColor(12);
656 for (
int i = 1;
i < loop;
i++) {
657 mechStavVol->AddNode(
659 new TGeoCombiTrans(
x + kWidth,
y - kHeight,
z - kStaveLength / 2 + ((4 /
n) * kL1 *
i) + kS1 / 2,
660 new TGeoRotation(
"volT1", -90, kAlpha, 0)));
661 mechStavVol->AddNode(
663 new TGeoCombiTrans(
x - kWidth,
y - kHeight,
z - kStaveLength / 2 + ((4 /
n) * kL1 *
i) + kS1 / 2,
664 new TGeoRotation(
"volT1", 90, kAlpha, 0)));
665 mechStavVol->AddNode(
667 new TGeoCombiTrans(
x + kWidth,
y - kHeight,
z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
668 new TGeoRotation(
"volT1", -90, -kAlpha, 0)));
669 mechStavVol->AddNode(
671 new TGeoCombiTrans(
x - kWidth,
y - kHeight,
z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
672 new TGeoRotation(
"volT1", -90, +kAlpha, 0)));
676 if (mBuildLevel < 2) {
678 auto* tG =
new TGeoBBox(0.0075 / 2, 0.18 / 2, kS1);
679 auto* volTG =
new TGeoVolume(
"Glue1", tG, medGlue);
680 volTG->SetLineColor(5);
681 volTG->SetFillColor(5);
683 for (
int i = 1;
i < loop;
i++) {
684 mechStavVol->AddNode(
686 new TGeoCombiTrans(
x + kWidth,
y - 0.16,
z - kStaveLength / 2 + ((4 /
n) * kL1 *
i) + kS1 / 2,
687 new TGeoRotation(
"volTG", -90, kAlpha, 0)));
688 mechStavVol->AddNode(
690 new TGeoCombiTrans(
x - kWidth,
y - 0.16,
z - kStaveLength / 2 + ((4 /
n) * kL1 *
i) + kS1 / 2,
691 new TGeoRotation(
"volTG", 90, kAlpha, 0)));
692 mechStavVol->AddNode(
694 new TGeoCombiTrans(
x + kWidth,
y - 0.16,
z - kStaveLength / 2 + ((4 /
n) *
i * kL1) + kS1 / 2,
695 new TGeoRotation(
"volTG", -90, -kAlpha, 0)));
696 mechStavVol->AddNode(
698 new TGeoCombiTrans(
x - kWidth,
y - 0.16,
z - kStaveLength / 2 + (
i * (4 /
n) * kL1) + kS1 / 2,
699 new TGeoRotation(
"volTG", -90, +kAlpha, 0)));
702 auto* glue =
new TGeoBBox(xsta, 0.005 / 2, zsta);
703 auto* volGlue =
new TGeoVolume(
"Glue2", glue, medGlue);
704 volGlue->SetLineColor(5);
705 volGlue->SetFillColor(5);
708 mechStavVol->AddNode(volGlue, 1,
new TGeoCombiTrans(
x,
y - 0.165 - mSensorThickness - 0.005,
z,
new TGeoRotation(
"", 0, 0, 0)));
711 if (mBuildLevel < 1) {
713 auto* kapCable =
new TGeoBBox(xsta, 0.01 / 2, zsta);
714 auto* volCable =
new TGeoVolume(
"FlexCable", kapCable, medFlexCable);
715 volCable->SetLineColor(28);
716 volCable->SetFillColor(28);
717 mechStavVol->AddNode(volCable, 0,
718 new TGeoCombiTrans(
x,
y - 0.165 - mSensorThickness - 0.005 - 0.01,
z,
719 new TGeoRotation(
"", 0, 0, 0)));
725TGeoVolume* V1Layer::createStaveModelInnerB1(
const Double_t xsta,
const Double_t zsta,
726 const TGeoManager* mgr)
729 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
730 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
732 TGeoMedium* medM60J3K = mgr->GetMedium(Form(
"%s_M60J3K$",
GetDetName()));
733 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
734 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
735 TGeoMedium* medFlexCable = mgr->GetMedium(Form(
"%s_FLEXCABLE$",
GetDetName()));
738 Double_t kConeOutRadius = 0.15 / 2;
740 Double_t kStaveLength = zsta * 2;
742 Double_t kStaveWidth = xsta * 2;
743 Double_t kWidth = kStaveWidth / 4;
744 Double_t kStaveHeight = 0.3;
745 Double_t kHeight = kStaveHeight / 2;
746 Double_t
kAlpha = 90 - 33.;
747 Double_t kTheta =
kAlpha * TMath::DegToRad();
748 Double_t kS1 = kWidth / TMath::Sin(kTheta);
749 Double_t kL1 = kWidth / TMath::Tan(kTheta);
750 Double_t kS2 = TMath::Sqrt(kHeight * kHeight + kS1 * kS1);
751 Double_t kThe2 = TMath::ATan(kHeight / kS1);
752 Double_t kBeta = kThe2 * TMath::RadToDeg();
753 Int_t loop = (Int_t)((kStaveLength / (2 * kL1)) / 2);
755 TGeoVolume* mechStavVol =
nullptr;
762 Double_t
z = 0,
y = -0.011 + 0.0150,
x = 0;
765 Double_t yMC =
y - kHeight + 0.01;
766 Int_t nb = (Int_t)(kStaveWidth / 0.1) + 1;
767 Double_t xstaMC = (nb * 0.1 - 0.08) / 2;
769 if (mBuildLevel < 5) {
771 auto* mechStruct =
new TGeoXtru(2);
773 kStaveWidth / 2 + 0.1, kStaveWidth / 2 + 0.1, 0, -kStaveWidth / 2 - 0.1,
774 -kStaveWidth / 2 - 0.1};
775 Double_t yv[5] = {-kConeOutRadius * 2 - 0.07, 0, kStaveHeight, 0, -kConeOutRadius * 2 - 0.07};
776 mechStruct->DefinePolygon(5, xv, yv);
777 mechStruct->DefineSection(0, -kStaveLength - 0.1, 0, 0, 1.);
778 mechStruct->DefineSection(1, kStaveLength + 0.1, 0, 0, 1.);
780 mechStavVol =
new TGeoVolume(volumeName, mechStruct, medAir);
781 mechStavVol->SetLineColor(12);
782 mechStavVol->SetFillColor(12);
783 mechStavVol->SetVisibility(kTRUE);
786 auto* tM0 =
new TGeoBBox(xstaMC, 0.005 / 2, zsta);
787 auto* volTM0 =
new TGeoVolume(
"MicroChanCover", tM0, medKapton);
788 volTM0->SetLineColor(35);
789 volTM0->SetFillColor(35);
790 mechStavVol->AddNode(volTM0, 0,
791 new TGeoCombiTrans(
x, -0.0125 + yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
792 mechStavVol->AddNode(volTM0, 1,
793 new TGeoCombiTrans(
x, +0.0125 + yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
795 auto* tM0b =
new TGeoBBox(0.02 / 2, 0.02 / 2, zsta);
796 auto* volTM0b =
new TGeoVolume(
"MicroChanWalls", tM0b, medKapton);
797 volTM0b->SetLineColor(35);
798 volTM0b->SetFillColor(35);
799 for (Int_t ib = 0; ib < nb; ib++) {
800 mechStavVol->AddNode(volTM0b, ib,
new TGeoCombiTrans(
x + ib * 0.1 - xstaMC + 0.01, yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
804 if (mBuildLevel < 4) {
806 auto* water =
new TGeoBBox(0.08 / 2, 0.02 / 2, zsta + 0.1);
807 auto* volWater =
new TGeoVolume(
"Water", water, medWater);
808 volWater->SetLineColor(4);
809 volWater->SetFillColor(4);
810 for (Int_t ib = 0; ib < (nb - 1); ib++) {
811 mechStavVol->AddNode(volWater, ib,
new TGeoCombiTrans(
x + ib * 0.1 - xstaMC + 0.06, yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
815 if (mBuildLevel < 3) {
817 Double_t filWidth = 0.04;
818 Double_t filHeight = 0.02;
819 auto*
t1 =
new TGeoBBox(filHeight / 2, filWidth / 2, kS1);
820 auto* volT1 =
new TGeoVolume(
"CFRPBottom",
t1, medM60J3K);
821 volT1->SetLineColor(12);
822 volT1->SetFillColor(12);
823 for (
int i = 0;
i < loop;
i++) {
824 mechStavVol->AddNode(volT1, 4 *
i + 0,
825 new TGeoCombiTrans(
x + kWidth,
y - kHeight + 0.04 + filHeight / 2,
826 z - kStaveLength / 2 + (4 * kL1) + kS1 / 2,
827 new TGeoRotation(
"volT1", -90, kAlpha, 0)));
828 mechStavVol->AddNode(volT1, 4 *
i + 1,
829 new TGeoCombiTrans(
x - kWidth,
y - kHeight + 0.04 + filHeight / 2,
830 z - kStaveLength / 2 + (4 * kL1 *
i) + kS1 / 2,
831 new TGeoRotation(
"volT1", 90, kAlpha, 0)));
832 mechStavVol->AddNode(
834 new TGeoCombiTrans(
x + kWidth,
y - kHeight + 0.04 + filHeight / 2,
835 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
836 new TGeoRotation(
"volT1", -90, -kAlpha, 0)));
837 mechStavVol->AddNode(
839 new TGeoCombiTrans(
x - kWidth,
y - kHeight + 0.04 + filHeight / 2,
840 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
841 new TGeoRotation(
"volT1", -90, +kAlpha, 0)));
845 auto* t2 =
new TGeoBBox(kS2, filHeight / 2, filWidth / 2);
846 auto* volT2 =
new TGeoVolume(
"CFRPTop", t2, medM60J3K);
847 volT2->SetLineColor(12);
848 volT2->SetFillColor(12);
849 for (
int i = 0;
i < loop;
i++) {
850 mechStavVol->AddNode(
852 new TGeoCombiTrans(
x + kWidth,
y + 0.04 + filHeight / 2,
853 z - kStaveLength / 2 + (
i * 4 * kL1) + kS1 / 2,
854 new TGeoRotation(
"volT2", 90, 90 - kAlpha, 90 - kBeta)));
855 mechStavVol->AddNode(
857 new TGeoCombiTrans(
x - kWidth,
y + 0.04 + filHeight / 2,
858 z - kStaveLength / 2 + (
i * 4 * kL1) + kS1 / 2,
859 new TGeoRotation(
"volT2", 90, -90 + kAlpha, -90 + kBeta)));
860 mechStavVol->AddNode(
862 new TGeoCombiTrans(
x + kWidth,
y + 0.04 + filHeight / 2,
863 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
864 new TGeoRotation(
"volT2", 90, -90 + kAlpha, 90 - kBeta)));
865 mechStavVol->AddNode(
867 new TGeoCombiTrans(
x - kWidth,
y + 0.04 + filHeight / 2,
868 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
869 new TGeoRotation(
"volT2", 90, 90 - kAlpha, -90 + kBeta)));
873 if (mBuildLevel < 2) {
875 auto* t3 =
new TGeoBBox(0.01 / 2, 0.04, kS1);
876 auto* volT3 =
new TGeoVolume(
"FilamentGlue", t3, medGlue);
877 volT3->SetLineColor(5);
878 volT3->SetFillColor(5);
879 for (
int i = 0;
i < loop;
i++) {
880 mechStavVol->AddNode(volT3, 4 *
i + 0,
881 new TGeoCombiTrans(
x + kWidth,
y - kHeight + 0.0325,
882 z - kStaveLength / 2 + (4 * kL1 *
i) + kS1 / 2,
883 new TGeoRotation(
"volT1", -90, kAlpha, 0)));
884 mechStavVol->AddNode(volT3, 4 *
i + 1,
885 new TGeoCombiTrans(
x - kWidth,
y - kHeight + 0.0325,
886 z - kStaveLength / 2 + (4 * kL1 *
i) + kS1 / 2,
887 new TGeoRotation(
"volT1", 90, kAlpha, 0)));
888 mechStavVol->AddNode(
890 new TGeoCombiTrans(
x + kWidth,
y - kHeight + 0.0325,
891 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
892 new TGeoRotation(
"volT1", -90, -kAlpha, 0)));
893 mechStavVol->AddNode(
895 new TGeoCombiTrans(
x - kWidth,
y - kHeight + 0.0325,
896 z - kStaveLength / 2 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
897 new TGeoRotation(
"volT1", -90, +kAlpha, 0)));
901 auto* glueM =
new TGeoBBox(xsta, 0.01 / 2, zsta);
902 auto* volGlueM =
new TGeoVolume(
"MicroChanGlue", glueM, medGlue);
903 volGlueM->SetLineColor(5);
904 volGlueM->SetFillColor(5);
905 mechStavVol->AddNode(volGlueM, 0,
906 new TGeoCombiTrans(
x,
y - 0.16,
z,
new TGeoRotation(
"", 0, 0, 0)));
909 auto* glue =
new TGeoBBox(xsta, 0.005 / 2, zsta);
910 auto* volGlue =
new TGeoVolume(
"SensorGlue", glue, medGlue);
911 volGlue->SetLineColor(5);
912 volGlue->SetFillColor(5);
913 mechStavVol->AddNode(volGlue, 1,
new TGeoCombiTrans(
x,
y - 0.165 - mSensorThickness - 0.005,
z,
new TGeoRotation(
"", 0, 0, 0)));
916 if (mBuildLevel < 1) {
917 auto* kapCable =
new TGeoBBox(xsta, 0.01 / 2, zsta);
918 auto* volCable =
new TGeoVolume(
"FlexCable", kapCable, medFlexCable);
919 volCable->SetLineColor(28);
920 volCable->SetFillColor(28);
921 mechStavVol->AddNode(volCable, 0,
922 new TGeoCombiTrans(
x,
y - 0.165 - mSensorThickness - 0.005 - 0.01,
z,
923 new TGeoRotation(
"", 0, 0, 0)));
929TGeoVolume* V1Layer::createStaveModelInnerB21(
const Double_t xsta,
const Double_t zsta,
930 const TGeoManager* mgr)
933 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
934 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
936 TGeoMedium* medM60J3K = mgr->GetMedium(Form(
"%s_M60J3K$",
GetDetName()));
937 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
938 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
939 TGeoMedium* medFlexCable = mgr->GetMedium(Form(
"%s_FLEXCABLE$",
GetDetName()));
940 TGeoMedium* medK13D2U2k = mgr->GetMedium(Form(
"%s_K13D2U2k$",
GetDetName()));
941 TGeoMedium* medFGS003 = mgr->GetMedium(Form(
"%s_FGS003$",
GetDetName()));
942 TGeoMedium* medCarbonFleece = mgr->GetMedium(Form(
"%s_CarbonFleece$",
GetDetName()));
945 Double_t kConeOutRadius = 0.151384 / 2;
946 Double_t kConeInRadius = 0.145034 / 2;
947 Double_t kStaveLength = zsta;
948 Double_t kStaveWidth = xsta * 2;
949 Double_t kWidth = (kStaveWidth + 0.005) / 4;
950 Double_t kStaveHeigth = 0.33;
951 Double_t kHeight = (kStaveHeigth + 0.025) / 2;
953 Double_t kTheta =
kAlpha * TMath::DegToRad();
954 Double_t kS1 = (kStaveWidth / 4) / TMath::Sin(kTheta);
955 Double_t kL1 = (kStaveWidth / 4) / TMath::Tan(kTheta);
956 Double_t kS2 = sqrt(kHeight * kHeight + kS1 * kS1);
957 Double_t kThe2 = TMath::ATan(kHeight / kS1);
958 Double_t kBeta = kThe2 * TMath::RadToDeg();
960 Double_t kLay1 = 0.003;
962 Double_t kLay2 = 0.002;
963 Double_t kLay3 = 0.007;
964 Int_t loop = (Int_t)(kStaveLength / (2 * kL1));
970 Double_t
z = 0,
y = -(kConeOutRadius + 0.03) + 0.0385,
x = 0;
972 TGeoVolume* mechStavVol =
nullptr;
974 if (mBuildLevel < 5) {
976 auto* mechStruct =
new TGeoXtru(2);
978 kStaveWidth / 2 + 0.1, kStaveWidth / 2 + 0.1, 0, -kStaveWidth / 2 - 0.1,
979 -kStaveWidth / 2 - 0.1};
980 Double_t yv[5] = {-kConeOutRadius * 2 - 0.07, 0, kStaveHeigth, 0, -kConeOutRadius * 2 - 0.07};
981 mechStruct->DefinePolygon(5, xv, yv);
982 mechStruct->DefineSection(0, -kStaveLength - 0.1, 0, 0, 1.);
983 mechStruct->DefineSection(1, kStaveLength + 0.1, 0, 0, 1.);
985 mechStavVol =
new TGeoVolume(volumeName, mechStruct, medAir);
986 mechStavVol->SetLineColor(12);
987 mechStavVol->SetFillColor(12);
988 mechStavVol->SetVisibility(kTRUE);
992 new TGeoCone(kStaveLength, kConeInRadius, kConeOutRadius, kConeInRadius, kConeOutRadius);
993 auto* volCone1 =
new TGeoVolume(
"PolyimidePipe", cone1, medKapton);
994 volCone1->SetFillColor(35);
995 volCone1->SetLineColor(35);
996 mechStavVol->AddNode(volCone1, 1,
new TGeoTranslation(
x + 0.25,
y,
z));
997 mechStavVol->AddNode(volCone1, 2,
new TGeoTranslation(
x - 0.25,
y,
z));
1000 if (mBuildLevel < 4) {
1001 auto* coolTubeW =
new TGeoTube(0., kConeInRadius, kStaveLength);
1002 auto* volCoolTubeW =
new TGeoVolume(
"Water", coolTubeW, medWater);
1003 volCoolTubeW->SetFillColor(4);
1004 volCoolTubeW->SetLineColor(4);
1005 mechStavVol->AddNode(volCoolTubeW, 0,
new TGeoTranslation(
x - 0.25,
y,
z));
1006 mechStavVol->AddNode(volCoolTubeW, 1,
new TGeoTranslation(
x + 0.25,
y,
z));
1009 if (mBuildLevel < 3) {
1013 new TGeoBBox(kS2, 0.02 / 2, 0.04 / 2);
1014 auto* volT2 =
new TGeoVolume(
"TopFilament", t2, medM60J3K);
1015 volT2->SetLineColor(12);
1016 volT2->SetFillColor(12);
1018 for (
int i = 0;
i < loop;
i++) {
1019 mechStavVol->AddNode(
1021 new TGeoCombiTrans(
x + kWidth,
y + kHeight + (0.12 / 2) - 0.014 + 0.007,
1022 z - kStaveLength + (
i * 4 * kL1) + kS1 / 2,
1023 new TGeoRotation(
"volT2", 90, 90 - kAlpha, 90 - kBeta)));
1024 mechStavVol->AddNode(
1026 new TGeoCombiTrans(
x - kWidth,
y + kHeight + (0.12 / 2) - 0.014 + 0.007,
1027 z - kStaveLength + (
i * 4 * kL1) + kS1 / 2,
1028 new TGeoRotation(
"volT2", 90, -90 + kAlpha, -90 + kBeta)));
1029 mechStavVol->AddNode(
1031 new TGeoCombiTrans(
x + kWidth,
y + kHeight + (0.12 / 2) - 0.014 + 0.007,
1032 z - kStaveLength + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
1033 new TGeoRotation(
"volT2", 90, -90 + kAlpha, 90 - kBeta)));
1034 mechStavVol->AddNode(
1036 new TGeoCombiTrans(
x - kWidth,
y + kHeight + (0.12 / 2) - 0.014 + 0.007,
1037 z - kStaveLength + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
1038 new TGeoRotation(
"volT2", 90, 90 - kAlpha, -90 + kBeta)));
1045 auto* box4 =
new TGeoBBox(0.03 / 2, 0.12 / 2, kStaveLength - 0.50);
1046 auto* plate4 =
new TGeoVolume(
"WallOut", box4, medM60J3K);
1047 plate4->SetFillColor(35);
1048 plate4->SetLineColor(35);
1049 mechStavVol->AddNode(plate4, 1,
1050 new TGeoCombiTrans(
x + (2 * kStaveWidth / 4) - (0.03 / 2),
1051 y - 0.0022 - kConeOutRadius + 0.12 / 2 + 0.007,
z,
1052 new TGeoRotation(
"plate4", 0, 0, 0)));
1053 mechStavVol->AddNode(plate4, 2,
1054 new TGeoCombiTrans(
x - (2 * kStaveWidth / 4) + (0.03 / 2),
1055 y - 0.0022 - kConeOutRadius + 0.12 / 2 + 0.007,
z,
1056 new TGeoRotation(
"plate4", 0, 0, 0)));
1058 auto* box5 =
new TGeoBBox(0.015 / 2, 0.12 / 2, kStaveLength - 0.50);
1059 auto* plate5 =
new TGeoVolume(
"WallIn", box5, medM60J3K);
1060 plate5->SetFillColor(12);
1061 plate5->SetLineColor(12);
1062 mechStavVol->AddNode(plate5, 1,
1063 new TGeoCombiTrans(
x + (2 * kStaveWidth / 4) - 0.03 - 0.015 / 2,
1064 y - 0.0022 - kConeOutRadius + 0.12 / 2 + 0.007,
z,
1065 new TGeoRotation(
"plate5", 0, 0, 0)));
1066 mechStavVol->AddNode(plate5, 2,
1067 new TGeoCombiTrans(
x - (2 * kStaveWidth / 4) + 0.03 + 0.015 / 2,
1068 y - 0.0022 - kConeOutRadius + 0.12 / 2 + 0.007,
z,
1069 new TGeoRotation(
"plate5", 0, 0, 0)));
1073 new TGeoConeSeg(kStaveLength - 0.50, kConeOutRadius, kConeOutRadius + kLay1, kConeOutRadius,
1074 kConeOutRadius + kLay1, 0, 180);
1075 auto* cone11 =
new TGeoVolume(
"ThermasolPipeCover", cons1, medFGS003);
1076 cone11->SetFillColor(2);
1077 cone11->SetLineColor(2);
1078 mechStavVol->AddNode(cone11, 1,
1079 new TGeoCombiTrans(
x + 0.25,
y,
z,
new TGeoRotation(
"Cone11", 0, 0, 0)));
1080 mechStavVol->AddNode(cone11, 2,
1081 new TGeoCombiTrans(
x - 0.25,
y,
z,
new TGeoRotation(
"Cone11", 0, 0, 0)));
1084 new TGeoBBox((0.50 - (2 * kConeOutRadius)) / 2, kLay1 / 2, kStaveLength - 0.50);
1085 auto* plate2 =
new TGeoVolume(
"ThermasolMiddle", box2, medFGS003);
1086 plate2->SetFillColor(2);
1087 plate2->SetLineColor(2);
1088 mechStavVol->AddNode(plate2, 1,
new TGeoCombiTrans(
x,
y - kConeOutRadius + (kLay1 / 2),
z,
new TGeoRotation(
"plate2", 0, 0, 0)));
1091 new TGeoBBox((0.75 - 0.25 - kConeOutRadius - kLay1) / 2, kLay1 / 2, kStaveLength - 0.50);
1092 auto* plate21 =
new TGeoVolume(
"ThermasolLeftRight", box21, medFGS003);
1093 plate21->SetFillColor(2);
1094 plate21->SetLineColor(2);
1095 mechStavVol->AddNode(
1096 plate21, 1,
new TGeoCombiTrans(
x + 0.25 + kConeOutRadius + (0.75 - 0.25 - kConeOutRadius) / 2 - (kLay1 / 2),
y - kConeOutRadius + (kLay1 / 2),
z,
new TGeoRotation(
"plate21", 0, 0, 0)));
1097 mechStavVol->AddNode(
1098 plate21, 2,
new TGeoCombiTrans(
x - 0.25 - kConeOutRadius - (0.75 - 0.25 - kConeOutRadius) / 2 + (kLay1 / 2),
y - kConeOutRadius + (kLay1 / 2),
z,
new TGeoRotation(
"plate21", 0, 0, 0)));
1100 auto* box22 =
new TGeoBBox((kLay1 / 2), kConeOutRadius / 2, kStaveLength - 0.50);
1101 auto* plate22 =
new TGeoVolume(
"ThermasolVertical", box22, medFGS003);
1102 plate22->SetFillColor(2);
1103 plate22->SetLineColor(2);
1104 mechStavVol->AddNode(plate22, 1,
new TGeoCombiTrans(
x + 0.25 + kConeOutRadius + (kLay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1105 mechStavVol->AddNode(plate22, 2,
new TGeoCombiTrans(
x + 0.25 - kConeOutRadius - (kLay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1106 mechStavVol->AddNode(plate22, 3,
new TGeoCombiTrans(
x - 0.25 + kConeOutRadius + (kLay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1107 mechStavVol->AddNode(plate22, 4,
new TGeoCombiTrans(
x - 0.25 - kConeOutRadius - (kLay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1111 new TGeoConeSeg(kStaveLength - 0.50, kConeOutRadius + kLay1, kConeOutRadius + kLay1 + kLay2,
1112 kConeOutRadius + kLay1, kConeOutRadius + kLay1 + kLay2, 0, 180);
1113 auto* cone12 =
new TGeoVolume(
"CFleecePipeCover", cons2, medCarbonFleece);
1114 cone12->SetFillColor(28);
1115 cone12->SetLineColor(28);
1116 mechStavVol->AddNode(cone12, 1,
1117 new TGeoCombiTrans(
x + 0.25,
y,
z,
new TGeoRotation(
"Cone12", 0, 0, 0)));
1118 mechStavVol->AddNode(cone12, 2,
1119 new TGeoCombiTrans(
x - 0.25,
y,
z,
new TGeoRotation(
"Cone12", 0, 0, 0)));
1122 new TGeoBBox((0.50 - (2 * (kConeOutRadius + kLay1))) / 2, kLay2 / 2, kStaveLength - 0.50);
1123 auto* plate3 =
new TGeoVolume(
"CFleeceMiddle", box3, medCarbonFleece);
1124 plate3->SetFillColor(28);
1125 plate3->SetLineColor(28);
1126 mechStavVol->AddNode(plate3, 1,
new TGeoCombiTrans(
x,
y - kConeOutRadius + kLay1 + (kLay2 / 2),
z,
new TGeoRotation(
"plate3", 0, 0, 0)));
1129 new TGeoBBox((0.75 - 0.25 - kConeOutRadius - kLay1) / 2, kLay2 / 2, kStaveLength - 0.50);
1130 auto* plate31 =
new TGeoVolume(
"CFleeceLeftRight", box31, medCarbonFleece);
1131 plate31->SetFillColor(28);
1132 plate31->SetLineColor(28);
1133 mechStavVol->AddNode(
1136 x + 0.25 + kConeOutRadius + kLay1 + (0.75 - 0.25 - kConeOutRadius - kLay1) / 2,
1137 y - kConeOutRadius + kLay1 + (kLay2 / 2),
z,
new TGeoRotation(
"plate31", 0, 0, 0)));
1138 mechStavVol->AddNode(
1141 x - 0.25 - kConeOutRadius - kLay1 - (0.75 - 0.25 - kConeOutRadius - kLay1) / 2,
1142 y - kConeOutRadius + kLay1 + (kLay2 / 2),
z,
new TGeoRotation(
"plate31", 0, 0, 0)));
1144 auto* box32 =
new TGeoBBox((kLay2 / 2), (kConeOutRadius - kLay1) / 2, kStaveLength - 0.50);
1145 auto* plate32 =
new TGeoVolume(
"CFleeceVertical", box32, medCarbonFleece);
1146 plate32->SetFillColor(28);
1147 plate32->SetLineColor(28);
1148 mechStavVol->AddNode(plate32, 1,
1149 new TGeoCombiTrans(
x + 0.25 + kConeOutRadius + kLay1 + (kLay2 / 2),
1150 y + (kLay1 - kConeOutRadius) / 2,
z,
1151 new TGeoRotation(
"plate32", 0, 0, 0)));
1152 mechStavVol->AddNode(plate32, 2,
1153 new TGeoCombiTrans(
x + 0.25 - kConeOutRadius - kLay1 - (kLay2 / 2),
1154 y + (kLay1 - kConeOutRadius) / 2,
z,
1155 new TGeoRotation(
"plate32", 0, 0, 0)));
1156 mechStavVol->AddNode(plate32, 3,
1157 new TGeoCombiTrans(
x - 0.25 + kConeOutRadius + kLay1 + (kLay2 / 2),
1158 y + (kLay1 - kConeOutRadius) / 2,
z,
1159 new TGeoRotation(
"plate32", 0, 0, 0)));
1160 mechStavVol->AddNode(plate32, 4,
1161 new TGeoCombiTrans(
x - 0.25 - kConeOutRadius - kLay1 - (kLay2 / 2),
1162 y + (kLay1 - kConeOutRadius) / 2,
z,
1163 new TGeoRotation(
"plate32", 0, 0, 0)));
1166 auto* box1 =
new TGeoBBox(2 * kWidth, kLay3 / 2, kStaveLength - 0.50);
1167 auto* plate1 =
new TGeoVolume(
"CarbonPlate", box1, medK13D2U2k);
1168 plate1->SetFillColor(5);
1169 plate1->SetLineColor(5);
1170 mechStavVol->AddNode(plate1, 1,
new TGeoCombiTrans(
x,
y - (kConeOutRadius + (kLay3 / 2)),
z,
new TGeoRotation(
"plate1", 0, 0, 0)));
1173 auto* box6 =
new TGeoBBox(2 * kWidth, kLay2 / 2, kStaveLength - 0.50);
1174 auto* plate6 =
new TGeoVolume(
"CFleeceBottom", box6, medCarbonFleece);
1175 plate6->SetFillColor(2);
1176 plate6->SetLineColor(2);
1177 mechStavVol->AddNode(plate6, 1,
1178 new TGeoCombiTrans(
x,
y - (kConeOutRadius + kLay3 + (kLay2 / 2)),
z,
1179 new TGeoRotation(
"plate1", 0, 0, 0)));
1182 if (mBuildLevel < 2) {
1184 auto* glue =
new TGeoBBox(kStaveWidth / 2, 0.005 / 2, zsta);
1185 auto* volGlue =
new TGeoVolume(
"Glue", glue, medGlue);
1186 volGlue->SetLineColor(5);
1187 volGlue->SetFillColor(5);
1188 mechStavVol->AddNode(
1189 volGlue, 0,
new TGeoCombiTrans(
x,
y - (kConeOutRadius + kLay3 + (kLay2 / 2) + (0.01 / 2)),
z,
new TGeoRotation(
"", 0, 0, 0)));
1190 mechStavVol->AddNode(volGlue, 1,
1191 new TGeoCombiTrans(
x,
y - (kConeOutRadius + kLay3 + (kLay2 / 2) + 0.01 + mSensorThickness + (0.01 / 2)),
1192 z,
new TGeoRotation(
"", 0, 0, 0)));
1195 if (mBuildLevel < 1) {
1196 auto* kapCable =
new TGeoBBox(kStaveWidth / 2, 0.01 / 2, zsta);
1197 auto* volCable =
new TGeoVolume(
"FlexCable", kapCable, medFlexCable);
1198 volCable->SetLineColor(28);
1199 volCable->SetFillColor(28);
1200 mechStavVol->AddNode(volCable, 0,
1201 new TGeoCombiTrans(
x,
y - (kConeOutRadius + kLay3 + (kLay2 / 2) + 0.01 + mSensorThickness + 0.01 + (0.01 / 2)),
1202 z,
new TGeoRotation(
"", 0, 0, 0)));
1209TGeoVolume* V1Layer::createStaveModelInnerB22(
const Double_t xsta,
const Double_t zsta,
1210 const TGeoManager* mgr)
1213 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
1214 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
1216 TGeoMedium* medM60J3K = mgr->GetMedium(Form(
"%s_M60J3K$",
GetDetName()));
1217 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
1218 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
1219 TGeoMedium* medFlexCable = mgr->GetMedium(Form(
"%s_FLEXCABLE$",
GetDetName()));
1220 TGeoMedium* medK13D2U2k = mgr->GetMedium(Form(
"%s_K13D2U2k$",
GetDetName()));
1221 TGeoMedium* medFGS003 = mgr->GetMedium(Form(
"%s_FGS003$",
GetDetName()));
1222 TGeoMedium* medCarbonFleece = mgr->GetMedium(Form(
"%s_CarbonFleece$",
GetDetName()));
1225 Double_t kConeOutRadius = (0.1024 + 0.0025) / 2;
1226 Double_t kConeInRadius = 0.1024 / 2;
1227 Double_t kStaveLength = zsta;
1228 Double_t kStaveWidth = xsta * 2;
1229 Double_t kWidth = (kStaveWidth) / 4;
1230 Double_t kStaveHeight = 0.283;
1231 Double_t kHeight = (kStaveHeight) / 2;
1233 Double_t kTheta =
kAlpha * TMath::DegToRad();
1234 Double_t kS1 = ((kStaveWidth) / 4) / TMath::Sin(kTheta);
1235 Double_t kL1 = (kStaveWidth / 4) / TMath::Tan(kTheta);
1236 Double_t kS2 = sqrt(kHeight * kHeight + kS1 * kS1);
1237 Double_t kThe2 = TMath::ATan(kHeight / (0.375 - 0.036));
1238 Double_t kBeta = kThe2 * TMath::RadToDeg();
1239 Double_t klay1 = 0.003;
1240 Double_t klay2 = 0.002;
1241 Double_t klay3 = 0.007;
1242 Double_t klay4 = 0.007;
1243 Double_t klay5 = 0.01;
1244 Double_t kTopVertexMaxWidth = 0.072;
1245 Double_t kTopVertexHeight = 0.04;
1246 Double_t kSideVertexMWidth = 0.052;
1247 Double_t kSideVertexHeight = 0.11;
1249 Int_t loop = (Int_t)(kStaveLength / (2 * kL1));
1251 char volumeName[30];
1255 Double_t
z = 0,
y = -(2 * kConeOutRadius) + klay1 + klay2 + mSensorThickness / 2 - 0.0004,
x = 0;
1257 TGeoVolume* mechStavVol =
nullptr;
1259 if (mBuildLevel < 5) {
1261 auto* mechStruct =
new TGeoXtru(2);
1263 kStaveWidth / 2, kStaveWidth / 2, 0.012,
1264 -0.012, -kStaveWidth / 2, -kStaveWidth / 2};
1270 -(kConeOutRadius * 2) - 0.06395, 0 - 0.02, kStaveHeight + 0.01,
1271 kStaveHeight + 0.01, 0 - 0.02, -(kConeOutRadius * 2) - 0.06395};
1272 mechStruct->DefinePolygon(6, xv, yv);
1273 mechStruct->DefineSection(0, -kStaveLength, 0, 0, 1.);
1274 mechStruct->DefineSection(1, kStaveLength, 0, 0, 1.);
1276 mechStavVol =
new TGeoVolume(volumeName, mechStruct, medAir);
1277 mechStavVol->SetLineColor(12);
1278 mechStavVol->SetFillColor(12);
1279 mechStavVol->SetVisibility(kTRUE);
1282 auto* cone1 =
new TGeoCone(kStaveLength, kConeInRadius, kConeOutRadius - 0.0001,
1283 kConeInRadius, kConeOutRadius - 0.0001);
1284 auto* volCone1 =
new TGeoVolume(
"PolyimidePipe", cone1, medKapton);
1285 volCone1->SetFillColor(35);
1286 volCone1->SetLineColor(35);
1287 mechStavVol->AddNode(volCone1, 1,
new TGeoTranslation(
x + 0.25,
y,
z));
1288 mechStavVol->AddNode(volCone1, 2,
new TGeoTranslation(
x - 0.25,
y,
z));
1291 if (mBuildLevel < 4) {
1292 auto* coolTubeW =
new TGeoTube(0., kConeInRadius - 0.0001, kStaveLength);
1293 auto* volCoolTubeW =
new TGeoVolume(
"Water", coolTubeW, medWater);
1294 volCoolTubeW->SetFillColor(4);
1295 volCoolTubeW->SetLineColor(4);
1296 mechStavVol->AddNode(volCoolTubeW, 0,
new TGeoTranslation(
x - 0.25,
y,
z));
1297 mechStavVol->AddNode(volCoolTubeW, 1,
new TGeoTranslation(
x + 0.25,
y,
z));
1300 if (mBuildLevel < 3) {
1303 auto* t2 =
new TGeoBBox(
1304 kS2 - 0.028, 0.02 / 2,
1306 auto* volT2 =
new TGeoVolume(
"TopFilament", t2, medM60J3K);
1307 volT2->SetLineColor(12);
1308 volT2->SetFillColor(12);
1309 for (
int i = 0;
i < loop;
i++) {
1311 mechStavVol->AddNode(
1313 new TGeoCombiTrans(
x + kWidth + 0.0036,
y + kHeight + 0.01,
1314 z - kStaveLength + 0.1 + (
i * 4 * kL1) + kS1 / 2,
1315 new TGeoRotation(
"volT2", 90, 90 - kAlpha, 90 - kBeta)));
1317 mechStavVol->AddNode(
1319 new TGeoCombiTrans(
x - kWidth - 0.0036,
y + kHeight + 0.01,
1320 z - kStaveLength + 0.1 + (
i * 4 * kL1) + kS1 / 2,
1321 new TGeoRotation(
"volT2", 90, -90 + kAlpha, -90 + kBeta)));
1323 mechStavVol->AddNode(
1325 new TGeoCombiTrans(
x + kWidth + 0.0036,
y + kHeight + 0.01,
1326 z - kStaveLength + 0.1 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
1327 new TGeoRotation(
"volT2", 90, -90 + kAlpha, 90 - kBeta)));
1329 mechStavVol->AddNode(
1331 new TGeoCombiTrans(
x - kWidth - 0.0036,
y + kHeight + 0.01,
1332 z - kStaveLength + 0.1 + 2 * kL1 + (
i * 4 * kL1) + kS1 / 2,
1333 new TGeoRotation(
"volT2", 90, 90 - kAlpha, -90 + kBeta)));
1338 auto* trd1 =
new TGeoTrd1(0, kTopVertexMaxWidth / 2, kStaveLength, kTopVertexHeight / 2);
1339 auto* ibdv =
new TGeoVolume(
"TopVertex", trd1, medM60J3K);
1340 ibdv->SetFillColor(12);
1341 ibdv->SetLineColor(12);
1342 mechStavVol->AddNode(
1343 ibdv, 1,
new TGeoCombiTrans(
x,
y + kStaveHeight + 0.03,
z,
new TGeoRotation(
"ibdv", 0., -90, 0)));
1346 auto* trd2 =
new TGeoTrd1(0, kSideVertexMWidth / 2, kStaveLength, kSideVertexHeight / 2);
1347 auto* ibdv2 =
new TGeoVolume(
"LeftVertex", trd2, medM60J3K);
1348 ibdv2->SetFillColor(12);
1349 ibdv2->SetLineColor(12);
1350 mechStavVol->AddNode(
1353 x + kStaveWidth / 2 - 0.06,
y - 0.0355,
z,
1354 new TGeoRotation(
"ibdv2", -103.3, 90, 0)));
1357 auto* trd3 =
new TGeoTrd1(0, kSideVertexMWidth / 2, kStaveLength, kSideVertexHeight / 2);
1358 auto* ibdv3 =
new TGeoVolume(
"RightVertex", trd3, medM60J3K);
1359 ibdv3->SetFillColor(12);
1360 ibdv3->SetLineColor(12);
1361 mechStavVol->AddNode(
1362 ibdv3, 1,
new TGeoCombiTrans(
x - kStaveWidth / 2 + 0.06,
y - 0.0355,
z,
new TGeoRotation(
"ibdv3", 103.3, 90, 0)));
1366 new TGeoConeSeg(zsta, kConeOutRadius + klay1, kConeOutRadius + klay1 + klay2,
1367 kConeOutRadius + klay1, kConeOutRadius + klay1 + klay2, 0, 180);
1368 auto* cone12 =
new TGeoVolume(
"CarbonFleecePipeCover", cons2, medCarbonFleece);
1369 cone12->SetFillColor(28);
1370 cone12->SetLineColor(28);
1371 mechStavVol->AddNode(cone12, 1,
1372 new TGeoCombiTrans(
x + 0.25,
y,
z,
new TGeoRotation(
"cone12", 0, 0, 0)));
1373 mechStavVol->AddNode(cone12, 2,
1374 new TGeoCombiTrans(
x - 0.25,
y,
z,
new TGeoRotation(
"cone12", 0, 0, 0)));
1376 auto* box3 =
new TGeoBBox((0.50 - (2 * (kConeOutRadius + klay1))) / 2, klay2 / 2,
1378 auto* plate3 =
new TGeoVolume(
"CarbonFleeceMiddle", box3, medCarbonFleece);
1379 plate3->SetFillColor(28);
1380 plate3->SetLineColor(28);
1381 mechStavVol->AddNode(plate3, 1,
new TGeoCombiTrans(
x,
y - kConeOutRadius + klay1 + (klay2 / 2),
z,
new TGeoRotation(
"plate3", 0, 0, 0)));
1384 new TGeoBBox((0.75 - 0.25 - kConeOutRadius - klay1) / 2 + 0.0025, klay2 / 2, zsta);
1385 auto* plate31 =
new TGeoVolume(
"CarbonFleeceLeftRight", box31, medCarbonFleece);
1386 plate31->SetFillColor(28);
1387 plate31->SetLineColor(28);
1388 mechStavVol->AddNode(
1391 x + 0.25 + kConeOutRadius + klay1 + (0.75 - 0.25 - kConeOutRadius - klay1) / 2,
1392 y - kConeOutRadius + klay1 + (klay2 / 2),
z,
new TGeoRotation(
"plate31", 0, 0, 0)));
1393 mechStavVol->AddNode(
1396 x - 0.25 - kConeOutRadius - klay1 - (0.75 - 0.25 - kConeOutRadius - klay1) / 2,
1397 y - kConeOutRadius + klay1 + (klay2 / 2),
z,
new TGeoRotation(
"plate31", 0, 0, 0)));
1399 auto* box32 =
new TGeoBBox((klay2 / 2), (kConeOutRadius - klay1) / 2, zsta);
1400 auto* plate32 =
new TGeoVolume(
"CarbonFleeceVertical", box32, medCarbonFleece);
1401 plate32->SetFillColor(28);
1402 plate32->SetLineColor(28);
1403 mechStavVol->AddNode(plate32, 1,
1404 new TGeoCombiTrans(
x + 0.25 + kConeOutRadius + klay1 + (klay2 / 2),
1405 y + (klay1 - kConeOutRadius) / 2,
z,
1406 new TGeoRotation(
"plate32", 0, 0, 0)));
1407 mechStavVol->AddNode(plate32, 2,
1408 new TGeoCombiTrans(
x + 0.25 - kConeOutRadius - klay1 - (klay2 / 2),
1409 y + (klay1 - kConeOutRadius) / 2,
z,
1410 new TGeoRotation(
"plate32", 0, 0, 0)));
1411 mechStavVol->AddNode(plate32, 3,
1412 new TGeoCombiTrans(
x - 0.25 + kConeOutRadius + klay1 + (klay2 / 2),
1413 y + (klay1 - kConeOutRadius) / 2,
z,
1414 new TGeoRotation(
"plate32", 0, 0, 0)));
1415 mechStavVol->AddNode(plate32, 4,
1416 new TGeoCombiTrans(
x - 0.25 - kConeOutRadius - klay1 - (klay2 / 2),
1417 y + (klay1 - kConeOutRadius) / 2,
z,
1418 new TGeoRotation(
"plate32", 0, 0, 0)));
1422 new TGeoConeSeg(zsta, kConeOutRadius, kConeOutRadius + klay1 - 0.0001, kConeOutRadius,
1423 kConeOutRadius + klay1 - 0.0001, 0, 180);
1424 auto* cone11 =
new TGeoVolume(
"ThermasolPipeCover", cons1, medFGS003);
1425 cone11->SetFillColor(2);
1426 cone11->SetLineColor(2);
1427 mechStavVol->AddNode(cone11, 1,
1428 new TGeoCombiTrans(
x + 0.25,
y,
z,
new TGeoRotation(
"cone11", 0, 0, 0)));
1429 mechStavVol->AddNode(cone11, 2,
1430 new TGeoCombiTrans(
x - 0.25,
y,
z,
new TGeoRotation(
"cone11", 0, 0, 0)));
1433 new TGeoBBox((0.50 - (2 * kConeOutRadius)) / 2, (klay1 / 2), zsta);
1434 auto* plate2 =
new TGeoVolume(
"ThermasolMiddle", box2, medFGS003);
1435 plate2->SetFillColor(2);
1436 plate2->SetLineColor(2);
1437 mechStavVol->AddNode(plate2, 1,
new TGeoCombiTrans(
x,
y - kConeOutRadius + (klay1 / 2),
z,
new TGeoRotation(
"plate2", 0, 0, 0)));
1440 new TGeoBBox((0.75 - 0.25 - kConeOutRadius - klay1) / 2 + 0.0025, (klay1 / 2), zsta);
1441 auto* plate21 =
new TGeoVolume(
"ThermasolLeftRight", box21, medFGS003);
1442 plate21->SetFillColor(2);
1443 plate21->SetLineColor(2);
1444 mechStavVol->AddNode(
1447 x + 0.25 + kConeOutRadius + (0.75 - 0.25 - kConeOutRadius) / 2 - (klay1 / 2) + 0.0025,
1448 y - kConeOutRadius + (klay1 / 2),
z,
new TGeoRotation(
"plate21", 0, 0, 0)));
1449 mechStavVol->AddNode(
1452 x - 0.25 - kConeOutRadius - (0.75 - 0.25 - kConeOutRadius) / 2 + (klay1 / 2) - 0.0025,
1453 y - kConeOutRadius + (klay1 / 2),
z,
new TGeoRotation(
"plate21", 0, 0, 0)));
1455 auto* box22 =
new TGeoBBox((klay1 / 2), kConeOutRadius / 2, zsta);
1456 auto* plate22 =
new TGeoVolume(
"ThermasolVertical", box22, medFGS003);
1457 plate22->SetFillColor(2);
1458 plate22->SetLineColor(2);
1459 mechStavVol->AddNode(plate22, 1,
new TGeoCombiTrans(
x + 0.25 + kConeOutRadius + (klay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1460 mechStavVol->AddNode(plate22, 2,
new TGeoCombiTrans(
x + 0.25 - kConeOutRadius - (klay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1461 mechStavVol->AddNode(plate22, 3,
new TGeoCombiTrans(
x - 0.25 + kConeOutRadius + (klay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1462 mechStavVol->AddNode(plate22, 4,
new TGeoCombiTrans(
x - 0.25 - kConeOutRadius - (klay1 / 2),
y - kConeOutRadius / 2,
z,
new TGeoRotation(
"plate22", 0, 0, 0)));
1465 auto* box1 =
new TGeoBBox(2 * kWidth, (klay3) / 2, zsta);
1466 auto* plate1 =
new TGeoVolume(
"CFPlate", box1, medK13D2U2k);
1467 plate1->SetFillColor(5);
1468 plate1->SetLineColor(5);
1469 mechStavVol->AddNode(plate1, 1,
new TGeoCombiTrans(
x,
y - (kConeOutRadius + (klay3 / 2)),
z,
new TGeoRotation(
"plate1", 0, 0, 0)));
1472 auto* box6 =
new TGeoBBox(2 * kWidth, (klay2) / 2, zsta);
1473 auto* plate6 =
new TGeoVolume(
"CarbonFleeceBottom", box6, medCarbonFleece);
1474 plate6->SetFillColor(2);
1475 plate6->SetLineColor(2);
1476 mechStavVol->AddNode(plate6, 1,
1477 new TGeoCombiTrans(
x,
y - (kConeOutRadius + klay3 + (klay2 / 2)),
z,
1478 new TGeoRotation(
"plate6", 0, 0, 0)));
1480 if (mBuildLevel < 2) {
1482 auto* glue =
new TGeoBBox(kStaveWidth / 2, (klay4) / 2, zsta);
1483 auto* volGlue =
new TGeoVolume(
"Glue", glue, medGlue);
1484 volGlue->SetLineColor(5);
1485 volGlue->SetFillColor(5);
1488 mechStavVol->AddNode(
1490 new TGeoCombiTrans(
x,
y - (kConeOutRadius + klay3 + klay2 + (klay4) / 2) + 0.00005,
z,
1491 new TGeoRotation(
"", 0, 0, 0)));
1494 if (mBuildLevel < 1) {
1496 auto* kapCable =
new TGeoBBox(kStaveWidth / 2, klay5 / 2, zsta);
1497 auto* volCable =
new TGeoVolume(
"FlexCable", kapCable, medFlexCable);
1498 volCable->SetLineColor(28);
1499 volCable->SetFillColor(28);
1504 mechStavVol->AddNode(
1507 x,
y - (kConeOutRadius + klay3 + klay2 + klay4 + mSensorThickness + (klay5) / 2) + 0.01185,
1508 z,
new TGeoRotation(
"", 0, 0, 0)));
1515TGeoVolume* V1Layer::createStaveModelInnerB3(
const Double_t xsta,
const Double_t zsta,
1516 const TGeoManager* mgr)
1519 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
1520 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
1522 TGeoMedium* medM60J3K = mgr->GetMedium(Form(
"%s_M60J3K$",
GetDetName()));
1523 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
1524 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
1525 TGeoMedium* medFlexCable = mgr->GetMedium(Form(
"%s_FLEXCABLE$",
GetDetName()));
1531 Double_t kConeOutRadius = 0.15 / 2;
1532 Double_t kStaveLength = zsta * 2;
1533 Double_t kStaveWidth = xsta * 2;
1534 Double_t
w = kStaveWidth / 4;
1535 Double_t staveHeight = 0.3;
1536 Double_t
h = staveHeight / 2;
1537 Double_t
alpha = 90 - 33.;
1538 Double_t the1 =
alpha * TMath::DegToRad();
1539 Double_t
s1 =
w / TMath::Sin(the1);
1540 Double_t l =
w / TMath::Tan(the1);
1541 Double_t s2 = TMath::Sqrt(
h *
h +
s1 *
s1);
1542 Double_t the2 = TMath::ATan(
h /
s1);
1543 Double_t beta = the2 * TMath::RadToDeg();
1544 Double_t klay4 = 0.007;
1545 Double_t klay5 = 0.01;
1546 Int_t loop = (Int_t)((kStaveLength / (2 * l)) / 2);
1548 Double_t ang1 = 0 * TMath::DegToRad();
1549 Double_t ang2 = 0 * TMath::DegToRad();
1550 Double_t ang3 = 0 * TMath::DegToRad();
1552 Double_t headWidth = 0.25;
1553 Double_t smcLength = kStaveLength / chips - 2 * headWidth;
1554 Double_t smcWidth = kStaveWidth;
1555 Double_t smcSide1Thick = 0.03;
1556 Double_t vaporThick = 0.032;
1557 Double_t liquidThick = 0.028;
1558 Double_t smcSide2Thick = 0.01;
1559 Double_t smcSide3Thick = 0.0055;
1560 Double_t smcSide4Thick = 0.0095;
1561 Double_t smcSide5Thick = 0.0075;
1562 Double_t smcSpace = 0.01;
1564 char volumeName[30];
1569 Double_t
z = 0,
y = 0 - 0.007,
x = 0;
1572 Double_t yMC =
y -
h + 0.01;
1573 Int_t nb = (Int_t)(kStaveWidth / 0.1) + 1;
1574 Double_t xstaMC = (nb * 0.1 - 0.08) / 2;
1576 TGeoVolume* mechStavVol =
nullptr;
1577 if (mBuildLevel < 5) {
1579 auto* mechStruct =
new TGeoXtru(2);
1581 kStaveWidth / 2 + 0.1, kStaveWidth / 2 + 0.1, 0, -kStaveWidth / 2 - 0.1,
1582 -kStaveWidth / 2 - 0.1};
1583 Double_t yv[5] = {-kConeOutRadius * 2 - 0.07, 0, staveHeight, 0, -kConeOutRadius * 2 - 0.07};
1584 mechStruct->DefinePolygon(5, xv, yv);
1585 mechStruct->DefineSection(0, -kStaveLength - 0.1, 0, 0, 1.);
1586 mechStruct->DefineSection(1, kStaveLength + 0.1, 0, 0, 1.);
1587 mechStavVol =
new TGeoVolume(volumeName, mechStruct, medAir);
1588 mechStavVol->SetLineColor(12);
1589 mechStavVol->SetFillColor(12);
1590 mechStavVol->SetVisibility(kTRUE);
1594 auto* tM0a =
new TGeoBBox(smcWidth / 2, 0.003 / 2, headWidth / 2);
1595 auto* volTM0a =
new TGeoVolume(
"microChanTop1", tM0a, medKapton);
1596 volTM0a->SetLineColor(35);
1597 volTM0a->SetFillColor(35);
1599 for (Int_t mo = 1; mo <= chips; mo++) {
1600 mechStavVol->AddNode(
1602 new TGeoCombiTrans(
x, yMC + 0.03,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth + smcLength / 2 + (headWidth / 2),
1603 new TGeoRotation(
"", ang1, ang2, ang3)));
1604 mechStavVol->AddNode(
1606 new TGeoCombiTrans(
x, yMC + 0.03,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth - smcLength / 2 - (headWidth / 2),
1607 new TGeoRotation(
"", ang1, ang2, ang3)));
1609 auto* tM0c =
new TGeoBBox(0.3 / 2, 0.003 / 2, smcLength / 2);
1610 auto* volTM0c =
new TGeoVolume(
"microChanTop2", tM0c, medKapton);
1611 volTM0c->SetLineColor(35);
1612 volTM0c->SetFillColor(35);
1613 for (Int_t mo = 1; mo <= chips; mo++) {
1614 mechStavVol->AddNode(
1615 volTM0c, 0,
new TGeoCombiTrans(
x + (smcWidth / 2) - (0.3 / 2), yMC + 0.03,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1616 mechStavVol->AddNode(
1617 volTM0c, 1,
new TGeoCombiTrans(
x - (smcWidth / 2) + (0.3 / 2), yMC + 0.03,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1619 auto* tM0c1 =
new TGeoBBox(0.2225 / 2, 0.003 / 2, smcLength / 2);
1620 auto* volTM0c1 =
new TGeoVolume(
"microChanBot1", tM0c1, medKapton);
1621 volTM0c1->SetLineColor(6);
1622 volTM0c1->SetFillColor(6);
1623 for (Int_t mo = 1; mo <= chips; mo++) {
1624 mechStavVol->AddNode(
1625 volTM0c1, 0,
new TGeoCombiTrans(
x + smcWidth / 2 - (smcSide1Thick) - (vaporThick) - (smcSide2Thick) - (smcSide3Thick) - (0.2225 / 2), yMC + 0.03 - hh - (0.003),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1626 mechStavVol->AddNode(
1627 volTM0c1, 1,
new TGeoCombiTrans(
x - smcWidth / 2 + (smcSide1Thick) + (liquidThick) + (smcSide2Thick) + (smcSide4Thick) + (0.2225 / 2), yMC + 0.03 - hh - (0.003),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1629 auto* tM0c2 =
new TGeoBBox(0.072 / 2, 0.003 / 2, smcLength / 2);
1630 auto* volTM0c2 =
new TGeoVolume(
"microChanBot2", tM0c2, medKapton);
1631 volTM0c2->SetLineColor(35);
1632 volTM0c2->SetFillColor(35);
1633 for (Int_t mo = 1; mo <= chips; mo++) {
1634 mechStavVol->AddNode(
1635 volTM0c2, 0,
new TGeoCombiTrans(
x + smcWidth / 2 - (0.072 / 2), yMC + 0.03 - (0.035 + 0.0015) - (0.003) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1637 auto* tM0c2r =
new TGeoBBox(0.068 / 2, 0.003 / 2, smcLength / 2);
1638 auto* volTM0c2r =
new TGeoVolume(
"microChanBot3", tM0c2r, medKapton);
1639 volTM0c2r->SetLineColor(35);
1640 volTM0c2r->SetFillColor(35);
1641 for (Int_t mo = 1; mo <= chips; mo++) {
1642 mechStavVol->AddNode(
1643 volTM0c2r, 0,
new TGeoCombiTrans(
x - smcWidth / 2 + (0.068 / 2), yMC + 0.03 - (0.035 + 0.0015) - (0.003) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1645 auto* tM0d =
new TGeoBBox(smcSide1Thick / 2, 0.035 / 2, smcLength / 2);
1646 auto* volTM0d =
new TGeoVolume(
"microChanSide1", tM0d, medKapton);
1647 volTM0d->SetLineColor(12);
1648 volTM0d->SetFillColor(12);
1649 for (Int_t mo = 1; mo <= chips; mo++) {
1650 mechStavVol->AddNode(
1651 volTM0d, 0,
new TGeoCombiTrans(
x + smcWidth / 2 - (smcSide1Thick / 2), yMC + 0.03 - 0.0015 - (0.035) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1652 mechStavVol->AddNode(
1653 volTM0d, 1,
new TGeoCombiTrans(
x - smcWidth / 2 + (smcSide1Thick / 2), yMC + 0.03 - 0.0015 - (0.035) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1656 auto* tM0d1 =
new TGeoBBox(smcSide2Thick / 2, 0.035 / 2, smcLength / 2);
1657 auto* volTM0d1 =
new TGeoVolume(
"microChanSide2", tM0d1, medKapton);
1658 volTM0d1->SetLineColor(12);
1659 volTM0d1->SetFillColor(12);
1660 for (Int_t mo = 1; mo <= chips; mo++) {
1661 mechStavVol->AddNode(
1663 new TGeoCombiTrans(
x + smcWidth / 2 - (smcSide1Thick) - (vaporThick) - (smcSide2Thick / 2),
1664 yMC + 0.03 - (0.003 + 0.035) / 2,
1665 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1666 new TGeoRotation(
"", ang1, ang2, ang3)));
1667 mechStavVol->AddNode(
1669 new TGeoCombiTrans(
x - smcWidth / 2 + (smcSide1Thick) + (liquidThick) + (smcSide2Thick / 2),
1670 yMC + 0.03 - (0.003 + 0.035) / 2,
1671 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1672 new TGeoRotation(
"", ang1, ang2, ang3)));
1674 auto* tM0d2 =
new TGeoBBox(smcSide3Thick / 2, (hh + 0.003) / 2, smcLength / 2);
1675 auto* volTM0d2 =
new TGeoVolume(
"microChanSide3", tM0d2, medKapton);
1676 volTM0d2->SetLineColor(12);
1677 volTM0d2->SetFillColor(12);
1678 for (Int_t mo = 1; mo <= chips; mo++) {
1679 mechStavVol->AddNode(
1680 volTM0d2, 0,
new TGeoCombiTrans(
x + smcWidth / 2 - (smcSide1Thick) - (vaporThick) - (smcSide2Thick) - (smcSide3Thick / 2), yMC + 0.03 - (0.003 + hh + 0.003) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1682 auto* tM0d2r =
new TGeoBBox(smcSide4Thick / 2, (hh + 0.003) / 2, smcLength / 2);
1683 auto* volTM0d2r =
new TGeoVolume(
"microChanSide4", tM0d2r, medKapton);
1684 volTM0d2r->SetLineColor(12);
1685 volTM0d2r->SetFillColor(12);
1686 for (Int_t mo = 1; mo <= chips; mo++) {
1687 mechStavVol->AddNode(
1689 new TGeoCombiTrans(
x - smcWidth / 2 + (smcSide1Thick) + (liquidThick) + (smcSide2Thick) +
1690 (smcSide4Thick / 2),
1691 yMC + 0.03 - (0.003 + hh + 0.003) / 2,
1692 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1693 new TGeoRotation(
"", ang1, ang2, ang3)));
1695 auto* tM0e =
new TGeoBBox(smcSide5Thick / 2, hh / 2, smcLength / 2);
1696 auto* volTM0e =
new TGeoVolume(
"microChanSide5", tM0e, medKapton);
1697 volTM0e->SetLineColor(12);
1698 volTM0e->SetFillColor(12);
1699 for (Int_t mo = 1; mo <= chips; mo++) {
1700 for (Int_t ie = 0; ie < 11; ie++) {
1701 mechStavVol->AddNode(
1703 new TGeoCombiTrans(
x - (ie * (smcSpace + smcSide5Thick)) + smcWidth / 2 -
1704 (smcSide1Thick) - (vaporThick) - (smcSide2Thick) - (smcSide3Thick)-smcSpace - (smcSide5Thick / 2),
1705 yMC + 0.03 - (0.003 + hh) / 2,
1706 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1707 new TGeoRotation(
"", ang1, ang2, ang3)));
1708 mechStavVol->AddNode(
1710 new TGeoCombiTrans(
x + (ie * (smcSpace + smcSide5Thick)) - smcWidth / 2 +
1711 (smcSide1Thick) + (liquidThick) + (smcSide2Thick) + (smcSide4Thick) +
1712 smcSpace + (smcSide5Thick / 2),
1713 yMC + 0.03 - (0.003 + hh) / 2,
1714 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1715 new TGeoRotation(
"", ang1, ang2, ang3)));
1719 auto* tM0f =
new TGeoBBox(0.02 / 2, hh / 2, smcLength / 2);
1720 auto* volTM0f =
new TGeoVolume(
"microChanTop3", tM0f, medKapton);
1722 Double_t smcCloseWallvapor = smcWidth / 2 - smcSide1Thick - vaporThick - smcSide2Thick -
1723 smcSide3Thick - 12 * smcSpace - 11 * smcSide5Thick;
1724 Double_t smcCloseWallliquid = smcWidth / 2 - smcSide1Thick - liquidThick - smcSide2Thick -
1725 smcSide4Thick - 12 * smcSpace - 11 * smcSide5Thick;
1726 volTM0f->SetLineColor(12);
1727 volTM0f->SetFillColor(12);
1728 for (Int_t mo = 1; mo <= chips; mo++) {
1729 mechStavVol->AddNode(
1731 new TGeoCombiTrans(
x + smcCloseWallvapor - (0.02) / 2, yMC + 0.03 - (0.003 + hh) / 2,
1732 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1733 new TGeoRotation(
"", ang1, ang2, ang3)));
1734 mechStavVol->AddNode(
1736 new TGeoCombiTrans(
x - smcCloseWallliquid + (0.02) / 2, yMC + 0.03 - (0.003 + hh) / 2,
1737 z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
1738 new TGeoRotation(
"", ang1, ang2, ang3)));
1742 auto* tM0hb =
new TGeoBBox(smcWidth / 2, 0.025 / 2, headWidth / 2);
1743 auto* volTM0hb =
new TGeoVolume(
"microChanHeadBackBottom1", tM0hb, medKapton);
1744 volTM0hb->SetLineColor(4);
1745 volTM0hb->SetFillColor(4);
1746 for (Int_t mo = 1; mo <= chips; mo++) {
1747 mechStavVol->AddNode(
1748 volTM0hb, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0145 - (0.025 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth + smcLength / 2 + (headWidth / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1749 mechStavVol->AddNode(
1750 volTM0hb, 1,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0145 - (0.025) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth - smcLength / 2 - (headWidth / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1752 auto* tM0h1 =
new TGeoBBox(smcWidth / 2, 0.013 / 2, 0.05 / 2);
1753 auto* volTM0h1 =
new TGeoVolume(
"microChanHeadBackBottom2", tM0h1, medKapton);
1754 volTM0h1->SetLineColor(5);
1755 volTM0h1->SetFillColor(5);
1756 for (Int_t mo = 1; mo <= chips; mo++) {
1757 mechStavVol->AddNode(
1758 volTM0h1, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - (0.013 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth - smcLength / 2 - headWidth + (0.05 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1760 auto* tM0h2 =
new TGeoBBox(smcWidth / 2, 0.003 / 2, 0.18 / 2);
1761 auto* volTM0h2 =
new TGeoVolume(
"microChanHeadBackBottom7", tM0h2, medKapton);
1762 volTM0h2->SetLineColor(6);
1763 volTM0h2->SetFillColor(6);
1764 for (Int_t mo = 1; mo <= chips; mo++) {
1765 mechStavVol->AddNode(
1766 volTM0h2, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - 0.01 - (0.003 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth - smcLength / 2 - 0.02 - (0.18 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1768 auto* tM0h3 =
new TGeoBBox(smcWidth / 2, 0.013 / 2, 0.02 / 2);
1769 auto* volTM0h3 =
new TGeoVolume(
"microChanHeadBackBottom3", tM0h3, medKapton);
1770 volTM0h3->SetLineColor(5);
1771 volTM0h3->SetFillColor(5);
1772 for (Int_t mo = 1; mo <= chips; mo++) {
1773 mechStavVol->AddNode(
1774 volTM0h3, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - (0.013 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth - smcLength / 2 - (0.02 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1776 auto* tM0b1 =
new TGeoBBox(smcWidth / 2, 0.013 / 2, 0.03 / 2);
1777 auto* volTM0b1 =
new TGeoVolume(
"microChanHeadBackBottom4", tM0b1, medKapton);
1778 volTM0b1->SetLineColor(5);
1779 volTM0b1->SetFillColor(5);
1780 for (Int_t mo = 1; mo <= chips; mo++) {
1781 mechStavVol->AddNode(
1782 volTM0b1, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - (0.013 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth + smcLength / 2 + headWidth - (0.03 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1784 auto* tM0b2 =
new TGeoBBox(smcWidth / 2, 0.003 / 2, 0.2 / 2);
1785 auto* volTM0b2 =
new TGeoVolume(
"microChanHeadBackBottom5", tM0b2, medKapton);
1786 volTM0b2->SetLineColor(6);
1787 volTM0b2->SetFillColor(6);
1788 for (Int_t mo = 1; mo <= chips; mo++) {
1789 mechStavVol->AddNode(
1790 volTM0b2, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - 0.01 - (0.003 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth + smcLength / 2 + 0.02 + (0.2 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1792 auto* tM0b3 =
new TGeoBBox(smcWidth / 2, 0.013 / 2, 0.02 / 2);
1793 auto* volTM0b3 =
new TGeoVolume(
"microChanHeadBackBottom6", tM0b3, medKapton);
1794 volTM0b3->SetLineColor(5);
1795 volTM0b3->SetFillColor(5);
1796 for (Int_t mo = 1; mo <= chips; mo++) {
1797 mechStavVol->AddNode(
1798 volTM0b3, 0,
new TGeoCombiTrans(
x, yMC + 0.03 - 0.0015 - (0.013 / 2),
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth + smcLength / 2 + (0.02 / 2),
new TGeoRotation(
"", ang1, ang2, ang3)));
1801 auto* tM0b =
new TGeoBBox(0.02 / 2, 0.02 / 2, zsta);
1802 auto* volTM0b =
new TGeoVolume(
"microChanWalls", tM0b, medKapton);
1803 volTM0b->SetLineColor(35);
1804 volTM0b->SetFillColor(35);
1805 for (Int_t ib = 0; ib < nb; ib++) {
1811 if (mBuildLevel < 4) {
1813 auto* tM0dv =
new TGeoBBox(vaporThick / 2, 0.035 / 2, smcLength / 2);
1814 auto* volTM0dv =
new TGeoVolume(
"microChanVapor", tM0dv, medWater);
1815 volTM0dv->SetLineColor(2);
1816 volTM0dv->SetFillColor(2);
1817 for (Int_t mo = 1; mo <= chips; mo++) {
1818 mechStavVol->AddNode(
1819 volTM0dv, 0,
new TGeoCombiTrans(
x + smcWidth / 2 - (smcSide1Thick) - (vaporThick / 2), yMC + 0.03 - 0.0015 - (0.035) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1821 auto* tM0dl =
new TGeoBBox(liquidThick / 2, 0.035 / 2, smcLength / 2);
1822 auto* volTM0dl =
new TGeoVolume(
"microChanLiquid", tM0dl, medWater);
1823 volTM0dl->SetLineColor(3);
1824 volTM0dl->SetFillColor(3);
1825 for (Int_t mo = 1; mo <= chips; mo++) {
1826 mechStavVol->AddNode(
1827 volTM0dl, 0,
new TGeoCombiTrans(
x - smcWidth / 2 + (smcSide1Thick) + (liquidThick / 2), yMC + 0.03 - 0.0015 - (0.035) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1830 auto* tM0dlq =
new TGeoBBox(smcSpace / 2, hh / 2, smcLength / 2);
1831 auto* volTM0dlq =
new TGeoVolume(
"smallLiquid", tM0dlq, medWater);
1832 volTM0dlq->SetLineColor(3);
1833 volTM0dlq->SetFillColor(3);
1834 auto* tM0dvp =
new TGeoBBox(smcSpace / 2, hh / 2, smcLength / 2);
1835 auto* volTM0dvp =
new TGeoVolume(
"microChanVapor", tM0dvp, medWater);
1836 volTM0dvp->SetLineColor(2);
1837 volTM0dvp->SetFillColor(2);
1838 for (Int_t mo = 1; mo <= chips; mo++) {
1839 for (Int_t is = 0; is < 12; is++) {
1840 mechStavVol->AddNode(
1841 volTM0dlq, 0,
new TGeoCombiTrans(
x + (is * (smcSpace + smcSide5Thick)) - smcWidth / 2 + (smcSide1Thick) + (vaporThick) + (smcSide2Thick) + (smcSide3Thick) + smcSpace / 2, yMC + 0.03 - (0.003 + hh) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1842 mechStavVol->AddNode(
1843 volTM0dvp, 1,
new TGeoCombiTrans(
x - (is * (smcSpace + smcSide5Thick)) + smcWidth / 2 - (smcSide1Thick) - (vaporThick) - (smcSide2Thick) - (smcSide3Thick)-smcSpace / 2, yMC + 0.03 - (0.003 + hh) / 2,
z + (mo - 3) * kStaveLength / 4 + smcLength / 2 + headWidth,
new TGeoRotation(
"", ang1, ang2, ang3)));
1848 if (mBuildLevel < 3) {
1850 Double_t filWidth = 0.04;
1851 Double_t filHeight = 0.02;
1852 auto*
t1 =
new TGeoBBox(filHeight / 2, filWidth / 2,
s1);
1853 auto* volT1 =
new TGeoVolume(
"bottomFilament",
t1, medM60J3K);
1854 volT1->SetLineColor(12);
1855 volT1->SetFillColor(12);
1856 for (
int i = 0;
i < loop;
i++) {
1857 mechStavVol->AddNode(volT1, 4 *
i + 0,
1858 new TGeoCombiTrans(
x +
w,
y -
h + 0.04 + filHeight / 2,
1859 z - kStaveLength / 2 + (4 * l *
i) +
s1 / 2,
1860 new TGeoRotation(
"volT1", -90,
alpha, 0)));
1861 mechStavVol->AddNode(volT1, 4 *
i + 1,
1862 new TGeoCombiTrans(
x -
w,
y -
h + 0.04 + filHeight / 2,
1863 z - kStaveLength / 2 + (4 * l *
i) +
s1 / 2,
1864 new TGeoRotation(
"volT1", 90,
alpha, 0)));
1865 mechStavVol->AddNode(volT1, 4 *
i + 2,
1866 new TGeoCombiTrans(
x +
w,
y -
h + 0.04 + filHeight / 2,
1867 z - kStaveLength / 2 + 2 * l + (
i * 4 * l) +
s1 / 2,
1868 new TGeoRotation(
"volT1", -90, -
alpha, 0)));
1869 mechStavVol->AddNode(volT1, 4 *
i + 3,
1870 new TGeoCombiTrans(
x -
w,
y -
h + 0.04 + filHeight / 2,
1871 z - kStaveLength / 2 + 2 * l + (
i * 4 * l) +
s1 / 2,
1872 new TGeoRotation(
"volT1", -90, +
alpha, 0)));
1876 auto* t2 =
new TGeoBBox(s2, filHeight / 2, filWidth / 2);
1877 auto* volT2 =
new TGeoVolume(
"topFilament", t2, medM60J3K);
1878 volT2->SetLineColor(12);
1879 volT2->SetFillColor(12);
1880 for (
int i = 0;
i < loop;
i++) {
1881 mechStavVol->AddNode(
1882 volT2, 4 *
i + 0,
new TGeoCombiTrans(
x +
w,
y + 0.04 + filHeight / 2,
z - kStaveLength / 2 + (
i * 4 * l) +
s1 / 2,
new TGeoRotation(
"volT2", 90, 90 -
alpha, 90 - beta)));
1883 mechStavVol->AddNode(
1885 new TGeoCombiTrans(
x -
w,
y + 0.04 + filHeight / 2,
1886 z - kStaveLength / 2 + (
i * 4 * l) +
s1 / 2,
1887 new TGeoRotation(
"volT2", 90, -90 +
alpha, -90 + beta)));
1888 mechStavVol->AddNode(
1890 new TGeoCombiTrans(
x +
w,
y + 0.04 + filHeight / 2,
1891 z - kStaveLength / 2 + 2 * l + (
i * 4 * l) +
s1 / 2,
1892 new TGeoRotation(
"volT2", 90, -90 +
alpha, 90 - beta)));
1893 mechStavVol->AddNode(
1895 new TGeoCombiTrans(
x -
w,
y + 0.04 + filHeight / 2,
1896 z - kStaveLength / 2 + 2 * l + (
i * 4 * l) +
s1 / 2,
1897 new TGeoRotation(
"volT2", 90, 90 -
alpha, -90 + beta)));
1901 if (mBuildLevel < 2) {
1903 auto* tM0 =
new TGeoBBox(xstaMC / 5, klay4 / 2, zsta);
1904 auto* volTM0 =
new TGeoVolume(
"glueFM", tM0, medGlue);
1905 volTM0->SetLineColor(5);
1906 volTM0->SetFillColor(5);
1907 mechStavVol->AddNode(volTM0, 0,
new TGeoCombiTrans(
x - xsta / 2 - 0.25, 0.03 + yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
1908 mechStavVol->AddNode(volTM0, 1,
new TGeoCombiTrans(
x + xsta / 2 + 0.25, 0.03 + yMC,
z,
new TGeoRotation(
"", 0, 0, 0)));
1911 auto* glueM =
new TGeoBBox(xstaMC / 5, klay4 / 2, zsta);
1912 auto* volGlueM =
new TGeoVolume(
"glueMS", glueM, medGlue);
1913 volGlueM->SetLineColor(5);
1914 volGlueM->SetFillColor(5);
1915 mechStavVol->AddNode(volGlueM, 0,
new TGeoCombiTrans(
x - xsta / 2 - 0.25, yMC - 0.01,
z,
new TGeoRotation(
"", 0, 0, 0)));
1916 mechStavVol->AddNode(volGlueM, 1,
new TGeoCombiTrans(
x + xsta / 2 + 0.25, yMC - 0.01,
z,
new TGeoRotation(
"", 0, 0, 0)));
1919 auto* glue =
new TGeoBBox(xsta, klay4 / 2, zsta);
1920 auto* volGlue =
new TGeoVolume(
"glueSensorBus", glue, medGlue);
1921 volGlue->SetLineColor(5);
1922 volGlue->SetFillColor(5);
1923 mechStavVol->AddNode(volGlue, 1,
new TGeoCombiTrans(
x,
y - 0.154 - mSensorThickness - klay4 / 2,
z,
new TGeoRotation(
"", 0, 0, 0)));
1926 if (mBuildLevel < 1) {
1927 auto* kapCable =
new TGeoBBox(xsta, klay5 / 2, zsta);
1928 auto* volCable =
new TGeoVolume(
"Flexcable", kapCable, medFlexCable);
1929 volCable->SetLineColor(28);
1930 volCable->SetFillColor(28);
1931 mechStavVol->AddNode(volCable, 0,
1932 new TGeoCombiTrans(
x,
y - 0.154 - mSensorThickness - klay4 - klay5 / 2,
z,
1933 new TGeoRotation(
"", 0, 0, 0)));
1939TGeoVolume* V1Layer::createStaveOuterB(
const TGeoManager* mgr)
1941 TGeoVolume* mechStavVol =
nullptr;
1943 switch (mStaveModel) {
1945 mechStavVol = createStaveModelOuterBDummy(mgr);
1948 mechStavVol = createStaveModelOuterB0(mgr);
1951 mechStavVol = createStaveModelOuterB1(mgr);
1954 LOG(fatal) <<
"Unknown stave model " << mStaveModel;
1960TGeoVolume* V1Layer::createStaveModelOuterBDummy(
const TGeoManager*)
const
1966TGeoVolume* V1Layer::createStaveModelOuterB0(
const TGeoManager* mgr)
1968 Double_t xmod, ymod, zmod;
1969 Double_t xlen, ylen, zlen;
1970 Double_t ypos, zpos;
1971 char volumeName[30];
1975 xlen = sOBHalfStaveWidth;
1976 ylen = 0.5 * mStaveThickness;
1977 zlen = sOBModuleZLength / 2;
1979 TGeoVolume* chipVol = createChipInnerB(xlen, ylen, zlen);
1981 xmod = ((TGeoBBox*)chipVol->GetShape())->GetDX();
1982 ymod = ((TGeoBBox*)chipVol->GetShape())->GetDY();
1983 zmod = ((TGeoBBox*)chipVol->GetShape())->GetDZ();
1985 auto*
module = new TGeoBBox(xmod, ymod, zmod);
1987 zlen = sOBModuleZLength * mNumberOfModules;
1988 auto* hstave =
new TGeoBBox(xlen, ylen, zlen / 2);
1991 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
1994 auto* modVol =
new TGeoVolume(volumeName, module, medAir);
1995 modVol->SetVisibility(kTRUE);
1998 auto* hstaveVol =
new TGeoVolume(volumeName, hstave, medAir);
2001 modVol->AddNode(chipVol, 0);
2002 mHierarchy[
kChip] = 1;
2004 for (Int_t
j = 0;
j < mNumberOfModules;
j++) {
2006 zpos = -hstave->GetDZ() +
j * 2 * zmod + zmod;
2007 hstaveVol->AddNode(modVol,
j,
new TGeoTranslation(0, ypos, zpos));
2014TGeoVolume* V1Layer::createStaveModelOuterB1(
const TGeoManager* mgr)
2016 Double_t yFlex1 = sOBFlexCableAlThick;
2017 Double_t yFlex2 = sOBFlexCableKapThick;
2018 Double_t flexOverlap = 5;
2019 Double_t xHalmSt = sOBHalfStaveWidth / 2;
2020 Double_t rCoolMin = sOBCoolTubeInnerD / 2;
2021 Double_t rCoolMax = rCoolMin + sOBCoolTubeThick;
2022 Double_t kLay1 = 0.004;
2023 Double_t kLay2 = sOBGraphiteFoilThick;
2025 Double_t xlen, ylen;
2026 Double_t ymod, zmod;
2027 Double_t xtru[12], ytru[12];
2028 Double_t xpos, ypos, ypos1, zpos ;
2030 char volumeName[30];
2032 zlen = (mNumberOfModules * sOBModuleZLength + (mNumberOfModules - 1) * sOBModuleGap) / 2;
2035 TGeoVolume* moduleVol = createModuleOuterB();
2036 moduleVol->SetVisibility(kTRUE);
2037 ymod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDY();
2038 zmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDZ();
2040 auto* busAl =
new TGeoBBox(
"BusAl", xHalmSt, sOBBusCableAlThick / 2, zlen);
2041 auto* busKap =
new TGeoBBox(
"BusKap", xHalmSt, sOBBusCableKapThick / 2, zlen);
2044 new TGeoBBox(
"ColdPlate", sOBHalfStaveWidth / 2, sOBColdPlateThick / 2, zlen);
2046 auto* coolTube =
new TGeoTube(
"CoolingTube", rCoolMin, rCoolMax, zlen);
2047 auto* coolWater =
new TGeoTube(
"CoolingWater", 0., rCoolMin, zlen);
2049 xlen = xHalmSt - sOBCoolTubeXDist / 2 - coolTube->GetRmax();
2050 auto* graphlat =
new TGeoBBox(
"GraphLateral", xlen / 2, kLay2 / 2, zlen);
2052 xlen = sOBCoolTubeXDist / 2 - coolTube->GetRmax();
2053 auto* graphmid =
new TGeoBBox(
"GraphMiddle", xlen, kLay2 / 2, zlen);
2055 ylen = coolTube->GetRmax() - kLay2;
2056 auto* graphvert =
new TGeoBBox(
"GraphVertical", kLay2 / 2, ylen / 2, zlen);
2059 new TGeoTubeSeg(
"GraphTube", rCoolMax, rCoolMax + kLay2, zlen, 180., 360.);
2061 xlen = xHalmSt - sOBCoolTubeXDist / 2 - coolTube->GetRmax() - kLay2;
2062 auto* fleeclat =
new TGeoBBox(
"FleecLateral", xlen / 2, kLay1 / 2, zlen);
2064 xlen = sOBCoolTubeXDist / 2 - coolTube->GetRmax() - kLay2;
2065 auto* fleecmid =
new TGeoBBox(
"FleecMiddle", xlen, kLay1 / 2, zlen);
2067 ylen = coolTube->GetRmax() - kLay2 - kLay1;
2068 auto* fleecvert =
new TGeoBBox(
"FleecVertical", kLay1 / 2, ylen / 2, zlen);
2071 new TGeoTubeSeg(
"FleecTube", rCoolMax + kLay2, rCoolMax + kLay1 + kLay2, zlen, 180., 360.);
2073 auto* flex1_5cm =
new TGeoBBox(
"Flex1MV_5cm", xHalmSt, yFlex1 / 2, flexOverlap / 2);
2074 auto* flex2_5cm =
new TGeoBBox(
"Flex2MV_5cm", xHalmSt, yFlex2 / 2, flexOverlap / 2);
2080 ytru[1] = -2 * (ymod + busAl->GetDY() + busKap->GetDY() + coldPlate->GetDY() + graphlat->GetDY() +
2082 xtru[2] = sOBCoolTubeXDist / 2 + fleectub->GetRmax();
2085 ytru[3] = ytru[2] - (coolTube->GetRmax() + fleectub->GetRmax());
2086 xtru[4] = sOBCoolTubeXDist / 2 - fleectub->GetRmax();
2090 for (Int_t
i = 0;
i < 6;
i++) {
2091 xtru[6 +
i] = -xtru[5 -
i];
2092 ytru[6 +
i] = ytru[5 -
i];
2094 auto* halmStave =
new TGeoXtru(2);
2095 halmStave->DefinePolygon(12, xtru, ytru);
2096 halmStave->DefineSection(0, -mZLength / 2);
2097 halmStave->DefineSection(1, mZLength / 2);
2101 TGeoMedium* medAluminum = mgr->GetMedium(Form(
"%s_ALUMINUM$",
GetDetName()));
2102 TGeoMedium* medCarbon = mgr->GetMedium(Form(
"%s_CARBON$",
GetDetName()));
2103 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
2104 TGeoMedium* medWater = mgr->GetMedium(Form(
"%s_WATER$",
GetDetName()));
2105 TGeoMedium* medCarbonFleece = mgr->GetMedium(Form(
"%s_CarbonFleece$",
GetDetName()));
2106 TGeoMedium* medFGS003 = mgr->GetMedium(Form(
"%s_FGS003$",
GetDetName()));
2107 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
2109 auto* busAlVol =
new TGeoVolume(
"BusAlVol", busAl, medAluminum);
2110 busAlVol->SetLineColor(kCyan);
2111 busAlVol->SetFillColor(busAlVol->GetLineColor());
2112 busAlVol->SetFillStyle(4000);
2114 auto* busKapVol =
new TGeoVolume(
"BusKapVol", busKap, medKapton);
2115 busKapVol->SetLineColor(kBlue);
2116 busKapVol->SetFillColor(busKapVol->GetLineColor());
2117 busKapVol->SetFillStyle(4000);
2119 auto* coldPlateVol =
new TGeoVolume(
"ColdPlateVol", coldPlate, medCarbon);
2120 coldPlateVol->SetLineColor(kYellow - 3);
2121 coldPlateVol->SetFillColor(coldPlateVol->GetLineColor());
2122 coldPlateVol->SetFillStyle(4000);
2124 auto* coolTubeVol =
new TGeoVolume(
"CoolingTubeVol", coolTube, medKapton);
2125 coolTubeVol->SetLineColor(kGray);
2126 coolTubeVol->SetFillColor(coolTubeVol->GetLineColor());
2127 coolTubeVol->SetFillStyle(4000);
2129 auto* coolWaterVol =
new TGeoVolume(
"CoolingWaterVol", coolWater, medWater);
2130 coolWaterVol->SetLineColor(kBlue);
2131 coolWaterVol->SetFillColor(coolWaterVol->GetLineColor());
2132 coolWaterVol->SetFillStyle(4000);
2134 auto* graphlatVol =
new TGeoVolume(
"GraphiteFoilLateral", graphlat, medFGS003);
2135 graphlatVol->SetLineColor(kGreen);
2136 graphlatVol->SetFillColor(graphlatVol->GetLineColor());
2137 graphlatVol->SetFillStyle(4000);
2139 auto* graphmidVol =
new TGeoVolume(
"GraphiteFoilMiddle", graphmid, medFGS003);
2140 graphmidVol->SetLineColor(kGreen);
2141 graphmidVol->SetFillColor(graphmidVol->GetLineColor());
2142 graphmidVol->SetFillStyle(4000);
2144 auto* graphvertVol =
new TGeoVolume(
"GraphiteFoilVertical", graphvert, medFGS003);
2145 graphvertVol->SetLineColor(kGreen);
2146 graphvertVol->SetFillColor(graphvertVol->GetLineColor());
2147 graphvertVol->SetFillStyle(4000);
2149 auto* graphtubVol =
new TGeoVolume(
"GraphiteFoilPipeCover", graphtub, medFGS003);
2150 graphtubVol->SetLineColor(kGreen);
2151 graphtubVol->SetFillColor(graphtubVol->GetLineColor());
2152 graphtubVol->SetFillStyle(4000);
2154 auto* fleeclatVol =
new TGeoVolume(
"CarbonFleeceLateral", fleeclat, medCarbonFleece);
2155 fleeclatVol->SetLineColor(kViolet);
2156 fleeclatVol->SetFillColor(fleeclatVol->GetLineColor());
2157 fleeclatVol->SetFillStyle(4000);
2159 auto* fleecmidVol =
new TGeoVolume(
"CarbonFleeceMiddle", fleecmid, medCarbonFleece);
2160 fleecmidVol->SetLineColor(kViolet);
2161 fleecmidVol->SetFillColor(fleecmidVol->GetLineColor());
2162 fleecmidVol->SetFillStyle(4000);
2164 auto* fleecvertVol =
new TGeoVolume(
"CarbonFleeceVertical", fleecvert, medCarbonFleece);
2165 fleecvertVol->SetLineColor(kViolet);
2166 fleecvertVol->SetFillColor(fleecvertVol->GetLineColor());
2167 fleecvertVol->SetFillStyle(4000);
2169 auto* fleectubVol =
new TGeoVolume(
"CarbonFleecePipeCover", fleectub, medCarbonFleece);
2170 fleectubVol->SetLineColor(kViolet);
2171 fleectubVol->SetFillColor(fleectubVol->GetLineColor());
2172 fleectubVol->SetFillStyle(4000);
2175 auto* halmStaveVol =
new TGeoVolume(volumeName, halmStave, medAir);
2180 auto* flex1_5cmVol =
new TGeoVolume(
"Flex1Vol5cm", flex1_5cm, medAluminum);
2181 auto* flex2_5cmVol =
new TGeoVolume(
"Flex2Vol5cm", flex2_5cm, medKapton);
2183 flex1_5cmVol->SetLineColor(kRed);
2184 flex2_5cmVol->SetLineColor(kGreen);
2187 ypos = -busKap->GetDY();
2188 halmStaveVol->AddNode(busKapVol, 1,
new TGeoTranslation(0, ypos, 0));
2190 ypos -= (busKap->GetDY() + busAl->GetDY());
2191 halmStaveVol->AddNode(busAlVol, 1,
new TGeoTranslation(0, ypos, 0));
2193 ypos -= (busAl->GetDY() + ymod);
2194 for (Int_t
j = 0;
j < mNumberOfModules;
j++) {
2195 zpos = -zlen +
j * (2 * zmod + sOBModuleGap) + zmod;
2196 halmStaveVol->AddNode(moduleVol,
j,
new TGeoTranslation(0, ypos, zpos));
2200 ypos -= (ymod + coldPlate->GetDY());
2201 halmStaveVol->AddNode(coldPlateVol, 1,
new TGeoTranslation(0, ypos, 0));
2203 coolTubeVol->AddNode(coolWaterVol, 1,
nullptr);
2205 xpos = sOBCoolTubeXDist / 2;
2206 ypos1 = ypos - (coldPlate->GetDY() + coolTube->GetRmax());
2207 halmStaveVol->AddNode(coolTubeVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2208 halmStaveVol->AddNode(coolTubeVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2210 halmStaveVol->AddNode(graphtubVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2211 halmStaveVol->AddNode(graphtubVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2213 halmStaveVol->AddNode(fleectubVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2214 halmStaveVol->AddNode(fleectubVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2216 xpos = xHalmSt - graphlat->GetDX();
2217 ypos1 = ypos - (coldPlate->GetDY() + graphlat->GetDY());
2218 halmStaveVol->AddNode(graphlatVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2219 halmStaveVol->AddNode(graphlatVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2221 halmStaveVol->AddNode(graphmidVol, 1,
new TGeoTranslation(0, ypos1, 0));
2223 xpos = xHalmSt - 2 * graphlat->GetDX() + graphvert->GetDX();
2224 ypos1 = ypos - (coldPlate->GetDY() + 2 * graphlat->GetDY() + graphvert->GetDY());
2225 halmStaveVol->AddNode(graphvertVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2226 halmStaveVol->AddNode(graphvertVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2227 xpos = graphmid->GetDX() - graphvert->GetDX();
2228 halmStaveVol->AddNode(graphvertVol, 3,
new TGeoTranslation(-xpos, ypos1, 0));
2229 halmStaveVol->AddNode(graphvertVol, 4,
new TGeoTranslation(xpos, ypos1, 0));
2231 xpos = xHalmSt - fleeclat->GetDX();
2232 ypos1 = ypos - (coldPlate->GetDY() + 2 * graphlat->GetDY() + fleeclat->GetDY());
2233 halmStaveVol->AddNode(fleeclatVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2234 halmStaveVol->AddNode(fleeclatVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2236 halmStaveVol->AddNode(fleecmidVol, 1,
new TGeoTranslation(0, ypos1, 0));
2238 xpos = xHalmSt - 2 * fleeclat->GetDX() + fleecvert->GetDX();
2240 (coldPlate->GetDY() + 2 * graphlat->GetDY() + 2 * fleeclat->GetDY() + fleecvert->GetDY());
2241 halmStaveVol->AddNode(fleecvertVol, 1,
new TGeoTranslation(-xpos, ypos1, 0));
2242 halmStaveVol->AddNode(fleecvertVol, 2,
new TGeoTranslation(xpos, ypos1, 0));
2243 xpos = fleecmid->GetDX() - fleecvert->GetDX();
2244 halmStaveVol->AddNode(fleecvertVol, 3,
new TGeoTranslation(-xpos, ypos1, 0));
2245 halmStaveVol->AddNode(fleecvertVol, 4,
new TGeoTranslation(xpos, ypos1, 0));
2288 return halmStaveVol;
2291TGeoVolume* V1Layer::createSpaceFrameOuterB(
const TGeoManager* mgr)
2293 TGeoVolume* mechStavVol =
nullptr;
2295 switch (mStaveModel) {
2298 mechStavVol = createSpaceFrameOuterBDummy(mgr);
2301 mechStavVol = createSpaceFrameOuterB1(mgr);
2304 LOG(fatal) <<
"Unknown stave model " << mStaveModel;
2311TGeoVolume* V1Layer::createSpaceFrameOuterBDummy(
const TGeoManager*)
const
2317TGeoVolume* V1Layer::createSpaceFrameOuterB1(
const TGeoManager* mgr)
2320 TGeoMedium* medCarbon = mgr->GetMedium(Form(
"%s_CARBON$",
GetDetName()));
2321 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
2324 Double_t sframeWidth = sOBSpaceFrameWidth;
2325 Double_t sframeHeight = sOBSpaceFrameTotHigh - sOBHalfStaveYTrans;
2326 Double_t staveBeamRadius = sOBSFrameBeamRadius;
2327 Double_t staveLa = sOBSpaceFrameLa;
2328 Double_t staveHa = sOBSpaceFrameHa;
2329 Double_t staveLb = sOBSpaceFrameLb;
2330 Double_t staveHb = sOBSpaceFrameHb;
2331 Double_t stavel = sOBSpaceFrameL;
2332 Double_t bottomBeamAngle = sOBSFBotBeamAngle;
2333 Double_t triangleHeight = sframeHeight - staveBeamRadius;
2334 Double_t halmTheta = TMath::ATan(0.5 * sframeWidth / triangleHeight);
2336 Double_t beta = (TMath::Pi() - 2. * halmTheta) / 4.;
2340 Double_t xpos, ypos, zpos;
2342 char volumeName[30];
2344 zlen = mNumberOfModules * sOBModuleZLength + (mNumberOfModules - 1) * sOBModuleGap;
2347 if (gGeoManager->GetVolume(volumeName)) {
2348 sframeHeight -= ((TGeoBBox*)gGeoManager->GetVolume(volumeName)->GetShape())->GetDY() * 2;
2349 zlen = ((TGeoBBox*)gGeoManager->GetVolume(volumeName)->GetShape())->GetDZ() * 2;
2351 seglen = zlen / mNumberOfModules;
2354 auto* spaceFrame =
new TGeoBBox(sframeWidth / 2, sframeHeight / 2, zlen / 2);
2355 auto*
segment =
new TGeoBBox(sframeWidth / 2, sframeHeight / 2, seglen / 2);
2357 auto* spaceFrameVol =
new TGeoVolume(
"CarbonFrameVolume", spaceFrame, medAir);
2358 spaceFrameVol->SetVisibility(kFALSE);
2360 auto* segmentVol =
new TGeoVolume(
"segmentVol",
segment, medAir);
2365 TGeoArb8* cmStavTop1 = createStaveSide(
"CFstavTopCornerVol1shape", seglen / 2., halmTheta, -1,
2366 staveLa, staveHa, stavel);
2367 auto* cmStavTopVol1 =
new TGeoVolume(
"CFstavTopCornerVol1", cmStavTop1, medCarbon);
2368 cmStavTopVol1->SetLineColor(35);
2370 TGeoArb8* cmStavTop2 = createStaveSide(
"CFstavTopCornerVol2shape", seglen / 2., halmTheta, 1,
2371 staveLa, staveHa, stavel);
2372 auto* cmStavTopVol2 =
new TGeoVolume(
"CFstavTopCornerVol2", cmStavTop2, medCarbon);
2373 cmStavTopVol2->SetLineColor(35);
2375 auto* trTop1 =
new TGeoTranslation(0, sframeHeight / 2, 0);
2378 TGeoArb8* cmStavSide1 =
2379 createStaveSide(
"CFstavSideCornerVol1shape", seglen / 2., beta, -1, staveLb, staveHb, stavel);
2380 auto* cmStavSideVol1 =
new TGeoVolume(
"CFstavSideCornerVol1", cmStavSide1, medCarbon);
2381 cmStavSideVol1->SetLineColor(35);
2383 TGeoArb8* cmStavSide2 =
2384 createStaveSide(
"CFstavSideCornerVol2shape", seglen / 2., beta, 1, staveLb, staveHb, stavel);
2385 auto* cmStavSideVol2 =
new TGeoVolume(
"CFstavSideCornerVol2", cmStavSide2, medCarbon);
2386 cmStavSideVol2->SetLineColor(35);
2388 xpos = -sframeWidth / 2;
2389 ypos = -sframeHeight / 2 + staveBeamRadius + staveHb * TMath::Sin(beta);
2390 auto* ctSideR =
new TGeoCombiTrans(
2391 xpos, ypos, 0,
new TGeoRotation(
"", 180 - 2 * beta * TMath::RadToDeg(), 0, 0));
2392 auto* ctSideL =
new TGeoCombiTrans(
2393 -xpos, ypos, 0,
new TGeoRotation(
"", -180 + 2 * beta * TMath::RadToDeg(), 0, 0));
2395 segmentVol->AddNode(cmStavTopVol1, 1, trTop1);
2396 segmentVol->AddNode(cmStavTopVol2, 1, trTop1);
2397 segmentVol->AddNode(cmStavSideVol1, 1, ctSideR);
2398 segmentVol->AddNode(cmStavSideVol1, 2, ctSideL);
2399 segmentVol->AddNode(cmStavSideVol2, 1, ctSideR);
2400 segmentVol->AddNode(cmStavSideVol2, 2, ctSideL);
2404 Double_t beamPhiPrime = TMath::ASin(
2405 1. / TMath::Sqrt((1 + TMath::Sin(2 * beta) * TMath::Sin(2 * beta) /
2406 (
tanD(sOBSFrameBeamSidePhi) *
tanD(sOBSFrameBeamSidePhi)))));
2407 Double_t beamLength = TMath::Sqrt(sframeHeight * sframeHeight /
2408 (TMath::Sin(beamPhiPrime) * TMath::Sin(beamPhiPrime)) +
2409 sframeWidth * sframeWidth / 4.) -
2410 staveLa / 2 - staveLb / 2;
2411 auto* sideBeam =
new TGeoTubeSeg(0, staveBeamRadius, beamLength / 2, 0, 180);
2412 auto* sideBeamVol =
new TGeoVolume(
"CFstavSideBeamVol", sideBeam, medCarbon);
2413 sideBeamVol->SetLineColor(35);
2415 auto* beamRot1 =
new TGeoRotation(
"", halmTheta * TMath::RadToDeg(),
2416 -beamPhiPrime * TMath::RadToDeg(), -90);
2418 new TGeoRotation(
"", 90 - 2. * beta * TMath::RadToDeg(), beamPhiPrime * TMath::RadToDeg(), -90);
2420 new TGeoRotation(
"", 90 + 2. * beta * TMath::RadToDeg(), beamPhiPrime * TMath::RadToDeg(), -90);
2421 auto* beamRot4 =
new TGeoRotation(
"", 90 + 2. * beta * TMath::RadToDeg(),
2422 -beamPhiPrime * TMath::RadToDeg(), -90);
2424 TGeoCombiTrans* beamTransf[8];
2425 xpos = 0.49 * triangleHeight * TMath::Tan(halmTheta);
2426 ypos = staveBeamRadius / 2;
2428 beamTransf[0] =
new TGeoCombiTrans(xpos, ypos, -3 * zpos, beamRot1);
2430 beamTransf[1] =
new TGeoCombiTrans(xpos, ypos, -3 * zpos, beamRot1);
2431 addTranslationToCombiTrans(beamTransf[1], 0, 0, seglen / 2);
2433 beamTransf[2] =
new TGeoCombiTrans(xpos, ypos, -zpos, beamRot2);
2435 beamTransf[3] =
new TGeoCombiTrans(xpos, ypos, -zpos, beamRot2);
2436 addTranslationToCombiTrans(beamTransf[3], 0, 0, seglen / 2);
2438 beamTransf[4] =
new TGeoCombiTrans(-xpos, ypos, -3 * zpos, beamRot3);
2440 beamTransf[5] =
new TGeoCombiTrans(-xpos, ypos, -3 * zpos, beamRot3);
2441 addTranslationToCombiTrans(beamTransf[5], 0, 0, seglen / 2);
2443 beamTransf[6] =
new TGeoCombiTrans(-xpos, ypos, -zpos, beamRot4);
2444 beamTransf[7] =
new TGeoCombiTrans(-xpos, ypos, 3 * zpos, beamRot4);
2448 new TGeoTubeSeg(0, staveBeamRadius, sframeWidth / 2. - staveLb / 3, 0, 180);
2449 auto* bottomBeam1Vol =
new TGeoVolume(
"CFstavBottomBeam1Vol", bottomBeam1, medCarbon);
2450 bottomBeam1Vol->SetLineColor(35);
2453 new TGeoTubeSeg(0, staveBeamRadius, sframeWidth / 2. - staveLb / 3, 0, 90);
2454 auto* bottomBeam2Vol =
new TGeoVolume(
"CFstavBottomBeam2Vol", bottomBeam2, medCarbon);
2455 bottomBeam2Vol->SetLineColor(35);
2457 auto* bottomBeam3 =
new TGeoTubeSeg(
2458 0, staveBeamRadius, 0.5 * sframeWidth /
sinD(bottomBeamAngle) - staveLb / 3, 0, 180);
2459 auto* bottomBeam3Vol =
new TGeoVolume(
"CFstavBottomBeam3Vol", bottomBeam3, medCarbon);
2460 bottomBeam3Vol->SetLineColor(35);
2462 auto* bottomBeamRot1 =
new TGeoRotation(
"", 90, 90, 90);
2463 auto* bottomBeamRot2 =
new TGeoRotation(
"", -90, 90, -90);
2465 auto* bottomBeamTransf1 =
2466 new TGeoCombiTrans(
"", 0, -(sframeHeight / 2 - staveBeamRadius), 0, bottomBeamRot1);
2467 auto* bottomBeamTransf2 =
2468 new TGeoCombiTrans(0, -(sframeHeight / 2 - staveBeamRadius), -seglen / 2, bottomBeamRot1);
2469 auto* bottomBeamTransf3 =
2470 new TGeoCombiTrans(0, -(sframeHeight / 2 - staveBeamRadius), seglen / 2, bottomBeamRot2);
2473 auto* bottomBeamRot4 =
new TGeoRotation(
"", -90, bottomBeamAngle, -90);
2474 auto* bottomBeamRot5 =
new TGeoRotation(
"", -90, -bottomBeamAngle, -90);
2476 auto* bottomBeamTransf4 =
2477 new TGeoCombiTrans(0, -(sframeHeight / 2 - staveBeamRadius), -seglen / 4, bottomBeamRot4);
2478 auto* bottomBeamTransf5 =
2479 new TGeoCombiTrans(0, -(sframeHeight / 2 - staveBeamRadius), seglen / 4, bottomBeamRot5);
2481 segmentVol->AddNode(sideBeamVol, 1, beamTransf[0]);
2482 segmentVol->AddNode(sideBeamVol, 2, beamTransf[1]);
2483 segmentVol->AddNode(sideBeamVol, 3, beamTransf[2]);
2484 segmentVol->AddNode(sideBeamVol, 4, beamTransf[3]);
2485 segmentVol->AddNode(sideBeamVol, 5, beamTransf[4]);
2486 segmentVol->AddNode(sideBeamVol, 6, beamTransf[5]);
2487 segmentVol->AddNode(sideBeamVol, 7, beamTransf[6]);
2488 segmentVol->AddNode(sideBeamVol, 8, beamTransf[7]);
2489 segmentVol->AddNode(bottomBeam1Vol, 1, bottomBeamTransf1);
2490 segmentVol->AddNode(bottomBeam2Vol, 1, bottomBeamTransf2);
2491 segmentVol->AddNode(bottomBeam2Vol, 2, bottomBeamTransf3);
2492 segmentVol->AddNode(bottomBeam3Vol, 1, bottomBeamTransf4);
2493 segmentVol->AddNode(bottomBeam3Vol, 2, bottomBeamTransf5);
2496 for (Int_t
i = 0;
i < mNumberOfModules;
i++) {
2497 zpos = -spaceFrame->GetDZ() + (1 + 2 *
i) *
segment->GetDZ();
2498 spaceFrameVol->AddNode(segmentVol,
i,
new TGeoTranslation(0, 0, zpos));
2502 return spaceFrameVol;
2505TGeoVolume* V1Layer::createChipInnerB(
const Double_t xchip,
const Double_t ychip,
2506 const Double_t zchip,
const TGeoManager* mgr)
2508 char volumeName[30];
2509 Double_t xlen, ylen, zlen;
2510 Double_t xpos, ypos, zpos;
2515 auto* chip =
new TGeoBBox(xchip, ychip, zchip);
2518 xlen = chip->GetDX();
2519 ylen = 0.5 * mSensorThickness;
2520 zlen = chip->GetDZ();
2521 auto* sensor =
new TGeoBBox(xlen, ylen, zlen);
2524 TGeoMedium* medSi = mgr->GetMedium(Form(
"%s_SI$",
GetDetName()));
2527 auto* chipVol =
new TGeoVolume(volumeName, chip, medSi);
2528 chipVol->SetVisibility(kTRUE);
2529 chipVol->SetLineColor(1);
2532 auto* sensVol =
new TGeoVolume(volumeName, sensor, medSi);
2533 sensVol->SetVisibility(kTRUE);
2534 sensVol->SetLineColor(8);
2535 sensVol->SetLineWidth(1);
2536 sensVol->SetFillColor(sensVol->GetLineColor());
2537 sensVol->SetFillStyle(4000);
2541 ypos = -chip->GetDY() + sensor->GetDY();
2544 chipVol->AddNode(sensVol, 1,
new TGeoTranslation(xpos, ypos, zpos));
2550TGeoVolume* V1Layer::createModuleOuterB(
const TGeoManager* mgr)
2552 char volumeName[30];
2554 Double_t xGap = sOBChipXGap;
2555 Double_t zGap = sOBChipZGap;
2557 Double_t xchip, ychip, zchip;
2558 Double_t xlen, ylen, zlen;
2559 Double_t xpos, ypos, zpos;
2564 xlen = (sOBHalfStaveWidth / 2 - xGap / 2) / sOBNChipRows;
2565 ylen = 0.5 * mStaveThickness;
2566 zlen = (sOBModuleZLength - (sOBChipsPerRow - 1) * zGap) / (2 * sOBChipsPerRow);
2568 TGeoVolume* chipVol = createChipInnerB(xlen, ylen, zlen);
2570 xchip = ((TGeoBBox*)chipVol->GetShape())->GetDX();
2571 ychip = ((TGeoBBox*)chipVol->GetShape())->GetDY();
2572 zchip = ((TGeoBBox*)chipVol->GetShape())->GetDZ();
2575 xlen = sOBHalfStaveWidth / 2;
2576 ylen = sOBCarbonPlateThick / 2;
2577 zlen = sOBModuleZLength / 2;
2578 auto* modPlate =
new TGeoBBox(
"CarbonPlate", xlen, ylen, zlen);
2581 ylen = sOBGlueThick / 2;
2582 auto* glue =
new TGeoBBox(
"Glue", xlen, ylen, zlen);
2585 ylen = sOBFlexCableAlThick / 2;
2586 auto* flexAl =
new TGeoBBox(
"FlexAl", xlen, ylen, zlen);
2588 ylen = sOBFlexCableKapThick / 2;
2589 auto* flexKap =
new TGeoBBox(
"FlexKap", xlen, ylen, zlen);
2592 xlen = sOBHalfStaveWidth / 2;
2593 ylen = ychip + modPlate->GetDY() + glue->GetDY() + flexAl->GetDY() + flexKap->GetDY();
2594 zlen = sOBModuleZLength / 2;
2595 auto*
module = new TGeoBBox("OBModule", xlen, ylen, zlen);
2599 TGeoMedium* medAir = mgr->GetMedium(Form(
"%s_AIR$",
GetDetName()));
2600 TGeoMedium* medCarbon = mgr->GetMedium(Form(
"%s_CARBON$",
GetDetName()));
2601 TGeoMedium* medGlue = mgr->GetMedium(Form(
"%s_GLUE$",
GetDetName()));
2602 TGeoMedium* medAluminum = mgr->GetMedium(Form(
"%s_ALUMINUM$",
GetDetName()));
2603 TGeoMedium* medKapton = mgr->GetMedium(Form(
"%s_KAPTON(POLYCH2)$",
GetDetName()));
2605 auto* modPlateVol =
new TGeoVolume(
"CarbonPlateVol", modPlate, medCarbon);
2606 modPlateVol->SetLineColor(kMagenta - 8);
2607 modPlateVol->SetFillColor(modPlateVol->GetLineColor());
2608 modPlateVol->SetFillStyle(4000);
2610 auto* glueVol =
new TGeoVolume(
"GlueVol", glue, medGlue);
2611 glueVol->SetLineColor(kBlack);
2612 glueVol->SetFillColor(glueVol->GetLineColor());
2613 glueVol->SetFillStyle(4000);
2615 auto* flexAlVol =
new TGeoVolume(
"FlexAlVol", flexAl, medAluminum);
2616 flexAlVol->SetLineColor(kRed);
2617 flexAlVol->SetFillColor(flexAlVol->GetLineColor());
2618 flexAlVol->SetFillStyle(4000);
2620 auto* flexKapVol =
new TGeoVolume(
"FlexKapVol", flexKap, medKapton);
2621 flexKapVol->SetLineColor(kGreen);
2622 flexKapVol->SetFillColor(flexKapVol->GetLineColor());
2623 flexKapVol->SetFillStyle(4000);
2626 auto* modVol =
new TGeoVolume(volumeName, module, medAir);
2627 modVol->SetVisibility(kTRUE);
2630 ypos = -
module->GetDY() + modPlate->GetDY();
2631 modVol->AddNode(modPlateVol, 1,
new TGeoTranslation(0, ypos, 0));
2633 ypos += (modPlate->GetDY() + glue->GetDY());
2634 modVol->AddNode(glueVol, 1,
new TGeoTranslation(0, ypos, 0));
2636 xpos = -
module->GetDX() + xchip;
2637 ypos += (glue->GetDY() + ychip);
2638 for (Int_t k = 0; k < sOBChipsPerRow; k++) {
2639 zpos = -
module->GetDZ() + zchip + k * (2 * zchip + zGap);
2640 modVol->AddNode(chipVol, 2 * k,
new TGeoTranslation(xpos, ypos, zpos));
2641 modVol->AddNode(chipVol, 2 * k + 1,
2642 new TGeoCombiTrans(-xpos, ypos, zpos,
new TGeoRotation(
"", 0, 180, 180)));
2643 mHierarchy[
kChip] += 2;
2646 ypos += (ychip + flexAl->GetDY());
2647 modVol->AddNode(flexAlVol, 1,
new TGeoTranslation(0, ypos, 0));
2649 ypos += (flexAl->GetDY() + flexKap->GetDY());
2650 modVol->AddNode(flexKapVol, 1,
new TGeoTranslation(0, ypos, 0));
2656Double_t V1Layer::radiusOmTurboContainer()
2658 Double_t
rr, delta,
z, lstav, rstav;
2660 if (mStaveThickness > 89.) {
2664 rstav = mLayerRadius + 0.5 * mStaveThickness;
2665 delta = (0.5 * mStaveThickness) /
cosD(mStaveTilt);
2666 z = (0.5 * mStaveThickness) *
tanD(mStaveTilt);
2669 lstav = (0.5 * mStaveWidth) -
z;
2671 if ((
rr *
sinD(mStaveTilt) < lstav)) {
2672 return (
rr *
cosD(mStaveTilt));
2680 if (mLayerNumber < sNumberOmInnerLayers) {
2683 mNumberOfModules = u;
2684 mNumberOfChips = sOBChipsPerRow;
2693 LOG(error) <<
"Not a Turbo layer";
2702 LOG(error) <<
"Not a Turbo layer";
2706TGeoArb8* V1Layer::createStaveSide(
const char*
name, Double_t dz, Double_t
angle,
2707 Double_t xSign, Double_t L, Double_t H, Double_t l)
2711 auto* cmStavSide =
new TGeoArb8(dz);
2712 cmStavSide->SetName(
name);
2715 cmStavSide->SetVertex(0, 0, 0);
2716 cmStavSide->SetVertex(2, xSign * (L * TMath::Sin(
angle) - l * TMath::Cos(
angle)),
2717 -L * TMath::Cos(
angle) - l * TMath::Sin(
angle));
2718 cmStavSide->SetVertex(4, 0, 0);
2719 cmStavSide->SetVertex(6, xSign * (L * TMath::Sin(
angle) - l * TMath::Cos(
angle)),
2720 -L * TMath::Cos(
angle) - l * TMath::Sin(
angle));
2722 cmStavSide->SetVertex(1, 0, -H);
2723 cmStavSide->SetVertex(3, xSign * L * TMath::Sin(
angle), -L * TMath::Cos(
angle));
2724 cmStavSide->SetVertex(5, 0, -H);
2725 cmStavSide->SetVertex(7, xSign * L * TMath::Sin(
angle), -L * TMath::Cos(
angle));
2727 cmStavSide->SetVertex(1, xSign * L * TMath::Sin(
angle), -L * TMath::Cos(
angle));
2728 cmStavSide->SetVertex(3, 0, -H);
2729 cmStavSide->SetVertex(5, xSign * L * TMath::Sin(
angle), -L * TMath::Cos(
angle));
2730 cmStavSide->SetVertex(7, 0, -H);
2735TGeoCombiTrans* V1Layer::createCombiTrans(
const char*
name, Double_t dy, Double_t dz,
2736 Double_t dphi, Bool_t planeSym)
2738 TGeoTranslation
t1(dy *
cosD(90. + dphi), dy *
sinD(90. + dphi), dz);
2739 TGeoRotation r1(
"", 0., 0., dphi);
2740 TGeoRotation r2(
"", 90, 180, -90 - dphi);
2742 auto* combiTrans1 =
new TGeoCombiTrans(
name);
2743 combiTrans1->SetTranslation(
t1);
2745 combiTrans1->SetRotation(r1);
2747 combiTrans1->SetRotation(r2);
2752void V1Layer::addTranslationToCombiTrans(TGeoCombiTrans* ct, Double_t dx, Double_t dy,
2756 const Double_t*
vect = ct->GetTranslation();
2757 Double_t newVect[3] = {
vect[0] + dx,
vect[1] + dy,
vect[2] + dz};
2758 ct->SetTranslation(newVect);
Definition of the GeometryTGeo class.
Class for time synchronization of RawReader instances.
static const char * getITSLayerPattern()
static const char * getITSSensorPattern()
static const char * getITSChipPattern()
static const char * getITSModulePattern()
static const char * getITSHalfStavePattern()
static const char * getITSStavePattern()
Double_t cosD(Double_t deg) const
Cosine function.
const char * GetDetName() const
Get detector name.
Double_t sinD(Double_t deg) const
Double_t tanD(Double_t deg) const
Tangent function.
void setStaveTilt(Double_t t)
void setNumberOfUnits(Int_t u)
virtual void createLayer(TGeoVolume *motherVolume)
~V1Layer() override
Default destructor.
V1Layer & operator=(const V1Layer &source)
Assignment operator.
void setStaveWidth(Double_t w)
GLfloat GLfloat GLfloat alpha
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLuint const GLchar * name
GLubyte GLubyte GLubyte GLubyte w
GLdouble GLdouble GLdouble z
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
value_T gpu::gpustd::array< value_T, 7 > & vect
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"