11 #include <TGeoVolume.h>
12 #include <TGeoMatrix.h>
23 const char *detName = mDetName->Name().Data();
26 for(
unsigned wl=0; wl<mWheels.size(); wl++) {
34 double moduleContainerHeight;
35 TGeoVolume *vwcontainer, *vmcontainer;
40 mMountingRingBeamLineThickness;
53 char wheelContainerVolumeName[128];
54 snprintf(wheelContainerVolumeName, 128-1,
"%sWheelContainerVolume%02d", detName, wl);
56 TGeoTube *wcontainer =
new TGeoTube(wheelContainerVolumeName,
60 vwcontainer =
new TGeoVolume(wheelContainerVolumeName, wcontainer,
GetMedium(
_AIR_));
67 char moduleContainerVolumeName[128];
68 snprintf(moduleContainerVolumeName, 128-1,
"%sModuleContainerVolume%02d", detName, wl);
73 TGeoTrd1 *mcontainer =
new TGeoTrd1(moduleContainerVolumeName,
79 0.1 * moduleContainerHeight/2);
80 vmcontainer =
new TGeoVolume(moduleContainerVolumeName, mcontainer,
GetMedium(
_AIR_));
83 for(
unsigned md=0; md<wheel->
mModuleNum; md++) {
86 TGeoRotation *
rw =
new TGeoRotation();
88 double radAngle = degAngle*TMath::Pi()/180.0;
89 rw->SetAngles(90.0, 0.0 - degAngle, 180.0, 0.0, 90.0, 90.0 - degAngle);
91 double xOffset = effRadius*sin(radAngle);
92 double yOffset = effRadius*
cos(radAngle);
93 double zOffset = wheel->
mModuleNum == 1 ? 0.0 :
94 (md%2 ? -1.0 : 1.0)*(module->
mFrameThickness + mMountingRingBeamLineThickness)/2;
96 vwcontainer->AddNode(vmcontainer, md,
new TGeoCombiTrans(0.1 *xOffset, 0.1 * yOffset, 0.1 * zOffset, rw));
121 char bottomFrameEdgeName[128], topFrameEdgeName[128], sideFrameEdgeName[128];
124 snprintf(bottomFrameEdgeName, 128-1,
"%sFrameEdgeBottom%02d", detName, wl);
125 snprintf(topFrameEdgeName, 128-1,
"%sFrameEdgeTop%02d", detName, wl);
126 snprintf(sideFrameEdgeName, 128-1,
"%sFrameEdgeSide%02d", detName, wl);
130 TGeoTrd1 *bottom =
new TGeoTrd1(bottomFrameEdgeName,
136 TGeoVolume *vbottom =
new TGeoVolume(bottomFrameEdgeName, bottom,
GetMedium(mG10Material));
139 vmcontainer->AddNode(vbottom, 0,
new TGeoCombiTrans(0.0, 0.0, 0.1 * zOffset, 0));
144 TGeoTrd1 *top =
new TGeoTrd1(topFrameEdgeName,
150 TGeoVolume *vtop =
new TGeoVolume(topFrameEdgeName, top,
GetMedium(mG10Material));
153 vmcontainer->AddNode(vtop, 0,
new TGeoCombiTrans(0.0, 0.0, 0.1 * zOffset, 0));
157 TGeoPara *side =
new TGeoPara(sideFrameEdgeName,
160 0.1 * moduleContainerHeight/2,
161 0.0, sideSlope*180/TMath::Pi(), 0.0);
162 TGeoVolume *vside =
new TGeoVolume(sideFrameEdgeName, side,
GetMedium(mG10Material));
163 for(
unsigned lr=0; lr<2; lr++) {
164 double xOffset = (lr ? -1.0 : 1.)*
168 TGeoRotation *
rw = 0;
170 rw =
new TGeoRotation();
174 vmcontainer->AddNode(vside, lr,
new TGeoCombiTrans(0.1 * xOffset, 0.0, 0.0, rw));
186 double vert[8][2] = {
204 PlaceMaterialLayer(detName,
"ReadoutSupport", wl, vmcontainer,
208 PlaceMaterialLayer(detName,
"ReadoutG10", wl, vmcontainer,
209 mG10Material.Data(), (
double*)vert,
213 PlaceMaterialLayer(detName,
"ReadoutKapton", wl, vmcontainer,
214 mKaptonMaterial.Data(), (
double*)vert,
224 PlaceMaterialLayer(detName,
"EffectiveCopper", wl, vmcontainer,
226 thickness, &yOffset);
231 PlaceMaterialLayer(detName,
"InductionRegionGas", wl, vmcontainer,
235 PlaceMaterialLayer(detName,
"InductionRegionFoil", wl, vmcontainer,
236 mKaptonMaterial.Data(), (
double*)vert,
243 PlaceMaterialLayer(detName,
"SecondTransferRegionGas", wl, vmcontainer,
247 PlaceMaterialLayer(detName,
"SecondTransferRegionFoil", wl, vmcontainer,
248 mKaptonMaterial.Data(), (
double*)vert,
255 PlaceMaterialLayer(detName,
"FirstTransferRegionGas", wl, vmcontainer,
259 PlaceMaterialLayer(detName,
"FirstTransferRegionFoil", wl, vmcontainer,
260 mKaptonMaterial.Data(), (
double*)vert,
268 PlaceMaterialLayer(detName,
"DriftRegionGas", wl, vmcontainer,
272 PlaceMaterialLayer(detName,
"DriftRegionFoil", wl, vmcontainer,
273 mKaptonMaterial.Data(), (
double*)vert,
279 PlaceMaterialLayer(detName,
"EntranceRegionGas", wl, vmcontainer,
283 PlaceMaterialLayer(detName,
"EntranceWindow", wl, vmcontainer,
288 printf(
"-> %f\n", yOffset);
298 char volumeName[128];
299 snprintf(volumeName, 128-1,
"%s%s%02d", detName,
"DriftRegionGas", wl);
304 snprintf(volumeName, 128-1,
"%sModuleContainerVolume%02d", detName, wl);
307 for(
unsigned md=0; md<wheel->
mModuleNum; md++) {
308 UInt_t geant[2] = {0, md}, logical[1] = {md};
310 if (SetMappingTableEntry(fgmap, geant, wl, logical)) {
311 cout <<
"Failed to set mapping table entry!" << endl;
328 TGeoVolume *moduleContainer,
const char *
material,
329 double *vert,
double thickness,
double *yOffset)
331 char volumeName[128];
335 snprintf(volumeName, 128-1,
"%s%s%02d", detName, volumeNamePrefix, wheelID);
337 TGeoArb8 *shape =
new TGeoArb8(volumeName, 0.1 * thickness/2, vert);
339 TGeoVolume *vshape =
new TGeoVolume(volumeName, shape,
GetMedium(material));
342 TGeoRotation *
rw =
new TGeoRotation();
344 moduleContainer->AddNode(vshape, 0,
new TGeoCombiTrans(0.0, 0.1 * (*yOffset + thickness/2),