Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
File diff suppressed because it is too large Load Diff
@@ -23,16 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointPhysicsMessenger.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/G4AdjointPhysicsMessenger.cc
/// \brief Implementation of the G4AdjointPhysicsMessenger class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: G4AdjointPhysicsMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: G4AdjointPhysicsMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4AdjointPhysicsMessenger.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
@@ -44,164 +50,115 @@
#include "G4UnitsTable.hh"
#include "G4AdjointPhysicsList.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4AdjointPhysicsMessenger::G4AdjointPhysicsMessenger(
G4AdjointPhysicsList* pPhysicsList)
:thePhysicsList(pPhysicsList)
:fPhysicsList(pPhysicsList)
{
PhysicsDir = new G4UIdirectory("/adjoint_physics/");
PhysicsDir->SetGuidance("Definition of physics processes to be used in the adjoint and forward simulation mode");
fPhysicsDir = new G4UIdirectory("/adjoint_physics/");
fPhysicsDir->SetGuidance("Definition of physics processes to be used in the adjoint and forward simulation mode");
//Physics
//-------
fUsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation",this);
fUsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered for adjoint and forward simulations");
fUsepIonisationCmd->AvailableForStates(G4State_PreInit);
/* UseIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseElectronIonisation",this);
UseIonisationCmd->SetGuidance("If true (false) the ionisation is (not) considered for both adjoint and forward simulations");
UseIonisationCmd->AvailableForStates(G4State_PreInit);
*/
fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung",this);
fUseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered for adjoint and forward simulations");
fUseBremCmd->AvailableForStates(G4State_PreInit);
UsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation",this);
UsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered for both adjoint and forward simulations");
UsepIonisationCmd->AvailableForStates(G4State_PreInit);
fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton",this);
fUseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered for adjoint and forward simulations");
fUseComptonCmd->AvailableForStates(G4State_PreInit);
UseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung",this);
UseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered for both adjoint and forward simulations");
UseBremCmd->AvailableForStates(G4State_PreInit);
fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS",this);
fUseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered for adjoint and forward simulations");
fUseMSCmd->AvailableForStates(G4State_PreInit);
UseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton",this);
UseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered for both adjoint and forward simulations");
UseComptonCmd->AvailableForStates(G4State_PreInit);
fUseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation",this);
fUseEgainFluctuationCmd->SetGuidance("If true (false) the fluctation for continuous energy gain and loss is (not) considered for adjoint and forward simulations");
fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit);
UseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS",this);
UseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered for both adjoint and forward simulations");
UseMSCmd->AvailableForStates(G4State_PreInit);
UseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation",this);
UseEgainFluctuationCmd->SetGuidance("If true (false) the fluctation for continuous energy gain and loss is (not) considered for adjoint and forward simulations");
UseEgainFluctuationCmd->AvailableForStates(G4State_PreInit);
UsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect",this);
UsePEEffectCmd->AvailableForStates(G4State_PreInit);
UsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered for the adjoint and forward simulations");
fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect",this);
fUsePEEffectCmd->AvailableForStates(G4State_PreInit);
fUsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered for the adjoint and forward simulations");
UseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion",this);
UseGammaConversionCmd->AvailableForStates(G4State_PreInit);
UseGammaConversionCmd->SetGuidance("If true the gamma pair conversion is considered as weel as the e+ physics for the forward simulation");
fUseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion",this);
fUseGammaConversionCmd->AvailableForStates(G4State_PreInit);
fUseGammaConversionCmd->SetGuidance("If true the gamma pair conversion is considered as well as the e+ physics for the forward simulation");
SetEminAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels",this);
SetEminAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models");
SetEminAdjModelsCmd->SetParameterName("Emin",false);
SetEminAdjModelsCmd->SetUnitCategory("Energy");
SetEminAdjModelsCmd->AvailableForStates(G4State_PreInit);
fSetEminAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels",this);
fSetEminAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models");
fSetEminAdjModelsCmd->SetParameterName("Emin",false);
fSetEminAdjModelsCmd->SetUnitCategory("Energy");
fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit);
SetEmaxAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels",this);
SetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models.");
SetEmaxAdjModelsCmd->SetParameterName("Emax",false);
SetEmaxAdjModelsCmd->SetUnitCategory("Energy");
SetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit);
/*
#ifdef TEST_MODE
SetCSBiasingFactorComptonCmd = new G4UIcmdWithADouble("/adjoint_physics/SetCSBiasingFactorForCompton",this);
SetCSBiasingFactorComptonCmd->SetGuidance("Set the CS biading factor for the adjoint Compton Cross section");
SetCSBiasingFactorComptonCmd->SetParameterName("biasing_factor",false);
SetCSBiasingFactorComptonCmd->AvailableForStates(G4State_PreInit);
SetCSBiasingFactorBremCmd = new G4UIcmdWithADouble("/adjoint_physics/SetCSBiasingFactorForBrem",this);
SetCSBiasingFactorBremCmd->SetGuidance("Set the CS biading factor for the adjoint Brem Cross section");
SetCSBiasingFactorBremCmd->SetParameterName("biasing_factor",false);
SetCSBiasingFactorBremCmd->AvailableForStates(G4State_PreInit);
SetCSBiasingFactorIonisationCmd = new G4UIcmdWithADouble("/adjoint_physics/SetCSBiasingFactorForIonisation",this);
SetCSBiasingFactorIonisationCmd->SetGuidance("Set the CS biading factor for the adjoint Ionisation Cross section");
SetCSBiasingFactorIonisationCmd->SetParameterName("biasing_factor",false);
SetCSBiasingFactorIonisationCmd->AvailableForStates(G4State_PreInit);
SetCSBiasingFactorPEeffectCmd = new G4UIcmdWithADouble("/adjoint_physics/SetCSBiasingFactorForPEeffect",this);
SetCSBiasingFactorPEeffectCmd->SetGuidance("Set the CS biading factor for the adjoint PEeffect Cross section");
SetCSBiasingFactorPEeffectCmd->SetParameterName("biasing_factor",false);
SetCSBiasingFactorPEeffectCmd->AvailableForStates(G4State_PreInit);
#endif
*/
fSetEmaxAdjModelsCmd = new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels",this);
fSetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models.");
fSetEmaxAdjModelsCmd->SetParameterName("Emax",false);
fSetEmaxAdjModelsCmd->SetUnitCategory("Energy");
fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4AdjointPhysicsMessenger::~G4AdjointPhysicsMessenger()
{
delete fUsepIonisationCmd;
delete fUseBremCmd;
delete fUseComptonCmd;
delete fUseMSCmd;
delete fUsePEEffectCmd;
delete fUseGammaConversionCmd;
delete fUseEgainFluctuationCmd;
delete fSetEminAdjModelsCmd;
delete fSetEmaxAdjModelsCmd;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if ( command==UsepIonisationCmd){
thePhysicsList->SetUseProtonIonisation(UsepIonisationCmd->GetNewBoolValue(newValue));
if ( command==fUsepIonisationCmd){
fPhysicsList->SetUseProtonIonisation(
fUsepIonisationCmd->GetNewBoolValue(newValue));
}
else if ( command==UseBremCmd){
thePhysicsList->SetUseBrem(UseBremCmd->GetNewBoolValue(newValue));
else if ( command==fUseBremCmd){
fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue));
}
else if ( command==UseComptonCmd){
thePhysicsList->SetUseCompton(UseComptonCmd->GetNewBoolValue(newValue));
else if ( command==fUseComptonCmd){
fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue));
}
else if ( command==UseMSCmd){
thePhysicsList->SetUseMS(UseMSCmd->GetNewBoolValue(newValue));
else if ( command==fUseMSCmd){
fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue));
}
else if ( command==UsePEEffectCmd){
thePhysicsList->SetUsePEEffect(UsePEEffectCmd->GetNewBoolValue(newValue));
else if ( command==fUsePEEffectCmd){
fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue));
}
else if ( command==UseGammaConversionCmd){
thePhysicsList->SetUseGammaConversion(UseGammaConversionCmd->GetNewBoolValue(newValue));
else if ( command==fUseGammaConversionCmd){
fPhysicsList->SetUseGammaConversion(
fUseGammaConversionCmd->GetNewBoolValue(newValue));
}
else if ( command==UseEgainFluctuationCmd){
thePhysicsList->SetUseEgainFluctuation(UseEgainFluctuationCmd->GetNewBoolValue(newValue));
else if ( command==fUseEgainFluctuationCmd){
fPhysicsList->SetUseEgainFluctuation(
fUseEgainFluctuationCmd->GetNewBoolValue(newValue));
}
else if ( command== SetEminAdjModelsCmd){
thePhysicsList->SetEminAdjModels(SetEminAdjModelsCmd->GetNewDoubleValue(newValue));
else if ( command== fSetEminAdjModelsCmd){
fPhysicsList->SetEminAdjModels(
fSetEminAdjModelsCmd->GetNewDoubleValue(newValue));
}
else if ( command== SetEmaxAdjModelsCmd){
thePhysicsList->SetEmaxAdjModels(SetEmaxAdjModelsCmd->GetNewDoubleValue(newValue));
else if ( command== fSetEmaxAdjModelsCmd){
fPhysicsList->SetEmaxAdjModels(
fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue));
}
/*
#ifdef TEST_MODE
else if ( command== SetCSBiasingFactorComptonCmd){
thePhysicsList->SetCSBiasingFactorCompton(SetCSBiasingFactorComptonCmd->GetNewDoubleValue(newValue));
}
else if ( command== SetCSBiasingFactorBremCmd){
thePhysicsList->SetCSBiasingFactorBrem(SetCSBiasingFactorBremCmd->GetNewDoubleValue(newValue));
}
else if ( command== SetCSBiasingFactorIonisationCmd){
thePhysicsList->SetCSBiasingFactorIonisation(SetCSBiasingFactorIonisationCmd->GetNewDoubleValue(newValue));
}
else if ( command== SetCSBiasingFactorPEeffectCmd){
thePhysicsList->SetCSBiasingFactorPEeffect(SetCSBiasingFactorPEeffectCmd->GetNewDoubleValue(newValue));
}
#endif
*/
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,16 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file biasing/ReverseMC01/src/Histo1DVar.cc
/// \brief Implementation of the Histo1DVar class
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: Histo1DVar.cc
//
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -23,16 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file biasing/ReverseMC01/src/Histo2Dvar.cc
/// \brief Implementation of the Histo2Dvar class
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: Histo2DVar.cc
//
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott, F Lei
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott, F Lei
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -230,13 +233,13 @@ double Histo2DVar::get_bin_error (int i, int j)
// totalWeight[i][j]*totalWeight[i][j]);}
{
if (nEvents[i][j]>0) {
error = totalWeight[i][j]/std::sqrt((G4double) nEvents[i][j]);
error = totalWeight[i][j]/std::sqrt((G4double) nEvents[i][j]);
}else {
error = 0.;} }
error = 0.;} }
else
{error = std::sqrt(uoflowTotalWeightSquared[xSpecialBin][ySpecialBin] -
uoflowTotalWeight[xSpecialBin][ySpecialBin]*
uoflowTotalWeight[xSpecialBin][ySpecialBin]);}
uoflowTotalWeight[xSpecialBin][ySpecialBin]*
uoflowTotalWeight[xSpecialBin][ySpecialBin]);}
return error;
}
@@ -23,16 +23,23 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01AdjointEventAction.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01AdjointEventAction.cc
/// \brief Implementation of the RMC01AdjointEventAction class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01AdjointEventAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01AdjointEventAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01AdjointEventAction.hh"
#include "G4Event.hh"
#include "G4PrimaryVertex.hh"
@@ -46,38 +53,42 @@
#include "G4VisAttributes.hh"
#include "G4Trajectory.hh"
#include "G4TrajectoryPoint.hh"
#include "G4UnitsTable.hh"
#include "G4SDManager.hh"
#include "Randomize.hh"
#include <iomanip>
#include "RMC01SD.hh"
#include "RMC01AnalysisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01AdjointEventAction::RMC01AdjointEventAction()
{;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01AdjointEventAction::~RMC01AdjointEventAction()
{;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01AdjointEventAction::BeginOfEventAction(const G4Event* anEvent )
{ G4int i_event=anEvent->GetEventID();
G4bool print_nb=false;
if (i_event <100) print_nb =true;
else if (i_event<500 && (i_event/100)*100 == i_event) print_nb = true;
else if (i_event<5000 && (i_event/500)*500 == i_event) print_nb = true;
else if ((i_event/5000)*5000 == i_event) print_nb = true;
if (print_nb) G4cout<<"nb event "<<i_event<<std::endl;
{ G4int i_event=anEvent->GetEventID();
G4bool print_nb=false;
if (i_event <100) print_nb =true;
else if (i_event<500 && (i_event/100)*100 == i_event) print_nb = true;
else if (i_event<5000 && (i_event/500)*500 == i_event) print_nb = true;
else if ((i_event/5000)*5000 == i_event) print_nb = true;
if (print_nb) G4cout<<"nb event "<<i_event<<std::endl;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01AdjointEventAction::EndOfEventAction(const G4Event* )
{ ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
File diff suppressed because it is too large Load Diff
@@ -23,15 +23,17 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01AnalysisManagerMessenger.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01AnalysisManagerMessenger.cc
/// \brief Implementation of the RMC01AnalysisManagerMessenger class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01AnalysisManagerMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01AnalysisManagerMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
#include "RMC01AnalysisManagerMessenger.hh"
@@ -40,20 +42,17 @@
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01AnalysisManagerMessenger::RMC01AnalysisManagerMessenger(RMC01AnalysisManager* analysisManager)
:theAnalysisManager(analysisManager)
RMC01AnalysisManagerMessenger::RMC01AnalysisManagerMessenger(
RMC01AnalysisManager* analysisManager)
:fAnalysisManager(analysisManager)
{
fAnalysisDir = new G4UIdirectory("/RMC01/analysis/");
fAnalysisDir->SetGuidance("Analysis commands");
analysisDir = new G4UIdirectory("/RMC01/analysis/");
analysisDir->SetGuidance("Analysis commands");
G4UIparameter* fluence_par = new G4UIparameter("Fluence",'d',true);
fluence_par->SetParameterRange("Fluence > 0");
fluence_par->SetGuidance("Omnidirectional fluence for primary spectrum");
@@ -63,104 +62,114 @@ RMC01AnalysisManagerMessenger::RMC01AnalysisManagerMessenger(RMC01AnalysisManage
G4UIparameter* alpha_par = new G4UIparameter("alpha",'d',true);
G4UIparameter* E0_par = new G4UIparameter("E0",'d',true);
E0_par->SetParameterRange("E0 > 0");
G4UIparameter* e0_par = new G4UIparameter("E0",'d',true);
e0_par->SetParameterRange("E0 > 0");
G4UIparameter* E1_par = new G4UIparameter("E1",'d',true);
E1_par->SetParameterRange("E1 > 0");
G4UIparameter* e1_par = new G4UIparameter("E1",'d',true);
e1_par->SetParameterRange("E1 > 0");
G4UIparameter* E2_par = new G4UIparameter("E2",'d',true);
E2_par->SetParameterRange("E2 > 0");
G4UIparameter* e2_par = new G4UIparameter("E2",'d',true);
e2_par->SetParameterRange("E2 > 0");
G4UIparameter* E_unit_par = new G4UIparameter("E_unit",'s',true);
E_unit_par->SetParameterCandidates("eV keV MeV GeV TeV");
G4UIparameter* e_unit_par = new G4UIparameter("E_unit",'s',true);
e_unit_par->SetParameterCandidates("eV keV MeV GeV TeV");
G4UIparameter* part_name_par = new G4UIparameter("particle_name",'s',true);
part_name_par->SetParameterCandidates("e- gamma proton ");
SetPowerLawSpectrumToNormaliseAdjointResultsCmd = new G4UIcommand("/RMC01/analysis/SetPowerLawPrimSpectrumForAdjointSim",this);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd
->SetGuidance("Set the primary spectrum to which adjoint simulation results will be normalised as a power law (Ekin^-alpha).");
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(part_name_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(fluence_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(fluence_unit_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(alpha_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(E1_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(E2_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->SetParameter(E_unit_par);
SetPowerLawSpectrumToNormaliseAdjointResultsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSetPowerLawSpectrumToNormaliseAdjResCmd =
new G4UIcommand("/RMC01/analysis/SetPowerLawPrimSpectrumForAdjointSim",this);
fSetPowerLawSpectrumToNormaliseAdjResCmd
->SetGuidance("Set the primary spectrum to which adjoint simulation results will be normalised as a power law (Ekin^-alpha).");
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(part_name_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(fluence_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(fluence_unit_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(alpha_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e1_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e2_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e_unit_par);
fSetPowerLawSpectrumToNormaliseAdjResCmd
->AvailableForStates(G4State_PreInit,G4State_Idle);
SetExponentialSpectrumToNormaliseAdjointResultsCmd = new G4UIcommand("/RMC01/analysis/SetExponentialSpectrumForAdjointSim",this);
SetExponentialSpectrumToNormaliseAdjointResultsCmd
->SetGuidance("Set the primary spectrum to which adjoint simulation results will be normalised as exponential (exp(-Ekin/E0)).");
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*part_name_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*fluence_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*fluence_unit_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*E0_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*E1_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*E2_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->SetParameter(new G4UIparameter(*E_unit_par));
SetExponentialSpectrumToNormaliseAdjointResultsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSetExpSpectrumToNormaliseAdjResCmd = new G4UIcommand("/RMC01/analysis/SetExponentialSpectrumForAdjointSim",this);
fSetExpSpectrumToNormaliseAdjResCmd
->SetGuidance("Set the primary spectrum to which adjoint simulation results will be normalised as exponential (exp(-Ekin/E0)).");
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*part_name_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*fluence_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*fluence_unit_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*e0_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*e1_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*e2_par));
fSetExpSpectrumToNormaliseAdjResCmd
->SetParameter(new G4UIparameter(*e_unit_par));
fSetExpSpectrumToNormaliseAdjResCmd
->AvailableForStates(G4State_PreInit,G4State_Idle);
SetPrecisionForConvergenceTestCmd = new G4UIcmdWithADouble("/RMC01/analysis/SetExpectedPrecisionOfResults",this);
SetPrecisionForConvergenceTestCmd
fSetPrecisionForConvergenceTestCmd = new G4UIcmdWithADouble("/RMC01/analysis/SetExpectedPrecisionOfResults",this);
fSetPrecisionForConvergenceTestCmd
->SetGuidance("Set the precision in % that the computed energy deposited in the sensitive volume should reached. If this precision is reached before the end of the run, the run is aborted and the results are registered.");
SetPrecisionForConvergenceTestCmd->SetParameterName("Precision",true);
SetPrecisionForConvergenceTestCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSetPrecisionForConvergenceTestCmd->SetParameterName("Precision",true);
fSetPrecisionForConvergenceTestCmd
->AvailableForStates(G4State_PreInit,G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01AnalysisManagerMessenger::~RMC01AnalysisManagerMessenger()
{
delete analysisDir;
delete fAnalysisDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01AnalysisManagerMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{ if( command == SetPowerLawSpectrumToNormaliseAdjointResultsCmd){
G4double alpha,E1,E2,fluence;
G4String f_unit,e_unit,part_name;
const char* nv = (const char*)newValue;
std::istringstream is(nv);
is >> part_name>>fluence>>f_unit>>alpha>>E1>>E2>>e_unit;
void RMC01AnalysisManagerMessenger::SetNewValue(
G4UIcommand* command,G4String newValue)
{
if( command == fSetPowerLawSpectrumToNormaliseAdjResCmd){
G4double alpha,e1,e2,fluence;
G4String f_unit,e_unit,part_name;
const char* nv = (const char*)newValue;
std::istringstream is(nv);
is >> part_name>>fluence>>f_unit>>alpha>>e1>>e2>>e_unit;
G4double factor_f_unit=1/cm2;
if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
fluence*=factor_f_unit;
E1*= G4UnitDefinition::GetValueOf(e_unit);
E2*= G4UnitDefinition::GetValueOf(e_unit);
theAnalysisManager->SetPrimaryPowerLawSpectrumForAdjointSim(part_name, fluence, alpha, E1, E2);
G4double factor_f_unit=1/cm2;
if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
fluence*=factor_f_unit;
e1*= G4UnitDefinition::GetValueOf(e_unit);
e2*= G4UnitDefinition::GetValueOf(e_unit);
fAnalysisManager->SetPrimaryPowerLawSpectrumForAdjointSim(
part_name, fluence, alpha, e1, e2);
}
else if( command == SetExponentialSpectrumToNormaliseAdjointResultsCmd){
G4double E0,E1,E2,fluence;
G4String f_unit,e_unit,part_name;
const char* nv = (const char*)newValue;
std::istringstream is(nv);
is >> part_name>>fluence>>f_unit>>E0>>E1>>E2>>e_unit;
else if( command == fSetExpSpectrumToNormaliseAdjResCmd){
G4double e0,e1,e2,fluence;
G4String f_unit,e_unit,part_name;
const char* nv = (const char*)newValue;
std::istringstream is(nv);
is >> part_name>>fluence>>f_unit>>e0>>e1>>e2>>e_unit;
G4double factor_f_unit=1/cm2;
if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
fluence*=factor_f_unit;
G4double factor_f_unit=1/cm2;
if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
E0*= G4UnitDefinition::GetValueOf(e_unit);
E1*= G4UnitDefinition::GetValueOf(e_unit);
E2*= G4UnitDefinition::GetValueOf(e_unit);
theAnalysisManager->SetPrimaryExponentialSpectrumForAdjointSim(part_name, fluence, E0, E1, E2);
fluence*=factor_f_unit;
e0*= G4UnitDefinition::GetValueOf(e_unit);
e1*= G4UnitDefinition::GetValueOf(e_unit);
e2*= G4UnitDefinition::GetValueOf(e_unit);
fAnalysisManager->SetPrimaryExpSpectrumForAdjointSim(part_name,
fluence, e0, e1, e2);
}
else if( command == SetPrecisionForConvergenceTestCmd){
theAnalysisManager->SetPrecision(SetPrecisionForConvergenceTestCmd->GetNewDoubleValue(newValue));
else if( command == fSetPrecisionForConvergenceTestCmd){
fAnalysisManager->SetPrecision(
fSetPrecisionForConvergenceTestCmd->GetNewDoubleValue(newValue));
}
}
@@ -23,16 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01DetectorConstruction.cc,v 1.2 2010-11-11 14:39:42 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01DetectorConstruction.cc
/// \brief Implementation of the RMC01DetectorConstruction class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01DetectorConstruction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01DetectorConstruction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01DetectorConstruction.hh"
#include "RMC01DetectorMessenger.hh"
@@ -51,44 +57,36 @@
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "RMC01SD.hh"
/////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01DetectorConstruction::RMC01DetectorConstruction()
: fShield_Thickness(5.*mm),
fSensitive_cylinder_H (1.*mm),
fSensitive_cylinder_Rout (1.*mm)
{
// create commands for interactive definition of the calorimeter
detectorMessenger = new RMC01DetectorMessenger(this);
sensitive_cylinder_H = 1.*mm;
sensitive_cylinder_Rout= 1.*mm;
SetShieldingThickness(5.*mm);
/* //Sensitive detector
theSensitiveDetector = new FORWARD_DOSESD("/ForwardDetecting");
G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
*/
fDetectorMessenger = new RMC01DetectorMessenger(this);
}
/////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01DetectorConstruction::~RMC01DetectorConstruction()
{ delete detectorMessenger;
{ delete fDetectorMessenger;
}
/////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* RMC01DetectorConstruction::Construct()
{
DefineMaterials();
return ConstructSimpleGeometry();
}
/////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01DetectorConstruction::DefineMaterials()
{
@@ -112,7 +110,6 @@ void RMC01DetectorConstruction::DefineMaterials()
new G4Material("Silicon", z=14., a=28.09*g/mole, density=2.33*g/cm3);
new G4Material("Tantalum", z=73., a=180.9479*g/mole, density=16.654*g/cm3);
//
// define air
//
@@ -121,169 +118,146 @@ void RMC01DetectorConstruction::DefineMaterials()
Air->AddElement(N, fractionmass=0.7);
Air->AddElement(O, fractionmass=0.3);
//
//Example of Vacuum
//
new G4Material("Vacuum", z=1., a=1.01*g/mole,density= universe_mean_density,
kStateGas, 3.e-18*pascal, 2.73*kelvin);
}
/////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* RMC01DetectorConstruction::ConstructSimpleGeometry()
{
// Clean old geometry, if any
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();
// World
//-----------
G4Box* solidWorld = new G4Box("World",15.*cm, 15.*cm, 15.*cm);
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
G4Material::GetMaterial("Vacuum"),
"World");
G4Box* solidWorld = new G4Box("World",15.*cm, 15.*cm, 15.*cm);
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
G4Material::GetMaterial("Vacuum"),
"World");
G4VPhysicalVolume* physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0);
G4VPhysicalVolume* physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0);
//Shielding Aluminum Sphere
//-------------------
//Shielding Aluminum Sphere
//-------------------
G4double radiusShieldingSphere =10.*cm;
G4Orb* solidShieldingSphere=new G4Orb("Shielding", radiusShieldingSphere);
G4LogicalVolume* logicShieldingSphere=
new G4LogicalVolume(solidShieldingSphere,
G4Material::GetMaterial("Aluminum"),
"Shielding"); //its name;
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicShieldingSphere, //its logical volume
"Shielding", //its name
logicWorld, //its mother volume
false, //no boolean operation
0);
//Bulk Sphere
//-------------------
G4Orb* solidBulkSphere=new G4Orb("Bulk", radiusShieldingSphere-fShield_Thickness);
G4LogicalVolume* logicBulkSphere=new G4LogicalVolume(solidBulkSphere, //its solid
G4Material::GetMaterial("Air"),//its material
"Bulk"); //its name;
G4double radiusShieldingSphere =10.*cm;
G4Orb* solidShieldingSphere=new G4Orb("Shielding", radiusShieldingSphere);
G4LogicalVolume* logicShieldingSphere=new G4LogicalVolume(solidShieldingSphere,
G4Material::GetMaterial("Aluminum"),
"Shielding"); //its name;
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicShieldingSphere, //its logical volume
"Shielding", //its name
logicWorld, //its mother volume
false, //no boolean operation
0);
//Bulk Sphere
//-------------------
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicBulkSphere, //its logical volume
"Bulk", //its name
logicShieldingSphere, //its mother volume
false, //no boolean operation
0);
G4Orb* solidBulkSphere=new G4Orb("Bulk", radiusShieldingSphere-shield_Thickness);
G4LogicalVolume* logicBulkSphere=new G4LogicalVolume(solidBulkSphere, //its solid
G4Material::GetMaterial("Air"),//its material
"Bulk"); //its name;
//Detecting cylinder
//-------------------
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicBulkSphere, //its logical volume
"Bulk", //its name
logicShieldingSphere, //its mother volume
false, //no boolean operation
0);
//Detecting cylinder
//-------------------
G4Tubs* solidDetecting=new G4Tubs("SensitiveVolume",
0.,fSensitive_cylinder_Rout,fSensitive_cylinder_H/2.,
0.,twopi);
G4LogicalVolume* logicDetectingCylinder=new G4LogicalVolume(solidDetecting,
G4Material::GetMaterial("Silicon"),
"SensitiveVolume");
G4Tubs* solidDetecting=new G4Tubs("SensitiveVolume",
0.,sensitive_cylinder_Rout,sensitive_cylinder_H/2.,0.,twopi);
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,0.), //at (0,0,0)
logicDetectingCylinder, //its logical volume
"SensitiveVolume", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
0);
RMC01SD* theSensitiveDetector = new RMC01SD("/SensitiveCylinder");
G4LogicalVolume* logicDetectingCylinder=new G4LogicalVolume(solidDetecting, //its solid
G4Material::GetMaterial("Silicon"),//its material
"SensitiveVolume"); //its name;
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,0.), //at (0,0,0)
logicDetectingCylinder, //its logical volume
"SensitiveVolume", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
0);
RMC01SD* theSensitiveDetector = new RMC01SD("/SensitiveCylinder");
G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
logicDetectingCylinder->SetSensitiveDetector(theSensitiveDetector);
G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
logicDetectingCylinder->SetSensitiveDetector(theSensitiveDetector);
//Tantalum Plates on the top and beside
//-------------------------------------
G4Box* solidPlate=new G4Box("TantalumPlate",4.*cm,4.*cm,0.25*mm);
G4LogicalVolume* logicPlate=new G4LogicalVolume(solidPlate, //its solid
G4Material::GetMaterial("Tantalum"),//its material
"TantalumPlate"); //its name;
//Tantalum Plates on the top and beside
//-------------------------------------
G4Box* solidPlate=new G4Box("TantalumPlate",4.*cm,4.*cm,0.25*mm);
G4LogicalVolume* logicPlate=new G4LogicalVolume(solidPlate, //its solid
G4Material::GetMaterial("Tantalum"),//its material
"TantalumPlate"); //its name;
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,6.*cm), //at (0,0,0)
logicPlate, //its logical volume
"TantalumPlate1", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,6.*cm), //at (0,0,0)
logicPlate, //its logical volume
"TantalumPlate1", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
0);
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,-6.*cm), //at (0,0,0)
logicPlate, //its logical volume
"TantalumPlate2", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
0);
new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,-6.*cm), //at (0,0,0)
logicPlate, //its logical volume
"TantalumPlate2", //its name
logicBulkSphere, //its mother volume
false, //no boolean operation
0);
return physiWorld;
//G4cout<<"Geo construction finished"<<std::endl;
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
///////////////////////////////////////////////////////////////////////////////////////
//
void RMC01DetectorConstruction::SetSensitiveVolumeRadius(G4double r)
{ sensitive_cylinder_Rout=r;
}
///////////////////////////////////////////////////////////////////////////////////////
//
void RMC01DetectorConstruction::SetSensitiveVolumeHeight(G4double h)
{ sensitive_cylinder_H=h;
{ fSensitive_cylinder_Rout=r;
}
///////////////////////////////////////////////////////////////////////////////////////
//
void RMC01DetectorConstruction::SetShieldingThickness(G4double d)
{ shield_Thickness=d;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01DetectorConstruction::SetSensitiveVolumeHeight(G4double h)
{ fSensitive_cylinder_H=h;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01DetectorConstruction::SetShieldingThickness(G4double d)
{ fShield_Thickness=d;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,17 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01DetectorMessenger.cc,v 1.2 2009-11-27 14:43:25 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01DetectorMessenger.cc
/// \brief Implementation of the RMC01DetectorMessenger class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01DetectorMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01DetectorMessenger
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01DetectorMessenger.hh"
#include "RMC01DetectorConstruction.hh"
@@ -45,29 +50,35 @@
RMC01DetectorMessenger::RMC01DetectorMessenger(
RMC01DetectorConstruction* GeneralDet)
:theDetector(GeneralDet)
:fTheDetector(GeneralDet)
{
GeneralDir= new G4UIdirectory("/RMC01/");
GeneralDir->SetGuidance("Control of the Geant4 Reverse Monte Carlo example1");
fGeneralDir= new G4UIdirectory("/RMC01/");
fGeneralDir->SetGuidance("Control of the Geant4 Reverse Monte Carlo example1");
detDir = new G4UIdirectory("/RMC01/geometry/");
detDir->SetGuidance("Geometry control");
fDetDir = new G4UIdirectory("/RMC01/geometry/");
fDetDir->SetGuidance("Geometry control");
SetSensitiveVolumeHeightCmd = new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetSensitiveVolumeHeight",this);
SetSensitiveVolumeHeightCmd->SetGuidance("Set the height of the sensitive cylinder");
SetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit);
fSetSensitiveVolumeHeightCmd = new G4UIcmdWithADoubleAndUnit(
"/RMC01/geometry/SetSensitiveVolumeHeight",this);
fSetSensitiveVolumeHeightCmd->SetGuidance(
"Set the height of the sensitive cylinder");
fSetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit);
SetSensitiveVolumeRadiusCmd = new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetSensitiveVolumeRadius",this);
SetSensitiveVolumeRadiusCmd->SetGuidance("Set the radius of the sensitive cylinder");
SetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit);
fSetSensitiveVolumeRadiusCmd = new G4UIcmdWithADoubleAndUnit(
"/RMC01/geometry/SetSensitiveVolumeRadius",this);
fSetSensitiveVolumeRadiusCmd->SetGuidance(
"Set the radius of the sensitive cylinder");
fSetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit);
SetShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetShieldingThickness",this);
SetShieldingThicknessCmd->SetGuidance("Set the thickness of the Aluminum Shielding sphere");
SetShieldingThicknessCmd->AvailableForStates(G4State_PreInit);
fSetShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit(
"/RMC01/geometry/SetShieldingThickness",this);
fSetShieldingThicknessCmd->SetGuidance(
"Set the thickness of the Aluminum Shielding sphere");
fSetShieldingThicknessCmd->AvailableForStates(G4State_PreInit);
}
@@ -75,28 +86,31 @@ RMC01DetectorMessenger::RMC01DetectorMessenger(
RMC01DetectorMessenger::~RMC01DetectorMessenger()
{
if (GeneralDir ) delete GeneralDir;
if (detDir) delete detDir;
if (SetSensitiveVolumeHeightCmd) delete SetSensitiveVolumeHeightCmd;
if (SetSensitiveVolumeRadiusCmd) delete SetSensitiveVolumeRadiusCmd;
if (SetShieldingThicknessCmd) delete SetShieldingThicknessCmd;
if (fGeneralDir ) delete fGeneralDir;
if (fDetDir) delete fDetDir;
if (fSetSensitiveVolumeHeightCmd) delete fSetSensitiveVolumeHeightCmd;
if (fSetSensitiveVolumeRadiusCmd) delete fSetSensitiveVolumeRadiusCmd;
if (fSetShieldingThicknessCmd) delete fSetShieldingThicknessCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{ if( command == SetSensitiveVolumeHeightCmd ){
theDetector->SetSensitiveVolumeHeight(SetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue));
void RMC01DetectorMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{ if( command == fSetSensitiveVolumeHeightCmd ){
fTheDetector->SetSensitiveVolumeHeight(
fSetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue));
}
else if( command == SetSensitiveVolumeRadiusCmd ){
theDetector->SetSensitiveVolumeRadius(SetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue));
else if( command == fSetSensitiveVolumeRadiusCmd ){
fTheDetector->SetSensitiveVolumeRadius(
fSetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue));
}
else if( command == SetShieldingThicknessCmd ){
theDetector->SetShieldingThickness(SetShieldingThicknessCmd->GetNewDoubleValue(newValue));
else if( command == fSetShieldingThicknessCmd ){
fTheDetector->SetShieldingThickness(
fSetShieldingThicknessCmd->GetNewDoubleValue(newValue));
}
}
@@ -23,47 +23,66 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01DoubleWithWeightHit.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01DoubleWithWeightHit.cc
/// \brief Implementation of the RMC01DoubleWithWeightHit class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01DoubleWithWeightHit
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01DoubleWithWeightHit
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01DoubleWithWeightHit.hh"
G4Allocator<RMC01DoubleWithWeightHit> RMC01DoubleWithWeightHitAllocator;
RMC01DoubleWithWeightHit::RMC01DoubleWithWeightHit(G4double aValue, G4double aWeight)
{
theValue = aValue;
theWeight = aWeight;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01DoubleWithWeightHit::RMC01DoubleWithWeightHit(G4double aValue,
G4double aWeight)
: fValue(aValue),fWeight (aWeight)
{;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01DoubleWithWeightHit::~RMC01DoubleWithWeightHit()
{
}
RMC01DoubleWithWeightHit::RMC01DoubleWithWeightHit(const RMC01DoubleWithWeightHit &right)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01DoubleWithWeightHit::RMC01DoubleWithWeightHit(
const RMC01DoubleWithWeightHit &right)
: G4VHit()
{
theValue = right.theValue;
theWeight = right.theWeight;
fValue = right.fValue;
fWeight = right.fWeight;
}
const RMC01DoubleWithWeightHit& RMC01DoubleWithWeightHit::operator=(const RMC01DoubleWithWeightHit &right)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RMC01DoubleWithWeightHit& RMC01DoubleWithWeightHit::operator=(
const RMC01DoubleWithWeightHit &right)
{
theValue = right.theValue;
theWeight = right.theWeight;
fValue = right.fValue;
fWeight = right.fWeight;
return *this;
}
int RMC01DoubleWithWeightHit::operator==(const RMC01DoubleWithWeightHit &right) const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int RMC01DoubleWithWeightHit::operator==
(const RMC01DoubleWithWeightHit &right) const
{
return(theValue == right.theValue && theWeight == right.theWeight);
return(fValue == right.fValue && fWeight == right.fWeight);
}
@@ -23,42 +23,57 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01EventAction.cc,v 1.2 2010-06-06 04:22:20 perl Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01EventAction.cc
/// \brief Implementation of the RMC01EventAction class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01EventAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01EventAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01EventAction.hh"
#include "G4Event.hh"
#include "RMC01AnalysisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01EventAction::RMC01EventAction()
{;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01EventAction::~RMC01EventAction()
{;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01EventAction::BeginOfEventAction(const G4Event* anEvent )
{ G4int i_event=anEvent->GetEventID();
G4bool print_nb=false;
if (i_event <100) print_nb =true;
else if (i_event<500 && (i_event/100)*100 == i_event) print_nb = true;
else if (i_event<5000 && (i_event/500)*500 == i_event) print_nb = true;
else if ((i_event/5000)*5000 == i_event) print_nb = true;
if (print_nb) G4cout<<"nb event "<<i_event<<std::endl;
RMC01AnalysisManager::GetInstance()->BeginOfEvent(anEvent);
{
G4int i_event=anEvent->GetEventID();
G4bool print_nb=false;
if (i_event <100) print_nb =true;
else if (i_event<500 && (i_event/100)*100 == i_event) print_nb = true;
else if (i_event<5000 && (i_event/500)*500 == i_event) print_nb = true;
else if ((i_event/5000)*5000 == i_event) print_nb = true;
if (print_nb) G4cout<<"nb event "<<i_event<<std::endl;
RMC01AnalysisManager::GetInstance()->BeginOfEvent(anEvent);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01EventAction::EndOfEventAction(const G4Event* anEvent)
{ RMC01AnalysisManager::GetInstance()->EndOfEvent(anEvent);
{
RMC01AnalysisManager::GetInstance()->EndOfEvent(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,38 +23,41 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01PrimaryGeneratorAction.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01PrimaryGeneratorAction.cc
/// \brief Implementation of the RMC01PrimaryGeneratorAction class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01PrimaryGeneratorAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01PrimaryGeneratorAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4SingleParticleSource.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4Electron.hh"
#include "Randomize.hh"
#include "G4ParticleTable.hh"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01PrimaryGeneratorAction::RMC01PrimaryGeneratorAction()
{theParticleSource = new G4GeneralParticleSource();
{fParticleSource = new G4GeneralParticleSource();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01PrimaryGeneratorAction::~RMC01PrimaryGeneratorAction()
{delete theParticleSource;
{delete fParticleSource;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{theParticleSource->GeneratePrimaryVertex(anEvent);
{fParticleSource->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,40 +23,49 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01RunAction.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01RunAction.cc
/// \brief Implementation of the RMC01RunAction class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01RunAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01RunAction
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
#include "RMC01RunAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01RunAction.hh"
#include "RMC01AnalysisManager.hh"
///////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01RunAction::RMC01RunAction()
{ theAnalysisManager = RMC01AnalysisManager::GetInstance();
{ fAnalysisManager = RMC01AnalysisManager::GetInstance();
}
///////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01RunAction::~RMC01RunAction()
{ if (theAnalysisManager) delete theAnalysisManager;
{ if (fAnalysisManager) delete fAnalysisManager;
}
///////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
theAnalysisManager->BeginOfRun(aRun);
fAnalysisManager->BeginOfRun(aRun);
}
///////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01RunAction::EndOfRunAction(const G4Run* aRun)
{ theAnalysisManager->EndOfRun(aRun);
{ fAnalysisManager->EndOfRun(aRun);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,16 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RMC01SD.cc,v 1.1 2009-11-19 22:41:18 ldesorgh Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file biasing/ReverseMC01/src/RMC01SD.cc
/// \brief Implementation of the RMC01SD class
//
// $Id$
//
//////////////////////////////////////////////////////////////
// Class Name: RMC01SD
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// Class Name: RMC01SD
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RMC01SD.hh"
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"
@@ -54,91 +60,107 @@
#include "G4Gamma.hh"
#include "G4Proton.hh"
class G4Step;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01SD::RMC01SD(G4String name)
:G4VSensitiveDetector(name)
{
collectionName.insert("edep");
collectionName.insert("current_electron");
collectionName.insert("current_proton");
collectionName.insert("current_gamma");
;
:G4VSensitiveDetector(name),
fTotalEventEdep(0.),fEventEdepCollection(0),
fProtonCurrentCollection(0),fGammaCurrentCollection(0),
fElectronCurrentCollection(0)
{
collectionName.insert("edep");
collectionName.insert("current_electron");
collectionName.insert("current_proton");
collectionName.insert("current_gamma");
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RMC01SD::~RMC01SD()
{;
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01SD::Initialize(G4HCofThisEvent* HCE)
{ TotalEventEdep=0.;
static G4int HCID = -1;
{
fTotalEventEdep=0.;
static G4int HCID = -1;
EventEdepCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>(SensitiveDetectorName,collectionName[0]);
HCID = GetCollectionID(0);
HCE->AddHitsCollection(HCID,EventEdepCollection);
fEventEdepCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>
(SensitiveDetectorName,collectionName[0]);
HCID = GetCollectionID(0);
HCE->AddHitsCollection(HCID,fEventEdepCollection);
ElectronCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>(SensitiveDetectorName,collectionName[1]);
HCID = GetCollectionID(1);
HCE->AddHitsCollection(HCID,ElectronCurrentCollection);
fElectronCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>
(SensitiveDetectorName,collectionName[1]);
HCID = GetCollectionID(1);
HCE->AddHitsCollection(HCID,fElectronCurrentCollection);
ProtonCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>(SensitiveDetectorName,collectionName[2]);
HCID = GetCollectionID(2);
HCE->AddHitsCollection(HCID,ProtonCurrentCollection);
fProtonCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>
(SensitiveDetectorName,collectionName[2]);
HCID = GetCollectionID(2);
HCE->AddHitsCollection(HCID,fProtonCurrentCollection);
GammaCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>(SensitiveDetectorName,collectionName[3]);
HCID = GetCollectionID(3);
HCE->AddHitsCollection(HCID,GammaCurrentCollection);
fGammaCurrentCollection = new G4THitsCollection<RMC01DoubleWithWeightHit>
(SensitiveDetectorName,collectionName[3]);
HCID = GetCollectionID(3);
HCE->AddHitsCollection(HCID,fGammaCurrentCollection);
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RMC01SD::ProcessHits(G4Step*aStep,G4TouchableHistory* )
{
G4double weight =aStep->GetTrack()->GetWeight();
G4double edep= aStep->GetTotalEnergyDeposit();
if (edep >0) EventEdepCollection->insert(new RMC01DoubleWithWeightHit(edep,weight));
if (edep >0) fEventEdepCollection->insert(
new RMC01DoubleWithWeightHit(edep,weight));
G4StepPoint* preStepPoint =aStep->GetPreStepPoint();
if (preStepPoint->GetStepStatus() == fGeomBoundary ){
// Entering the sensitive volume
weight=preStepPoint->GetWeight();
G4double eKin = preStepPoint->GetKineticEnergy();
G4ParticleDefinition* thePartDef = aStep->GetTrack()->GetDefinition();
if (thePartDef == G4Electron::Electron()) ElectronCurrentCollection->insert(new RMC01DoubleWithWeightHit(eKin,weight));
else if (thePartDef == G4Gamma::Gamma()) GammaCurrentCollection->insert(new RMC01DoubleWithWeightHit(eKin,weight));
else if (thePartDef == G4Proton::Proton()) ProtonCurrentCollection->insert(new RMC01DoubleWithWeightHit(eKin,weight));
// Entering the sensitive volume
weight=preStepPoint->GetWeight();
G4double eKin = preStepPoint->GetKineticEnergy();
G4ParticleDefinition* thePartDef = aStep->GetTrack()->GetDefinition();
if (thePartDef == G4Electron::Electron()) fElectronCurrentCollection->
insert(new RMC01DoubleWithWeightHit(eKin,weight));
else if (thePartDef == G4Gamma::Gamma()) fGammaCurrentCollection->
insert(new RMC01DoubleWithWeightHit(eKin,weight));
else if (thePartDef == G4Proton::Proton()) fProtonCurrentCollection->
insert(new RMC01DoubleWithWeightHit(eKin,weight));
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01SD::EndOfEvent(G4HCofThisEvent*)
{ EventEdepCollection->insert(new RMC01DoubleWithWeightHit(TotalEventEdep,1.));
{
fEventEdepCollection->insert(new RMC01DoubleWithWeightHit(fTotalEventEdep,1.));
}
////////////////////////////////////////////////////////////////////////////////
//
void RMC01SD::clear()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01SD::Clear()
{;
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01SD::DrawAll()
{;
}
////////////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RMC01SD::PrintAll()
{;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,16 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file biasing/ReverseMC01/src/VariableLengthPartition.cc
/// \brief Implementation of the VariableLengthPartition class
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: VariableLengthParition.cc
//
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
// Version: 1.0
// Date: 09/03/00
// Author: P R Truscott
// Organisation: DERA UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 12115/96/NL/JG Work Order No. 3
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -89,13 +92,13 @@ long VariableLengthPartition::get_elem_bin (double *data_point)
// Find out whether *data_point falls below of exceeds the range of the
// binning scheme.
//
int location (0);
int loc (0);
if ((conv == LEFT && *data_point > bin[nbin]) ||
(conv == RIGHT && *data_point >= bin[nbin])) {
location = BIN_OVERFLOW;}
loc = BIN_OVERFLOW;}
else if ((conv == LEFT && *data_point <= *bin.begin()) ||
(conv == RIGHT && *data_point < *bin.begin())) {
location = BIN_UNDERFLOW;}
loc = BIN_UNDERFLOW;}
else {
//
//
@@ -103,16 +106,16 @@ long VariableLengthPartition::get_elem_bin (double *data_point)
//
int upperLimit = bin.size()-1;
int lowerLimit = 0;
location = (upperLimit-1)/2;
while (*data_point < bin[location] || *data_point > bin[location+1]) {
if (*data_point < bin[location]) {upperLimit = location;}
else {lowerLimit = location;}
location = (upperLimit+lowerLimit)/2;
loc = (upperLimit-1)/2;
while (*data_point < bin[loc] || *data_point > bin[loc+1]) {
if (*data_point < bin[loc]) {upperLimit = loc;}
else {lowerLimit = loc;}
loc = (upperLimit+lowerLimit)/2;
}
if (bin[location] == *data_point && conv == RIGHT) {
location++;}
if (bin[loc] == *data_point && conv == RIGHT) {
loc++;}
}
return location;
return loc;
}
////////////////////////////////////////////////////////////////////////////////
//