33 fGarfieldPhysicsDir(0),
34 fIonizationModelCmd(0),
35 fGarfieldParticleCmd(0)
37 fExampleDir =
new G4UIdirectory(
"/exampleGarfield/");
38 fExampleDir->SetGuidance(
"Commands specific to this example");
40 G4bool broadcast =
false;
42 new G4UIdirectory(
"/exampleGarfield/physics/", broadcast);
44 "Particle and energy ranges for Garfield++ physics model");
47 new G4UIcommand(
"/exampleGarfield/physics/setIonizationModel",
this);
50 " and choose whether to use default particles");
53 G4UIparameter* ionizationModelPrm =
54 new G4UIparameter(
"ionizationModel",
's',
false);
55 ionizationModelPrm->SetGuidance(
"ionization model (1. PAIPhot, 2. Heed)");
56 ionizationModelPrm->SetGuidance(
57 " 1. Geant4 model, delta electrons transported by Heed");
58 ionizationModelPrm->SetGuidance(
" 2. Use directly Heed");
61 G4UIparameter* useDefaultsPrm =
new G4UIparameter(
"useDefaults",
'b',
false);
62 useDefaultsPrm->SetGuidance(
63 "true to use default, false to manually choose particles and energies");
69 "/exampleGarfield/physics/setGarfieldParticleTypeAndEnergy",
this);
71 "Select particle types and energies for Heed model.");
73 " For PAI and PAIPhot model choose at which energy electrons are");
75 " transported as delta electrons by Heed, and treatment of gammas");
77 G4UIparameter* particleGarfieldPrm =
78 new G4UIparameter(
"particleName",
's',
false);
79 particleGarfieldPrm->SetGuidance(
80 "Particle name (gamma, e-, e+, mu-, mu+, proton, anti_proton, pi-, pi+, "
81 "kaon, kaon+, alpha, deuteron)");
84 G4UIparameter* minEnergyGarfieldPrm =
85 new G4UIparameter(
"minimumEnergyGarfield",
'd',
false);
86 minEnergyGarfieldPrm->SetGuidance(
"minimum energy");
87 minEnergyGarfieldPrm->SetParameterRange(
"minimumEnergyGarfield>=0");
90 G4UIparameter* maxEnergyGarfieldPrm =
91 new G4UIparameter(
"maximumEnergyGarfield",
'd',
false);
92 maxEnergyGarfieldPrm->SetGuidance(
"maximum energy");
93 maxEnergyGarfieldPrm->SetParameterRange(
"maximumEnergyGarfield>=0");
96 G4UIparameter* unitGarfieldPrm =
new G4UIparameter(
"unit",
's',
false);
97 unitGarfieldPrm->SetGuidance(
"unit of energy");
98 G4String unitListGarfield =
99 G4UIcommand::UnitsList(G4UIcommand::CategoryOf(
"MeV"));
100 unitGarfieldPrm->SetParameterCandidates(unitListGarfield);
124 std::istringstream is(newValue);
125 is >> modelName >> std::boolalpha >> useDefaults;
130 G4String particleName, unit, programName;
133 std::istringstream is(newValue);
134 is >> particleName >> minEnergy >> maxEnergy >> unit;
135 minEnergy *= G4UIcommand::ValueOf(unit);
136 maxEnergy *= G4UIcommand::ValueOf(unit);