12 #include <MapsGeoParData.h>
18 #include <TGeoTorus.h>
19 #include <TGeoCompositeShape.h>
22 #include <MapsGeoParData.h>
23 #include <MapsMimosaAssembly.h>
30 mMountingRingBeamLineThickness ( 5.00 * etm::
mm),
31 mMountingRingRadialThickness ( 5.00 * etm::
mm),
32 mWaterPipeExtensionLength ( 4.00 * etm::
mm),
33 mEnforcementBracketThickness ( 1.00 * etm::
mm),
34 mUseTriangularAssemblies (
true),
35 mWithMountingRings (
false),
36 mWithEnforcementBrackets (
false),
37 mWithExternalPipes (
false),
38 mCarbonFiberMaterial (
"MapsCarbonFiber"),
39 mKaptonMaterial (
"MapsKapton")
56 char flexName[128], aluStripName[128], flatRoofName[128], roofSideBeamName[128];
57 char waterPipeName[128], waterName[128], apexEnforcementBeamName[128];
58 char coldPlateName[128], sideWallName[128], baseEnforcementBeamName[128];
60 snprintf(flexName, 128-1,
"%sCellFlexLayer%02d", detName,
id);
61 snprintf(aluStripName, 128-1,
"%sAluStrips%02d", detName,
id);
62 snprintf(coldPlateName, 128-1,
"%sColdPlate%02d", detName,
id);
65 snprintf(waterPipeName, 128-1,
"%sWaterPipe%02d", detName,
id);
66 snprintf(waterName, 128-1,
"%sWater%02d", detName,
id);
67 snprintf(apexEnforcementBeamName, 128-1,
"%sEnforcementBeamApex%02d", detName,
id);
68 snprintf(baseEnforcementBeamName, 128-1,
"%sEnforcementBeamBase%02d", detName,
id);
69 snprintf(sideWallName, 128-1,
"%sSideWall%02d", detName,
id);
70 snprintf(flatRoofName, 128-1,
"%sFlatRoof%02d", detName,
id);
71 snprintf(roofSideBeamName, 128-1,
"%sRoofSideBeam%02d", detName,
id);
91 char tmp1Name[128], tmp2Name[128];
93 snprintf(tmp1Name, 128-1,
"%sTmp1Volume%02d", detName,
id);
94 snprintf(tmp2Name, 128-1,
"%sTmp2Volume%02d", detName,
id);
103 #if _DISABLED_ANYWAY_
104 TGeoTrd1 *
tmp1 =
new TGeoTrd1(tmp1Name,
109 TGeoBBox *
tmp2 =
new TGeoBBox(tmp2Name,
114 TGeoCompositeShape *cs =
new TGeoCompositeShape(
mCellAssemblyName, TString(tmp1Name) +
"*" + TString(tmp2Name));
120 double aluThickness = 0.0, kaptonThickness = 0.0, carbonThickness = 0.0, waterThickness = 0.0;
137 TGeoBBox *flex =
new TGeoBBox(flexName,
156 TGeoBBox *alu =
new TGeoBBox(aluStripName,
177 vcell->AddNode(vmimosa, 0,
new TGeoCombiTrans(0.0, 0.0, (zOffset + mcell->
mChipThickness/2), 0));
192 vmimosa->AddNode(vmicore, 0,
new TGeoCombiTrans((-mcell->
mChipDeadAreaWidth/2), 0.0, 0.0, 0));
201 TGeoBBox *cold =
new TGeoBBox(coldPlateName,
207 vcell->AddNode(vcold, 0,
new TGeoCombiTrans(0.0, 0.0, (zOffset + mcell->
mColdPlateThickness/2), 0));
220 double effectiveWaterThickness =
225 waterThickness += 2*effectiveWaterThickness;
227 double effectiveKaptonThickness =
228 (TMath::Pi()*(waterPipeOuterDiameter * waterPipeOuterDiameter)/4.)/
231 kaptonThickness += 2*(effectiveKaptonThickness - effectiveWaterThickness);
234 TGeoTube *wpipe =
new TGeoTube(waterPipeName,
236 waterPipeOuterDiameter/2,
241 TGeoTube *water =
new TGeoTube(waterName,
247 TGeoRotation *
rw =
new TGeoRotation();
254 for(
unsigned lr=0; lr<2; lr++) {
257 vcell->AddNode(vwpipe, lr,
new TGeoCombiTrans(xOffset, 0.0,
mWaterPipeZoffset, rw));
258 vcell->AddNode(vwater, lr,
new TGeoCombiTrans(xOffset, 0.0,
mWaterPipeZoffset, rw));
280 TGeoTube *abeam =
new TGeoTube(apexEnforcementBeamName,
286 TGeoRotation *rw =
new TGeoRotation();
290 double hOffset = zOffset +
292 vcell->AddNode(vabeam, 0,
new TGeoCombiTrans(0.0, 0.0, hOffset, rw));
299 double vert[8][2] = {
311 TGeoArb8 *bbeam =
new TGeoArb8(baseEnforcementBeamName, baseBeamHeight/2, (
double*)vert);
314 double hOffset = zOffset + baseBeamHeight/2;
316 for(
unsigned lr=0; lr<2; lr++) {
319 TGeoRotation *rw =
new TGeoRotation();
320 if (lr) rw->RotateZ(180);
322 vcell->AddNode(vbbeam, lr,
new TGeoCombiTrans(xOffset, 0.0, hOffset, rw));
337 double slotHeight = sideWallWidth;
339 double radSlope = atan(slotWidth/slotHeight);
340 double degSlope = radSlope*180./TMath::Pi();
342 double beamLength = sqrt(slotWidth*slotWidth + slotHeight*slotHeight) -
345 double fullThickness;
358 TGeoBBox *side =
new TGeoBBox(sideWallName,
370 TGeoBBox *flat =
new TGeoBBox(flatRoofName,
382 TGeoBBox *
beam =
new TGeoBBox(roofSideBeamName,
388 for(
unsigned iq=0; iq<4; iq++) {
391 TGeoRotation *rw =
new TGeoRotation();
392 rw->RotateZ((iq%2 ? -1. : 1.)*degSlope);
395 vside->AddNode(vbeam, iq,
new TGeoCombiTrans(0.0, qOffset, -mcell->
mSideWallThickness/2, rw));
402 double hOffset = zOffset + (fullThickness/2)*
cos(radangle) + (sideWallWidth/2)*sin(radangle);
404 for(
unsigned lr=0; lr<2; lr++) {
406 (fullThickness/2)*sin(radangle) -
407 (sideWallWidth/2)*
cos(radangle));
409 TGeoRotation *rw =
new TGeoRotation();
415 vcell->AddNode(vside, lr,
new TGeoCombiTrans(xOffset, 0.0, hOffset, rw));
429 double aluRadLen, kaptonRadLen, carbonRadLen, waterRadLen;
436 waterRadLen = waterThickness /
GetMedium(
_WATER_)->GetMaterial()->GetRadLen();
440 double equivalentCarbonThickness = (aluRadLen + kaptonRadLen + carbonRadLen + waterRadLen)*
449 double equivalentFlexThickness =
450 equivalentCarbonThickness < offsetFromBottomSide ? equivalentCarbonThickness : offsetFromBottomSide;
452 TGeoBBox *flex =
new TGeoBBox(flexName,
455 equivalentFlexThickness/2);
458 vcell->AddNode(vflex, 0,
new TGeoCombiTrans(0.0, 0.0, (equivalentFlexThickness -
mAssemblyHeight)/2, 0));
460 double equivalentColdThickness = equivalentCarbonThickness - equivalentFlexThickness;
462 if (equivalentColdThickness > 0.0) {
464 TGeoBBox *cold =
new TGeoBBox(coldPlateName,
467 equivalentColdThickness/2);
472 vcell->AddNode(vcold, 0,
new TGeoCombiTrans(0.0, 0.0, (zOffset + equivalentColdThickness/2), 0));
489 char staveName[128], waterPipeName[128], waterName[128];
490 char bracketName[128], waterTorusPipeName[128], waterTorusName[128];
492 snprintf(staveName, 128-1,
"%sStave%02d", detName,
id);
493 snprintf(bracketName, 128-1,
"%sStaveBracket%02d", detName,
id);
494 snprintf(waterTorusPipeName, 128-1,
"%sStaveWaterPipeTorus%02d", detName,
id);
495 snprintf(waterTorusName, 128-1,
"%sStaveWaterTorus%02d", detName,
id);
496 snprintf(waterPipeName, 128-1,
"%sStaveWaterPipe%02d", detName,
id);
497 snprintf(waterName, 128-1,
"%sStaveWater%02d", detName,
id);
512 TGeoTrd1 *qstave =
new TGeoTrd1(staveName,
520 char tmp1Name[128], tmp2Name[128];
522 snprintf(tmp1Name, 128-1,
"%sTmp1Volume%02d", detName,
id);
523 snprintf(tmp2Name, 128-1,
"%sTmp2Volume%02d", detName,
id);
528 #if _DISABLED_ANYWAY_
529 TGeoTrd1 *tmp1 =
new TGeoTrd1(tmp1Name,
534 TGeoBBox *tmp2 =
new TGeoBBox(tmp2Name,
539 TGeoCompositeShape *cs =
new TGeoCompositeShape(staveName, TString(tmp1Name) +
"*" + TString(tmp2Name));
546 for(
unsigned nn=0; nn<chipNum; nn++) {
549 stave->
mVolume->AddNode(vcell, nn,
new TGeoCombiTrans(0.0, yOffset, 0.0, 0));
554 TGeoTrd1 *bracket =
new TGeoTrd1(bracketName,
561 for(
unsigned ud=0; ud<2; ud++) {
564 stave->
mVolume->AddNode(vbracket, ud,
new TGeoCombiTrans(0.0, yOffset, 0.0, 0));
574 TGeoTube *wpipe =
new TGeoTube(waterPipeName,
576 waterPipeOuterDiameter/2,
581 TGeoTube *water =
new TGeoTube(waterName,
587 TGeoRotation *rw =
new TGeoRotation();
590 for(
unsigned lr=0; lr<2; lr++) {
601 TGeoTorus *wtpipe =
new TGeoTorus(waterTorusPipeName,
604 waterPipeOuterDiameter/2,
610 TGeoTorus *twater =
new TGeoTorus(waterTorusName,
615 TGeoVolume *vtwater =
new TGeoVolume(waterTorusName, twater,
GetMedium(
_WATER_));
650 for(
unsigned nn=0; nn<chipNum; nn++) {
651 UInt_t geant[4] = {0, 0, nn, 0}, logical[1] = {nn};
654 cout <<
"Failed to set mapping table entry!" << endl;