Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: DetectorConstruction.cc 77256 2013-11-22 10:10:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -53,16 +53,19 @@
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
:fAbsorberMaterial(0),fGapMaterial(0),fDefaultMaterial(0),
|
||||
:G4VUserDetectorConstruction(),
|
||||
fAbsorberMaterial(0),fGapMaterial(0),fDefaultMaterial(0),
|
||||
fSolidWorld(0),fLogicWorld(0),fPhysiWorld(0),
|
||||
fSolidCalor(0),fLogicCalor(0),fPhysiCalor(0),
|
||||
fSolidLayer(0),fLogicLayer(0),fPhysiLayer(0),
|
||||
fSolidAbsorber(0),fLogicAbsorber(0),fPhysiAbsorber(0),
|
||||
fSolidGap (0),fLogicGap (0),fPhysiGap (0)
|
||||
fSolidGap (0),fLogicGap (0),fPhysiGap (0),
|
||||
fDetectorMessenger(0)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
fAbsorberThickness = 10.*mm;
|
||||
@@ -135,10 +138,10 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicWorld, //its logical volume
|
||||
fLogicWorld, //its logical volume
|
||||
"World", //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
//
|
||||
@@ -149,7 +152,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
|
||||
if (fCalorThickness > 0.)
|
||||
{ fSolidCalor = new G4Box("Calorimeter", //its name
|
||||
fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);//size
|
||||
fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);//size
|
||||
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
@@ -160,7 +163,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
fLogicCalor, //its logical volume
|
||||
"Calorimeter", //its name
|
||||
fLogicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
//
|
||||
@@ -176,16 +179,16 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
fPhysiLayer = new G4PVReplica("Layer", //its name
|
||||
fLogicLayer, //its logical volume
|
||||
fLogicCalor, //its mother
|
||||
kXAxis, //axis of replication
|
||||
kXAxis, //axis of replication
|
||||
fNbOfLayers, //number of replica
|
||||
fLayerThickness); //witdth of replica
|
||||
else
|
||||
fPhysiLayer = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicLayer, //its logical volume
|
||||
fLogicLayer, //its logical volume
|
||||
"Layer", //its name
|
||||
fLogicCalor, //its mother volume
|
||||
false, //no boolean operation
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
}
|
||||
|
||||
@@ -199,15 +202,15 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
fAbsorberThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
|
||||
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, //its solid
|
||||
fAbsorberMaterial, //its material
|
||||
fAbsorberMaterial->GetName()); //name
|
||||
fAbsorberMaterial, //its material
|
||||
fAbsorberMaterial->GetName());//name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(-fGapThickness/2,0.,0.), //its position
|
||||
fLogicAbsorber, //its logical volume
|
||||
fLogicAbsorber, //its logical volume
|
||||
fAbsorberMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
|
||||
}
|
||||
@@ -227,7 +230,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
|
||||
fPhysiGap = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(fAbsorberThickness/2,0.,0.), //its position
|
||||
fLogicGap, //its logical volume
|
||||
fLogicGap, //its logical volume
|
||||
fGapMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
@@ -270,7 +273,15 @@ void DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
if (pttoMaterial) fAbsorberMaterial = pttoMaterial;
|
||||
if (pttoMaterial)
|
||||
{
|
||||
fAbsorberMaterial = pttoMaterial;
|
||||
if ( fLogicAbsorber )
|
||||
{
|
||||
fLogicAbsorber->SetMaterial(fAbsorberMaterial);
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -280,7 +291,15 @@ void DetectorConstruction::SetGapMaterial(G4String materialChoice)
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
if (pttoMaterial) fGapMaterial = pttoMaterial;
|
||||
if (pttoMaterial)
|
||||
{
|
||||
fGapMaterial = pttoMaterial;
|
||||
if ( fLogicGap )
|
||||
{
|
||||
fLogicGap->SetMaterial(fGapMaterial);
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -289,6 +308,7 @@ void DetectorConstruction::SetAbsorberThickness(G4double val)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
fAbsorberThickness = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -297,6 +317,7 @@ void DetectorConstruction::SetGapThickness(G4double val)
|
||||
{
|
||||
// change Gap thickness and recompute the calorimeter parameters
|
||||
fGapThickness = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -305,6 +326,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double val)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
fCalorSizeYZ = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -312,15 +334,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double val)
|
||||
void DetectorConstruction::SetNbOfLayers(G4int val)
|
||||
{
|
||||
fNbOfLayers = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
void DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user