@@ -2235,42 +2235,35 @@ void Geometry::createServices(std::vector<int> const& idtmed)
22352235 // Services in front of the super module
22362236 //
22372237
2238- // Gas in-/outlet pipes (INOX)
2239- parTube[0 ] = 0.0 ;
2240- parTube[1 ] = 0.0 ;
2241- parTube[2 ] = 0.0 ;
2242- createVolume (" UTG3" , " TUBE" , idtmed[8 ], parTube, 0 );
2243- // The gas inside the in-/outlet pipes (Xe)
2244- parTube[0 ] = 0.0 ;
2245- parTube[1 ] = 1.2 / 2.0 ;
2246- parTube[2 ] = -1.0 ;
2247- createVolume (" UTG4" , " TUBE" , idtmed[9 ], parTube, kNparTube );
2248- xpos = 0.0 ;
2249- ypos = 0.0 ;
2250- zpos = 0.0 ;
2251- TVirtualMC::GetMC ()->Gspos (" UTG4" , 1 , " UTG3" , xpos, ypos, zpos, 0 , " ONLY" );
2238+ // Gas in-/outlet pipes (INOX) with the Xe inside them, one per layer. These used to reuse
2239+ // the names UTG3/UTG4 of the sector-17 tubes above, which only worked because the two
2240+ // registrations happened to land in different TGeo volume lists.
22522241 for (ilayer = 0 ; ilayer < NLAYER - 1 ; ilayer++) {
2253- xpos = 0.0 ;
2254- ypos = CLENGTH [ilayer][2 ] / 2.0 + CLENGTH [ilayer][1 ] + CLENGTH [ilayer][0 ];
2255- zpos = 9.0 - SHEIGHT / 2.0 + ilayer * (CH + VSPACE );
2242+ snprintf (cTagV, kTag , " UGI%01d" , ilayer);
22562243 parTube[0 ] = 0.0 ;
22572244 parTube[1 ] = 1.5 / 2.0 ;
22582245 parTube[2 ] = CWIDTH [ilayer] / 2.0 - 2.5 ;
2259- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 , " UTI1" , xpos, ypos, zpos, matrix[2 ], " ONLY" , parTube, kNparTube );
2260- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 1 * NLAYER , " UTI1" , xpos, -ypos, zpos, matrix[2 ], " ONLY" , parTube,
2261- kNparTube );
2262- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 2 * NLAYER , " UTI2" , xpos, ypos, zpos, matrix[2 ], " ONLY" , parTube,
2263- kNparTube );
2264- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 3 * NLAYER , " UTI2" , xpos, -ypos, zpos, matrix[2 ], " ONLY" , parTube,
2265- kNparTube );
2266- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 4 * NLAYER , " UTI3" , xpos, ypos, zpos, matrix[2 ], " ONLY" , parTube,
2267- kNparTube );
2268- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 5 * NLAYER , " UTI3" , xpos, -ypos, zpos, matrix[2 ], " ONLY" , parTube,
2269- kNparTube );
2270- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 6 * NLAYER , " UTI4" , xpos, ypos, zpos, matrix[2 ], " ONLY" , parTube,
2271- kNparTube );
2272- TVirtualMC::GetMC ()->Gsposp (" UTG3" , ilayer + 1 + 7 * NLAYER , " UTI4" , xpos, -ypos, zpos, matrix[2 ], " ONLY" , parTube,
2273- kNparTube );
2246+ createVolume (cTagV, " TUBE" , idtmed[8 ], parTube, kNparTube );
2247+ snprintf (cTagM, kTag , " UGX%01d" , ilayer);
2248+ parTube[0 ] = 0.0 ;
2249+ parTube[1 ] = 1.2 / 2.0 ;
2250+ parTube[2 ] = CWIDTH [ilayer] / 2.0 - 2.5 ;
2251+ createVolume (cTagM, " TUBE" , idtmed[9 ], parTube, kNparTube );
2252+ TVirtualMC::GetMC ()->Gspos (cTagM, 1 , cTagV, 0.0 , 0.0 , 0.0 , 0 , " ONLY" );
2253+ }
2254+ for (ilayer = 0 ; ilayer < NLAYER - 1 ; ilayer++) {
2255+ xpos = 0.0 ;
2256+ ypos = CLENGTH [ilayer][2 ] / 2.0 + CLENGTH [ilayer][1 ] + CLENGTH [ilayer][0 ];
2257+ zpos = 9.0 - SHEIGHT / 2.0 + ilayer * (CH + VSPACE );
2258+ snprintf (cTagV, kTag , " UGI%01d" , ilayer);
2259+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 , " UTI1" , xpos, ypos, zpos, matrix[2 ], " ONLY" );
2260+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 1 * NLAYER , " UTI1" , xpos, -ypos, zpos, matrix[2 ], " ONLY" );
2261+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 2 * NLAYER , " UTI2" , xpos, ypos, zpos, matrix[2 ], " ONLY" );
2262+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 3 * NLAYER , " UTI2" , xpos, -ypos, zpos, matrix[2 ], " ONLY" );
2263+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 4 * NLAYER , " UTI3" , xpos, ypos, zpos, matrix[2 ], " ONLY" );
2264+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 5 * NLAYER , " UTI3" , xpos, -ypos, zpos, matrix[2 ], " ONLY" );
2265+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 6 * NLAYER , " UTI4" , xpos, ypos, zpos, matrix[2 ], " ONLY" );
2266+ TVirtualMC::GetMC ()->Gspos (cTagV, ilayer + 1 + 7 * NLAYER , " UTI4" , xpos, -ypos, zpos, matrix[2 ], " ONLY" );
22742267 }
22752268
22762269 // Gas distribution box
0 commit comments