Skip to content

Commit

Permalink
Apply minor style changes for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
EricMEsch committed Sep 12, 2024
1 parent 83eafe1 commit dd71c09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/rmg-commands.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions src/RMGGrabmayrGCReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ GammaCascadeLine RMGGrabmayrGCReader::GetNextEntry(G4int z, G4int a) {
std::pair<G4int, G4int> key = std::make_pair(z, a);
auto it = fCascadeFiles.find(key);
if (it == fCascadeFiles.end())
RMGLog::Out(RMGLog::fatal, "No Cascade exists for Isotope Z: " + std::to_string(z) +
" A: " + std::to_string(a) + " Exit!");
RMGLog::OutFormat(RMGLog::fatal, "Isotope Z: {} A: {} does not exist.", z, a);
// read next line from file
std::string line;
do {
Expand Down Expand Up @@ -105,8 +104,7 @@ void RMGGrabmayrGCReader::SetGammaCascadeFile(const G4int z, const G4int a, cons
std::unique_ptr<std::ifstream> file = std::make_unique<std::ifstream>(file_name);

if (z == 0 || a == 0)
RMGLog::Out(RMGLog::fatal,
"Isotope Z:" + std::to_string(z) + " A: " + std::to_string(a) + " does not exist.");
RMGLog::OutFormat(RMGLog::fatal, "Isotope Z: {} A: {} does not exist.", z, a);
if (!file || !file->is_open())
RMGLog::Out(RMGLog::fatal, "Gamma cascade file: " + file_name + " not found! Exit.");

Expand Down Expand Up @@ -141,15 +139,14 @@ void RMGGrabmayrGCReader::DefineCommands() {
.SetDefaultValue("0")
.SetStates(G4State_PreInit, G4State_Idle);

// SetGammaCascadeFile cannot be defined with the G4GenericMessenger (it has to many parameters).
// SetGammaCascadeFile cannot be defined with the G4GenericMessenger (it has too many parameters).
fUIMessenger = std::make_unique<GCMessenger>(this);
}


RMGGrabmayrGCReader::GCMessenger::GCMessenger(RMGGrabmayrGCReader* reader) : fReader(reader) {
fGammaFileCmd = new G4UIcommand("/RMG/GrabmayrGammaCascades/SetGammaCascadeFile", this);
fGammaFileCmd->SetGuidance("Set the Z, A and /path/to/file for the gamma cascade employed upon "
"neutron capture on said isotope");
fGammaFileCmd->SetGuidance("Set a gamma cascade file for neutron capture on a specified isotope");

auto p_Z = new G4UIparameter("Z", 'i', false);
p_Z->SetGuidance("Z of isotope");
Expand Down
2 changes: 1 addition & 1 deletion src/RMGNeutronCaptureProcess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ G4VParticleChange* RMGNeutronCaptureProcess::PostStepDoIt(const G4Track& aTrack,
G4ThreeVector location = aTrack.GetPosition();
G4double time = aTrack.GetGlobalTime();

// Expect no deponition as the total energy will be distributed
// Expect no deposition as the total energy will be distributed
theTotalResult->ProposeLocalEnergyDeposit(0.0);
theTotalResult->ProposeTrackStatus(fStopAndKill);
theTotalResult->ProposeEnergy(0.0);
Expand Down
11 changes: 5 additions & 6 deletions src/RMGPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,19 @@ void RMGPhysics::ConstructProcess() {
if (fUseGrabmayrGammaCascades) {
// Apply RMG custom neutron capture
// Mostly similar to examples/extended/Hadr04
G4ProcessManager* pManager = G4Neutron::Neutron()->GetProcessManager();
G4ProcessVector* processVector = pManager->GetProcessList();
G4NeutronCaptureProcess* neutronCaptureProcess = nullptr;
auto pManager = G4Neutron::Neutron()->GetProcessManager();
auto processVector = pManager->GetProcessList();
// Find the existing neutron capture process
neutronCaptureProcess =
auto neutronCaptureProcess =
dynamic_cast<G4NeutronCaptureProcess*>(pManager->GetProcess("nCapture"));

// Overwrite the old Process, keeping all of the interactions
if (neutronCaptureProcess) {
RMGLog::Out(RMGLog::detail, "Overwriting NeutronCaptureProcess");
pManager->RemoveProcess(neutronCaptureProcess);
RMGNeutronCaptureProcess* RMGProcess = new RMGNeutronCaptureProcess();
auto RMGProcess = new RMGNeutronCaptureProcess();
// HP cross section data set not naturally in G4NeutronCaptureProcess
G4ParticleHPCaptureData* dataSet = new G4ParticleHPCaptureData();
auto dataSet = new G4ParticleHPCaptureData();
RMGProcess->AddDataSet(dataSet);
// Move all interactions to the new process
for (auto& el : neutronCaptureProcess->GetHadronicInteractionList()) {
Expand Down

0 comments on commit dd71c09

Please sign in to comment.