Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/src/G4VEmProcess.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/utils/src/G4VEmProcess.cc (Version 11.3.0) and /processes/electromagnetic/utils/src/G4VEmProcess.cc (Version 7.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
                                                   >>  23 // $Id: G4VEmProcess.cc,v 1.15 2004/11/10 14:37:25 vnivanch Exp $
                                                   >>  24 // GEANT4 tag $Name: geant4-07-00-patch-01 $
                                                   >>  25 //
 26 // -------------------------------------------     26 // -------------------------------------------------------------------
 27 //                                                 27 //
 28 // GEANT4 Class file                               28 // GEANT4 Class file
 29 //                                                 29 //
 30 //                                                 30 //
 31 // File name:     G4VEmProcess                     31 // File name:     G4VEmProcess
 32 //                                                 32 //
 33 // Author:        Vladimir Ivanchenko on base      33 // Author:        Vladimir Ivanchenko on base of Laszlo Urban code
 34 //                                                 34 //
 35 // Creation date: 01.10.2003                       35 // Creation date: 01.10.2003
 36 //                                                 36 //
 37 // Modifications: by V.Ivanchenko              <<  37 // Modifications:
                                                   >>  38 // 30-06-04 make it to be pure discrete process (V.Ivanchenko)
                                                   >>  39 // 30-09-08 optimise integral option (V.Ivanchenko)
                                                   >>  40 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
                                                   >>  41 //
 38 //                                                 42 //
 39 // Class Description: based class for discrete <<  43 // Class Description:
 40 //                                                 44 //
                                                   >>  45 // It is the unified process for e+ annililation at rest and in fly.
 41                                                    46 
 42 // -------------------------------------------     47 // -------------------------------------------------------------------
 43 //                                                 48 //
 44 //....oooOO0OOooo........oooOO0OOooo........oo     49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 45 //....oooOO0OOooo........oooOO0OOooo........oo     50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 46                                                    51 
 47 #include "G4VEmProcess.hh"                         52 #include "G4VEmProcess.hh"
 48 #include "G4PhysicalConstants.hh"              << 
 49 #include "G4SystemOfUnits.hh"                  << 
 50 #include "G4ProcessManager.hh"                 << 
 51 #include "G4LossTableManager.hh"                   53 #include "G4LossTableManager.hh"
 52 #include "G4LossTableBuilder.hh"               << 
 53 #include "G4Step.hh"                               54 #include "G4Step.hh"
 54 #include "G4ParticleDefinition.hh"                 55 #include "G4ParticleDefinition.hh"
 55 #include "G4VEmModel.hh"                           56 #include "G4VEmModel.hh"
 56 #include "G4DataVector.hh"                         57 #include "G4DataVector.hh"
 57 #include "G4PhysicsTable.hh"                       58 #include "G4PhysicsTable.hh"
 58 #include "G4EmDataHandler.hh"                  <<  59 #include "G4PhysicsVector.hh"
 59 #include "G4PhysicsLogVector.hh"                   60 #include "G4PhysicsLogVector.hh"
 60 #include "G4VParticleChange.hh"                    61 #include "G4VParticleChange.hh"
 61 #include "G4ProductionCutsTable.hh"                62 #include "G4ProductionCutsTable.hh"
 62 #include "G4Region.hh"                             63 #include "G4Region.hh"
                                                   >>  64 #include "G4RegionStore.hh"
 63 #include "G4Gamma.hh"                              65 #include "G4Gamma.hh"
 64 #include "G4Electron.hh"                           66 #include "G4Electron.hh"
 65 #include "G4Positron.hh"                           67 #include "G4Positron.hh"
 66 #include "G4PhysicsTableHelper.hh"                 68 #include "G4PhysicsTableHelper.hh"
 67 #include "G4EmBiasingManager.hh"               << 
 68 #include "G4EmParameters.hh"                   << 
 69 #include "G4EmProcessSubType.hh"               << 
 70 #include "G4EmTableUtil.hh"                    << 
 71 #include "G4EmUtility.hh"                      << 
 72 #include "G4DNAModelSubType.hh"                << 
 73 #include "G4GenericIon.hh"                     << 
 74 #include "G4Log.hh"                            << 
 75 #include <iostream>                            << 
 76                                                    69 
 77 //....oooOO0OOooo........oooOO0OOooo........oo     70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 78                                                    71 
 79 G4VEmProcess::G4VEmProcess(const G4String& nam     72 G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
 80   G4VDiscreteProcess(name, type)               <<  73                       G4VDiscreteProcess(name, type),
                                                   >>  74   theLambdaTable(0),
                                                   >>  75   theEnergyOfCrossSectionMax(0),
                                                   >>  76   theCrossSectionMax(0),
                                                   >>  77   particle(0),
                                                   >>  78   secondaryParticle(0),
                                                   >>  79   nLambdaBins(90),
                                                   >>  80   lambdaFactor(0.1),
                                                   >>  81   currentCouple(0),
                                                   >>  82   integral(false),
                                                   >>  83   meanFreePath(true),
                                                   >>  84   aboveCSmax(true),
                                                   >>  85   buildLambdaTable(true)
 81 {                                                  86 {
 82   theParameters = G4EmParameters::Instance();  << 
 83   SetVerboseLevel(1);                          << 
 84                                                    87 
 85   // Size of tables                            <<  88   minKinEnergy    = 0.1*keV;
 86   minKinEnergy = 0.1*CLHEP::keV;               <<  89   maxKinEnergy    = 100.0*GeV;
 87   maxKinEnergy = 100.0*CLHEP::TeV;             << 
 88                                                << 
 89   // default lambda factor                     << 
 90   invLambdaFactor = 1.0/lambdaFactor;          << 
 91                                                << 
 92   // particle types                            << 
 93   theGamma = G4Gamma::Gamma();                 << 
 94   theElectron = G4Electron::Electron();        << 
 95   thePositron = G4Positron::Positron();        << 
 96                                                    90 
 97   pParticleChange = &fParticleChange;              91   pParticleChange = &fParticleChange;
 98   fParticleChange.SetSecondaryWeightByProcess( << 
 99   secParticles.reserve(5);                     << 
100                                                    92 
101   modelManager = new G4EmModelManager();           93   modelManager = new G4EmModelManager();
102   lManager = G4LossTableManager::Instance();   <<  94   (G4LossTableManager::Instance())->Register(this);
103   lManager->Register(this);                    << 
104   isTheMaster = lManager->IsMaster();          << 
105   G4LossTableBuilder* bld = lManager->GetTable << 
106   theDensityFactor = bld->GetDensityFactors(); << 
107   theDensityIdx = bld->GetCoupleIndexes();     << 
108 }                                                  95 }
109                                                    96 
110 //....oooOO0OOooo........oooOO0OOooo........oo     97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
111                                                    98 
112 G4VEmProcess::~G4VEmProcess()                      99 G4VEmProcess::~G4VEmProcess()
113 {                                                 100 {
114   if(isTheMaster) {                            << 101   Clear();
115     delete theData;                            << 
116     delete theEnergyOfCrossSectionMax;         << 
117   }                                            << 
118   delete modelManager;                            102   delete modelManager;
119   delete biasManager;                          << 103   (G4LossTableManager::Instance())->DeRegister(this);
120   lManager->DeRegister(this);                  << 
121 }                                                 104 }
122                                                   105 
123 //....oooOO0OOooo........oooOO0OOooo........oo    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
124                                                   107 
125 void G4VEmProcess::AddEmModel(G4int order, G4V << 108 void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
126                               const G4Region*  << 
127 {                                                 109 {
128   if(nullptr == ptr) { return; }               << 110   if(!particle) particle = &part;
129   G4VEmFluctuationModel* fm = nullptr;         << 111 
130   modelManager->AddEmModel(order, ptr, fm, reg << 112   if(particle == &part) {
131   ptr->SetParticleChange(pParticleChange);     << 113     Clear();
                                                   >> 114     theCutsGamma =
                                                   >> 115         modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
                                                   >> 116     const G4ProductionCutsTable* theCoupleTable=
                                                   >> 117           G4ProductionCutsTable::GetProductionCutsTable();
                                                   >> 118     theCutsGamma    = theCoupleTable->GetEnergyCutsVector(idxG4GammaCut);
                                                   >> 119     theCutsElectron = theCoupleTable->GetEnergyCutsVector(idxG4ElectronCut);
                                                   >> 120     theCutsPositron = theCoupleTable->GetEnergyCutsVector(idxG4PositronCut);
                                                   >> 121     if(buildLambdaTable)
                                                   >> 122       theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
                                                   >> 123   }
132 }                                                 124 }
133                                                   125 
134 //....oooOO0OOooo........oooOO0OOooo........oo    126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
135                                                   127 
136 void G4VEmProcess::SetEmModel(G4VEmModel* ptr, << 128 void G4VEmProcess::Clear()
137 {                                                 129 {
138   if(nullptr == ptr) { return; }               << 130   if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
139   if(!emModels.empty()) {                      << 131   if(theCrossSectionMax) delete [] theCrossSectionMax;
140     for(auto & em : emModels) { if(em == ptr)  << 132   theEnergyOfCrossSectionMax = 0;
141   }                                            << 133   theCrossSectionMax = 0;
142   emModels.push_back(ptr);                     << 134   modelManager->Clear();
                                                   >> 135   currentCouple = 0;
                                                   >> 136   preStepLambda = 0.0;
                                                   >> 137   mfpKinEnergy  = DBL_MAX;
                                                   >> 138   preStepMFP    = DBL_MAX;
143 }                                                 139 }
144                                                   140 
145 //....oooOO0OOooo........oooOO0OOooo........oo    141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
146                                                   142 
147 void G4VEmProcess::PreparePhysicsTable(const G << 143 void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
148 {                                                 144 {
149   if(nullptr == particle) { SetParticle(&part) << 145   if(0 < verboseLevel) {
150                                                << 146     G4cout << "G4VEmProcess::BuildPhysicsTable() for "
151   if(part.GetParticleType() == "nucleus" &&    << 147            << GetProcessName()
152      part.GetParticleSubType() == "generic") { << 148            << " and particle " << part.GetParticleName()
153                                                << 149            << G4endl;
154     G4String pname = part.GetParticleName();   << 
155     if(pname != "deuteron" && pname != "triton << 
156        pname != "He3" && pname != "alpha" && p << 
157        pname != "helium" && pname != "hydrogen << 
158                                                << 
159       particle = G4GenericIon::GenericIon();   << 
160       isIon = true;                            << 
161     }                                          << 
162   }                                               150   }
163   if(particle != &part) { return; }            << 
164                                                   151 
165   lManager->PreparePhysicsTable(&part, this);  << 152   if(buildLambdaTable) {
166                                                << 153     BuildLambdaTable();
167   // for new run                               << 154     FindLambdaMax();
168   currentCouple = nullptr;                     << 155   }
169   preStepLambda = 0.0;                         << 156   if(-1 < verboseLevel) PrintInfoDefinition();
170   fLambdaEnergy = 0.0;                         << 
171                                                << 
172   InitialiseProcess(particle);                 << 
173                                                   157 
174   G4LossTableBuilder* bld = lManager->GetTable << 158   if(0 < verboseLevel) {
175   const G4ProductionCutsTable* theCoupleTable= << 159     G4cout << "G4VEmProcess::BuildPhysicsTable() done for "
176     G4ProductionCutsTable::GetProductionCutsTa << 160            << GetProcessName()
177   theCutsGamma    = theCoupleTable->GetEnergyC << 161            << " and particle " << part.GetParticleName()
178   theCutsElectron = theCoupleTable->GetEnergyC << 162            << G4endl;
179   theCutsPositron = theCoupleTable->GetEnergyC << 
180                                                << 
181   // initialisation of the process             << 
182   if(!actMinKinEnergy) { minKinEnergy = thePar << 
183   if(!actMaxKinEnergy) { maxKinEnergy = thePar << 
184                                                << 
185   applyCuts       = theParameters->ApplyCuts() << 
186   lambdaFactor    = theParameters->LambdaFacto << 
187   invLambdaFactor = 1.0/lambdaFactor;          << 
188   theParameters->DefineRegParamForEM(this);    << 
189                                                << 
190   // integral option may be disabled           << 
191   if(!theParameters->Integral()) { fXSType = f << 
192                                                << 
193   // prepare tables                            << 
194   if(isTheMaster) {                            << 
195     if(nullptr == theData) { theData = new G4E << 
196                                                << 
197     if(buildLambdaTable) {                     << 
198       theLambdaTable = theData->MakeTable(0);  << 
199       bld->InitialiseBaseMaterials(theLambdaTa << 
200     }                                          << 
201     // high energy table                       << 
202     if(minKinEnergyPrim < maxKinEnergy) {      << 
203       theLambdaTablePrim = theData->MakeTable( << 
204       bld->InitialiseBaseMaterials(theLambdaTa << 
205     }                                          << 
206   }                                               163   }
207   // models                                    << 
208   baseMat = bld->GetBaseMaterialFlag();        << 
209   numberOfModels = modelManager->NumberOfModel << 
210   currentModel = modelManager->GetModel(0);    << 
211   if(nullptr != lManager->AtomDeexcitation())  << 
212     modelManager->SetFluoFlag(true);           << 
213   }                                            << 
214   // forced biasing                            << 
215   if(nullptr != biasManager) {                 << 
216     biasManager->Initialise(part, GetProcessNa << 
217     biasFlag = false;                          << 
218   }                                            << 
219                                                << 
220   theCuts =                                    << 
221     G4EmTableUtil::PrepareEmProcess(this, part << 
222                                     modelManag << 
223                                     secID, tri << 
224                                     verboseLev << 
225 }                                                 164 }
226                                                   165 
227 //....oooOO0OOooo........oooOO0OOooo........oo    166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
228                                                   167 
229 void G4VEmProcess::BuildPhysicsTable(const G4P << 168 void G4VEmProcess::BuildLambdaTable()
230 {                                                 169 {
231   if(nullptr == masterProc) {                  << 170   if(0 < verboseLevel) {
232     if(isTheMaster) { masterProc = this; }     << 171     G4cout << "G4VEnergyLossSTD::BuildLambdaTable() for process "
233     else { masterProc = static_cast<const G4VE << 172            << GetProcessName() << " and particle "
234   }                                            << 173            << particle->GetParticleName()
235   G4int nModels = modelManager->NumberOfModels << 174            << G4endl;
236   G4bool isLocked = theParameters->IsPrintLock << 175   }
237   G4bool toBuild = (buildLambdaTable || minKin << 
238                                                << 
239   G4EmTableUtil::BuildEmProcess(this, masterPr << 
240                                 nModels, verbo << 
241                                 isLocked, toBu << 
242 }                                              << 
243                                                   176 
244 //....oooOO0OOooo........oooOO0OOooo........oo << 177   // Access to materials
                                                   >> 178   const G4ProductionCutsTable* theCoupleTable=
                                                   >> 179         G4ProductionCutsTable::GetProductionCutsTable();
                                                   >> 180   size_t numOfCouples = theCoupleTable->GetTableSize();
245                                                   181 
246 void G4VEmProcess::BuildLambdaTable()          << 182   for(size_t i=0; i<numOfCouples; i++) {
247 {                                              << 
248   G4double scale = theParameters->MaxKinEnergy << 
249   G4int nbin =                                 << 
250     theParameters->NumberOfBinsPerDecade()*G4l << 
251   if(actBinning) { nbin = std::max(nbin, nLamb << 
252   scale = nbin/G4Log(scale);                   << 
253                                                << 
254   G4LossTableBuilder* bld = lManager->GetTable << 
255   G4EmTableUtil::BuildLambdaTable(this, partic << 
256                                   bld, theLamb << 
257                                   minKinEnergy << 
258                                   maxKinEnergy << 
259                                   startFromNul << 
260 }                                              << 
261                                                   183 
262 //....oooOO0OOooo........oooOO0OOooo........oo << 184     if (theLambdaTable->GetFlag(i)) {
263                                                   185 
264 void G4VEmProcess::StreamInfo(std::ostream& ou << 186       // create physics vector and fill it
265                   const G4ParticleDefinition&  << 187       const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
266 {                                              << 188       G4PhysicsVector* aVector = LambdaPhysicsVector(couple);
267   G4String indent = (rst ? "  " : "");         << 189       modelManager->FillLambdaVector(aVector, couple);
268   out << std::setprecision(6);                 << 190       G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
269   out << G4endl << indent << GetProcessName()  << 
270   if (!rst) {                                  << 
271     out << " for " << part.GetParticleName();  << 
272   }                                            << 
273   if(fXSType != fEmNoIntegral)  { out << " XSt << 
274   if(applyCuts) { out << " applyCuts:1 "; }    << 
275   G4int subtype = GetProcessSubType();         << 
276   out << " SubType=" << subtype;               << 
277   if (subtype == fAnnihilation) {              << 
278     G4int mod = theParameters->PositronAtRestM << 
279     const G4String namp[2] = {"Simple", "Allis << 
280     out << " AtRestModel:" << namp[mod];       << 
281   }                                            << 
282   if(biasFactor != 1.0) { out << "  BiasingFac << 
283   out << " BuildTable=" << buildLambdaTable << << 
284   if(buildLambdaTable) {                       << 
285     if(particle == &part) {                    << 
286       for(auto & v : *theLambdaTable) {        << 
287         if(nullptr != v) {                     << 
288           out << "      Lambda table from ";   << 
289           G4double emin = v->Energy(0);        << 
290           G4double emax = v->GetMaxEnergy();   << 
291           G4int nbin = G4int(v->GetVectorLengt << 
292           if(emin > minKinEnergy) { out << "th << 
293           else { out << G4BestUnit(emin,"Energ << 
294           out << " to "                        << 
295               << G4BestUnit(emax,"Energy")     << 
296               << ", " << G4lrint(nbin/std::log << 
297               << " bins/decade, spline: "      << 
298               << splineFlag << G4endl;         << 
299           break;                               << 
300         }                                      << 
301       }                                        << 
302     } else {                                   << 
303       out << "      Used Lambda table of "     << 
304       << particle->GetParticleName() << G4endl << 
305     }                                             191     }
306   }                                               192   }
307   if(minKinEnergyPrim < maxKinEnergy) {        << 
308     if(particle == &part) {                    << 
309       for(auto & v : *theLambdaTablePrim) {    << 
310         if(nullptr != v) {                     << 
311           out << "      LambdaPrime table from << 
312               << G4BestUnit(v->Energy(0),"Ener << 
313               << " to "                        << 
314               << G4BestUnit(v->GetMaxEnergy(), << 
315               << " in " << v->GetVectorLength( << 
316               << " bins " << G4endl;           << 
317           break;                               << 
318         }                                      << 
319       }                                        << 
320     } else {                                   << 
321       out << "      Used LambdaPrime table of  << 
322                << particle->GetParticleName()  << 
323     }                                          << 
324   }                                            << 
325   StreamProcessInfo(out);                      << 
326   modelManager->DumpModelList(out, verboseLeve << 
327                                                   193 
328   if(verboseLevel > 2 && buildLambdaTable) {   << 194   if(0 < verboseLevel) {
329     out << "      LambdaTable address= " << th << 195     G4cout << "Lambda table is built for "
330     if(theLambdaTable && particle == &part) {  << 196            << particle->GetParticleName()
331       out << (*theLambdaTable) << G4endl;      << 197            << G4endl;
                                                   >> 198     if(2 < verboseLevel) {
                                                   >> 199       G4cout << *theLambdaTable << G4endl;
332     }                                             200     }
333   }                                               201   }
334 }                                                 202 }
335                                                   203 
336 //....oooOO0OOooo........oooOO0OOooo........oo    204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
337                                                   205 
338 void G4VEmProcess::StartTracking(G4Track* trac << 206 void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
339 {                                                 207 {
340   // reset parameters for the new track        << 208   particle = p;
341   currentParticle = track->GetParticleDefiniti << 
342   theNumberOfInteractionLengthLeft = -1.0;     << 
343   mfpKinEnergy = DBL_MAX;                      << 
344   preStepLambda = 0.0;                         << 
345                                                << 
346   if(isIon) { massRatio = proton_mass_c2/curre << 
347                                                << 
348   // forced biasing only for primary particles << 
349   if(biasManager) {                            << 
350     if(0 == track->GetParentID()) {            << 
351       // primary particle                      << 
352       biasFlag = true;                         << 
353       biasManager->ResetForcedInteraction();   << 
354     }                                          << 
355   }                                            << 
356 }                                                 209 }
357                                                   210 
358 //....oooOO0OOooo........oooOO0OOooo........oo    211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
359                                                   212 
360 G4double G4VEmProcess::PostStepGetPhysicalInte << 213 void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
361                              const G4Track& tr << 214 {
362                              G4double   previo << 215   secondaryParticle = p;
363                              G4ForceCondition* << 
364 {                                              << 
365   *condition = NotForced;                      << 
366   G4double x = DBL_MAX;                        << 
367                                                << 
368   DefineMaterial(track.GetMaterialCutsCouple() << 
369   preStepKinEnergy = track.GetKineticEnergy(); << 
370   const G4double scaledEnergy = preStepKinEner << 
371   SelectModel(scaledEnergy, currentCoupleIndex << 
372   /*                                           << 
373   G4cout << "PostStepGetPhysicalInteractionLen << 
374          << "  couple: " << currentCouple << G << 
375   */                                           << 
376   if(!currentModel->IsActive(scaledEnergy)) {  << 
377     theNumberOfInteractionLengthLeft = -1.0;   << 
378     currentInteractionLength = DBL_MAX;        << 
379     mfpKinEnergy = DBL_MAX;                    << 
380     preStepLambda = 0.0;                       << 
381     return x;                                  << 
382   }                                            << 
383                                                << 
384   // forced biasing only for primary particles << 
385   if(biasManager) {                            << 
386     if(0 == track.GetParentID()) {             << 
387       if(biasFlag &&                           << 
388          biasManager->ForcedInteractionRegion( << 
389         return biasManager->GetStepLimit((G4in << 
390       }                                        << 
391     }                                          << 
392   }                                            << 
393                                                << 
394   // compute mean free path                    << 
395                                                << 
396   ComputeIntegralLambda(preStepKinEnergy, trac << 
397                                                << 
398   // zero cross section                        << 
399   if(preStepLambda <= 0.0) {                   << 
400     theNumberOfInteractionLengthLeft = -1.0;   << 
401     currentInteractionLength = DBL_MAX;        << 
402                                                << 
403   } else {                                     << 
404                                                << 
405     // non-zero cross section                  << 
406     if (theNumberOfInteractionLengthLeft < 0.0 << 
407                                                << 
408       // beggining of tracking (or just after  << 
409       theNumberOfInteractionLengthLeft = -G4Lo << 
410       theInitialNumberOfInteractionLength = th << 
411                                                << 
412     } else {                                   << 
413                                                << 
414       theNumberOfInteractionLengthLeft -=      << 
415         previousStepSize/currentInteractionLen << 
416       theNumberOfInteractionLengthLeft =       << 
417         std::max(theNumberOfInteractionLengthL << 
418     }                                          << 
419                                                << 
420     // new mean free path and step limit for t << 
421     currentInteractionLength = 1.0/preStepLamb << 
422     x = theNumberOfInteractionLengthLeft * cur << 
423   }                                            << 
424   return x;                                    << 
425 }                                                 216 }
426                                                   217 
427 //....oooOO0OOooo........oooOO0OOooo........oo    218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
428                                                   219 
429 void G4VEmProcess::ComputeIntegralLambda(G4dou << 220 void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p, const G4Region* region)
430 {                                                 221 {
431   if (fXSType == fEmNoIntegral) {              << 222   modelManager->AddEmModel(order, p, 0, region);
432     preStepLambda = GetCurrentLambda(e, LogEki << 223 }
433                                                << 
434   } else if (fXSType == fEmIncreasing) {       << 
435     if(e*invLambdaFactor < mfpKinEnergy) {     << 
436       preStepLambda = GetCurrentLambda(e, LogE << 
437       mfpKinEnergy = (preStepLambda > 0.0) ? e << 
438     }                                          << 
439                                                   224 
440   } else if(fXSType == fEmDecreasing) {        << 225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
441     if(e < mfpKinEnergy) {                     << 
442       const G4double e1 = e*lambdaFactor;      << 
443       preStepLambda = GetCurrentLambda(e1);    << 
444       mfpKinEnergy = e1;                       << 
445     }                                          << 
446                                                   226 
447   } else if(fXSType == fEmOnePeak) {           << 227 void G4VEmProcess::UpdateEmModel(const G4String& nam, G4double emin, G4double emax)
448     const G4double epeak = (*theEnergyOfCrossS << 228 {
449     if(e <= epeak) {                           << 229   modelManager->UpdateEmModel(nam, emin, emax);
450       if(e*invLambdaFactor < mfpKinEnergy) {   << 
451         preStepLambda = GetCurrentLambda(e, Lo << 
452         mfpKinEnergy = (preStepLambda > 0.0) ? << 
453       }                                        << 
454     } else if(e < mfpKinEnergy) {              << 
455       const G4double e1 = std::max(epeak, e*la << 
456       preStepLambda = GetCurrentLambda(e1);    << 
457       mfpKinEnergy = e1;                       << 
458     }                                          << 
459   } else {                                     << 
460     preStepLambda = GetCurrentLambda(e, LogEki << 
461   }                                            << 
462 }                                                 230 }
463                                                   231 
464 //....oooOO0OOooo........oooOO0OOooo........oo    232 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
465                                                   233 
466 G4VParticleChange* G4VEmProcess::PostStepDoIt(    234 G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
467                                                   235                                               const G4Step& step)
468 {                                                 236 {
469   // clear number of interaction lengths in an << 
470   theNumberOfInteractionLengthLeft = -1.0;     << 
471   mfpKinEnergy = DBL_MAX;                      << 
472                                                << 
473   fParticleChange.InitializeForPostStep(track)    237   fParticleChange.InitializeForPostStep(track);
474                                                   238 
475   // Do not make anything if particle is stopp    239   // Do not make anything if particle is stopped, the annihilation then
476   // should be performed by the AtRestDoIt!       240   // should be performed by the AtRestDoIt!
477   if (track.GetTrackStatus() == fStopButAlive) << 241   if (track.GetTrackStatus() == fStopButAlive) return &fParticleChange;
478                                                << 
479   const G4double finalT = track.GetKineticEner << 
480                                                << 
481   // forced process - should happen only once  << 
482   if(biasFlag) {                               << 
483     if(biasManager->ForcedInteractionRegion((G << 
484       biasFlag = false;                        << 
485     }                                          << 
486   }                                            << 
487                                                   242 
488   // check active and select model             << 243   G4double finalT = track.GetKineticEnergy();
489   const G4double scaledEnergy = finalT*massRat << 
490   SelectModel(scaledEnergy, currentCoupleIndex << 
491   if(!currentModel->IsActive(scaledEnergy)) {  << 
492                                                   244 
493   // Integral approach                            245   // Integral approach
494   if (fXSType != fEmNoIntegral) {              << 246   if (integral) {
495     const G4double logFinalT =                 << 247     G4double lx = GetLambda(finalT, currentCouple);
496       track.GetDynamicParticle()->GetLogKineti << 248     if(preStepLambda<lx && 0 < verboseLevel) {
497     const G4double lx = std::max(GetCurrentLam << 249       G4cout << "WARING: for " << particle->GetParticleName() 
498 #ifdef G4VERBOSE                               << 250              << " and " << GetProcessName()
499     if(preStepLambda < lx && 1 < verboseLevel) << 251              << " E(MeV)= " << finalT/MeV
500       G4cout << "WARNING: for " << currentPart << 252              << " preLambda= " << preStepLambda << " < " << lx << " (postLambda) "
501              << " and " << GetProcessName() << << 253        << G4endl;  
502              << " preLambda= " << preStepLambd << 
503              << " < " << lx << " (postLambda)  << 
504     }                                             254     }
505 #endif                                         << 
506     // if false interaction then use new cross << 
507     // if both values are zero - no interactio << 
508     if(preStepLambda*G4UniformRand() >= lx) {  << 
509       return &fParticleChange;                 << 
510     }                                          << 
511   }                                            << 
512                                                   255 
513   // define new weight for primary and seconda << 256     if(preStepLambda*G4UniformRand() > lx)
514   G4double weight = fParticleChange.GetParentW << 257       return G4VDiscreteProcess::PostStepDoIt(track,step);
515   if(weightFlag) {                             << 
516     weight /= biasFactor;                      << 
517     fParticleChange.ProposeWeight(weight);     << 
518   }                                               258   }
519                                                << 259 
520 #ifdef G4VERBOSE                               << 260   G4VEmModel* currentModel = SelectModel(finalT);
521   if(1 < verboseLevel) {                       << 261   const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
                                                   >> 262 
                                                   >> 263   /*
                                                   >> 264   if(0 < verboseLevel) {
                                                   >> 265     const G4ParticleDefinition* pd = dynParticle->GetDefinition();
522     G4cout << "G4VEmProcess::PostStepDoIt: Sam    266     G4cout << "G4VEmProcess::PostStepDoIt: Sample secondary; E= "
523            << finalT/MeV                          267            << finalT/MeV
524            << " MeV; model= (" << currentModel << 268            << " MeV; model= (" << currentModel->LowEnergyLimit(pd)
525            << ", " <<  currentModel->HighEnerg << 269            << ", " <<  currentModel->HighEnergyLimit(pd) << ")"
526            << G4endl;                             270            << G4endl;
527   }                                               271   }
528 #endif                                         << 272   */
529                                                << 
530   // sample secondaries                        << 
531   secParticles.clear();                        << 
532   currentModel->SampleSecondaries(&secParticle << 
533                                   currentCoupl << 
534                                   track.GetDyn << 
535                                   (*theCuts)[c << 
536                                                << 
537   G4int num0 = (G4int)secParticles.size();     << 
538                                                << 
539   // splitting or Russian roulette             << 
540   if(biasManager) {                            << 
541     if(biasManager->SecondaryBiasingRegion((G4 << 
542       G4double eloss = 0.0;                    << 
543       weight *= biasManager->ApplySecondaryBia << 
544         secParticles, track, currentModel, &fP << 
545         (G4int)currentCoupleIndex, (*theCuts)[ << 
546         step.GetPostStepPoint()->GetSafety()); << 
547       if(eloss > 0.0) {                        << 
548         eloss += fParticleChange.GetLocalEnerg << 
549         fParticleChange.ProposeLocalEnergyDepo << 
550       }                                        << 
551     }                                          << 
552   }                                            << 
553                                                   273 
554   // save secondaries                          << 274   std::vector<G4DynamicParticle*>* newp = SecondariesPostStep(currentModel,
555   G4int num = (G4int)secParticles.size();      << 275                                                               currentCouple,
556   if(num > 0) {                                << 276                                                   dynParticle);
557                                                << 277   G4double edep = fParticleChange.GetLocalEnergyDeposit();
558     fParticleChange.SetNumberOfSecondaries(num << 278   if (newp) {
559     G4double edep = fParticleChange.GetLocalEn << 279     G4int num = newp->size();
560     G4double time = track.GetGlobalTime();     << 280     if(num > 0) {
561                                                << 281       fParticleChange.SetNumberOfSecondaries(num);
562     G4int n1(0), n2(0);                        << 282       G4double gcut = (*theCutsGamma)[currentMaterialIndex];
563     if(num0 > mainSecondaries) {               << 283       G4double ecut = (*theCutsElectron)[currentMaterialIndex];
564       currentModel->FillNumberOfSecondaries(n1 << 284       G4double pcut = (*theCutsPositron)[currentMaterialIndex];
565     }                                          << 285       for (G4int i=0; i<num; i++) {
566                                                << 286         G4DynamicParticle* dp = (*newp)[i];
567     for (G4int i=0; i<num; ++i) {              << 287         const G4ParticleDefinition* p = dp->GetDefinition();
568       G4DynamicParticle* dp = secParticles[i]; << 
569       if (nullptr != dp) {                     << 
570         const G4ParticleDefinition* p = dp->Ge << 
571         G4double e = dp->GetKineticEnergy();      288         G4double e = dp->GetKineticEnergy();
572         G4bool good = true;                    << 289   G4bool good = true;
573         if(applyCuts) {                        << 290   if (p == G4Gamma::Gamma()) {
574           if (p == theGamma) {                 << 291      if (e < gcut) {
575             if (e < (*theCutsGamma)[currentCou << 292        good = false;
576                                                << 293        edep += e;
577           } else if (p == theElectron) {       << 294      }
578             if (e < (*theCutsElectron)[current << 295   } else if (p == G4Electron::Electron()) {
579                                                << 296      if (e < ecut) {
580           } else if (p == thePositron) {       << 297        good = false;
581             if (electron_mass_c2 < (*theCutsGa << 298        edep += e;
582                 e < (*theCutsPositron)[current << 299      }
583               good = false;                    << 300   } else if (p == G4Positron::Positron()) {
584               e += 2.0*electron_mass_c2;       << 301      if (e < pcut) {
585             }                                  << 302        good = false;
586           }                                    << 303        edep += e + electron_mass_c2;
587           // added secondary if it is good     << 304      }
588         }                                      << 
589         if (good) {                            << 
590           G4Track* t = new G4Track(dp, time, t << 
591           t->SetTouchableHandle(track.GetTouch << 
592           if (biasManager) {                   << 
593             t->SetWeight(weight * biasManager- << 
594           } else {                             << 
595             t->SetWeight(weight);              << 
596           }                                    << 
597           pParticleChange->AddSecondary(t);    << 
598                                                << 
599           // define type of secondary          << 
600           if(i < mainSecondaries) {            << 
601             t->SetCreatorModelID(secID);       << 
602             if(GetProcessSubType() == fCompton << 
603               t->SetCreatorModelID(_ComptonGam << 
604             }                                  << 
605           } else if(i < mainSecondaries + n1)  << 
606             t->SetCreatorModelID(tripletID);   << 
607           } else if(i < mainSecondaries + n1 + << 
608             t->SetCreatorModelID(_IonRecoil);  << 
609           } else {                             << 
610             if(i < num0) {                     << 
611               if(p == theGamma) {              << 
612                 t->SetCreatorModelID(fluoID);  << 
613               } else {                         << 
614                 t->SetCreatorModelID(augerID); << 
615               }                                << 
616             } else {                           << 
617               t->SetCreatorModelID(biasID);    << 
618             }                                  << 
619           }                                    << 
620           /*                                   << 
621           G4cout << "Secondary(post step) has  << 
622                  << ", Ekin= " << t->GetKineti << 
623                  << GetProcessName() << " fluo << 
624                  << " augerID= " << augerID << << 
625           */                                   << 
626         } else {                               << 
627           delete dp;                           << 
628           edep += e;                           << 
629         }                                         305         }
630       }                                        << 306         if (good) fParticleChange.AddSecondary(dp);
                                                   >> 307         else      delete dp;
                                                   >> 308       }
631     }                                             309     }
632     fParticleChange.ProposeLocalEnergyDeposit( << 310     delete newp;
633   }                                            << 
634                                                << 
635   if(0.0 == fParticleChange.GetProposedKinetic << 
636      fAlive == fParticleChange.GetTrackStatus( << 
637     if(particle->GetProcessManager()->GetAtRes << 
638          { fParticleChange.ProposeTrackStatus( << 
639     else { fParticleChange.ProposeTrackStatus( << 
640   }                                               311   }
                                                   >> 312   fParticleChange.ProposeLocalEnergyDeposit(edep);
641                                                   313 
642   return &fParticleChange;                        314   return &fParticleChange;
643 }                                                 315 }
644                                                   316 
645 //....oooOO0OOooo........oooOO0OOooo........oo    317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
646                                                   318 
647 G4bool G4VEmProcess::StorePhysicsTable(const G << 319 void G4VEmProcess::PrintInfoDefinition()
648                                        const G << 
649                                        G4bool  << 
650 {                                                 320 {
651   if(!isTheMaster || part != particle) { retur << 321   G4cout << G4endl << GetProcessName() << ":  " << G4endl
652   if(G4EmTableUtil::StoreTable(this, part, the << 322          << "      Lambda tables from threshold to "
653              directory, "Lambda",              << 323          << G4BestUnit(maxKinEnergy,"Energy")
654                                verboseLevel, a << 324          << " in " << nLambdaBins << " bins."
655      G4EmTableUtil::StoreTable(this, part, the << 325          << G4endl;
656              directory, "LambdaPrim",          << 
657                                verboseLevel, a << 
658      return true;                              << 
659   }                                            << 
660   return false;                                << 
661 }                                              << 
662                                                   326 
663 //....oooOO0OOooo........oooOO0OOooo........oo << 327   if(0 < verboseLevel) {
                                                   >> 328     G4cout << "Tables are built for " << particle->GetParticleName()
                                                   >> 329            << G4endl;
664                                                   330 
665 G4bool G4VEmProcess::RetrievePhysicsTable(cons << 331     if(2 < verboseLevel) {
666                                           cons << 332       G4cout << "LambdaTable address= " << theLambdaTable << G4endl;
667                                           G4bo << 333       if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
668 {                                              << 334     }
669   if(!isTheMaster || part != particle) { retur << 
670   G4bool yes = true;                           << 
671   if(buildLambdaTable) {                       << 
672     yes = G4EmTableUtil::RetrieveTable(this, p << 
673                                        "Lambda << 
674                                        ascii,  << 
675   }                                            << 
676   if(yes && minKinEnergyPrim < maxKinEnergy) { << 
677     yes = G4EmTableUtil::RetrieveTable(this, p << 
678                                        "Lambda << 
679                                        ascii,  << 
680   }                                               335   }
681   return yes;                                  << 
682 }                                                 336 }
683                                                   337 
684 //....oooOO0OOooo........oooOO0OOooo........oo    338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
685                                                   339 
686 G4double G4VEmProcess::GetCrossSection(G4doubl << 340 G4double G4VEmProcess::MicroscopicCrossSection(G4double kineticEnergy,
687                                        const G << 341                                          const G4MaterialCutsCouple* couple)
688 {                                                 342 {
689   CurrentSetup(couple, kinEnergy);             << 343   // Cross section per atom is calculated
690   return GetCurrentLambda(kinEnergy, G4Log(kin << 344   DefineMaterial(couple);
691 }                                              << 345   G4double cross = 0.0;
                                                   >> 346   G4bool b;
                                                   >> 347   if(theLambdaTable) {
                                                   >> 348     cross = (((*theLambdaTable)[currentMaterialIndex])->
                                                   >> 349                            GetValue(kineticEnergy, b));
692                                                   350 
693 //....oooOO0OOooo........oooOO0OOooo........oo << 351     cross /= currentMaterial->GetTotNbOfAtomsPerVolume();
                                                   >> 352   }
694                                                   353 
695 G4double G4VEmProcess::GetMeanFreePath(const G << 354   return cross;
696                                        G4doubl << 
697                                        G4Force << 
698 {                                              << 
699   *condition = NotForced;                      << 
700   return G4VEmProcess::MeanFreePath(track);    << 
701 }                                                 355 }
702                                                   356 
703 //....oooOO0OOooo........oooOO0OOooo........oo    357 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
704                                                   358 
705 G4double                                       << 359 G4double G4VEmProcess::MeanFreePath(const G4Track& track,
706 G4VEmProcess::ComputeCrossSectionPerAtom(G4dou << 360                                           G4double s,
707                                          G4dou << 361                                           G4ForceCondition* cond)
708 {                                                 362 {
709   SelectModel(kinEnergy, currentCoupleIndex);  << 363   return GetMeanFreePath(track, s, cond);
710   return (currentModel) ?                      << 
711     currentModel->ComputeCrossSectionPerAtom(c << 
712                                              Z << 
713 }                                                 364 }
714                                                   365 
715 //....oooOO0OOooo........oooOO0OOooo........oo    366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
716                                                   367 
717 G4PhysicsVector*                               << 368 G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
718 G4VEmProcess::LambdaPhysicsVector(const G4Mate << 369                const G4String& directory,
                                                   >> 370                      G4bool ascii)
719 {                                                 371 {
720   DefineMaterial(couple);                      << 372   G4bool yes = true;
721   G4PhysicsVector* newv = new G4PhysicsLogVect << 
722                                                << 
723   return newv;                                 << 
724 }                                              << 
725                                                   373 
726 //....oooOO0OOooo........oooOO0OOooo........oo << 374   if ( theLambdaTable && part == particle) {
                                                   >> 375     const G4String name = GetPhysicsTableFileName(part,directory,"Lambda",ascii);
                                                   >> 376     yes = theLambdaTable->StorePhysicsTable(name,ascii);
727                                                   377 
728 const G4Element* G4VEmProcess::GetCurrentEleme << 378     if ( yes ) {
729 {                                              << 379       G4cout << "Physics tables are stored for " << particle->GetParticleName()
730   return (nullptr != currentModel) ?           << 380              << " and process " << GetProcessName()
731     currentModel->GetCurrentElement(currentMat << 381        << " in the directory <" << directory
                                                   >> 382        << "> " << G4endl;
                                                   >> 383     } else {
                                                   >> 384       G4cout << "Fail to store Physics Tables for " << particle->GetParticleName()
                                                   >> 385              << " and process " << GetProcessName()
                                                   >> 386        << " in the directory <" << directory
                                                   >> 387        << "> " << G4endl;
                                                   >> 388     }
                                                   >> 389   }
                                                   >> 390   return yes;
732 }                                                 391 }
733                                                   392 
734 //....oooOO0OOooo........oooOO0OOooo........oo << 393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
735                                                   394 
736 const G4Element* G4VEmProcess::GetTargetElemen << 395 G4bool G4VEmProcess::RetrievePhysicsTable(const G4ParticleDefinition* part,
                                                   >> 396                     const G4String& directory,
                                                   >> 397                           G4bool ascii)
737 {                                                 398 {
738   return (nullptr != currentModel) ?           << 399   if(0 < verboseLevel) {
739     currentModel->GetCurrentElement(currentMat << 400     G4cout << "G4VEmProcess::RetrievePhysicsTable() for "
740 }                                              << 401            << part->GetParticleName() << " and process "
                                                   >> 402      << GetProcessName() << G4endl;
                                                   >> 403   }
                                                   >> 404   G4bool yes = true;
741                                                   405 
742 //....oooOO0OOooo........oooOO0OOooo........oo << 406   if(!buildLambdaTable || particle != part) return yes;
743                                                   407 
744 const G4Isotope* G4VEmProcess::GetTargetIsotop << 408   const G4String particleName = part->GetParticleName();
745 {                                              << 409   G4String filename;
746   return (nullptr != currentModel) ?           << 410 
747     currentModel->GetCurrentIsotope(GetCurrent << 411   filename = GetPhysicsTableFileName(part,directory,"Lambda",ascii);
                                                   >> 412   yes = G4PhysicsTableHelper::RetrievePhysicsTable(theLambdaTable,filename,ascii);
                                                   >> 413   if ( yes ) {
                                                   >> 414     if (-1 < verboseLevel) {
                                                   >> 415       G4cout << "Lambda table for " << particleName << " is Retrieved from <"
                                                   >> 416              << filename << ">"
                                                   >> 417              << G4endl;
                                                   >> 418     }
                                                   >> 419   } else {
                                                   >> 420     if (-1 < verboseLevel) {
                                                   >> 421       G4cout << "Lambda table for " << particleName << " in file <"
                                                   >> 422              << filename << "> is not exist"
                                                   >> 423              << G4endl;
                                                   >> 424     }
                                                   >> 425   }
                                                   >> 426 
                                                   >> 427   return yes;
748 }                                                 428 }
749                                                   429 
750 //....oooOO0OOooo........oooOO0OOooo........oo    430 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
751                                                   431 
752 void G4VEmProcess::SetCrossSectionBiasingFacto << 432 void G4VEmProcess::FindLambdaMax()
753 {                                                 433 {
754   if(f > 0.0) {                                << 434   if(1 < verboseLevel) {
755     biasFactor = f;                            << 435     G4cout << "### FindLambdaMax: " << particle->GetParticleName() 
756     weightFlag = flag;                         << 436            << " and process " << GetProcessName() << G4endl; 
757     if(1 < verboseLevel) {                     << 437   }
758       G4cout << "### SetCrossSectionBiasingFac << 438   size_t n = theLambdaTable->length();
759              << particle->GetParticleName()    << 439   G4PhysicsVector* pv = (*theLambdaTable)[0];
760              << " and process " << GetProcessN << 440   size_t nb = pv->GetVectorLength();
761              << " biasFactor= " << f << " weig << 441   G4double emax = pv->GetLowEdgeEnergy(nb);
762              << G4endl;                        << 442   G4double e, s, smax = 0.0;
                                                   >> 443   theEnergyOfCrossSectionMax = new G4double [n];
                                                   >> 444   theCrossSectionMax = new G4double [n];
                                                   >> 445   G4bool b;
                                                   >> 446 
                                                   >> 447   for (size_t i=0; i<n; i++) {
                                                   >> 448     pv = (*theLambdaTable)[i];
                                                   >> 449     smax = 0.0;
                                                   >> 450     for (size_t j=0; j<nb; j++) {
                                                   >> 451       e = pv->GetLowEdgeEnergy(j);
                                                   >> 452       s = pv->GetValue(e,b);
                                                   >> 453       if(s > smax) {
                                                   >> 454   smax = s;
                                                   >> 455   emax = e;
                                                   >> 456       }
                                                   >> 457     }
                                                   >> 458     theEnergyOfCrossSectionMax[i] = emax;
                                                   >> 459     theCrossSectionMax[i] = smax;
                                                   >> 460     if(2 < verboseLevel) {
                                                   >> 461       G4cout << "For " << particle->GetParticleName() 
                                                   >> 462        << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
                                                   >> 463        << " lambda= " << smax << G4endl;
763     }                                             464     }
764   }                                               465   }
765 }                                                 466 }
766                                                   467 
767 //....oooOO0OOooo........oooOO0OOooo........oo    468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
768                                                   469 
769 void                                           << 470 void G4VEmProcess::SetLambdaBinning(G4int nbins)
770 G4VEmProcess::ActivateForcedInteraction(G4doub << 
771                                         G4bool << 
772 {                                                 471 {
773   if(nullptr == biasManager) { biasManager = n << 472   nLambdaBins = nbins;
774   if(1 < verboseLevel) {                       << 
775     G4cout << "### ActivateForcedInteraction:  << 
776            << particle->GetParticleName()      << 
777            << " and process " << GetProcessNam << 
778            << " length(mm)= " << length/mm     << 
779            << " in G4Region <" << r            << 
780            << "> weightFlag= " << flag         << 
781            << G4endl;                          << 
782   }                                            << 
783   weightFlag = flag;                           << 
784   biasManager->ActivateForcedInteraction(lengt << 
785 }                                                 473 }
786                                                   474 
787 //....oooOO0OOooo........oooOO0OOooo........oo    475 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
788                                                   476 
789 void                                           << 477 G4int G4VEmProcess::LambdaBinning() const
790 G4VEmProcess::ActivateSecondaryBiasing(const G << 478 {
791                  G4double factor,              << 479   return nLambdaBins;
792                  G4double energyLimit)         << 
793 {                                              << 
794   if (0.0 <= factor) {                         << 
795                                                << 
796     // Range cut can be applied only for e-    << 
797     if(0.0 == factor && secondaryParticle != G << 
798       { return; }                              << 
799                                                << 
800     if(!biasManager) { biasManager = new G4EmB << 
801     biasManager->ActivateSecondaryBiasing(regi << 
802     if(1 < verboseLevel) {                     << 
803       G4cout << "### ActivateSecondaryBiasing: << 
804        << " process " << GetProcessName()      << 
805        << " factor= " << factor                << 
806        << " in G4Region <" << region           << 
807        << "> energyLimit(MeV)= " << energyLimi << 
808        << G4endl;                              << 
809     }                                          << 
810   }                                            << 
811 }                                                 480 }
812                                                   481 
813 //....oooOO0OOooo........oooOO0OOooo........oo    482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
814                                                   483 
815 void G4VEmProcess::SetLambdaBinning(G4int n)   << 484 void G4VEmProcess::SetMinKinEnergy(G4double e)
816 {                                                 485 {
817   if(5 < n && n < 10000000) {                  << 486   minKinEnergy = e;
818     nLambdaBins = n;                           << 
819     actBinning = true;                         << 
820   } else {                                     << 
821     G4double e = (G4double)n;                  << 
822     PrintWarning("SetLambdaBinning", e);       << 
823   }                                            << 
824 }                                                 487 }
825                                                   488 
826 //....oooOO0OOooo........oooOO0OOooo........oo    489 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
827                                                   490 
828 void G4VEmProcess::SetMinKinEnergy(G4double e) << 491 G4double G4VEmProcess::MinKinEnergy() const
829 {                                                 492 {
830   if(1.e-3*eV < e && e < maxKinEnergy) {       << 493   return minKinEnergy;
831     nLambdaBins = G4lrint(nLambdaBins*G4Log(ma << 
832                           /G4Log(maxKinEnergy/ << 
833     minKinEnergy = e;                          << 
834     actMinKinEnergy = true;                    << 
835   } else { PrintWarning("SetMinKinEnergy", e); << 
836 }                                                 494 }
837                                                   495 
838 //....oooOO0OOooo........oooOO0OOooo........oo    496 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
839                                                   497 
840 void G4VEmProcess::SetMaxKinEnergy(G4double e)    498 void G4VEmProcess::SetMaxKinEnergy(G4double e)
841 {                                                 499 {
842   if(minKinEnergy < e && e < 1.e+6*TeV) {      << 500   maxKinEnergy = e;
843     nLambdaBins = G4lrint(nLambdaBins*G4Log(e/ << 
844                           /G4Log(maxKinEnergy/ << 
845     maxKinEnergy = e;                          << 
846     actMaxKinEnergy = true;                    << 
847   } else { PrintWarning("SetMaxKinEnergy", e); << 
848 }                                                 501 }
849                                                   502 
850 //....oooOO0OOooo........oooOO0OOooo........oo    503 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
851                                                   504 
852 void G4VEmProcess::SetMinKinEnergyPrim(G4doubl << 505 G4double G4VEmProcess::MaxKinEnergy() const
853 {                                                 506 {
854   if(theParameters->MinKinEnergy() <= e &&     << 507   return maxKinEnergy;
855      e <= theParameters->MaxKinEnergy()) { min << 
856   else { PrintWarning("SetMinKinEnergyPrim", e << 
857 }                                                 508 }
858                                                   509 
859 //....oooOO0OOooo........oooOO0OOooo........oo    510 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
860                                                   511 
861 G4VEmProcess* G4VEmProcess::GetEmProcess(const << 512 void G4VEmProcess::ActivateFluorescence(G4bool, const G4Region*)
862 {                                              << 513 {}
863   return (nam == GetProcessName()) ? this : nu << 
864 }                                              << 
865                                                   514 
866 //....oooOO0OOooo........oooOO0OOooo........oo    515 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
867                                                   516 
868 G4double G4VEmProcess::PolarAngleLimit() const << 517 void G4VEmProcess::ActivateAugerElectronProduction(G4bool, const G4Region*)
                                                   >> 518 {}
                                                   >> 519 
                                                   >> 520 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 521 
                                                   >> 522 const G4PhysicsTable* G4VEmProcess::LambdaTable() const
869 {                                                 523 {
870   return theParameters->MscThetaLimit();       << 524   return theLambdaTable;
871 }                                                 525 }
872                                                   526 
873 //....oooOO0OOooo........oooOO0OOooo........oo    527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
874                                                   528 
875 void G4VEmProcess::PrintWarning(G4String tit,  << 529 void G4VEmProcess::SetIntegral(G4bool val)
876 {                                                 530 {
877   G4String ss = "G4VEmProcess::" + tit;        << 531   integral = val;
878   G4ExceptionDescription ed;                   << 
879   ed << "Parameter is out of range: " << val   << 
880      << " it will have no effect!\n" << "  Pro << 
881      << GetProcessName() << "  nbins= " << the << 
882      << " Emin(keV)= " << theParameters->MinKi << 
883      << " Emax(GeV)= " << theParameters->MaxKi << 
884   G4Exception(ss, "em0044", JustWarning, ed);  << 
885 }                                                 532 }
886                                                   533 
887 //....oooOO0OOooo........oooOO0OOooo........oo    534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
888                                                   535 
889 void G4VEmProcess::ProcessDescription(std::ost << 536 G4bool G4VEmProcess::IsIntegral() const
890 {                                                 537 {
891   if(nullptr != particle) {                    << 538   return integral;
892     StreamInfo(out, *particle, true);          << 
893   }                                            << 
894 }                                                 539 }
895                                                   540 
896 //....oooOO0OOooo........oooOO0OOooo........oo    541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
897                                                   542