DetectorConstruction Class Reference

#include <DetectorConstruction.hh>

Inheritance diagram for DetectorConstruction:

Inheritance graph
[legend]
Collaboration diagram for DetectorConstruction:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetectorConstruction ()
 ~DetectorConstruction ()
G4VPhysicalVolume * Construct ()
G4Material * GetSpacecraftMaterial ()
G4Material * GetCabinMaterial ()
G4Material * GetFloorMaterial ()
G4double GetWorldSizeXY ()
G4double GetWorldSizeZ ()
void PrintParameters ()

Private Member Functions

void DefineMaterials ()
G4VPhysicalVolume * ConstructVolumes ()

Private Attributes

G4Material * m_worldMaterial
G4Material * m_spacecraftMaterial
G4Material * m_cabinMaterial
G4Material * m_floorMaterial
G4VPhysicalVolume * m_physiWorld
G4double m_worldSizeXY
G4double m_worldSizeZ


Detailed Description

Definition at line 18 of file DetectorConstruction.hh.


Constructor & Destructor Documentation

DetectorConstruction::DetectorConstruction (  ) 

Definition at line 21 of file DetectorConstruction.cc.

00022 {  
00023   DefineMaterials();
00024 }

DetectorConstruction::~DetectorConstruction (  ) 

Definition at line 28 of file DetectorConstruction.cc.

00029 { }


Member Function Documentation

G4VPhysicalVolume * DetectorConstruction::Construct (  ) 

Definition at line 33 of file DetectorConstruction.cc.

00034 {
00035   return ConstructVolumes();
00036 }

G4Material* DetectorConstruction::GetSpacecraftMaterial (  )  [inline]

Definition at line 31 of file DetectorConstruction.hh.

00031 {return m_spacecraftMaterial;};

G4Material* DetectorConstruction::GetCabinMaterial (  )  [inline]

Definition at line 32 of file DetectorConstruction.hh.

00032 {return m_cabinMaterial;};     

G4Material* DetectorConstruction::GetFloorMaterial (  )  [inline]

Definition at line 33 of file DetectorConstruction.hh.

00033 {return m_floorMaterial;};

G4double DetectorConstruction::GetWorldSizeXY (  )  [inline]

Definition at line 35 of file DetectorConstruction.hh.

00035 {return m_worldSizeXY;};

G4double DetectorConstruction::GetWorldSizeZ (  )  [inline]

Definition at line 36 of file DetectorConstruction.hh.

00036 {return m_worldSizeZ;};

void DetectorConstruction::PrintParameters (  ) 

Definition at line 229 of file DetectorConstruction.cc.

Referenced by ConstructVolumes().

00230 {
00231   G4cout << "\n---------------------------------------------------------\n";
00232   G4cout 
00233     << "---> The world is in " << m_worldMaterial->GetName()           << "\n"
00234     << "---> The spacecraft is in " << m_spacecraftMaterial->GetName() << "\n"
00235     << "---> The cabin is in " << m_cabinMaterial->GetName()           << "\n" 
00236     << "---> The floor is in " << m_floorMaterial->GetName();
00237   G4cout << "\n---------------------------------------------------------\n";
00238   G4cout << G4endl;
00239 }

void DetectorConstruction::DefineMaterials (  )  [private]

Definition at line 40 of file DetectorConstruction.cc.

Referenced by DetectorConstruction().

