11 #include <TGeoVolume.h>
12 #include <TGeoMatrix.h>
18 #include <GemGeoParData.h>
23 mActiveWindowBottomWidth ( 30.0 * etm::
mm),
24 mActiveWindowTopWidth ( 430.0 * etm::
mm),
25 mActiveWindowHeight ( 700.0 * etm::
mm),
28 mFrameThickness ( 18.0 * etm::
mm),
29 mFrameBottomEdgeWidth ( 30.0 * etm::
mm),
30 mFrameTopEdgeWidth ( 30.0 * etm::
mm),
31 mFrameSideEdgeWidth ( 8.0 * etm::
mm),
34 mEntranceWindowMaterial (
"GemKapton"),
35 mEntranceWindowThickness ( 50.0 * etm::
um),
41 mDriftFoilKaptonThickness ( 50.0 * etm::
um),
42 mDriftFoilCopperThickness ( 3.0 * etm::
um),
43 mGemFoilAreaFraction ( 0.80),
44 mGemFoilKaptonThickness ( 30.0 * etm::
um),
45 mGemFoilCopperThickness ( 3.0 * etm::
um),
47 mReadoutG10Thickness ( 0.0 * etm::
mm),
48 mReadoutKaptonThickness ( 30.0 * etm::
um),
49 mReadoutCopperThickness ( 3.0 * etm::
um),
52 mReadoutSupportMaterial (
"GemNomex"),
53 mReadoutSupportThickness ( 3.0 * etm::
mm),
56 mGasMixture (
"arco27030"),
58 mEntranceRegionLength ( 3.0 * etm::
mm),
59 mDriftRegionLength ( 3.0 * etm::
mm),
61 mFirstTransferRegionLength ( 2.0 * etm::
mm),
62 mSecondTransferRegionLength ( 2.0 * etm::
mm),
63 mInductionRegionLength ( 2.0 * etm::
mm)
74 for(
unsigned wl=0; wl<
mWheels.size(); wl++) {
82 double moduleContainerHeight;
83 TGeoVolume *vwcontainer, *vmcontainer;
101 char wheelContainerVolumeName[128];
102 snprintf(wheelContainerVolumeName, 128-1,
"%sWheelContainerVolume%02d", detName, wl);
104 TGeoTube *wcontainer =
new TGeoTube(wheelContainerVolumeName,
108 vwcontainer =
new TGeoVolume(wheelContainerVolumeName, wcontainer,
GetMedium(
_AIR_));
115 char moduleContainerVolumeName[128];
116 snprintf(moduleContainerVolumeName, 128-1,
"%sModuleContainerVolume%02d", detName, wl);
121 TGeoTrd1 *mcontainer =
new TGeoTrd1(moduleContainerVolumeName,
127 moduleContainerHeight/2);
128 vmcontainer =
new TGeoVolume(moduleContainerVolumeName, mcontainer,
GetMedium(
_AIR_));
131 for(
unsigned md=0; md<wheel->
mModuleNum; md++) {
134 TGeoRotation *
rw =
new TGeoRotation();
136 double radAngle = degAngle*TMath::Pi()/180.0;
137 rw->SetAngles(90.0, 0.0 - degAngle, 180.0, 0.0, 90.0, 90.0 - degAngle);
139 double xOffset = effRadius*sin(radAngle);
140 double yOffset = effRadius*
cos(radAngle);
141 double zOffset = wheel->
mModuleNum == 1 ? 0.0 :
144 vwcontainer->AddNode(vmcontainer, md,
new TGeoCombiTrans(xOffset, yOffset, zOffset, rw));
161 char bottomFrameEdgeName[128], topFrameEdgeName[128], sideFrameEdgeName[128];
164 snprintf(bottomFrameEdgeName, 128-1,
"%sFrameEdgeBottom%02d", detName, wl);
165 snprintf(topFrameEdgeName, 128-1,
"%sFrameEdgeTop%02d", detName, wl);
166 snprintf(sideFrameEdgeName, 128-1,
"%sFrameEdgeSide%02d", detName, wl);
170 TGeoTrd1 *bottom =
new TGeoTrd1(bottomFrameEdgeName,
179 vmcontainer->AddNode(vbottom, 0,
new TGeoCombiTrans(0.0, 0.0, zOffset, 0));
183 TGeoTrd1 *top =
new TGeoTrd1(topFrameEdgeName,
192 vmcontainer->AddNode(vtop, 0,
new TGeoCombiTrans(0.0, 0.0, zOffset, 0));
196 TGeoPara *side =
new TGeoPara(sideFrameEdgeName,
199 moduleContainerHeight/2,
200 0.0, sideSlope*180/TMath::Pi(), 0.0);
202 for(
unsigned lr=0; lr<2; lr++) {
203 double xOffset = (lr ? -1.0 : 1.)*
207 TGeoRotation *rw = 0;
209 rw =
new TGeoRotation();
213 vmcontainer->AddNode(vside, lr,
new TGeoCombiTrans(xOffset, 0.0, 0.0, rw));
319 char volumeName[128];
320 snprintf(volumeName, 128-1,
"%s%s%02d", detName,
"DriftRegionGas", wl);
325 snprintf(volumeName, 128-1,
"%sModuleContainerVolume%02d", detName, wl);
328 for(
unsigned md=0; md<wheel->
mModuleNum; md++) {
329 UInt_t geant[2] = {0, md}, logical[1] = {md};
332 cout <<
"Failed to set mapping table entry!" << endl;
357 TGeoVolume *moduleContainer,
const char *
material,
358 double thickness,
double *yOffset)
360 char volumeName[128];
364 snprintf(volumeName, 128-1,
"%s%s%02d", detName, volumeNamePrefix, wheelID);
370 TGeoTrd1 *shape =
new TGeoTrd1(volumeName,
375 TGeoVolume *vshape =
new TGeoVolume(volumeName, shape,
GetMedium(material));
378 moduleContainer->AddNode(vshape, 0,
new TGeoCombiTrans(0.0, (*yOffset + thickness/2),