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