Beam_Pipe.cc

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Source file for Beam_Pipe class.
00004 //!
00005 //! The Beam_Pipe class is used to build the beamline for the OLYMPUS
00006 //! detector simulation.  This file declares the Beam_Pipe class and the
00007 //! member routines which construct the OLYMPUS beam line.
00008 //!
00009 //! \author D.K. Hasell
00010 //! \version 1.0
00011 //! \date 2010-02-27
00012 //!
00013 //! \ingroup detector
00014 
00015 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00016 
00017 // Include the Beam_Pipe header file.
00018 
00019 #include "Beam_Pipe.h"
00020 
00021 // Include the GEANT4 header files referenced in this file.
00022 
00023 #include "G4VPhysicalVolume.hh"
00024 #include "G4LogicalVolume.hh"
00025 #include "G4PVPlacement.hh"
00026 #include "G4VSolid.hh"
00027 #include "G4Tubs.hh"
00028 #include "G4Cons.hh"
00029 #include "G4UnionSolid.hh"
00030 #include "G4SubtractionSolid.hh"
00031 #include "G4Material.hh"
00032 #include "G4ThreeVector.hh"
00033 #include "G4VisAttributes.hh"
00034 #include "G4Colour.hh"
00035 
00036 // Use the standard namespace.
00037 
00038 using namespace std;
00039 
00040 // Routines to define the OLYMPUS Beam_Pipe class.
00041 
00042 // Constructor.
00043 
00044 Beam_Pipe::Beam_Pipe() {}
00045 
00046 // Destructor.
00047 
00048 Beam_Pipe::~Beam_Pipe() {}
00049 
00050 // Member function to build the beamline.
00051 
00052 void Beam_Pipe::Build( G4VPhysicalVolume * World_phys ) {
00053 
00054    // Building the Beamline.
00055 
00056    cout << "Building the Beam Pipe volume.\n" << flush;
00057 
00058    // Declare pointers to the solid, union, and logical volumes used here.
00059 
00060    G4VSolid * Solid_1;
00061    G4VSolid * Solid_2;
00062 
00063    G4UnionSolid * Solid_3;
00064    G4UnionSolid * Solid_4;
00065 
00066    G4LogicalVolume * Log_1;
00067    G4LogicalVolume * Log_2;
00068 
00069    // Declare variables used for the dimensions, OD, ID, length, and Z.
00070 
00071    G4double OD, OD1, OD2;
00072    G4double ID, ID1, ID2;
00073    G4double L;
00074    G4double Z;
00075 
00076    G4double Deg360 = 360.0 * degree;
00077 
00078    // Define colours for the various materials used.
00079 
00080    G4Colour Gas( 0.000, 0.000, 0.000 );
00081    G4Colour Al(  0.663, 0.675, 0.714 );
00082    G4Colour SST( 0.878, 0.875, 0.859 );
00083  
00084    // Work away from the upstream face of the target chamber.
00085 
00086    Z = -65.0 * cm;
00087    
00088    // -------------------------------------------------------------------------
00089 
00090    // Dimensions for pipe connecting target chamber to flange.
00091 
00092    OD = 2.500 * 2.54 * cm / 2.0;
00093    ID = 2.250 * 2.54 * cm / 2.0;
00094    L  = 2.025 * 2.54 * cm / 2.0;
00095 
00096    // Create the volume and place it.
00097 
00098    Solid_1 = new G4Tubs( "BP_U1_solid", 0.0, OD, L, 0.0, Deg360 );
00099 
00100    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00101                                 "BP_U1_log", 0, 0, 0, true );
00102    
00103    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00104 
00105    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z - L ), 
00106                       "BP_U1_phys", Log_1, World_phys, false, 0, true );
00107 
00108    // Create the tube and place it.
00109 
00110    Solid_2 = new G4Tubs( "BP_U2_solid", ID, OD, L, 0.0, Deg360 );
00111 
00112    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "G4_Al" ),
00113                                 "BP_U2_log", 0, 0, 0, true );
00114 
00115    Log_2->SetVisAttributes( G4VisAttributes( true, Al ) );
00116 
00117    new G4PVPlacement( 0, G4ThreeVector(),
00118                       Log_2, "BP_U2_phys", Log_1, false, 0, true );
00119 
00120    Z -= 2.0 * L;
00121 
00122    // -------------------------------------------------------------------------
00123 
00124    // Dimensions for aluminum portion of flange.
00125 
00126    OD = 4.47 * 2.54 * cm / 2.0;
00127    ID = 2.25 * 2.54 * cm / 2.0;
00128    L  = 0.75 * 2.54 * cm / 2.0 * 2.0 / 3.0;
00129 
00130    // Create the volume and place it.
00131 
00132    Solid_1 = new G4Tubs( "BP_U3_solid", 0.0, OD, L, 0.0, Deg360 );
00133 
00134    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00135                                 "BP_U3_log", 0, 0, 0, true );
00136    
00137    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00138 
00139    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z - L ), 
00140                       "BP_U3_phys", Log_1, World_phys, false, 0, true );
00141 
00142    // Create the tube and place it.
00143 
00144    Solid_2 = new G4Tubs( "BP_U4_solid", ID, OD, L, 0.0, Deg360 );
00145 
00146    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "G4_Al" ),
00147                                 "BP_U4_log", 0, 0, 0, true );
00148 
00149    Log_2->SetVisAttributes( G4VisAttributes( true, Al ) );
00150 
00151    new G4PVPlacement( 0, G4ThreeVector(),
00152                       Log_2, "BP_U4_phys", Log_1, false, 0, true );
00153 
00154    Z -= 2.0 * L;
00155 
00156    // -------------------------------------------------------------------------
00157 
00158    // Dimensions for SST portion of flange.
00159 
00160    OD = 4.47 * 2.54 * cm / 2.0;
00161    ID = 2.25 * 2.54 * cm / 2.0;
00162    L  = 0.75 * 2.54 * cm / 2.0 * 1.0 / 3.0;
00163 
00164    // Create the volume and place it.
00165 
00166    Solid_1 = new G4Tubs( "BP_U5_solid", 0.0, OD, L, 0.0, Deg360 );
00167 
00168    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00169                                 "BP_U5_log", 0, 0, 0, true );
00170    
00171    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00172 
00173    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z - L ), 
00174                       "BP_U5_phys", Log_1, World_phys, false, 0, true );
00175 
00176    // Create the tube and place it.
00177 
00178    Solid_2 = new G4Tubs( "BP_U6_solid", ID, OD, L, 0.0, Deg360 );
00179 
00180    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00181                                 "BP_U6_log", 0, 0, 0, true );
00182 
00183    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00184 
00185    new G4PVPlacement( 0, G4ThreeVector(),
00186                       Log_2, "BP_U6_phys", Log_1, false, 0, true );
00187 
00188    Z -= 2.0 * L;
00189 
00190    // -------------------------------------------------------------------------
00191 
00192    // Dimensions for SST flange.
00193 
00194    OD = 4.47 * 2.54 * cm / 2.0;
00195    ID = 2.25 * 2.54 * cm / 2.0;
00196    L  = 0.68 * 2.54 * cm / 2.0;
00197 
00198    // Create the volume and place it.
00199 
00200    Solid_1 = new G4Tubs( "BP_U7_solid", 0.0, OD, L, 0.0, Deg360 );
00201 
00202    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00203                                 "BP_U7_log", 0, 0, 0, true );
00204    
00205    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00206 
00207    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z - L ), 
00208                       "BP_U7_phys", Log_1, World_phys, false, 0, true );
00209 
00210    // Create the tube and place it.
00211 
00212    Solid_2 = new G4Tubs( "BP_U8_solid", ID, OD, L, 0.0, Deg360 );
00213 
00214    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00215                                 "BP_U8_log", 0, 0, 0, true );
00216 
00217    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00218 
00219    new G4PVPlacement( 0, G4ThreeVector(),
00220                       Log_2, "BP_U8_phys", Log_1, false, 0, true );
00221 
00222    Z -= 2.0 * L;
00223 
00224    // -------------------------------------------------------------------------
00225 
00226    // Dimensions for SST beampipe.
00227 
00228    OD =   2.50 * 2.54 * cm / 2.0;
00229    ID =   2.25 * 2.54 * cm / 2.0;
00230    L  = 100.00 * 2.54 * cm / 2.0;
00231 
00232    // Create the volume and place it.
00233 
00234    Solid_1 = new G4Tubs( "BP_U9_solid", 0.0, OD, L, 0.0, Deg360 );
00235 
00236    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00237                                 "BP_U9_log", 0, 0, 0, true );
00238    
00239    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00240 
00241    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z - L ), 
00242                       "BP_U9_phys", Log_1, World_phys, false, 0, true );
00243 
00244    // Create the tube and place it.
00245 
00246    Solid_2 = new G4Tubs( "BP_U10_solid", ID, OD, L, 0.0, Deg360 );
00247 
00248    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00249                                 "BP_U10_log", 0, 0, 0, true );
00250 
00251    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00252 
00253    new G4PVPlacement( 0, G4ThreeVector(),
00254                       Log_2, "BP_U10_phys", Log_1, false, 0, true );
00255 
00256    Z -= 2.0 * L;
00257 
00258    // -------------------------------------------------------------------------
00259    // -------------------------------------------------------------------------
00260 
00261    // Work away from the downstream face of the target chamber.
00262 
00263    Z = 55.0 * cm;
00264 
00265    // -------------------------------------------------------------------------
00266 
00267    // Dimensions for pipe connecting target chamber to flange.
00268 
00269    OD = 2.500 * 2.54 * cm / 2.0;
00270    ID = 2.250 * 2.54 * cm / 2.0;
00271    L  = 2.025 * 2.54 * cm / 2.0;
00272 
00273    // Create the volume and place it.
00274 
00275    Solid_1 = new G4Tubs( "BP_D1_solid", 0.0, OD, L, 0.0, Deg360 );
00276 
00277    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00278                                 "BP_D1_log", 0, 0, 0, true );
00279    
00280    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00281 
00282    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00283                       "BP_D1_phys", Log_1, World_phys, false, 0, true );
00284 
00285    // Create the tube and place it.
00286 
00287    Solid_2 = new G4Tubs( "BP_D2_solid", ID, OD, L, 0.0, Deg360 );
00288 
00289    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "G4_Al" ),
00290                                 "BP_D2_log", 0, 0, 0, true );
00291 
00292    Log_2->SetVisAttributes( G4VisAttributes( true, Al ) );
00293 
00294    new G4PVPlacement( 0, G4ThreeVector(),
00295                       Log_2, "BP_D2_phys", Log_1, false, 0, true );
00296 
00297    Z += 2.0 * L;
00298 
00299    // -------------------------------------------------------------------------
00300 
00301    // Dimensions for aluminum portion of flange.
00302 
00303    OD = 4.47 * 2.54 * cm / 2.0;
00304    ID = 2.25 * 2.54 * cm / 2.0;
00305    L  = 0.75 * 2.54 * cm / 2.0 * 2.0 / 3.0;
00306 
00307    // Create the volume and place it.
00308 
00309    Solid_1 = new G4Tubs( "BP_D3_solid", 0.0, OD, L, 0.0, Deg360 );
00310 
00311    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00312                                 "BP_D3_log", 0, 0, 0, true );
00313    
00314    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00315 
00316    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00317                       "BP_D3_phys", Log_1, World_phys, false, 0, true );
00318 
00319    // Create the tube and place it.
00320 
00321    Solid_2 = new G4Tubs( "BP_D4_solid", ID, OD, L, 0.0, Deg360 );
00322 
00323    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "G4_Al" ),
00324                                 "BP_D4_log", 0, 0, 0, true );
00325 
00326    Log_2->SetVisAttributes( G4VisAttributes( true, Al ) );
00327 
00328    new G4PVPlacement( 0, G4ThreeVector(),
00329                       Log_2, "BP_D4_phys", Log_1, false, 0, true );
00330 
00331    Z += 2.0 * L;
00332 
00333    // -------------------------------------------------------------------------
00334 
00335    // Dimensions for SST portion of flange.
00336 
00337    OD = 4.47 * 2.54 * cm / 2.0;
00338    ID = 2.25 * 2.54 * cm / 2.0;
00339    L  = 0.75 * 2.54 * cm / 2.0 * 1.0 / 3.0;
00340 
00341    // Create the volume and place it.
00342 
00343    Solid_1 = new G4Tubs( "BP_D5_solid", 0.0, OD, L, 0.0, Deg360 );
00344 
00345    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00346                                 "BP_D5_log", 0, 0, 0, true );
00347    
00348    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00349 
00350    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00351                       "BP_D5_phys", Log_1, World_phys, false, 0, true );
00352 
00353    // Create the tube and place it.
00354 
00355    Solid_2 = new G4Tubs( "BP_D6_solid", ID, OD, L, 0.0, Deg360 );
00356 
00357    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00358                                 "BP_D6_log", 0, 0, 0, true );
00359 
00360    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00361 
00362    new G4PVPlacement( 0, G4ThreeVector(),
00363                       Log_2, "BP_D6_phys", Log_1, false, 0, true );
00364 
00365    Z += 2.0 * L;
00366 
00367    // -------------------------------------------------------------------------
00368 
00369    // Dimensions for SST flange.
00370 
00371    OD = 4.470 * 2.54 * cm / 2.0;
00372    ID = 2.375 * 2.54 * cm / 2.0;
00373    L  = 0.680 * 2.54 * cm / 2.0;
00374 
00375    // Create the volume and place it.
00376 
00377    Solid_1 = new G4Tubs( "BP_D7_solid", 0.0, OD, L, 0.0, Deg360 );
00378 
00379    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00380                                 "BP_D7_log", 0, 0, 0, true );
00381    
00382    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00383 
00384    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00385                       "BP_D7_phys", Log_1, World_phys, false, 0, true );
00386 
00387    // Create the tube and place it.
00388 
00389    Solid_2 = new G4Tubs( "BP_D8_solid", ID, OD, L, 0.0, Deg360 );
00390 
00391    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00392                                 "BP_D8_log", 0, 0, 0, true );
00393 
00394    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00395 
00396    new G4PVPlacement( 0, G4ThreeVector(),
00397                       Log_2, "BP_D8_phys", Log_1, false, 0, true );
00398 
00399    Z += 2.0 * L;
00400 
00401    // -------------------------------------------------------------------------
00402 
00403    // Dimensions for short SST pipe.
00404 
00405    OD = 2.500 * 2.54 * cm / 2.0;
00406    ID = 2.375 * 2.54 * cm / 2.0;
00407    L  = 8.640 * 2.54 * cm / 2.0;
00408 
00409    // Create the volume and place it.
00410 
00411    Solid_1 = new G4Tubs( "BP_D9_solid", 0.0, OD, L, 0.0, Deg360 );
00412 
00413    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00414                                 "BP_D9_log", 0, 0, 0, true );
00415    
00416    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00417 
00418    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00419                       "BP_D9_phys", Log_1, World_phys, false, 0, true );
00420 
00421    // Create the tube and place it.
00422 
00423    Solid_2 = new G4Tubs( "BP_D10_solid", ID, OD, L, 0.0, Deg360 );
00424 
00425    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00426                                 "BP_D10_log", 0, 0, 0, true );
00427 
00428    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00429 
00430    new G4PVPlacement( 0, G4ThreeVector(),
00431                       Log_2, "BP_D10_phys", Log_1, false, 0, true );
00432 
00433    Z += 2.0 * L;
00434 
00435    // -------------------------------------------------------------------------
00436 
00437    // Dimensions for two SST flanges.
00438 
00439    OD = 4.470 * 2.54 * cm / 2.0;
00440    ID = 2.375 * 2.54 * cm / 2.0;
00441    L  = 0.680 * 2.54 * cm / 2.0 * 2.0;
00442 
00443    // Create the volume and place it.
00444 
00445    Solid_1 = new G4Tubs( "BP_D11_solid", 0.0, OD, L, 0.0, Deg360 );
00446 
00447    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00448                                 "BP_D11_log", 0, 0, 0, true );
00449    
00450    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00451 
00452    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00453                       "BP_D11_phys", Log_1, World_phys, false, 0, true );
00454 
00455    // Create the tube and place it.
00456 
00457    Solid_2 = new G4Tubs( "BP_D12_solid", ID, OD, L, 0.0, Deg360 );
00458 
00459    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00460                                 "BP_D12_log", 0, 0, 0, true );
00461 
00462    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00463 
00464    new G4PVPlacement( 0, G4ThreeVector(),
00465                       Log_2, "BP_D12_phys", Log_1, false, 0, true );
00466 
00467    Z += 2.0 * L;
00468 
00469    // -------------------------------------------------------------------------
00470 
00471    // Dimensions for short SST transition.
00472 
00473    OD = 2.500 * 2.54 * cm / 2.0;
00474    ID = 2.375 * 2.54 * cm / 2.0;
00475    L  = 0.070 * 2.54 * cm / 2.0;
00476 
00477    // Create the volume and place it.
00478 
00479    Solid_1 = new G4Tubs( "BP_D13_solid", 0.0, OD, L, 0.0, Deg360 );
00480 
00481    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00482                                 "BP_D13_log", 0, 0, 0, true );
00483    
00484    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00485 
00486    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00487                       "BP_D13_phys", Log_1, World_phys, false, 0, true );
00488 
00489    // Create the tube and place it.
00490 
00491    Solid_2 = new G4Tubs( "BP_D14_solid", ID, OD, L, 0.0, Deg360 );
00492 
00493    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00494                                 "BP_D14_log", 0, 0, 0, true );
00495 
00496    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00497 
00498    new G4PVPlacement( 0, G4ThreeVector(),
00499                       Log_2, "BP_D14_phys", Log_1, false, 0, true );
00500 
00501    Z += 2.0 * L;
00502 
00503    // -------------------------------------------------------------------------
00504 
00505    // Dimensions for 2.5" to 6" cone.
00506 
00507    OD1 = 2.500 * 2.54 * cm / 2.0;
00508    OD2 = 6.000 * 2.54 * cm / 2.0;
00509    ID1 = 2.375 * 2.54 * cm / 2.0;
00510    ID2 = 5.760 * 2.54 * cm / 2.0;
00511 
00512    L   = 8.375 * 2.54 * cm / 2.0;
00513 
00514    // Create the volume and place it.
00515 
00516    Solid_1 = new G4Cons( "BP_D15_solid", 0.0, OD1, 0.0, OD2, L, 0.0, Deg360 );
00517 
00518    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00519                                 "BP_D15_log", 0, 0, 0, true );
00520    
00521    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00522 
00523    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00524                       "BP_D15_phys", Log_1, World_phys, false, 0, true );
00525 
00526    // Create the cone and place it.
00527 
00528    Solid_2 = new G4Cons( "BP_D16_solid", ID1, OD1, ID2, OD2, L, 0.0, Deg360 );
00529 
00530    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00531                                 "BP_D16_log", 0, 0, 0, true );
00532 
00533    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00534 
00535    new G4PVPlacement( 0, G4ThreeVector(),
00536                       Log_2, "BP_D16_phys", Log_1, false, 0, true );
00537 
00538    Z += 2.0 * L;
00539 
00540    // -------------------------------------------------------------------------
00541 
00542    // Dimensions for short SST transition.
00543 
00544    OD = 6.000 * 2.54 * cm / 2.0;
00545    ID = 5.760 * 2.54 * cm / 2.0;
00546    L  = 0.375 * 2.54 * cm / 2.0;
00547 
00548    // Create the volume and place it.
00549 
00550    Solid_1 = new G4Tubs( "BP_D17_solid", 0.0, OD, L, 0.0, Deg360 );
00551 
00552    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00553                                 "BP_D17_log", 0, 0, 0, true );
00554    
00555    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00556 
00557    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00558                       "BP_D17_phys", Log_1, World_phys, false, 0, true );
00559 
00560    // Create the tube and place it.
00561 
00562    Solid_2 = new G4Tubs( "BP_D18_solid", ID, OD, L, 0.0, Deg360 );
00563 
00564    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00565                                 "BP_D18_log", 0, 0, 0, true );
00566 
00567    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00568 
00569    new G4PVPlacement( 0, G4ThreeVector(),
00570                       Log_2, "BP_D18_phys", Log_1, false, 0, true );
00571 
00572    Z += 2.0 * L;
00573 
00574    // -------------------------------------------------------------------------
00575 
00576    // Dimensions for 6" beampipe.
00577 
00578    OD =  6.000 * 2.54 * cm / 2.0;
00579    ID =  5.760 * 2.54 * cm / 2.0;
00580    L  = 68.625 * 2.54 * cm / 2.0;
00581 
00582    // Create the volume and place it.
00583 
00584    Solid_1 = new G4Tubs( "BP_D19_solid", 0.0, OD, L, 0.0, Deg360 );
00585 
00586    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00587                                 "BP_D19_log", 0, 0, 0, true );
00588    
00589    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00590 
00591    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00592                       "BP_D19_phys", Log_1, World_phys, false, 0, true );
00593 
00594    // Create the tube and place it.
00595 
00596    Solid_2 = new G4Tubs( "BP_D20_solid", ID, OD, L, 0.0, Deg360 );
00597 
00598    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00599                                 "BP_D20_log", 0, 0, 0, true );
00600 
00601    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00602 
00603    new G4PVPlacement( 0, G4ThreeVector(),
00604                       Log_2, "BP_D20_phys", Log_1, false, 0, true );
00605 
00606    Z += 2.0 * L;
00607 
00608    // -------------------------------------------------------------------------
00609 
00610    // Dimensions for short SST transition.
00611 
00612    OD = 6.000 * 2.54 * cm / 2.0;
00613    ID = 5.760 * 2.54 * cm / 2.0;
00614    L  = 0.375 * 2.54 * cm / 2.0;
00615 
00616    // Create the volume and place it.
00617 
00618    Solid_1 = new G4Tubs( "BP_D21_solid", 0.0, OD, L, 0.0, Deg360 );
00619 
00620    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00621                                 "BP_D21_log", 0, 0, 0, true );
00622    
00623    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00624 
00625    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00626                       "BP_D21_phys", Log_1, World_phys, false, 0, true );
00627 
00628    // Create the tube and place it.
00629 
00630    Solid_2 = new G4Tubs( "BP_D22_solid", ID, OD, L, 0.0, Deg360 );
00631 
00632    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00633                                 "BP_D22_log", 0, 0, 0, true );
00634 
00635    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00636 
00637    new G4PVPlacement( 0, G4ThreeVector(),
00638                       Log_2, "BP_D22_phys", Log_1, false, 0, true );
00639 
00640    Z += 2.0 * L;
00641 
00642    // -------------------------------------------------------------------------
00643 
00644    // Dimensions for 6" to 1.5" cone.
00645 
00646    OD1 = 6.000 * 2.54 * cm / 2.0;
00647    OD2 = 1.500 * 2.54 * cm / 2.0;
00648    ID1 = 5.760 * 2.54 * cm / 2.0;
00649    ID2 = 1.370 * 2.54 * cm / 2.0;
00650 
00651    L   = 8.375 * 2.54 * cm / 2.0;
00652 
00653    // Dimensions for tube for SM detector.
00654 
00655    OD = 1.0 * 2.54 * cm / 2.0;
00656    ID = 0.87 * 2.54 * cm / 2.0;
00657    G4double L1  = L;
00658 
00659    G4double angle = 1.25 * degree;
00660 
00661    // Create the cone.
00662 
00663    Solid_1 = new G4Cons( "BP_D23_solid", 0.0, OD1, 0.0, OD2, L, 0.0, Deg360 );
00664 
00665    // Create the tube for the SM detector.
00666 
00667    Solid_2 = new G4Tubs( "BP_D24_solid", 0.0, OD, L1, 0.0, Deg360 );
00668 
00669    // Form union.
00670 
00671    G4RotationMatrix * rot_1 = new G4RotationMatrix;
00672    rot_1->rotateY( angle );
00673 
00674    G4ThreeVector shift_1( 2.632 * 2.54 * cm - L1 * sin(angle), 0.0, L1 - L );
00675 
00676    Solid_3 = new G4UnionSolid( "BP_T1", Solid_1, Solid_2, rot_1, shift_1 );
00677 
00678    G4RotationMatrix * rot_2 = new G4RotationMatrix;
00679    rot_2->rotateY( -angle );
00680 
00681    G4ThreeVector shift_2( -2.632 * 2.54 * cm + L1 * sin(angle), 0.0, L1 - L );
00682 
00683    Solid_4 = new G4UnionSolid( "BP_T2", Solid_3, Solid_2, rot_2, shift_2 );
00684 
00685    Log_1 = new G4LogicalVolume( Solid_4, G4Material::GetMaterial( "SST316" ),
00686                                 "BP_D23_log", 0, 0, 0, true );
00687    
00688    Log_1->SetVisAttributes( G4VisAttributes( true, SST ) );
00689 
00690    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00691                       "BP_D23_phys", Log_1, World_phys, false, 0, true );
00692 
00693    // Repeat for inside volume.
00694 
00695    // Create the cone.
00696 
00697    Solid_1 = new G4Cons( "BP_D25_solid", 0.0, ID1, 0.0, ID2, L, 0.0, Deg360 );
00698 
00699    // Create the tube for the SM detector.
00700 
00701    Solid_2 = new G4Tubs( "BP_D26_solid", 0.0, ID, L1, 0.0, Deg360 );
00702 
00703    // Create union.
00704 
00705    G4RotationMatrix * rot_3 = new G4RotationMatrix;
00706    rot_3->rotateY( angle );
00707 
00708    G4ThreeVector shift_3( 2.632 * 2.54 * cm - L1 * sin(angle), 0.0, L1 - L );
00709 
00710    Solid_3 = new G4UnionSolid( "BP_T3", Solid_1, Solid_2, rot_3, shift_3 );
00711 
00712    G4RotationMatrix * rot_4 = new G4RotationMatrix;
00713    rot_4->rotateY( -angle );
00714 
00715    G4ThreeVector shift_4( -2.632 * 2.54 * cm + L1 * sin(angle), 0.0, L1 - L );
00716 
00717    Solid_4 = new G4UnionSolid( "BP_T4", Solid_3, Solid_2, rot_2, shift_2 );
00718 
00719    Log_2 = new G4LogicalVolume( Solid_4, G4Material::GetMaterial( "Beam_gas" ),
00720                                 "BP_D25_log", 0, 0, 0, true );
00721    
00722    Log_2->SetVisAttributes( G4VisAttributes( false, Gas ) );
00723 
00724    new G4PVPlacement( 0, G4ThreeVector(), Log_2, "BP_D25_phys", Log_1,
00725                       false, 0, true );
00726 
00727    Z += 2.0 * L;
00728 
00729    // -------------------------------------------------------------------------
00730 
00731    // Dimensions for beampipe beside symmetric Moller detector.
00732 
00733    OD =  1.500 * 2.54 * cm / 2.0;
00734    ID =  1.375 * 2.54 * cm / 2.0;
00735    L  = 31.635 * 2.54 * cm / 2.0;
00736 
00737    // Create the volume and place it.
00738 
00739    Solid_1 = new G4Tubs( "BP_D27_solid", 0.0, OD, L, 0.0, Deg360 );
00740 
00741    Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00742                                 "BP_D27_log", 0, 0, 0, true );
00743    
00744    Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00745 
00746    new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00747                       "BP_D27_phys", Log_1, World_phys, false, 0, true );
00748 
00749    // Create the tube and place it.
00750 
00751    Solid_2 = new G4Tubs( "BP_D28_solid", ID, OD, L, 0.0, Deg360 );
00752 
00753    Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00754                                 "BP_D28_log", 0, 0, 0, true );
00755 
00756    Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00757 
00758    new G4PVPlacement( 0, G4ThreeVector(),
00759                       Log_2, "BP_D28_phys", Log_1, false, 0, true );
00760 
00761    Z += 2.0 * L;
00762 
00763    // -------------------------------------------------------------------------
00764 /*
00765 // Go back and add ports for symmetric Moller.
00766 
00767 Z = 89.496 * 2.54 * cm;
00768 
00769 // -------------------------------------------------------------------------
00770 
00771 // Flange on end of SM tube.
00772 
00773 OD = 2.73 * 2.54 * cm / 2.0;
00774 ID = 0.94 * 2.54 * cm / 2.0;
00775 L  = 1.00 * 2.54 * cm / 2.0;
00776 
00777 // Create the volume and place it.
00778 
00779 Solid_1 = new G4Tubs( "BP_D27_solid", 0.0, OD, L, 0.0, Deg360 );
00780 
00781 Log_1 = new G4LogicalVolume( Solid_1, G4Material::GetMaterial( "Beam_gas" ),
00782 "BP_D27_log", 0, 0, 0, true );
00783    
00784 Log_1->SetVisAttributes( G4VisAttributes( false, Gas ) );
00785 
00786 new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, Z + L ), 
00787 "BP_D27_phys", Log_1, World_phys, false, 0, true );
00788 
00789 // Create the tube and place it.
00790 
00791 Solid_2 = new G4Tubs( "BP_D28_solid", ID, OD, L, 0.0, Deg360 );
00792 
00793 Log_2 = new G4LogicalVolume( Solid_2, G4Material::GetMaterial( "SST316" ),
00794 "BP_D28_log", 0, 0, 0, true );
00795 
00796 Log_2->SetVisAttributes( G4VisAttributes( true, SST ) );
00797 
00798 new G4PVPlacement( 0, G4ThreeVector(),
00799 Log_2, "BP_D28_phys", Log_1, false, 0, true );
00800 */
00801    // -------------------------------------------------------------------------
00802 
00803    cout << "     done.\n" << endl << flush;
00804 
00805    // That's All Folks !
00806 
00807    return;
00808 
00809 }