00041 { 
00042   //
00043   // define simple materials
00044   //
00045   G4double Z,A,density;
00046   
00047   G4Material* Al =
00048   new G4Material("Aluminium", Z=13., A=26.98*g/mole, density=2.700*g/cm3);
00049   
00050   //
00051   // build compounds from Elements
00052   //  
00053   G4Element* N  = new G4Element("Nitrogen" ,"N" , Z=7., A=14.01*g/mole);
00054   G4Element* O  = new G4Element("Oxygen"   ,"O" , Z=8., A=16.00*g/mole);
00055 
00056   G4int ncomponents;
00057   G4double fractionmass;  
00058   
00059   G4Material* Air = 
00060   new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
00061   Air->AddElement(N, fractionmass=70.*perCent);
00062   Air->AddElement(O, fractionmass=30.*perCent);
00063         
00064   // Vacuum standard definition...
00065   //
00066   G4Material* Vacuum =
00067   new G4Material("Galactic", Z=1., A=1.01*g/mole, density= 1.e-10*g/cm3,
00068                            kStateGas, 2.73*kelvin, 3.e-18*pascal);
00069                            
00070   //associate materials
00071   //
00072   m_worldMaterial = Vacuum;
00073   m_spacecraftMaterial = m_floorMaterial = Al;
00074   m_cabinMaterial = Air;
00075                              
00076   // Print
00077   //
00078   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
00079 }

G4VPhysicalVolume * DetectorConstruction::ConstructVolumes (  )  [private]

G4double floorYtop = floorYcenter + 0.5*floorThickness;

Definition at line 83 of file DetectorConstruction.cc.

Referenced by Construct().

