source: trunk/source/processes/electromagnetic/utils/src/G4EmModelManager.cc @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 20.2 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4EmModelManager.cc,v 1.63 2010/10/15 10:22:13 vnivanch Exp $
27// GEANT4 tag $Name: emutils-V09-03-23 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:     G4EmModelManager
35//
36// Author:        Vladimir Ivanchenko
37//
38// Creation date: 07.05.2002
39//
40// Modifications:
41//
42// 23-12-02 V.Ivanchenko change interface in order to move
43//                           to cut per region
44// 20-01-03 Migrade to cut per region (V.Ivanchenko)
45// 24-01-03 Make models region aware (V.Ivanchenko)
46// 13-02-03 The set of models is defined for region (V.Ivanchenko)
47// 06-03-03 Fix in energy intervals for models (V.Ivanchenko)
48// 13-04-03 Add startFromNull (V.Ivanchenko)
49// 13-05-03 Add calculation of precise range (V.Ivanchenko)
50// 16-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection
51//          calculation (V.Ivanchenko)
52// 21-07-03 Add UpdateEmModel method (V.Ivanchenko)
53// 03-11-03 Substitute STL vector for G4RegionModels (V.Ivanchenko)
54// 26-01-04 Fix in energy range conditions (V.Ivanchenko)
55// 24-03-05 Remove check or IsInCharge (V.Ivanchenko)
56// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
57// 18-08-05 Fix cut for e+e- pair production (V.Ivanchenko)
58// 29-11-05 Add protection for arithmetic operations with cut=DBL_MAX (V.Ivanchenko)
59// 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
60// 13-05-06 Add GetModel by index method (VI)
61// 15-03-07 Add maxCutInRange (V.Ivanchenko)
62// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
63// 08-04-08 Fixed and simplified initialisation of G4RegionModel (VI)
64// 03-08-09 Create internal vectors only it is needed (VI)
65//
66// Class Description:
67//
68// It is the unified energy loss process it calculates the continuous
69// energy loss for charged particles using a set of Energy Loss
70// models valid for different energy regions. There are a possibility
71// to create and access to dE/dx and range tables, or to calculate
72// that information on fly.
73// -------------------------------------------------------------------
74//
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
77
78#include "G4EmModelManager.hh"
79
80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
81
82G4RegionModels::G4RegionModels(G4int nMod, std::vector<G4int>& indx, 
83                               G4DataVector& lowE, const G4Region* reg)
84{
85  nModelsForRegion      = nMod;
86  theListOfModelIndexes = new G4int [nModelsForRegion];
87  lowKineticEnergy      = new G4double [nModelsForRegion+1];
88  for (G4int i=0; i<nModelsForRegion; ++i) {
89    theListOfModelIndexes[i] = indx[i];
90    lowKineticEnergy[i] = lowE[i];
91  }
92  lowKineticEnergy[nModelsForRegion] = lowE[nModelsForRegion];
93  theRegion = reg;
94}
95
96//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
97
98G4RegionModels::~G4RegionModels()
99{
100  delete [] theListOfModelIndexes;
101  delete [] lowKineticEnergy;
102}
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105
106#include "G4Step.hh"
107#include "G4ParticleDefinition.hh"
108#include "G4PhysicsVector.hh"
109#include "G4Gamma.hh"
110#include "G4Positron.hh"
111#include "G4MaterialCutsCouple.hh"
112#include "G4ProductionCutsTable.hh"
113#include "G4RegionStore.hh"
114#include "G4Gamma.hh"
115#include "G4Positron.hh"
116#include "G4UnitsTable.hh"
117#include "G4DataVector.hh"
118
119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
120
121G4EmModelManager::G4EmModelManager():
122  nEmModels(0),
123  nRegions(0),
124  particle(0),
125  verboseLevel(0)
126{
127  maxSubCutInRange = 0.7*mm;
128  models.reserve(4);
129  flucModels.reserve(4);
130  regions.reserve(4);
131  orderOfModels.reserve(4);
132  isUsed.reserve(4);
133  severalModels = true;
134  currRegionModel = 0;
135  currModel = 0;
136}
137
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
139
140G4EmModelManager::~G4EmModelManager()
141{
142  verboseLevel = 0; // no verbosity at destruction
143  Clear();
144}
145
146//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
147
148void G4EmModelManager::Clear()
149{
150  if(1 < verboseLevel) {
151    G4cout << "G4EmModelManager::Clear()" << G4endl;
152  }
153  size_t n = setOfRegionModels.size();
154  if(n > 0) {
155    for(size_t i=0; i<n; ++i) {
156      delete setOfRegionModels[i];
157      setOfRegionModels[i] = 0;
158    }
159  }
160}
161
162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
163
164void G4EmModelManager::AddEmModel(G4int num, G4VEmModel* p,
165                                  G4VEmFluctuationModel* fm, const G4Region* r)
166{
167  if(!p) {
168    G4cout << "G4EmModelManager::AddEmModel WARNING: no model defined." 
169           << G4endl;
170    return;
171  }
172  models.push_back(p);
173  flucModels.push_back(fm);
174  regions.push_back(r);
175  orderOfModels.push_back(num);
176  isUsed.push_back(0);
177  p->DefineForRegion(r);
178  nEmModels++;
179}
180
181//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
182
183void G4EmModelManager::UpdateEmModel(const G4String& nam, 
184                                     G4double emin, G4double emax)
185{
186  if (nEmModels > 0) {
187    for(G4int i=0; i<nEmModels; ++i) {
188      if(nam == models[i]->GetName()) {
189        models[i]->SetLowEnergyLimit(emin);
190        models[i]->SetHighEnergyLimit(emax);
191        break;
192      }
193    }
194  }
195  G4cout << "G4EmModelManager::UpdateEmModel WARNING: no model <"
196         << nam << "> is found out"
197         << G4endl;
198}
199
200//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
201
202G4VEmModel* G4EmModelManager::GetModel(G4int i, G4bool ver)
203{
204  G4VEmModel* m = 0;
205  if(i >= 0 && i < nEmModels) {m = models[i];}
206  else if(verboseLevel > 0 && ver) { 
207    G4cout << "G4EmModelManager::GetModel WARNING: "
208           << "index " << i << " is wrong Nmodels= "
209           << nEmModels;
210    if(particle) G4cout << " for " << particle->GetParticleName(); 
211    G4cout<< G4endl;
212  }
213  return m;
214}
215
216//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
217
218const G4DataVector* 
219G4EmModelManager::Initialise(const G4ParticleDefinition* p,
220                             const G4ParticleDefinition* secondaryParticle,
221                             G4double minSubRange,
222                             G4int val)
223{
224  verboseLevel = val;
225  G4String partname = p->GetParticleName();
226  if(1 < verboseLevel) {
227    G4cout << "G4EmModelManager::Initialise() for "
228           << partname << G4endl;
229  }
230  // Are models defined?
231  if(nEmModels < 1) {
232    G4Exception("G4EmModelManager::Initialise: no model defined for " + partname);
233  }
234
235  particle = p;
236  Clear(); // needed if run is not first
237
238  G4RegionStore* regionStore = G4RegionStore::GetInstance();
239  const G4Region* world = 
240    regionStore->GetRegion("DefaultRegionForTheWorld", false);
241
242  // Identify the list of regions with different set of models
243  nRegions = 1;
244  std::vector<const G4Region*> setr;
245  setr.push_back(world);
246  G4bool isWorld = false;
247
248  for (G4int ii=0; ii<nEmModels; ++ii) {
249    const G4Region* r = regions[ii];
250    if ( r == 0 || r == world) {
251      isWorld = true;
252      regions[ii] = world;
253    } else {
254      G4bool newRegion = true;
255      if (nRegions>1) {
256        for (G4int j=1; j<nRegions; ++j) {
257          if ( r == setr[j] ) newRegion = false;
258        }
259      }
260      if (newRegion) {
261        setr.push_back(r);
262        nRegions++;
263      }
264    }
265  }
266  // Are models defined?
267  if(!isWorld) {
268    G4Exception("G4EmModelManager::Initialise: no models defined for " + 
269                partname + " in the World volume");
270  }
271
272  G4ProductionCutsTable* theCoupleTable=
273    G4ProductionCutsTable::GetProductionCutsTable();
274  size_t numOfCouples = theCoupleTable->GetTableSize();
275
276  // prepare vectors, shortcut for the case of only 1 model
277  if(nRegions > 1 && nEmModels > 1) {
278    if(numOfCouples > idxOfRegionModels.size()) idxOfRegionModels.resize(numOfCouples);
279  }
280  size_t nr = 1;
281  if(nEmModels > 1) nr = nRegions;
282  if(nr > setOfRegionModels.size()) setOfRegionModels.resize(nr);
283
284  std::vector<G4int>    modelAtRegion(nEmModels);
285  std::vector<G4int>    modelOrd(nEmModels);
286  G4DataVector          eLow(nEmModels+1);
287  G4DataVector          eHigh(nEmModels);
288
289  // Order models for regions
290  for (G4int reg=0; reg<nRegions; ++reg) {
291    const G4Region* region = setr[reg];
292    G4int n = 0;
293
294    for (G4int ii=0; ii<nEmModels; ++ii) {
295
296      G4VEmModel* model = models[ii];
297      if ( region == regions[ii] ) {
298
299        G4double tmin = model->LowEnergyLimit();
300        G4double tmax = model->HighEnergyLimit();
301        G4int  ord    = orderOfModels[ii];
302        G4bool push   = true;
303        G4bool insert = false;
304        G4int  idx    = n;
305
306        if(1 < verboseLevel) {
307          G4cout << "Model #" << ii
308                 << " <" << model->GetName() << "> for region <";
309          if (region) G4cout << region->GetName();
310          G4cout << ">  "
311                 << " tmin(MeV)= " << tmin/MeV
312                 << "; tmax(MeV)= " << tmax/MeV
313                 << "; order= " << ord
314                 << G4endl;
315        }
316       
317        if(n > 0) {
318
319          // extend energy range to previous models
320          tmin = std::min(tmin, eHigh[n-1]);
321          tmax = std::max(tmax, eLow[0]);
322          //G4cout << "tmin= " << tmin << "  tmax= "
323          //       << tmax << "  ord= " << ord <<G4endl;
324          // empty energy range
325          if( tmax - tmin <= eV) push = false;
326          // low-energy model
327          else if (tmax == eLow[0]) {
328            push = false;
329            insert = true;
330            idx = 0;
331            // resolve intersections
332          } else if(tmin < eHigh[n-1]) { 
333            // compare order
334            for(G4int k=0; k<n; ++k) {
335              // new model has lower application
336              if(ord >= modelOrd[k]) {
337                if(tmin < eHigh[k]  && tmin >= eLow[k]) tmin = eHigh[k];
338                if(tmax <= eHigh[k] && tmax >  eLow[k]) tmax = eLow[k];
339                if(tmax > eHigh[k] && tmin < eLow[k]) {
340                  if(tmax - eHigh[k] > eLow[k] - tmin) tmin = eHigh[k];
341                  else tmax = eLow[k];
342                }
343                if( tmax - tmin <= eV) {
344                  push = false;
345                  break;
346                }
347              }
348            }
349            //G4cout << "tmin= " << tmin << "  tmax= "
350            //     << tmax << "  push= " << push << " idx= " << idx <<G4endl;
351            if(push) {
352              if (tmax == eLow[0]) {
353                push = false;
354                insert = true;
355                idx = 0;
356                // continue resolve intersections
357              } else if(tmin < eHigh[n-1]) { 
358                // last energy interval
359                if(tmin > eLow[n-1] && tmax >= eHigh[n-1]) {
360                  eHigh[n-1] = tmin;
361                  // first energy interval
362                } else if(tmin <= eLow[0] && tmax < eHigh[0]) {
363                  eLow[0] = tmax;
364                  push = false;
365                  insert = true;
366                  idx = 0;
367                } else {
368                  // find energy interval to replace
369                  for(G4int k=0; k<n; ++k) { 
370                    if(tmin <= eLow[k] && tmax >= eHigh[k]) {
371                      push = false;
372                      modelAtRegion[k] = ii;
373                      modelOrd[k] = ord;
374                      isUsed[ii] = 1;
375                    } 
376                  }
377                }
378              }
379            }
380          }
381        }
382        if(insert) {
383          for(G4int k=n-1; k>=idx; --k) {   
384            modelAtRegion[k+1] = modelAtRegion[k];
385            modelOrd[k+1] = modelOrd[k];
386            eLow[k+1]  = eLow[k];
387            eHigh[k+1] = eHigh[k];
388          }
389        }
390        //G4cout << "push= " << push << " insert= " << insert
391        //<< " idx= " << idx <<G4endl;
392        if (push || insert) {
393          ++n;
394          modelAtRegion[idx] = ii;
395          modelOrd[idx] = ord;
396          eLow[idx]  = tmin;
397          eHigh[idx] = tmax;
398          isUsed[ii] = 1;
399        }
400      }
401    }
402    eLow[0] = 0.0;
403    eLow[n] = eHigh[n-1];
404
405    if(1 < verboseLevel) {
406      G4cout << "New G4RegionModels set with " << n << " models for region <";
407      if (region) G4cout << region->GetName();
408      G4cout << ">  Elow(MeV)= ";
409      for(G4int ii=0; ii<=n; ++ii) {G4cout << eLow[ii]/MeV << " ";}
410      G4cout << G4endl;
411    }
412    G4RegionModels* rm = new G4RegionModels(n, modelAtRegion, eLow, region);
413    setOfRegionModels[reg] = rm;
414    if(1 == nEmModels) break;
415  }
416
417  currRegionModel = setOfRegionModels[0];
418
419  // Access to materials and build cuts
420  size_t idx = 1;
421  if(secondaryParticle) {
422    if( secondaryParticle == G4Gamma::Gamma() )           { idx = 0; }
423    else if( secondaryParticle == G4Positron::Positron()) { idx = 2; }
424  }
425
426  if(numOfCouples > theCuts.size()) { theCuts.resize(numOfCouples); }
427  if(minSubRange < 1.0 && numOfCouples > theSubCuts.size()) {
428    theSubCuts.resize(numOfCouples);
429  }
430  for(size_t i=0; i<numOfCouples; ++i) {
431
432    const G4MaterialCutsCouple* couple = 
433      theCoupleTable->GetMaterialCutsCouple(i);
434    const G4Material* material = couple->GetMaterial();
435    const G4ProductionCuts* pcuts = couple->GetProductionCuts();
436 
437    G4int reg = 0;
438    if(nRegions > 1 && nEmModels > 1) {
439      reg = nRegions;
440      do {--reg;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
441      idxOfRegionModels[i] = reg;
442    }
443    if(1 < verboseLevel) {
444      G4cout << "G4EmModelManager::Initialise() for "
445             << material->GetName()
446             << " indexOfCouple= " << i
447             << " indexOfRegion= " << reg
448             << G4endl;
449    }
450
451    G4double cut = (*theCoupleTable->GetEnergyCutsVector(idx))[i]; 
452    G4double subcut = DBL_MAX;
453    if(secondaryParticle) {
454
455      // compute subcut
456      if( cut < DBL_MAX && minSubRange < 1.0) {
457        subcut = minSubRange*cut;
458        G4double rcut = std::min(minSubRange*pcuts->GetProductionCut(idx), 
459                                 maxSubCutInRange);
460        G4double tcutmax = 
461          theCoupleTable->ConvertRangeToEnergy(secondaryParticle,material,rcut);
462        if(tcutmax < subcut) { subcut = tcutmax; }
463      }
464    }
465    theCuts[i] = cut;
466    if(minSubRange < 1.0) { theSubCuts[i] = subcut; }
467  }
468
469  // initialize models
470  G4int nn = 0;
471  severalModels = true;
472  for(G4int jj=0; jj<nEmModels; ++jj) {
473    if(1 == isUsed[jj]) {
474      ++nn;
475      currModel = models[jj];
476      currModel->Initialise(particle, theCuts);
477      if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
478    }
479  }
480  if(1 == nn) { severalModels = false; }
481
482  if(1 < verboseLevel) {
483    G4cout << "G4EmModelManager for " << particle->GetParticleName() 
484           << " is initialised; nRegions=  " << nRegions
485           << G4endl;
486  }
487
488  return &theCuts;
489}
490
491//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
492
493void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
494                                      const G4MaterialCutsCouple* couple,
495                                      G4EmTableType tType)
496{
497  size_t i = couple->GetIndex();
498  G4double cut = theCuts[i];
499  G4double emin = 0.0;
500
501  if(fTotal == tType) cut = DBL_MAX;
502  else if(fSubRestricted == tType) {
503    emin = cut;
504    if(theSubCuts.size() > 0) emin = theSubCuts[i];
505  }
506
507  if(1 < verboseLevel) {
508    G4cout << "G4EmModelManager::FillDEDXVector() for "
509           << couple->GetMaterial()->GetName()
510           << "  cut(MeV)= " << cut
511           << "  emin(MeV)= " << emin
512           << "  Type " << tType
513           << "  for " << particle->GetParticleName()
514           << G4endl;
515  }
516
517  G4int reg  = 0;
518  if(nRegions > 1 && nEmModels > 1) reg = idxOfRegionModels[i];
519  const G4RegionModels* regModels = setOfRegionModels[reg];
520  G4int nmod = regModels->NumberOfModels();
521
522  // Calculate energy losses vector
523
524  //G4cout << "nmod= " << nmod << G4endl;
525  size_t totBinsLoss = aVector->GetVectorLength();
526  for(size_t j=0; j<totBinsLoss; ++j) {
527
528    G4double e = aVector->Energy(j);
529    G4double del = 0.0;
530
531    // Choose a model of energy losses
532    G4int k = 0;
533    if (nmod > 1) {
534      k = nmod;
535      do {--k;} while (k>0 && e <= regModels->LowEdgeEnergy(k));
536      //G4cout << "k= " << k << G4endl;
537      if(k > 0) {
538        G4double elow = regModels->LowEdgeEnergy(k);
539        G4double dedx1 = ComputeDEDX(models[regModels->ModelIndex(k-1)],
540                                     couple,elow,cut,emin);
541        G4double dedx2 = ComputeDEDX(models[regModels->ModelIndex(k)],
542                                     couple,elow,cut,emin);
543        del = (dedx1 - dedx2)*elow/e;
544        //G4cout << "elow= " << elow
545        //       << " dedx1= " << dedx1 << " dedx2= " << dedx2 << G4endl;
546      }
547    }
548    G4double dedx = ComputeDEDX(models[regModels->ModelIndex(k)],
549                                couple,e,cut,emin) + del;
550
551    if(dedx < 0.0) dedx = 0.0;
552    if(2 < verboseLevel) {
553      G4cout << "Material= " << couple->GetMaterial()->GetName()
554             << "   E(MeV)= " << e/MeV
555             << "  dEdx(MeV/mm)= " << dedx*mm/MeV
556             << "  del= " << del*mm/MeV<< " k= " << k
557             << " modelIdx= " << regModels->ModelIndex(k)
558             << G4endl;
559    }
560    aVector->PutValue(j, dedx);
561  }
562}
563
564//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
565
566void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
567                                        const G4MaterialCutsCouple* couple,
568                                        G4bool startFromNull,
569                                        G4EmTableType tType)
570{
571  size_t i = couple->GetIndex();
572  G4double cut  = theCuts[i];
573  G4double tmax = DBL_MAX;
574  if (fSubRestricted == tType) {
575    tmax = cut;
576    if(theSubCuts.size() > 0) cut  = theSubCuts[i];
577  }
578
579  G4int reg  = 0;
580  if(nRegions > 1 && nEmModels > 1) reg  = idxOfRegionModels[i];
581  const G4RegionModels* regModels = setOfRegionModels[reg];
582  G4int nmod = regModels->NumberOfModels();
583  if(1 < verboseLevel) {
584    G4cout << "G4EmModelManager::FillLambdaVector() for "
585           << particle->GetParticleName()
586           << " in " << couple->GetMaterial()->GetName()
587           << " Ecut(MeV)= " << cut
588           << " Emax(MeV)= " << tmax
589           << " Type " << tType   
590           << " nmod= " << nmod
591           << G4endl;
592  }
593
594
595  // Calculate lambda vector
596  size_t totBinsLambda = aVector->GetVectorLength();
597  for(size_t j=0; j<totBinsLambda; ++j) {
598
599    G4double e = aVector->Energy(j);
600
601    G4double del = 0.0;
602
603    // Choose a model
604    G4int k = 0;
605    G4VEmModel* mod = models[regModels->ModelIndex(0)]; 
606    if (nmod > 1) {
607      k = nmod;
608      do {--k;} while (k>0 && e <= regModels->LowEdgeEnergy(k));
609      if(k > 0) {
610        G4double elow = regModels->LowEdgeEnergy(k);
611        G4VEmModel* m = models[regModels->ModelIndex(k-1)]; 
612        G4double xs1  = m->CrossSection(couple,particle,elow,cut,tmax);
613        mod = models[regModels->ModelIndex(k)]; 
614        G4double xs2 = mod->CrossSection(couple,particle,elow,cut,tmax);
615        del = (xs1 - xs2)*elow/e;
616      }
617    }
618    G4double cross = mod->CrossSection(couple,particle,e,cut,tmax) + del;
619   
620    if(j==0 && startFromNull) cross = 0.0;
621
622    if(2 < verboseLevel) {
623      G4cout << "FillLambdaVector: " << j << ".   e(MeV)= " << e/MeV
624             << "  cross(1/mm)= " << cross*mm
625             << " del= " << del*mm << " k= " << k
626             << " modelIdx= " << regModels->ModelIndex(k)
627             << G4endl;
628    }
629    if(cross < 0.0) cross = 0.0;
630
631    aVector->PutValue(j, cross);
632  }
633}
634
635//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
636
637void G4EmModelManager::DumpModelList(G4int verb)
638{
639  if(verb == 0) { return; }
640  for(G4int i=0; i<nRegions; ++i) {
641    G4RegionModels* r = setOfRegionModels[i];
642    const G4Region* reg = r->Region();
643    G4int n = r->NumberOfModels(); 
644    if(n > 0) {
645      G4cout << "      ===== EM models for the G4Region  " << reg->GetName()
646             << " ======" << G4endl;;
647      for(G4int j=0; j<n; ++j) {
648        G4VEmModel* m = models[r->ModelIndex(j)];
649        G4cout << std::setw(20);
650        G4cout << m->GetName() << " :   Emin= " 
651               << std::setw(8) << G4BestUnit(r->LowEdgeEnergy(j),"Energy")
652               << "      Emax=   " 
653               << std::setw(8) << G4BestUnit(r->LowEdgeEnergy(j+1),"Energy");
654        G4VEmAngularDistribution* an = m->GetAngularDistribution();
655        if(an) { G4cout << "  " << an->GetName(); }
656        G4cout << G4endl;
657      } 
658    }
659    if(1 == nEmModels) break; 
660  }
661}
662
663//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.