Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -27,7 +27,7 @@
/// \brief Implementation of the DetectorMessenger class
//
//
// $Id$
// $Id: DetectorMessenger.cc 77254 2013-11-22 10:08:02Z gcosmo $
//
//
/////////////////////////////////////////////////////////////////////////
@@ -56,7 +56,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
:fDetector(Det)
:G4UImessenger(), fDetector(Det)
{
ftestDir = new G4UIdirectory("/testhadr/");
ftestDir->SetGuidance(" Hadronic Extended Example.");
@@ -65,11 +65,13 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
fmatCmd->SetGuidance("Select Material for the target");
fmatCmd->SetParameterName("tMaterial",false);
fmatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fmatCmd->SetToBeBroadcasted(false);
fmat1Cmd = new G4UIcmdWithAString("/testhadr/WorldMat",this);
fmat1Cmd->SetGuidance("Select Material for world");
fmat1Cmd->SetParameterName("wMaterial",false);
fmat1Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fmat1Cmd->SetToBeBroadcasted(false);
frCmd = new G4UIcmdWithADoubleAndUnit("/testhadr/TargetRadius",this);
frCmd->SetGuidance("Set radius of the target");
@@ -77,6 +79,7 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
frCmd->SetUnitCategory("Length");
frCmd->SetRange("radius>0");
frCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
frCmd->SetToBeBroadcasted(false);
flCmd = new G4UIcmdWithADoubleAndUnit("/testhadr/TargetLength",this);
flCmd->SetGuidance("Set length of the target");
@@ -84,61 +87,8 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
flCmd->SetUnitCategory("Length");
flCmd->SetRange("length>0");
flCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
flCmd->SetToBeBroadcasted(false);
fbinCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsE",this);
fbinCmd->SetGuidance("Set number of bins for energy");
fbinCmd->SetParameterName("NEbins",false);
fbinCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fnOfAbsCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsP",this);
fnOfAbsCmd->SetGuidance("Set number of bins for momentum");
fnOfAbsCmd->SetParameterName("NPbins",false);
fnOfAbsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fupdateCmd = new G4UIcmdWithoutParameter("/testhadr/update",this);
fupdateCmd->SetGuidance("Update geometry.");
fupdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
fupdateCmd->SetGuidance("if you changed geometrical value(s)");
fupdateCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fpartCmd = new G4UIcmdWithAString("/testhadr/particle",this);
fpartCmd->SetGuidance("Set particle name");
fpartCmd->SetParameterName("Particle",false);
fpartCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fcsCmd = new G4UIcmdWithAString("/testhadr/targetElm",this);
fcsCmd->SetGuidance("Set element name");
fcsCmd->SetParameterName("Elm",false);
fcsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fe1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minEnergy",this);
fe1Cmd->SetGuidance("Set min kinetic energy");
fe1Cmd->SetParameterName("eMin",false);
fe1Cmd->SetUnitCategory("Energy");
fe1Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fe2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxEnergy",this);
fe2Cmd->SetGuidance("Set max kinetic energy");
fe2Cmd->SetParameterName("eMax",false);
fe2Cmd->SetUnitCategory("Energy");
fe2Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fp1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minMomentum",this);
fp1Cmd->SetGuidance("Set min momentum");
fp1Cmd->SetParameterName("pMin",false);
fp1Cmd->SetUnitCategory("Energy");
fp1Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fp2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxMomentum",this);
fp2Cmd->SetGuidance("Set max momentum");
fp2Cmd->SetParameterName("pMax",false);
fp2Cmd->SetUnitCategory("Energy");
fp2Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fverbCmd = new G4UIcmdWithAnInteger("/testhadr/verbose",this);
fverbCmd->SetGuidance("Set verbose for ");
fverbCmd->SetParameterName("verb",false);
fverbCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -149,23 +99,13 @@ DetectorMessenger::~DetectorMessenger()
delete fmat1Cmd;
delete frCmd;
delete flCmd;
delete fnOfAbsCmd;
delete fupdateCmd;
delete ftestDir;
delete fpartCmd;
delete fcsCmd;
delete fe1Cmd;
delete fe2Cmd;
delete fp1Cmd;
delete fp2Cmd;
delete fverbCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
HistoManager* histo = HistoManager::GetPointer();
if( command == fmatCmd ) {
fDetector->SetTargetMaterial(newValue);
} else if( command == fmat1Cmd ) {
@@ -174,26 +114,6 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
fDetector->SetTargetRadius(frCmd->GetNewDoubleValue(newValue));
} else if( command == flCmd ) {
fDetector->SetTargetLength(flCmd->GetNewDoubleValue(newValue));
} else if( command == fupdateCmd ) {
fDetector->UpdateGeometry();
} else if( command == fbinCmd ) {
histo->SetNumberOfBinsE(fbinCmd->GetNewIntValue(newValue));
} else if( command == fnOfAbsCmd ) {
histo->SetNumberOfBinsP(fnOfAbsCmd->GetNewIntValue(newValue));
} else if( command == fverbCmd ) {
histo->SetVerbose(fverbCmd->GetNewIntValue(newValue));
} else if( command == fpartCmd ) {
histo->SetParticleName(newValue);
} else if( command == fcsCmd ) {
histo->SetElementName(newValue);
} else if( command == fe1Cmd ) {
histo->SetMinKinEnergy(fe1Cmd->GetNewDoubleValue(newValue));
} else if( command == fe2Cmd ) {
histo->SetMaxKinEnergy(fe2Cmd->GetNewDoubleValue(newValue));
} else if( command == fp1Cmd ) {
histo->SetMinMomentum(fp1Cmd->GetNewDoubleValue(newValue));
} else if( command == fp2Cmd ) {
histo->SetMaxMomentum(fp2Cmd->GetNewDoubleValue(newValue));
}
}