11 #include <FstGeoParData.h>
28 unsigned staveGlobalCounter = 0, chipGlobalCounter = 0;
31 SetLogicalDimensions(GetNumberOfLayers(), maxStaveNumPerLayer, 0, maxChipNumPerStave);
34 for(
unsigned dc=0; dc<
mDiscs.size(); dc++) {
37 char mountingRingName[128], discName[128];
41 unsigned staveLocalCounter = 0, nChipsMax = 0;
45 snprintf(discName, 128-1,
"%sContainerVolume%02d", detName, dc);
46 snprintf(mountingRingName, 128-1,
"%sMountingRing%02d", detName, dc);
49 TGeoTube *mdisc =
new TGeoTube(discName,
53 TGeoVolume *vdisc =
new TGeoVolume(discName, mdisc,
GetMedium(
_AIR_));
60 double hOffset = disc->
mMinRadius + staveWidth/2;
70 for(nChips=0; ; nChips++) {
73 double xx = hOffset + staveWidth/2;
74 double yy = staveLength/2;
75 double rr = sqrt(xx*xx + yy*yy);
80 if (nChips > nChipsMax) nChipsMax = nChips;
91 bool odd = (staveLocalCounter++)%2;
93 double zOffset = (odd ? -1.0 : 1.0)*
96 for(
unsigned lr=0; lr<2; lr++) {
103 rw =
new TGeoRotation();
106 rw->SetAngles(90.0, 0.0, 90.0, 270.0, 180.0, 0.0);
107 else if ( lr && !odd)
108 rw->SetAngles(90.0, 180.0, 90.0, 270.0, 0.0, 0.0);
110 rw->SetAngles(90.0, 180.0, 90.0, 90.0, 180.0, 0.0);
113 chipGlobalCounter += nChips;
116 vdisc->AddNode(stave->
GetVolume(), 0,
new TGeoCombiTrans(0.1 * (lr ? -1.0 : 1.0)*hOffset,
132 for(nChips=0; ; nChips++) {
135 double xx = staveWidth/2;
137 double rr = sqrt(xx*xx + yy*yy);
151 for(
unsigned tb=0; tb<2; tb++) {
152 TGeoRotation *rw = 0;
155 rw =
new TGeoRotation();
159 chipGlobalCounter += nChips;
179 for(nChips=0; ; nChips++) {
182 double xx = staveWidth/2;
183 double yy = y0 + staveLength;
184 double rr = sqrt(xx*xx + yy*yy);
197 for(
unsigned lr=0; lr<2; lr++)
198 for(
unsigned tb=0; tb<2; tb++) {
199 TGeoRotation *rw =
new TGeoRotation();
206 chipGlobalCounter += nChips;
209 new TGeoCombiTrans(0.1 * ((lr ? -1.0 : 1.0) * hOffset +
211 0.1 * (tb ? -1.0 : 1.0)*(y0 + stave->
GetLength()/2),
221 TGeoTube *mring =
new TGeoTube(mountingRingName,
227 vdisc->AddNode(vmring, 0,
new TGeoCombiTrans(0.0, 0.0, 0.0, 0));
248 TGeoTube *bpipe =
new TGeoTube(
"Pipe",
252 TGeoVolume *vbpipe =
new TGeoVolume(
"Pipe", bpipe,
GetMedium(
"MapsCarbonFiber"));
254 GetTopVolume()->AddNode(vbpipe, 0,
new TGeoCombiTrans(0.0, 0.0, 0.1 * 350., 0));
258 printf(
"%5d chip(s) and %5d stave(s) total\n", chipGlobalCounter, staveGlobalCounter);