Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -66,7 +66,7 @@ DetectorConstruction::DetectorConstruction()
|
||||
fSurface->SetFinish(ground);
|
||||
fSurface->SetModel(unified);
|
||||
fSurface->SetMaterialPropertiesTable(fSurfaceMPT);
|
||||
|
||||
|
||||
fTank_LV = nullptr;
|
||||
fWorld_LV = nullptr;
|
||||
|
||||
@@ -136,10 +136,18 @@ void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v) {
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::SetSurfacePolish(G4double v) {
|
||||
fSurface->SetPolish(v);
|
||||
G4RunManager::GetRunManager()->GeometryHasBeenModified();
|
||||
|
||||
G4cout << "Surface polish set to: " << fSurface->GetPolish()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddTankMPV(const char* c,
|
||||
G4MaterialPropertyVector* mpv) {
|
||||
mpv->SetSpline(true);
|
||||
fTankMPT->AddProperty(c, mpv);
|
||||
G4cout << "The MPT for the box is now: " << G4endl;
|
||||
fTankMPT->DumpTable();
|
||||
@@ -149,7 +157,6 @@ void DetectorConstruction::AddTankMPV(const char* c,
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddWorldMPV(const char* c,
|
||||
G4MaterialPropertyVector* mpv) {
|
||||
mpv->SetSpline(true);
|
||||
fWorldMPT->AddProperty(c, mpv);
|
||||
G4cout << "The MPT for the world is now: " << G4endl;
|
||||
fWorldMPT->DumpTable();
|
||||
@@ -159,7 +166,6 @@ void DetectorConstruction::AddWorldMPV(const char* c,
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddSurfaceMPV(const char* c,
|
||||
G4MaterialPropertyVector* mpv) {
|
||||
mpv->SetSpline(true);
|
||||
fSurfaceMPT->AddProperty(c, mpv);
|
||||
G4cout << "The MPT for the surface is now: " << G4endl;
|
||||
fSurfaceMPT->DumpTable();
|
||||
@@ -167,7 +173,7 @@ void DetectorConstruction::AddSurfaceMPV(const char* c,
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddTankMPCV(const char* c, G4double v) {
|
||||
void DetectorConstruction::AddTankMPC(const char* c, G4double v) {
|
||||
fTankMPT->AddConstProperty(c, v);
|
||||
G4cout << "The MPT for the box is now: " << G4endl;
|
||||
fTankMPT->DumpTable();
|
||||
@@ -175,12 +181,19 @@ void DetectorConstruction::AddTankMPCV(const char* c, G4double v) {
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddWorldMPCV(const char* c, G4double v) {
|
||||
void DetectorConstruction::AddWorldMPC(const char* c, G4double v) {
|
||||
fWorldMPT->AddConstProperty(c, v);
|
||||
G4cout << "The MPT for the world is now: " << G4endl;
|
||||
fWorldMPT->DumpTable();
|
||||
G4cout << "............." << G4endl;
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::AddSurfaceMPC(const char* c, G4double v) {
|
||||
fSurfaceMPT->AddConstProperty(c, v);
|
||||
G4cout << "The MPT for the surface is now: " << G4endl;
|
||||
fSurfaceMPT->DumpTable();
|
||||
G4cout << "............." << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void DetectorConstruction::SetWorldMaterial(const G4String& mat) {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
:G4UImessenger(),fDetector(Det)
|
||||
{
|
||||
{
|
||||
fOpticalDir = new G4UIdirectory("/opnovice2/");
|
||||
fOpticalDir->SetGuidance("Parameters for optical simulation.");
|
||||
|
||||
@@ -59,18 +59,18 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fSurfaceTypeCmd->SetGuidance("Surface type.");
|
||||
fSurfaceTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceTypeCmd->SetToBeBroadcasted(false);
|
||||
|
||||
|
||||
fSurfaceFinishCmd = new G4UIcmdWithAString("/opnovice2/surfaceFinish", this);
|
||||
fSurfaceFinishCmd->SetGuidance("Surface finish.");
|
||||
fSurfaceFinishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceFinishCmd->SetToBeBroadcasted(false);
|
||||
|
||||
|
||||
fSurfaceModelCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/surfaceModel", this);
|
||||
fSurfaceModelCmd->SetGuidance("surface model.");
|
||||
fSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceModelCmd->SetToBeBroadcasted(false);
|
||||
|
||||
|
||||
fSurfaceSigmaAlphaCmd =
|
||||
new G4UIcmdWithADouble("/opnovice2/surfaceSigmaAlpha", this);
|
||||
fSurfaceSigmaAlphaCmd->SetGuidance("surface sigma alpha");
|
||||
@@ -78,6 +78,13 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fSurfaceSigmaAlphaCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fSurfacePolishCmd =
|
||||
new G4UIcmdWithADouble("/opnovice2/surfacePolish", this);
|
||||
fSurfacePolishCmd->SetGuidance("surface polish");
|
||||
fSurfacePolishCmd->SetGuidance(" parameter (for Glisur model).");
|
||||
fSurfacePolishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfacePolishCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fSurfaceMatPropVectorCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/surfaceProperty", this);
|
||||
fSurfaceMatPropVectorCmd->SetGuidance("Set material property vector");
|
||||
@@ -85,6 +92,13 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fSurfaceMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceMatPropVectorCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fSurfaceMatPropConstCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/surfaceConstProperty", this);
|
||||
fSurfaceMatPropConstCmd->SetGuidance("Set material constant property");
|
||||
fSurfaceMatPropConstCmd->SetGuidance(" for the surface.");
|
||||
fSurfaceMatPropConstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fSurfaceMatPropConstCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fTankMatPropVectorCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/boxProperty", this);
|
||||
fTankMatPropVectorCmd->SetGuidance("Set material property vector for ");
|
||||
@@ -92,12 +106,12 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fTankMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fTankMatPropVectorCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fTankMatConstPropVectorCmd =
|
||||
fTankMatPropConstCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/boxConstProperty", this);
|
||||
fTankMatConstPropVectorCmd->SetGuidance("Set material constant property ");
|
||||
fTankMatConstPropVectorCmd->SetGuidance("for the box.");
|
||||
fTankMatConstPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fTankMatConstPropVectorCmd->SetToBeBroadcasted(false);
|
||||
fTankMatPropConstCmd->SetGuidance("Set material constant property ");
|
||||
fTankMatPropConstCmd->SetGuidance("for the box.");
|
||||
fTankMatPropConstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fTankMatPropConstCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fTankMaterialCmd = new G4UIcmdWithAString("/opnovice2/boxMaterial", this);
|
||||
fTankMaterialCmd->SetGuidance("Set material of box.");
|
||||
@@ -111,13 +125,13 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fWorldMatPropVectorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fWorldMatPropVectorCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fWorldMatConstPropVectorCmd =
|
||||
fWorldMatPropConstCmd =
|
||||
new G4UIcmdWithAString("/opnovice2/worldConstProperty", this);
|
||||
fWorldMatConstPropVectorCmd->SetGuidance("Set material constant property");
|
||||
fWorldMatConstPropVectorCmd->SetGuidance(" for the world.");
|
||||
fWorldMatConstPropVectorCmd->
|
||||
fWorldMatPropConstCmd->SetGuidance("Set material constant property");
|
||||
fWorldMatPropConstCmd->SetGuidance(" for the world.");
|
||||
fWorldMatPropConstCmd->
|
||||
AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
fWorldMatConstPropVectorCmd->SetToBeBroadcasted(false);
|
||||
fWorldMatPropConstCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fWorldMaterialCmd = new G4UIcmdWithAString("/opnovice2/worldMaterial", this);
|
||||
fWorldMaterialCmd->SetGuidance("Set material of world.");
|
||||
@@ -134,12 +148,14 @@ DetectorMessenger::~DetectorMessenger()
|
||||
delete fSurfaceTypeCmd;
|
||||
delete fSurfaceModelCmd;
|
||||
delete fSurfaceSigmaAlphaCmd;
|
||||
delete fSurfacePolishCmd;
|
||||
delete fSurfaceMatPropVectorCmd;
|
||||
delete fSurfaceMatPropConstCmd;
|
||||
delete fTankMatPropVectorCmd;
|
||||
delete fTankMatConstPropVectorCmd;
|
||||
delete fTankMatPropConstCmd;
|
||||
delete fTankMaterialCmd;
|
||||
delete fWorldMatPropVectorCmd;
|
||||
delete fWorldMatConstPropVectorCmd;
|
||||
delete fWorldMatPropConstCmd;
|
||||
delete fWorldMaterialCmd;
|
||||
}
|
||||
|
||||
@@ -323,13 +339,16 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
fDetector->SetSurfaceSigmaAlpha(
|
||||
G4UIcmdWithADouble::GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == fSurfacePolishCmd) {
|
||||
fDetector->SetSurfacePolish(
|
||||
G4UIcmdWithADouble::GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == fTankMatPropVectorCmd) {
|
||||
// got a string. need to convert it to physics vector.
|
||||
// string format is property name, then pairs of energy, value
|
||||
// string format is property name, then pairs of energy, value
|
||||
// specify units for each value, eg 3.0*eV
|
||||
// space delimited
|
||||
G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
|
||||
mpv->SetSpline(true);
|
||||
std::istringstream instring(newValue);
|
||||
G4String prop;
|
||||
instring >> prop;
|
||||
@@ -342,14 +361,14 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
G4double val;
|
||||
val = G4UIcommand::ConvertToDouble(tmp);
|
||||
mpv->InsertValues(en, val);
|
||||
}
|
||||
}
|
||||
const char* c = prop.c_str();
|
||||
|
||||
fDetector->AddTankMPV(c, mpv);
|
||||
}
|
||||
else if (command == fWorldMatPropVectorCmd) {
|
||||
// Convert string to physics vector
|
||||
// string format is property name, then pairs of energy, value
|
||||
// string format is property name, then pairs of energy, value
|
||||
G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
|
||||
std::istringstream instring(newValue);
|
||||
G4String prop;
|
||||
@@ -390,7 +409,7 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
fDetector->AddSurfaceMPV(c, mpv);
|
||||
}
|
||||
|
||||
else if (command == fTankMatConstPropVectorCmd) {
|
||||
else if (command == fTankMatPropConstCmd) {
|
||||
// Convert string to physics vector
|
||||
// string format is property name, then value
|
||||
// space delimited
|
||||
@@ -401,9 +420,9 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
instring >> tmp;
|
||||
G4double val = G4UIcommand::ConvertToDouble(tmp);
|
||||
const char* c = prop.c_str();
|
||||
fDetector->AddTankMPCV(c, val);
|
||||
fDetector->AddTankMPC(c, val);
|
||||
}
|
||||
else if (command == fWorldMatConstPropVectorCmd) {
|
||||
else if (command == fWorldMatPropConstCmd) {
|
||||
// Convert string to physics vector
|
||||
// string format is property name, then value
|
||||
// space delimited
|
||||
@@ -414,9 +433,22 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
instring >> tmp;
|
||||
G4double val = G4UIcommand::ConvertToDouble(tmp);
|
||||
const char* c = prop.c_str();
|
||||
fDetector->AddTankMPCV(c, val);
|
||||
fDetector->AddTankMPC(c, val);
|
||||
}
|
||||
else if (command == fWorldMaterialCmd) {
|
||||
else if (command == fSurfaceMatPropConstCmd) {
|
||||
// Convert string to physics vector
|
||||
// string format is property name, then value
|
||||
// space delimited
|
||||
std::istringstream instring(newValue);
|
||||
G4String prop;
|
||||
G4String tmp;
|
||||
instring >> prop;
|
||||
instring >> tmp;
|
||||
G4double val = G4UIcommand::ConvertToDouble(tmp);
|
||||
const char* c = prop.c_str();
|
||||
fDetector->AddSurfaceMPC(c, val);
|
||||
}
|
||||
else if (command == fWorldMaterialCmd) {
|
||||
fDetector->SetWorldMaterial(newValue);
|
||||
}
|
||||
else if (command == fTankMaterialCmd) {
|
||||
|
||||
@@ -62,9 +62,9 @@ void HistoManager::Book()
|
||||
analysisManager->SetActivation(true); // enable inactivation of histograms
|
||||
|
||||
// Define histogram indices, titles
|
||||
G4int maxHisto = 12;
|
||||
G4int maxHisto = 13;
|
||||
G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
"10","11","12" };
|
||||
"10","11","12","13" };
|
||||
|
||||
G4String title[] = {
|
||||
"dummy", // 0
|
||||
@@ -80,6 +80,7 @@ void HistoManager::Book()
|
||||
"X momentum dir of Fresnel-refracted photons", //10
|
||||
"Y momentum dir of Fresnel-refracted photons", //11
|
||||
"Z momentum dir of Fresnel-refracted photons", //12
|
||||
"scintillation photons creation time", //13
|
||||
};
|
||||
|
||||
// Default values (to be reset via /analysis/h1/set command)
|
||||
|
||||
@@ -306,14 +306,17 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
G4double en = sec->GetKineticEnergy();
|
||||
run->AddCerenkovEnergy(en);
|
||||
run->AddCerenkov();
|
||||
G4AnalysisManager::Instance()->FillH1(1, en);
|
||||
G4AnalysisManager::Instance()->FillH1(1, en/eV);
|
||||
}
|
||||
else if (sec->GetCreatorProcess()
|
||||
->GetProcessName().compare("Scintillation") == 0) {
|
||||
G4double en = sec->GetKineticEnergy();
|
||||
run->AddScintillationEnergy(en);
|
||||
run->AddScintillation();
|
||||
G4AnalysisManager::Instance()->FillH1(2, en);
|
||||
G4AnalysisManager::Instance()->FillH1(2, en/eV);
|
||||
|
||||
G4double time = sec->GetGlobalTime();
|
||||
analysisMan->FillH1(13, time/ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user