216 G4ProductionCuts* prodCuts =
region->GetProductionCuts();
225 double gammacut = 0.0;
226 double electroncut = 0.0;
227 double positroncut = 0.0;
228 double protoncut = 0.0;
230 auto gammacutStr = spec->
strValue(
"ProdCutsForGamma");
231 if (gammacutStr.empty()) {
234 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForGamma.");
236 gammacut = dd4hep::_toDouble({gammacutStr.data(), gammacutStr.size()});
238 auto electroncutStr = spec->
strValue(
"ProdCutsForElectrons");
239 if (electroncutStr.empty()) {
242 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForElectrons.");
244 electroncut = dd4hep::_toDouble({electroncutStr.data(), electroncutStr.size()});
246 auto positroncutStr = spec->
strValue(
"ProdCutsForPositrons");
247 if (positroncutStr.empty()) {
250 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForPositrons.");
252 positroncut = dd4hep::_toDouble({positroncutStr.data(), positroncutStr.size()});
254 if (!spec->
hasValue(
"ProdCutsForProtons")) {
258 protoncut = electroncut;
263 auto protoncutStr = spec->
strValue(
"ProdCutsForProtons");
264 if (protoncutStr.empty()) {
267 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - more than one ProdCutsForProtons.");
269 protoncut = dd4hep::_toDouble({protoncutStr.data(), protoncutStr.size()});
272 prodCuts =
new G4ProductionCuts();
273 region->SetProductionCuts(prodCuts);
275 prodCuts->SetProductionCut(gammacut, idxG4GammaCut);
276 prodCuts->SetProductionCut(electroncut, idxG4ElectronCut);
277 prodCuts->SetProductionCut(positroncut, idxG4PositronCut);
278 prodCuts->SetProductionCut(protoncut, idxG4ProtonCut);
281 <<
"\n Electrons: " << electroncut <<
"\n Positrons: " << positroncut
282 <<
"\n Gamma : " << gammacut <<
"\n Proton : " << protoncut;
287 <<
"DDG4ProductionCuts : Cuts are already set for " <<
region->GetName()
288 <<
"\n Electrons: " <<
region->GetProductionCuts()->GetProductionCut(idxG4ElectronCut)
289 <<
"\n Positrons: " <<
region->GetProductionCuts()->GetProductionCut(idxG4PositronCut)
290 <<
"\n Gamma : " <<
region->GetProductionCuts()->GetProductionCut(idxG4GammaCut)
291 <<
"\n Proton : " <<
region->GetProductionCuts()->GetProductionCut(idxG4ProtonCut);