@@ -90,7 +90,7 @@ TGeoVolume* TRKLayer::createChip(std::string type, double width)
9090 return chipVol;
9191}
9292
93- TGeoVolume* TRKLayer::createStave (std::string type)
93+ TGeoVolume* TRKLayer::createStave (std::string type, double width )
9494{
9595 TGeoMedium* medAir = gGeoManager ->GetMedium (" TRK_AIR$" );
9696 std::string staveName = o2::trk::GeometryTGeo::getTRKStavePattern () + std::to_string (mLayerNumber );
@@ -106,7 +106,7 @@ TGeoVolume* TRKLayer::createStave(std::string type)
106106 LOGP (info, " Inserting {} in {} " , chipVol->GetName (), staveVol->GetName ());
107107 staveVol->AddNode (chipVol, 1 , nullptr );
108108 } else if (type == " flat" ) {
109- double width = mModuleWidth * 2 ; // Each stave has two modules (based on the LOI design)
109+ if ( width < 0 ) LOGP (fatal, " Attempting to create stave with invalid width " );
110110 stave = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 );
111111 chipVol = createChip (" flat" , width);
112112 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
@@ -157,7 +157,9 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
157157 layerVol->AddNode (staveVol, 1 , nullptr );
158158 } else if (mLayout == eLayout::kTurboStaves ) {
159159 // Compute the number of staves
160- double width = mModuleWidth * 2 ; // Each stave has two modules (based on the LOI design)
160+ double width = mModuleWidth ; // Each stave has two modules (based on the LOI design)
161+ if (mInnerRadius > 25 ) width *= 2 ; // Outer layers have two modules per stave
162+
161163 int nStaves = (int )std::ceil (mInnerRadius * 2 * TMath::Pi () / width);
162164 nStaves += nStaves % 2 ; // Require an even number of staves
163165
@@ -171,12 +173,12 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
171173 LOGP (info, " Creating a layer with {} staves and {} mm overlap" , nStaves, overlap * 10 );
172174
173175 for (int iStave = 0 ; iStave < nStaves; iStave++) {
174- TGeoVolume* staveVol = createStave (" flat" );
176+ TGeoVolume* staveVol = createStave (" flat" , width );
175177
176178 // Put the staves in the correct position and orientation
177179 TGeoCombiTrans* trans = new TGeoCombiTrans ();
178180 double theta = 360 . * iStave / nStaves;
179- TGeoRotation* rot = new TGeoRotation (" rot" , theta + 90 + 2 , 0 , 0 );
181+ TGeoRotation* rot = new TGeoRotation (" rot" , theta + 90 + 3 , 0 , 0 );
180182 trans->SetRotation (rot);
181183 trans->SetTranslation (mInnerRadius * std::cos (2 . * TMath::Pi () * iStave / nStaves), mInnerRadius * std::sin (2 * TMath::Pi () * iStave / nStaves), 0 );
182184
0 commit comments