00084 {  
00085   //define geometrical parameters
00086   //
00087   G4double cabinRadius = 50*cm;       
00088   G4double cabinLength = 80*cm;
00089   
00090   G4double spacecraftThickness = 2*cm;    
00091   G4double spacecraftRadius = cabinRadius + spacecraftThickness;       
00092   G4double spacecraftLength = cabinLength + 2*spacecraftThickness;
00093   
00094   G4double floorThickness = 2*cm;
00095   G4double floorYcenter   = - 0.5*cabinRadius;
00096   ///G4double floorYtop      = floorYcenter + 0.5*floorThickness;
00097   G4double floorYbottom   = floorYcenter - 0.5*floorThickness;      
00098   G4double floorWidth =
00099           2*std::sqrt(cabinRadius*cabinRadius - floorYbottom*floorYbottom);
00100   G4double floorLength    = cabinLength;
00101     
00102   m_worldSizeXY = 2.2*spacecraftRadius;
00103   m_worldSizeZ  = 1.1*spacecraftLength;
00104   
00105     
00106   // World volume
00107   //
00108 
00109   G4Box*
00110   solidWorld = new G4Box("World",                                  //its name
00111                        m_worldSizeXY/2,m_worldSizeXY/2,m_worldSizeZ/2);  //its size
00112   
00113   G4LogicalVolume*  
00114   logicWorld = new G4LogicalVolume(solidWorld,          //its solid
00115                                    m_worldMaterial,     //its material
00116                                    "World");            //its name
00117 
00118   m_physiWorld = new G4PVPlacement(0,                   //no rotation
00119                                  G4ThreeVector(),       //at (0,0,0)
00120                                  logicWorld,            //its logical volume
00121                                  "World",               //its name
00122                                  0,                     //its mother  volume
00123                                  false,                 //no boolean operation
00124                                  0);                    //copy number
00125                                  
00126   // SpaceCraft volume
00127   //
00128   G4Tubs*
00129   solidSpacecraft = new G4Tubs("Spacecraft",            //name
00130                          0*cm, spacecraftRadius,        //r1, r2
00131                          0.5*spacecraftLength,          //half-length 
00132                          0., twopi);                    //teta1, teta2
00133                          
00134   G4LogicalVolume*    
00135   logicSpacecraft = new G4LogicalVolume(solidSpacecraft,   //solid
00136                                       m_spacecraftMaterial,  //material
00137                                         "Spacecraft");     //name
00138   
00139                     new G4PVPlacement(0,                //no rotation
00140                                   G4ThreeVector(0,0,0), //position
00141                                   logicSpacecraft,      //logicalVolume
00142                                   "Spacecraft",         //name
00143                                    logicWorld,          //mother
00144                                    false,               //no boolean
00145                                    0);                  //copy nb
00146   
00147   // Cabin
00148   //
00149   G4Tubs*
00150   solidCabin = new G4Tubs("Cabin",                      //name
00151                          0*cm, cabinRadius,             //r1, r2
00152                          0.5*cabinLength,               //half-length 
00153                          0., 360*deg);                  //teta1, teta2
00154                          
00155   G4LogicalVolume*    
00156   logicCabin = new G4LogicalVolume(solidCabin,          //solid
00157                                    m_cabinMaterial,     //material
00158                                    "Cabin");            //name
00159                                           
00160                new G4PVPlacement(0,                     //no rotation
00161                                  G4ThreeVector(0,0,0),  //position
00162                                  logicCabin,            //logicalVolume
00163                                  "Cabin",               //name
00164                                   logicSpacecraft,      //mother
00165                                   false,                //no boolean
00166                                   0);                   //copy nb
00167   
00168 
00169   // Floor
00170   //
00171   G4Box*
00172   solidFloor = new G4Box("Floor",                                    //name
00173                     floorWidth/2,floorLength/2,floorThickness/2);    //size
00174                     
00175   G4LogicalVolume*  
00176   logicFloor = new G4LogicalVolume(solidFloor, m_floorMaterial, "Floor");
00177   
00178   //rotation matrix to place the floor within cabin
00179   G4RotationMatrix* rotm = new G4RotationMatrix();
00180   rotm->rotateX(90*deg);
00181 
00182               new G4PVPlacement(rotm,                   //rotation
00183                                  G4ThreeVector(0,floorYcenter,0), //position 
00184                                  logicFloor,            //logicalVolume 
00185                                  "Floor",               //name 
00186                                  logicCabin,            //mother
00187                                  false,                 //no boolean
00188                                  0);                    //copy nb
00189 
00190   //colour attributes
00191   //
00192   
00193   G4VisAttributes* colourWhite= new G4VisAttributes(G4Colour(1.,1.,1.)); 
00194   colourWhite->SetVisibility(true);
00195   colourWhite->SetForceSolid(false);
00196   
00197   G4VisAttributes* colourGrey= new G4VisAttributes(G4Colour(0.5,0.5,0.5)); 
00198   colourGrey->SetVisibility(true);
00199   colourGrey->SetForceSolid(false);
00200   
00201   G4VisAttributes* colourCyan= new G4VisAttributes(G4Colour(0.,1.,1.)); 
00202   colourCyan->SetVisibility(true);
00203   colourCyan->SetForceSolid(false);
00204 
00205   G4VisAttributes* colourMagenta= new G4VisAttributes(G4Colour(1.,0.,1.)); 
00206   colourMagenta->SetVisibility(true);
00207   colourMagenta->SetForceSolid(true);
00208 
00209   G4VisAttributes* colourBlue= new G4VisAttributes(G4Colour(0.,0.,1.)); 
00210   colourBlue->SetVisibility(true);
00211   colourBlue->SetForceSolid(false);
00212   
00213   logicWorld->SetVisAttributes(colourGrey);
00214   logicSpacecraft->SetVisAttributes(colourCyan);
00215   logicCabin->SetVisAttributes(colourCyan);
00216   logicFloor->SetVisAttributes(colourWhite);
00217   
00218   //print parameters
00219   //
00220   PrintParameters();
00221   
00222   // always return Physical World
00223   //
00224   return m_physiWorld;
00225 }


Member Data Documentation

Definition at line 47 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), DefineMaterials(), and PrintParameters().

G4VPhysicalVolume* DetectorConstruction::m_physiWorld [private]

Definition at line 52 of file DetectorConstruction.hh.

Referenced by ConstructVolumes().

Definition at line 53 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetWorldSizeXY().

Definition at line 53 of file DetectorConstruction.hh.

Referenced by ConstructVolumes(), and GetWorldSizeZ().


The documentation for this class was generated from the following files:

Generated on Fri Nov 21 10:19:45 2008 for jour1a by  doxygen 1.5.7.1