Skip to content

Commit

Permalink
Fix length of command descriptions across all generators
Browse files Browse the repository at this point in the history
  • Loading branch information
paolafer committed Jan 18, 2024
1 parent c005a2f commit 1aa7a09
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 16 deletions.
3 changes: 2 additions & 1 deletion source/generators/ECECGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ ECECGenerator::ECECGenerator():
"Shell from which the electron is captured.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where vertices will be generated.");
"Region of the geometry "
"where vertices will be generated.");

}

Expand Down
4 changes: 3 additions & 1 deletion source/generators/ElecPositronPairGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ geom_(0)
max_energy.SetRange("max_energy>0.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");

DetectorConstruction* detconst = (DetectorConstruction*) G4RunManager::GetRunManager()->GetUserDetectorConstruction();
geom_ = detconst->GetGeometry();
Expand Down Expand Up @@ -129,3 +130,4 @@ void ElecPositronPairGenerator::GeneratePrimaryVertex(G4Event* event)
vertex->SetPrimary(particle2);
event->AddPrimaryVertex(vertex);
}

18 changes: 12 additions & 6 deletions source/generators/IonGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ IonGenerator::IonGenerator():
msg_(nullptr), geom_(nullptr)
{
msg_ = new G4GenericMessenger(this, "/Generator/IonGenerator/",
"Control commands of the ion gun primary generator.");
"Control commands of the ion gun "
"primary generator.");

G4GenericMessenger::Command& atomic_number_cmd =
msg_->DeclareProperty("atomic_number", atomic_number_, "Atomic number of the ion.");
msg_->DeclareProperty("atomic_number", atomic_number_,
"Atomic number of the ion.");
atomic_number_cmd.SetParameterName("atomic_number", false);
atomic_number_cmd.SetRange("atomic_number > 0");

G4GenericMessenger::Command& mass_number_cmd =
msg_->DeclareProperty("mass_number", mass_number_, "Mass number of the ion.");
msg_->DeclareProperty("mass_number", mass_number_,
"Mass number of the ion.");
mass_number_cmd.SetParameterName("mass_number", false);
mass_number_cmd.SetRange("mass_number > 0");

Expand All @@ -54,13 +57,15 @@ IonGenerator::IonGenerator():
"Set to true to make unstable ions decay at t=0.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where vertices will be generated.");
"Region of the geometry "
"where vertices will be generated.");

// Load the detector geometry, which will be used for the generation of vertices
const DetectorConstruction* detconst = dynamic_cast<const DetectorConstruction*>
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
if (detconst) geom_ = detconst->GetGeometry();
else G4Exception("[IonGenerator]", "IonGenerator()", FatalException, "Unable to load geometry.");
else G4Exception("[IonGenerator]", "IonGenerator()", FatalException,
"Unable to load geometry.");
}


Expand All @@ -73,7 +78,8 @@ IonGenerator::~IonGenerator()
G4ParticleDefinition* IonGenerator::IonDefinition()
{
G4ParticleDefinition* pdef =
G4IonTable::GetIonTable()->GetIon(atomic_number_, mass_number_, energy_level_);
G4IonTable::GetIonTable()->GetIon(atomic_number_, mass_number_,
energy_level_);

if (!pdef) G4Exception("[IonGenerator]", "IonDefinition()",
FatalException, "Unable to find the requested ion.");
Expand Down
6 changes: 4 additions & 2 deletions source/generators/Kr83mGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace nexus {

using namespace CLHEP;

Kr83mGenerator::Kr83mGenerator() : geom_(0), energy_32_(32.1473*keV), energy_9_(9.396*keV),
Kr83mGenerator::Kr83mGenerator() : geom_(0), energy_32_(32.1473*keV),
energy_9_(9.396*keV),
probGamma_9_(0.0490), lifetime_9_(154.*ns)
{
// From the TORI /ENSDF data tables.
Expand Down Expand Up @@ -88,7 +89,8 @@ namespace nexus {
"Control commands of Kr83 generator.");

msg_->DeclareProperty("region", region_,
"Set the region of the geometry where the vertex will be generated.");
"Set the region of the geometry "
"where the vertex will be generated.");

// Set particle type searching in particle table by name
particle_defgamma_ = G4ParticleTable::GetParticleTable()->
Expand Down
3 changes: 2 additions & 1 deletion source/generators/LambertianGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ costheta_min_(0), costheta_max_(1.)
max_energy.SetRange("max_energy>0.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");


msg_->DeclarePropertyWithUnit("momentum", "mm", momentum_,
Expand Down
3 changes: 2 additions & 1 deletion source/generators/MuonGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ MuonGenerator::MuonGenerator():
max_energy.SetRange("max_energy>0.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");

msg_->DeclareProperty("use_lsc_dist", use_lsc_dist_,
"Distribute muon directions according to file?");
Expand Down
5 changes: 3 additions & 2 deletions source/generators/Na22Generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ namespace nexus {

Na22Generator::Na22Generator() : geom_(0)
{
/// For the moment, only random direction are allowed. To be fixes if needed
/// For the moment, only random direction are allowed. To be fixed if needed
msg_ = new G4GenericMessenger(this, "/Generator/Na22Generator/",
"Control commands of Na22 generator.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");


DetectorConstruction* detconst = (DetectorConstruction*)
Expand Down
3 changes: 2 additions & 1 deletion source/generators/ScintillationGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ScintillationGenerator::ScintillationGenerator() :
"Control commands of scintillation generator.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");

msg_->DeclareProperty("nphotons", nphotons_, "Number of photons");

Expand Down
3 changes: 2 additions & 1 deletion source/generators/SingleParticleGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ costheta_min_(-1.), costheta_max_(1.), phi_min_(0.), phi_max_(2.*pi)
max_energy.SetRange("max_energy>0.");

msg_->DeclareProperty("region", region_,
"Region of the geometry where the vertex will be generated.");
"Region of the geometry "
"where the vertex will be generated.");


msg_->DeclarePropertyWithUnit("momentum", "mm", momentum_,
Expand Down

0 comments on commit 1aa7a09

Please sign in to comment.