137 for(
size_t i=0; i<
n; ++i) {
150 G4cout <<
"G4EmModelManager::AddEmModel WARNING: no model defined."
170 if(nam ==
models[i]->GetName()) {
171 models[i]->SetLowEnergyLimit(emin);
172 models[i]->SetHighEnergyLimit(emax);
177 G4cout <<
"G4EmModelManager::UpdateEmModel WARNING: no model <"
178 << nam <<
"> is found out"
189 G4cout <<
"G4EmModelManager::GetModel WARNING: "
190 <<
"index " << i <<
" is wrong Nmodels= "
226 G4cout <<
"G4EmModelManager::Initialise() for "
234 G4Exception(
"G4EmModelManager::Initialise",
"em0002",
243 regionStore->
GetRegion(
"DefaultRegionForTheWorld",
false);
247 std::vector<const G4Region*> setr;
248 setr.push_back(world);
253 if ( r == 0 || r == world) {
260 if ( r == setr[j] ) { newRegion =
false; }
272 ed <<
"No models defined for the World volume for "
274 G4Exception(
"G4EmModelManager::Initialise",
"em0002",
292 std::vector<G4int> modelAtRegion(nEmModels);
293 std::vector<G4int> modelOrd(nEmModels);
299 <<
" Nmodels= " << nEmModels <<
G4endl;
321 <<
" <" << model->
GetName() <<
"> for region <";
324 <<
" tmin(MeV)= " << tmin/
MeV
325 <<
"; tmax(MeV)= " << tmax/
MeV
326 <<
"; order= " << ord
341 if( tmax - tmin <= limitdelta) { push =
false; }
343 else if (tmax == eLow[0]) {
348 }
else if(tmin < eHigh[n-1]) {
354 if(ord >= modelOrd[
k]) {
355 if(tmin < eHigh[k] && tmin >= eLow[k]) { tmin = eHigh[
k]; }
356 if(tmax <= eHigh[k] && tmax > eLow[k]) { tmax = eLow[
k]; }
357 if(tmax > eHigh[k] && tmin < eLow[k]) {
358 if(tmax - eHigh[k] > eLow[k] - tmin) { tmin = eHigh[
k]; }
359 else { tmax = eLow[
k]; }
361 if( tmax - tmin <= limitdelta) {
372 if (tmax <= eLow[0]) {
377 }
else if(tmin < eHigh[n-1]) {
379 if(tmin > eLow[n-1] && tmax >= eHigh[n-1]) {
382 }
else if(tmin <= eLow[0] && tmax < eHigh[0]) {
390 if(tmin <= eLow[
k] && tmax >= eHigh[
k]) {
396 for(
G4int kk=k; kk<n-1; ++kk) {
397 modelAtRegion[kk] = modelAtRegion[kk+1];
398 modelOrd[kk] = modelOrd[kk+1];
399 eLow[kk] = eLow[kk+1];
400 eHigh[kk] = eHigh[kk+1];
407 if(tmin <= eLow[k] && tmax > eLow[k]) {
412 }
else if(tmin < eHigh[k] && tmax >= eHigh[k]) {
419 }
else if(tmin > eLow[k] && tmax < eHigh[k]) {
420 if(eHigh[k] - tmax > tmin - eLow[k]) {
443 modelAtRegion[
k+1] = modelAtRegion[
k];
444 modelOrd[
k+1] = modelOrd[
k];
446 eHigh[
k+1] = eHigh[
k];
452 if (push || insert) {
454 modelAtRegion[
idx] = ii;
462 if(eHigh[
k] - eLow[
k] <= limitdelta) {
465 for(
G4int kk=
k; kk<n-1; ++kk) {
466 modelAtRegion[kk] = modelAtRegion[kk+1];
467 modelOrd[kk] = modelOrd[kk+1];
468 eLow[kk] = eLow[kk+1];
469 eHigh[kk] = eHigh[kk+1];
478 eLow[
n] = eHigh[n-1];
481 G4cout <<
"### New G4RegionModels set with " << n
482 <<
" models for region <";
484 G4cout <<
"> Elow(MeV)= ";
491 if(1 == nEmModels) {
break; }
499 if(secondaryParticle) {
512 if(minSubRange < 1.0) {
519 for(
size_t i=0; i<numOfCouples; ++i) {
527 if(nRegions > 1 && nEmModels > 1) {
530 do {--
reg;}
while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
534 G4cout <<
"G4EmModelManager::Initialise() for "
536 <<
" indexOfCouple= " << i
537 <<
" indexOfRegion= " << reg
542 if(secondaryParticle) {
545 if( cut <
DBL_MAX && minSubRange < 1.0) {
552 if(tcutmax < subcut) { subcut = tcutmax; }
553 (*theSubCuts)[i] = subcut;
559 if(nRegions > 1 && nEmModels > 1) {
569 for(
G4int jj=0; jj<nnm; ++jj) {
576 (*theCutsNew)[i] = cutlim;
604 G4cout <<
"G4EmModelManager for " << partname
605 <<
" is initialised; nRegions= " << nRegions
630 G4cout <<
"G4EmModelManager::FillDEDXVector() for "
632 <<
" cut(MeV)= " << cut
633 <<
" emin(MeV)= " << emin
651 for(
size_t j=0; j<totBinsLoss; ++j) {
660 do {--
k;}
while (k>0 && e <= regModels->LowEdgeEnergy(k));
662 if(k > 0 && k != k0) {
666 couple,elow,cut,
emin);
668 couple,elow,cut,
emin);
670 if(dedx2 > 0.0) { del = (dedx1/dedx2 - 1.0)*elow; }
677 dedx *= (1.0 + del/
e);
680 G4cout <<
"Material= " << couple->GetMaterial()->GetName()
681 <<
" E(MeV)= " << e/
MeV
682 <<
" dEdx(MeV/mm)= " << dedx*
mm/
MeV
683 <<
" del= " << del*
mm/
MeV<<
" k= " << k
687 if(dedx < 0.0) { dedx = 0.0; }
712 G4cout <<
"G4EmModelManager::FillLambdaVector() for "
715 <<
" Emin(MeV)= " << aVector->
Energy(0)
730 for(
size_t j=0; j<totBinsLambda; ++j) {
738 do {--
k;}
while (k>0 && e <= regModels->LowEdgeEnergy(k));
739 if(k > 0 && k != k0) {
747 if(xs2 > 0.0) { del = (xs1/xs2 - 1.0)*elow; }
753 cross *= (1.0 + del/
e);
756 if(j==0 && startFromNull) { cross = 0.0; }
759 G4cout <<
"FillLambdaVector: " << j <<
". e(MeV)= " << e/
MeV
760 <<
" cross(1/mm)= " << cross*
mm
761 <<
" del= " << del*
mm <<
" k= " << k
774 if(verb == 0) {
return; }
780 out <<
" ===== EM models for the G4Region " << reg->
GetName()
782 for(
G4int j=0; j<
n; ++j) {
789 out << std::setw(20);
790 out << model->
GetName() <<
" : Emin="
796 size_t kk = table->size();
797 for(
size_t k=0;
k<kk; ++
k) {
801 out <<
" Nbins=" << nn <<
" "
810 if(an) { out <<
" " << an->
GetName(); }
821 out <<
" ===== Limit on energy threshold has been applied " <<
G4endl;