43 : G4UImessenger(),
44 fDetector(Det),
45 fExampleDir(0),
46 fAbsorberDir(0),
47 fGarfieldPhysicsDir(0),
48 fMaterialCmd(0),
49 fIsotopeCmd(0),
50 fIonizationModelCmd(0),
51 fGeant4ParticleCmd(0) {
52 fExampleDir = new G4UIdirectory("/exampleGarfield/");
53 fExampleDir->SetGuidance("Commands specific to this example");
54
55 G4bool broadcast = false;
56 fAbsorberDir = new G4UIdirectory("/exampleGarfield/absorber/", broadcast);
57 fAbsorberDir->SetGuidance("Absorber construction commands");
58
59 fGarfieldPhysicsDir =
60 new G4UIdirectory("/exampleGarfield/physics/", broadcast);
61 fGarfieldPhysicsDir->SetGuidance(
62 "Particle and energy ranges for Garfield++ physics model");
63
64 fMaterialCmd =
65 new G4UIcmdWithAString("/exampleGarfield/absorber/setMat", this);
66 fMaterialCmd->SetGuidance("Select material of the absorber:");
67 fMaterialCmd->SetParameterName("choice", false);
68 fMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
69
70 fIsotopeCmd =
71 new G4UIcommand("/exampleGarfield/absorber/setIsotopeMat", this);
72 fIsotopeCmd->SetGuidance("Build and select a material with single isotope");
73 fIsotopeCmd->SetGuidance(" symbol of isotope, Z, A, density of material");
74
75 G4UIparameter* symbPrm = new G4UIparameter("isotope", 's', false);
76 symbPrm->SetGuidance("isotope symbol");
77 fIsotopeCmd->SetParameter(symbPrm);
78
79 G4UIparameter* ZPrm = new G4UIparameter("Z", 'i', false);
80 ZPrm->SetGuidance("Z");
81 ZPrm->SetParameterRange("Z>0");
82 fIsotopeCmd->SetParameter(ZPrm);
83
84 G4UIparameter* APrm = new G4UIparameter("A", 'i', false);
85 APrm->SetGuidance("A");
86 APrm->SetParameterRange("A>0");
87 fIsotopeCmd->SetParameter(APrm);
88
89 G4UIparameter* densityPrm = new G4UIparameter("density", 'd', false);
90 densityPrm->SetGuidance("density of material");
91 densityPrm->SetParameterRange("density>0.");
92 fIsotopeCmd->SetParameter(densityPrm);
93
94 G4UIparameter* unitPrm = new G4UIparameter("unit", 's', false);
95 unitPrm->SetGuidance("unit of density");
96 G4String unitList = G4UIcommand::UnitsList(G4UIcommand::CategoryOf("g/cm3"));
97 unitPrm->SetParameterCandidates(unitList);
98 fIsotopeCmd->SetParameter(unitPrm);
99
100 fIsotopeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
101
102 fIonizationModelCmd =
103 new G4UIcommand("/exampleGarfield/physics/setIonizationModel", this);
104 fIonizationModelCmd->SetGuidance("Select ionization model for Garfield++");
105 fIonizationModelCmd->SetGuidance(
106 " and choose whether to use default particles");
107 fIonizationModelCmd->SetGuidance(" and energy ranges for the chosen model");
108
109 G4UIparameter* ionizationModelPrm =
110 new G4UIparameter("ionizationModel", 's', false);
111 ionizationModelPrm->SetGuidance(
112 "ionization model (1. PAIPhot, 2. PAI or 3. Heed)");
113 ionizationModelPrm->SetGuidance(
114 " 1. PAIPhot model in Geant4, delta electrons transported by Heed");
115 ionizationModelPrm->SetGuidance(
116 " 2. PAI model in Geant4, delta electrons transported by Heed");
117 ionizationModelPrm->SetGuidance(" 3. Use directly Heed");
118 fIonizationModelCmd->SetParameter(ionizationModelPrm);
119
120 G4UIparameter* useDefaultsPrm = new G4UIparameter("useDefaults", 'b', false);
121 useDefaultsPrm->SetGuidance(
122 "true to use default, false to manually choose particles and energies");
123 fIonizationModelCmd->SetParameter(useDefaultsPrm);
124
125 fIonizationModelCmd->AvailableForStates(G4State_PreInit);
126
127 fGeant4ParticleCmd = new G4UIcommand(
128 "/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy", this);
129 fGeant4ParticleCmd->SetGuidance(
130 "Select particle types and energies for PAI and PAIPhot model");
131 fGeant4ParticleCmd->SetGuidance(" in Geant4");
132
133 G4UIparameter* particleGeant4Prm =
134 new G4UIparameter("particleName", 's', false);
135 particleGeant4Prm->SetGuidance(
136 "Particle name (e-, e+, mu-, mu+, proton, pi-, pi+, alpha, He3, "
137 "GenericIon)");
138 fGeant4ParticleCmd->SetParameter(particleGeant4Prm);
139
140 G4UIparameter* minEnergyGeant4Prm =
141 new G4UIparameter("minimumEnergyGeant4", 'd', false);
142 minEnergyGeant4Prm->SetGuidance("minimum energy");
143 minEnergyGeant4Prm->SetParameterRange("minimumEnergyGeant4>=0");
144 fGeant4ParticleCmd->SetParameter(minEnergyGeant4Prm);
145
146 G4UIparameter* maxEnergyGeant4Prm =
147 new G4UIparameter("maximumEnergyGeant4", 'd', false);
148 maxEnergyGeant4Prm->SetGuidance("maximum energy");
149 maxEnergyGeant4Prm->SetParameterRange("maximumEnergyGeant4>=0");
150 fGeant4ParticleCmd->SetParameter(maxEnergyGeant4Prm);
151
152 G4UIparameter* unitGeant4Prm = new G4UIparameter("unit", 's', false);
153 unitGeant4Prm->SetGuidance("unit of energy");
154 G4String unitListGeant4 =
155 G4UIcommand::UnitsList(G4UIcommand::CategoryOf("MeV"));
156 unitGeant4Prm->SetParameterCandidates(unitListGeant4);
157 fGeant4ParticleCmd->SetParameter(unitGeant4Prm);
158
159 fGeant4ParticleCmd->AvailableForStates(G4State_PreInit);
160
161 fGarfieldParticleCmd = new G4UIcommand(
162 "/exampleGarfield/physics/setGarfieldParticleTypeAndEnergy", this);
163 fGarfieldParticleCmd->SetGuidance(
164 "Select particle types and energies for Heed model.");
165 fGarfieldParticleCmd->SetGuidance(
166 " For PAI and PAIPhot model choose at which energy electrons are");
167 fGarfieldParticleCmd->SetGuidance(
168 " transported as delta electrons by Heed, and treatment of gammas");
169
170 G4UIparameter* particleGarfieldPrm =
171 new G4UIparameter("particleName", 's', false);
172 particleGarfieldPrm->SetGuidance(
173 "Particle name (gamma, e-, e+, mu-, mu+, proton, anti_proton, pi-, pi+, "
174 "kaon, kaon+, alpha, deuteron)");
175 fGarfieldParticleCmd->SetParameter(particleGarfieldPrm);
176
177 G4UIparameter* minEnergyGarfieldPrm =
178 new G4UIparameter("minimumEnergyGarfield", 'd', false);
179 minEnergyGarfieldPrm->SetGuidance("minimum energy");
180 minEnergyGarfieldPrm->SetParameterRange("minimumEnergyGarfield>=0");
181 fGarfieldParticleCmd->SetParameter(minEnergyGarfieldPrm);
182
183 G4UIparameter* maxEnergyGarfieldPrm =
184 new G4UIparameter("maximumEnergyGarfield", 'd', false);
185 maxEnergyGarfieldPrm->SetGuidance("maximum energy");
186 maxEnergyGarfieldPrm->SetParameterRange("maximumEnergyGarfield>=0");
187 fGarfieldParticleCmd->SetParameter(maxEnergyGarfieldPrm);
188
189 G4UIparameter* unitGarfieldPrm = new G4UIparameter("unit", 's', false);
190 unitGarfieldPrm->SetGuidance("unit of energy");
191 G4String unitListGarfield =
192 G4UIcommand::UnitsList(G4UIcommand::CategoryOf("MeV"));
193 unitGarfieldPrm->SetParameterCandidates(unitListGarfield);
194 fGarfieldParticleCmd->SetParameter(unitGarfieldPrm);
195
196 fGarfieldParticleCmd->AvailableForStates(G4State_PreInit);
197}