11 #include <TGeoVolume.h>
19 const char *detName = mDetName->Name().Data();
22 for(
unsigned bl=0; bl<mBarrels.size(); bl++) {
34 if (airContainerThickness < layer->mOuterFrameThickness)
38 char barrelContainerVolumeName[128];
39 snprintf(barrelContainerVolumeName, 128-1,
"%sBarrelContainerVolume%02d", detName, bl);
41 TGeoTube *bcontainer =
new TGeoTube(barrelContainerVolumeName,
43 0.1 * (barrel->
mRadius + airContainerThickness),
45 TGeoVolume *vbcontainer =
new TGeoVolume(barrelContainerVolumeName, bcontainer,
GetMedium(
_AIR_));
50 char outerFrameVolumeName[128];
51 snprintf(outerFrameVolumeName, 128-1,
"%sOuterFrameVolume%02d", detName, bl);
53 TGeoTube *oframe =
new TGeoTube(outerFrameVolumeName,
57 TGeoVolume *voframe =
new TGeoVolume(outerFrameVolumeName, oframe,
GetMedium(
"MuMegasCarbonFiber"));
59 for(
unsigned fb=0; fb<2; fb++)
60 vbcontainer->AddNode(voframe, fb,
new TGeoCombiTrans(0.0, 0.0, 0.1 * (fb ? -1.0 : 1.0)*zOffset, 0));
63 double singleSectorLength =
70 char innerFrameVolumeName[128];
71 snprintf(innerFrameVolumeName, 128-1,
"%sInnerFrameVolume%02d", detName, bl);
73 TGeoTube *iframe =
new TGeoTube(innerFrameVolumeName,
77 TGeoVolume *viframe =
new TGeoVolume(innerFrameVolumeName, iframe,
GetMedium(
"MuMegasCarbonFiber"));
82 vbcontainer->AddNode(viframe, iz,
new TGeoCombiTrans(0.0, 0.0, 0.1*zOffset, 0));
87 double circumference = 2.0 * TMath::Pi() * barrel->
mRadius;
88 double clearAcceptanceFraction =
93 char sectorContainerVolumeName[128];
94 snprintf(sectorContainerVolumeName, 128-1,
"%sSectorContainerVolume%02d", detName, bl);
98 TGeoCtub *sector =
new TGeoCtub(sectorContainerVolumeName,
100 0.1 * (barrel->
mRadius + gasSectorThickness),
101 0.1 * singleSectorLength/2,
102 0.0, singleSectorAngle,
104 TGeoVolume *vsector =
new TGeoVolume(sectorContainerVolumeName, sector,
GetMedium(layer->
mGasMixture));
108 TGeoRotation *
rw = 0;
110 rw =
new TGeoRotation();
118 new TGeoCombiTrans(0.0, 0.0, 0.1 * zOffset, rw));
124 double rOffset = barrel->
mRadius;
126 PlaceMaterialLayer(detName,
"ReadoutPcb", bl, vsector,
128 singleSectorLength, singleSectorAngle,
132 PlaceMaterialLayer(detName,
"ReadoutStrips", bl, vsector,
134 singleSectorLength, singleSectorAngle,
138 PlaceMaterialLayer(detName,
"AmplificationRegion", bl, vsector,
140 singleSectorLength, singleSectorAngle,
144 PlaceMaterialLayer(detName,
"SteelMesh", bl, vsector,
146 singleSectorLength, singleSectorAngle,
150 PlaceMaterialLayer(detName,
"ConversionRegion", bl, vsector,
152 singleSectorLength, singleSectorAngle - 1.0,
156 PlaceMaterialLayer(detName,
"ExitWindow", bl, vsector,
158 singleSectorLength, singleSectorAngle,
166 char sectorFrameVolumeName[128];
167 snprintf(sectorFrameVolumeName, 128-1,
"%sSectorFrameVolume%02d", detName, bl);
169 TGeoCtub *sframe =
new TGeoCtub(sectorFrameVolumeName,
172 0.1 * singleSectorLength/2,
174 singleSectorFrameAngle,
176 TGeoVolume *vsframe =
new TGeoVolume(sectorFrameVolumeName, sframe,
GetMedium(
"MuMegasCarbonFiber"));
179 TGeoRotation *
rw =
new TGeoRotation();
186 new TGeoCombiTrans(0.0, 0.0, 0.1 * zOffset, rw));
198 char conversionVolumeName[128];
199 snprintf(conversionVolumeName, 128-1,
"%s%s%02d", detName,
"ConversionRegion", bl);
210 if (SetMappingTableEntry(fgmap, geant, bl, logical)) {
211 cout <<
"Failed to set mapping table entry!" << endl;
228 TGeoVolume *sectorContainer,
const char *
material,
229 double length,
double angle,
232 char volumeName[128];
234 snprintf(volumeName, 128-1,
"%s%s%02d", detName, volumeNamePrefix, barrelID);
235 TGeoCtub *shape =
new TGeoCtub(volumeName,
237 0.1 * (*rOffset + thickness),
242 TGeoVolume *vshape =
new TGeoVolume(volumeName, shape,
GetMedium(material));
244 sectorContainer->AddNode(vshape, 0,
new TGeoCombiTrans(0.0, 0.0, 0.0, 0));