#include <DetectorConstruction.hh>
Definition at line 18 of file DetectorConstruction.hh.
DetectorConstruction::DetectorConstruction | ( | ) |
Definition at line 27 of file DetectorConstruction.cc.
00028 { 00029 DefineMaterials(); 00030 00031 //define geometrical parameters 00032 // 00033 m_cabinRadius = 50*cm; 00034 m_cabinLength = 80*cm; 00035 m_spacecraftThickness = 2*cm; 00036 00037 m_floorThickness = 2*cm; 00038 00039 m_astronautHeight = 50*cm; 00040 m_astronautTopWidth = 40*cm; 00041 m_astronautBottomWidth = 60*cm; 00042 00043 }
DetectorConstruction::~DetectorConstruction | ( | ) |
void DetectorConstruction::SetWorldMaterial | ( | G4String | materialChoice | ) |
Definition at line 322 of file DetectorConstruction.cc.
00323 { 00324 // search the material by its name 00325 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 00326 if (pttoMaterial) m_worldMaterial = pttoMaterial; 00327 }
void DetectorConstruction::SetSpacecraftMaterial | ( | G4String | materialChoice | ) |
Definition at line 331 of file DetectorConstruction.cc.
00332 { 00333 // search the material by its name 00334 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 00335 if (pttoMaterial) m_spacecraftMaterial = pttoMaterial; 00336 }
void DetectorConstruction::SetCabinMaterial | ( | G4String | materialChoice | ) |
Definition at line 340 of file DetectorConstruction.cc.
00341 { 00342 // search the material by its name 00343 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 00344 if (pttoMaterial) m_cabinMaterial = pttoMaterial; 00345 }
void DetectorConstruction::SetFloorMaterial | ( | G4String | materialChoice | ) |
Definition at line 349 of file DetectorConstruction.cc.
00350 { 00351 // search the material by its name 00352 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 00353 if (pttoMaterial) m_floorMaterial = pttoMaterial; 00354 }
void DetectorConstruction::SetAstronautMaterial | ( | G4String | materialChoice | ) |
Definition at line 358 of file DetectorConstruction.cc.
00359 { 00360 // search the material by its name 00361 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 00362 if (pttoMaterial) m_astronautMaterial = pttoMaterial; 00363 }
void DetectorConstruction::SetWorldSizeXY | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetWorldSizeZ | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetSpacecraftRadius | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetSpacecraftLength | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetSpacecraftThickness | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetCabinRadius | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetCabinLength | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetFloorThickness | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetFloorWidth | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetFloorLength | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetFloorYcenter | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetAstronautHeight | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetAstronautTopWidth | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetAstronautBottomWidth | ( | G4double | val | ) | [inline] |
void DetectorConstruction::SetAstronautPosition | ( | G4double | val | ) | [inline] |
G4VPhysicalVolume * DetectorConstruction::Construct | ( | ) |
Definition at line 52 of file DetectorConstruction.cc.
00053 { 00054 return ConstructVolumes(); 00055 }
void DetectorConstruction::UpdateGeometry | ( | ) |
Definition at line 369 of file DetectorConstruction.cc.
00370 { 00371 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); 00372 }
G4Material* DetectorConstruction::GetWorldMaterial | ( | ) | [inline] |
G4Material* DetectorConstruction::GetSpacecraftMaterial | ( | ) | [inline] |
G4Material* DetectorConstruction::GetCabinMaterial | ( | ) | [inline] |
G4Material* DetectorConstruction::GetFloorMaterial | ( | ) | [inline] |
G4Material* DetectorConstruction::GetAstronautMaterial | ( | ) | [inline] |
G4double DetectorConstruction::GetWorldSizeXY | ( | ) | [inline] |
G4double DetectorConstruction::GetWorldSizeZ | ( | ) | [inline] |
G4double DetectorConstruction::GetSpacecraftRadius | ( | ) | [inline] |
G4double DetectorConstruction::GetSpacecraftLength | ( | ) | [inline] |
G4double DetectorConstruction::GetSpacecraftThickness | ( | ) | [inline] |
G4double DetectorConstruction::GetCabinRadius | ( | ) | [inline] |
G4double DetectorConstruction::GetCabinLength | ( | ) | [inline] |
G4double DetectorConstruction::GetFloorThickness | ( | ) | [inline] |
G4double DetectorConstruction::GetFloorWidth | ( | ) | [inline] |
G4double DetectorConstruction::GetFloorLength | ( | ) | [inline] |
G4double DetectorConstruction::GetFloorYcenter | ( | ) | [inline] |
G4double DetectorConstruction::GetAstronautHeight | ( | ) | [inline] |
G4double DetectorConstruction::GetAstronautTopWidth | ( | ) | [inline] |
G4double DetectorConstruction::GetAstronautBottomWidth | ( | ) | [inline] |
G4double DetectorConstruction::GetAstronautPosition | ( | ) | [inline] |
void DetectorConstruction::PrintParameters | ( | ) |
Definition at line 290 of file DetectorConstruction.cc.
Referenced by ConstructVolumes().
00291 { 00292 G4cout << "\n---------------------------------------------------------\n"; 00293 G4cout 00294 << "---> World : (" << m_worldSizeXY/m << " X " << m_worldSizeXY/m << " X " 00295 << m_worldSizeZ/m << ") m of " 00296 << m_worldMaterial->GetName() << G4endl; 00297 G4cout 00298 << "---> Spacecraft : radius = " << G4BestUnit(m_spacecraftRadius,"Length") 00299 << "\t length = " << G4BestUnit(m_spacecraftLength,"Length") 00300 << "\t thickness = " << G4BestUnit(m_spacecraftThickness,"Length") 00301 << "\t material : " << m_spacecraftMaterial->GetName() << G4endl; 00302 G4cout 00303 << "---> Cabin : radius = " << G4BestUnit(m_cabinRadius,"Length") 00304 << "\t length = " << G4BestUnit(m_cabinLength,"Length") 00305 << "\t material : " << m_cabinMaterial->GetName() << G4endl; 00306 G4cout 00307 << "---> Floor : thickness = " << G4BestUnit(m_floorThickness,"Length") 00308 << "\t width = " << G4BestUnit(m_floorWidth,"Length") 00309 << "\t length = " << G4BestUnit(m_floorLength,"Length") 00310 << "\t material : " << m_floorMaterial->GetName() << G4endl; 00311 G4cout 00312 << "---> Astronaut : height = " << G4BestUnit(m_astronautHeight,"Length") 00313 << "\t bottom width = " << G4BestUnit(m_astronautBottomWidth,"Length") 00314 << "\t top width = " << G4BestUnit(m_astronautTopWidth,"Length") 00315 << "\t material : " << m_astronautMaterial->GetName() << G4endl; 00316 G4cout << "\n---------------------------------------------------------\n"; 00317 G4cout << G4endl; 00318 }
void DetectorConstruction::DefineMaterials | ( | ) | [private] |
Definition at line 59 of file DetectorConstruction.cc.
Referenced by DetectorConstruction().
00060 { 00061 // 00062 // define simple materials 00063 // 00064 G4double Z,A,density; 00065 00066 G4Material* Al = 00067 new G4Material("Aluminium", Z=13., A=26.98*g/mole, density=2.700*g/cm3); 00068 00069 // 00070 // build compounds from Elements 00071 // 00072 G4Element* H = new G4Element("Hydrogen" ,"H" , Z=1., A= 1.01*g/mole); 00073 G4Element* N = new G4Element("Nitrogen" ,"N" , Z=7., A=14.01*g/mole); 00074 G4Element* O = new G4Element("Oxygen" ,"O" , Z=8., A=16.00*g/mole); 00075 00076 G4int ncomponents, natoms; 00077 G4double fractionmass; 00078 00079 G4Material* Air = 00080 new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2); 00081 Air->AddElement(N, fractionmass=70.*perCent); 00082 Air->AddElement(O, fractionmass=30.*perCent); 00083 00084 G4Material* H2O = 00085 new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); 00086 H2O->AddElement(H, natoms=2); 00087 H2O->AddElement(O, natoms=1); 00088 00089 // Vacuum standard definition... 00090 // 00091 G4Material* Vacuum = 00092 new G4Material("Galactic", Z=1., A=1.01*g/mole, density= 1.e-10*g/cm3, 00093 kStateGas, 2.73*kelvin, 3.e-18*pascal); 00094 00095 //associate materials 00096 // 00097 m_worldMaterial = Vacuum; 00098 m_spacecraftMaterial = m_floorMaterial = Al; 00099 m_cabinMaterial = Air; 00100 m_astronautMaterial = H2O; 00101 00102 // Print 00103 // 00104 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 00105 }
G4VPhysicalVolume * DetectorConstruction::ConstructVolumes | ( | ) | [private] |
Definition at line 109 of file DetectorConstruction.cc.
Referenced by Construct(), and UpdateGeometry().
00110 { 00111 // Cleanup old geometry 00112 G4GeometryManager::GetInstance()->OpenGeometry(); 00113 G4PhysicalVolumeStore::GetInstance()->Clean(); 00114 G4LogicalVolumeStore::GetInstance()->Clean(); 00115 G4SolidStore::GetInstance()->Clean(); 00116 00117 //define geometrical parameters 00118 // 00119 m_spacecraftRadius = m_cabinRadius + m_spacecraftThickness; 00120 m_spacecraftLength = m_cabinLength + 2*m_spacecraftThickness; 00121 00122 m_floorYcenter = - 0.5*m_cabinRadius; 00123 G4double floorYtop = m_floorYcenter + 0.5*m_floorThickness; 00124 G4double floorYbottom = m_floorYcenter - 0.5*m_floorThickness; 00125 m_floorWidth = 00126 2*std::sqrt(m_cabinRadius*m_cabinRadius - floorYbottom*floorYbottom); 00127 m_floorLength = m_cabinLength; 00128 00129 m_worldSizeXY = 2.2*m_spacecraftRadius; 00130 m_worldSizeZ = 1.1*m_spacecraftLength; 00131 00132 m_astronautPosition = floorYtop + 0.5*m_astronautHeight; 00133 00134 00135 // World volume 00136 // 00137 00138 G4Box* 00139 solidWorld = new G4Box("World", //its name 00140 m_worldSizeXY/2,m_worldSizeXY/2,m_worldSizeZ/2); //its size 00141 00142 G4LogicalVolume* 00143 logicWorld = new G4LogicalVolume(solidWorld, //its solid 00144 m_worldMaterial, //its material 00145 "World"); //its name 00146 00147 m_physiWorld = new G4PVPlacement(0, //no rotation 00148 G4ThreeVector(), //at (0,0,0) 00149 logicWorld, //its logical volume 00150 "World", //its name 00151 0, //its mother volume 00152 false, //no boolean operation 00153 0); //copy number 00154 00155 // SpaceCraft volume 00156 // 00157 G4Tubs* 00158 solidSpacecraft = new G4Tubs("Spacecraft", //name 00159 0*cm, m_spacecraftRadius, //r1, r2 00160 0.5*m_spacecraftLength, //half-length 00161 0., twopi); //teta1, teta2 00162 00163 G4LogicalVolume* 00164 logicSpacecraft = new G4LogicalVolume(solidSpacecraft, //solid 00165 m_spacecraftMaterial, //material 00166 "Spacecraft"); //name 00167 00168 new G4PVPlacement(0, //no rotation 00169 G4ThreeVector(0,0,0), //position 00170 logicSpacecraft, //logicalVolume 00171 "Spacecraft", //name 00172 logicWorld, //mother 00173 false, //no boolean 00174 0); //copy nb 00175 00176 // Cabin 00177 // 00178 G4Tubs* 00179 solidCabin = new G4Tubs("Cabin", //name 00180 0*cm, m_cabinRadius, //r1, r2 00181 0.5*m_cabinLength, //half-length 00182 0., 360*deg); //teta1, teta2 00183 00184 G4LogicalVolume* 00185 logicCabin = new G4LogicalVolume(solidCabin, //solid 00186 m_cabinMaterial, //material 00187 "Cabin"); //name 00188 00189 new G4PVPlacement(0, //no rotation 00190 G4ThreeVector(0,0,0), //position 00191 logicCabin, //logicalVolume 00192 "Cabin", //name 00193 logicSpacecraft, //mother 00194 false, //no boolean 00195 0); //copy nb 00196 00197 00198 // Floor 00199 // 00200 G4Box* 00201 solidFloor = new G4Box("Floor", //name 00202 m_floorWidth/2,m_floorLength/2,m_floorThickness/2); //size 00203 00204 G4LogicalVolume* 00205 logicFloor = new G4LogicalVolume(solidFloor, m_floorMaterial, "Floor"); 00206 00207 //rotation matrix to place the floor within cabin 00208 G4RotationMatrix* rotm1 = new G4RotationMatrix(); 00209 rotm1->rotateX(90*deg); 00210 00211 new G4PVPlacement(rotm1, //rotation 00212 G4ThreeVector(0,m_floorYcenter,0), //position 00213 logicFloor, //logicalVolume 00214 "Floor", //name 00215 logicCabin, //mother 00216 false, //no boolean 00217 0); //copy nb 00218 00219 // Astronaut 00220 // 00221 00222 G4Trd* 00223 solidAstronaut = new G4Trd("Astronaut", //name 00224 0.5 * m_astronautBottomWidth, //dx1 00225 0.5 * m_astronautTopWidth, //dx2 00226 0.5 * m_astronautBottomWidth, //dy1 00227 0.5 * m_astronautTopWidth, //dy2 00228 0.5 * m_astronautHeight); //dz 00229 00230 00231 G4LogicalVolume* 00232 logicAstronaut = new G4LogicalVolume(solidAstronaut, //solid 00233 m_astronautMaterial, //material 00234 "Astronaut"); //name 00235 00236 //rotation matrix to place astronaut within cabin 00237 G4RotationMatrix* rotm2 = new G4RotationMatrix(); 00238 rotm2->rotateX(90*deg); 00239 00240 //translation vector to place astronaut within cabin 00241 G4ThreeVector position = G4ThreeVector(0.,m_astronautPosition,0.); 00242 00243 new G4PVPlacement(rotm2, //no rotation 00244 position, //position 00245 logicAstronaut, //logicalVolume 00246 "Astronaut", //name 00247 logicCabin, //mother 00248 false, //no boolean 00249 0); //copy nb 00250 //colour attributes 00251 // 00252 00253 G4VisAttributes* colourWhite= new G4VisAttributes(G4Colour(1.,1.,1.)); 00254 colourWhite->SetVisibility(true); 00255 colourWhite->SetForceSolid(false); 00256 00257 G4VisAttributes* colourGrey= new G4VisAttributes(G4Colour(0.5,0.5,0.5)); 00258 colourGrey->SetVisibility(true); 00259 colourGrey->SetForceSolid(false); 00260 00261 G4VisAttributes* colourCyan= new G4VisAttributes(G4Colour(0.,1.,1.)); 00262 colourCyan->SetVisibility(true); 00263 colourCyan->SetForceSolid(false); 00264 00265 G4VisAttributes* colourMagenta= new G4VisAttributes(G4Colour(1.,0.,1.)); 00266 colourMagenta->SetVisibility(true); 00267 colourMagenta->SetForceSolid(true); 00268 00269 G4VisAttributes* colourBlue= new G4VisAttributes(G4Colour(0.,0.,1.)); 00270 colourBlue->SetVisibility(true); 00271 colourBlue->SetForceSolid(false); 00272 00273 logicWorld->SetVisAttributes(colourGrey); 00274 logicSpacecraft->SetVisAttributes(colourCyan); 00275 logicCabin->SetVisAttributes(colourCyan); 00276 logicFloor->SetVisAttributes(colourWhite); 00277 logicAstronaut->SetVisAttributes(colourBlue); 00278 00279 //print parameters 00280 // 00281 PrintParameters(); 00282 00283 // always return Physical World 00284 // 00285 return m_physiWorld; 00286 }
G4Material* DetectorConstruction::m_worldMaterial [private] |
Definition at line 85 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DefineMaterials(), GetWorldMaterial(), PrintParameters(), and SetWorldMaterial().
G4Material* DetectorConstruction::m_spacecraftMaterial [private] |
Definition at line 86 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DefineMaterials(), GetSpacecraftMaterial(), PrintParameters(), and SetSpacecraftMaterial().
G4Material* DetectorConstruction::m_cabinMaterial [private] |
Definition at line 87 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DefineMaterials(), GetCabinMaterial(), PrintParameters(), and SetCabinMaterial().
G4Material* DetectorConstruction::m_floorMaterial [private] |
Definition at line 88 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DefineMaterials(), GetFloorMaterial(), PrintParameters(), and SetFloorMaterial().
G4Material* DetectorConstruction::m_astronautMaterial [private] |
Definition at line 89 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DefineMaterials(), GetAstronautMaterial(), PrintParameters(), and SetAstronautMaterial().
G4VPhysicalVolume* DetectorConstruction::m_physiWorld [private] |
G4double DetectorConstruction::m_worldSizeXY [private] |
Definition at line 93 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetWorldSizeXY(), PrintParameters(), and SetWorldSizeXY().
G4double DetectorConstruction::m_worldSizeZ [private] |
Definition at line 94 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetWorldSizeZ(), PrintParameters(), and SetWorldSizeZ().
G4double DetectorConstruction::m_spacecraftRadius [private] |
Definition at line 96 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetSpacecraftRadius(), PrintParameters(), and SetSpacecraftRadius().
G4double DetectorConstruction::m_spacecraftLength [private] |
Definition at line 97 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetSpacecraftLength(), PrintParameters(), and SetSpacecraftLength().
G4double DetectorConstruction::m_spacecraftThickness [private] |
Definition at line 98 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetSpacecraftThickness(), PrintParameters(), and SetSpacecraftThickness().
G4double DetectorConstruction::m_cabinRadius [private] |
Definition at line 100 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetCabinRadius(), PrintParameters(), and SetCabinRadius().
G4double DetectorConstruction::m_cabinLength [private] |
Definition at line 101 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetCabinLength(), PrintParameters(), and SetCabinLength().
G4double DetectorConstruction::m_floorThickness [private] |
Definition at line 103 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetFloorThickness(), PrintParameters(), and SetFloorThickness().
G4double DetectorConstruction::m_floorWidth [private] |
Definition at line 104 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetFloorWidth(), PrintParameters(), and SetFloorWidth().
G4double DetectorConstruction::m_floorLength [private] |
Definition at line 105 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetFloorLength(), PrintParameters(), and SetFloorLength().
G4double DetectorConstruction::m_floorYcenter [private] |
Definition at line 106 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetFloorYcenter(), and SetFloorYcenter().
G4double DetectorConstruction::m_astronautHeight [private] |
Definition at line 108 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetAstronautHeight(), PrintParameters(), and SetAstronautHeight().
G4double DetectorConstruction::m_astronautTopWidth [private] |
Definition at line 109 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetAstronautTopWidth(), PrintParameters(), and SetAstronautTopWidth().
G4double DetectorConstruction::m_astronautBottomWidth [private] |
Definition at line 110 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), DetectorConstruction(), GetAstronautBottomWidth(), PrintParameters(), and SetAstronautBottomWidth().
G4double DetectorConstruction::m_astronautPosition [private] |
Definition at line 111 of file DetectorConstruction.hh.
Referenced by ConstructVolumes(), GetAstronautPosition(), and SetAstronautPosition().