@@ -1827,7 +1827,7 @@ TGeoVolume* V3Layer::createStaveModelOuterB2(const TGeoManager* mgr)
18271827 Double_t yGraph = sOBGraphiteFoilThick ;
18281828 Double_t xHalfSt, yHalfSt;
18291829
1830- Double_t xmod, ymod, zmod, ypowbus;
1830+ Double_t xmod, ymod, zmod, ypowbus, zbias ;
18311831 Double_t xtru[12 ], ytru[12 ];
18321832 Double_t xpos, ypos, ypos1, zpos /* , zpos5cm*/ ;
18331833 Double_t xlen, ylen, zlen;
@@ -2051,13 +2051,17 @@ TGeoVolume* V3Layer::createStaveModelOuterB2(const TGeoManager* mgr)
20512051 // flex1_5cmVol->SetLineColor(kRed);
20522052 // flex2_5cmVol->SetLineColor(kGreen);
20532053
2054+ // Compute starting Z pos to center modules in stave
2055+ // (no need to divide by 2, these are already half-lengths)
2056+ zbias = zlen - mNumberOfModules * zmod - (mNumberOfModules - 1 ) * 0.5 * sOBModuleGap ;
2057+
20542058 // Now build up the half stave
20552059 ypos = -ypowbus;
20562060 halfStaveVol->AddNode (powerBusVol, 1 , new TGeoTranslation (0 , ypos, 0 ));
20572061
20582062 ypos -= (ypowbus + ymod);
20592063 for (Int_t j = 0 ; j < mNumberOfModules ; j++) {
2060- zpos = zlen - j * (2 * zmod + sOBModuleGap ) - zmod;
2064+ zpos = zlen - zbias - j * (2 * zmod + sOBModuleGap ) - zmod;
20612065 halfStaveVol->AddNode (moduleVol, j, new TGeoTranslation (0 , ypos, zpos));
20622066 mHierarchy [kModule ]++;
20632067 }
0 commit comments