233 G4String partname = p->GetParticleName();
237 G4cout <<
"G4EmModelManager::Initialise() for " 243 ed <<
"No models found out for " << p->GetParticleName()
245 G4Exception(
"G4EmModelManager::Initialise",
"em0002",
254 regionStore->
GetRegion(
"DefaultRegionForTheWorld",
false);
258 std::vector<const G4Region*> setr;
259 setr.push_back(world);
264 if ( r == 0 || r == world) {
271 if ( r == setr[j] ) { newRegion =
false; }
283 ed <<
"No models defined for the World volume for " 284 << p->GetParticleName() <<
" !";
285 G4Exception(
"G4EmModelManager::Initialise",
"em0002",
295 if(nRegions > 1 && nEmModels > 1) {
303 std::vector<G4int> modelAtRegion(nEmModels);
304 std::vector<G4int> modelOrd(nEmModels);
309 G4cout <<
" Nregions= " << nRegions
310 <<
" Nmodels= " << nEmModels <<
G4endl;
332 <<
" <" << model->
GetName() <<
"> for region <";
335 <<
" tmin(MeV)= " << tmin/
MeV 336 <<
"; tmax(MeV)= " << tmax/
MeV 337 <<
"; order= " << ord
349 if( tmax - tmin <=
eV) push =
false;
351 else if (tmax == eLow[0]) {
356 }
else if(tmin < eHigh[n-1]) {
358 for(
G4int k=0; k<
n; ++k) {
360 if(ord >= modelOrd[k]) {
361 if(tmin < eHigh[k] && tmin >= eLow[k]) tmin = eHigh[k];
362 if(tmax <= eHigh[k] && tmax > eLow[k]) tmax = eLow[k];
363 if(tmax > eHigh[k] && tmin < eLow[k]) {
364 if(tmax - eHigh[k] > eLow[k] - tmin) tmin = eHigh[k];
367 if( tmax - tmin <=
eV) {
376 if (tmax == eLow[0]) {
381 }
else if(tmin < eHigh[n-1]) {
383 if(tmin > eLow[n-1] && tmax >= eHigh[n-1]) {
386 }
else if(tmin <= eLow[0] && tmax < eHigh[0]) {
393 for(
G4int k=0; k<
n; ++k) {
394 if(tmin <= eLow[k] && tmax >= eHigh[k]) {
396 modelAtRegion[k] = ii;
407 for(
G4int k=n-1; k>=idx; --k) {
408 modelAtRegion[k+1] = modelAtRegion[k];
409 modelOrd[k+1] = modelOrd[k];
411 eHigh[k+1] = eHigh[k];
416 if (push || insert) {
418 modelAtRegion[idx] = ii;
427 eLow[
n] = eHigh[n-1];
430 G4cout <<
"New G4RegionModels set with " << n <<
" models for region <";
432 G4cout <<
"> Elow(MeV)= ";
439 if(1 == nEmModels) {
break; }
447 if(secondaryParticle) {
460 if(minSubRange < 1.0) {
467 for(
size_t i=0; i<numOfCouples; ++i) {
475 if(nRegions > 1 && nEmModels > 1) {
478 do {--
reg;}
while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
482 G4cout <<
"G4EmModelManager::Initialise() for " 484 <<
" indexOfCouple= " << i
485 <<
" indexOfRegion= " << reg
490 if(secondaryParticle) {
493 if( cut <
DBL_MAX && minSubRange < 1.0) {
500 if(tcutmax < subcut) { subcut = tcutmax; }
501 (*theSubCuts)[i] = subcut;
507 if(nRegions > 1 && nEmModels > 1) {
517 for(
G4int jj=0; jj<nnm; ++jj) {
524 (*theCutsNew)[i] = cutlim;
552 G4cout <<
"G4EmModelManager for " << partname
553 <<
" is initialised; nRegions= " << nRegions
G4double LowEnergyLimit() const
const G4String & GetName() const
std::vector< G4int > idxOfRegionModels
std::ostringstream G4ExceptionDescription
const G4Material * GetMaterial() const
G4ProductionCuts * GetProductionCuts() const
const G4DataVector * theCuts
G4int ModelIndex(G4int n) const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *)
G4int NumberOfModels() const
std::vector< G4int > orderOfModels
static const G4double reg
G4double GetProductionCut(G4int index) const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)=0
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
std::vector< G4int > isUsed
G4double HighEnergyLimit() const
const G4ParticleDefinition * particle
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const G4String & GetName() const
G4DataVector * theSubCuts
std::vector< G4VEmModel * > models
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4Positron * Positron()
G4double maxSubCutInRange
std::vector< const G4Region * > regions
size_t GetTableSize() const
static G4Electron * Electron()
G4RegionModels * currRegionModel
G4double ConvertRangeToEnergy(const G4ParticleDefinition *particle, const G4Material *material, G4double range)
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
const G4String & GetName() const
std::vector< G4VEmFluctuationModel * > flucModels
G4DataVector * theCutsNew
std::vector< G4RegionModels * > setOfRegionModels