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