Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/dna/models/src/G4DNASancheExcitationModel.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/dna/models/src/G4DNASancheExcitationModel.cc (Version 11.3.0) and /processes/electromagnetic/dna/models/src/G4DNASancheExcitationModel.cc (Version 10.7)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27                                                    27 
 28 // Created by Z. Francis                           28 // Created by Z. Francis
 29                                                    29 
 30 #include "G4DNASancheExcitationModel.hh"           30 #include "G4DNASancheExcitationModel.hh"
 31 #include "G4SystemOfUnits.hh"                      31 #include "G4SystemOfUnits.hh"
 32 #include "G4DNAMolecularMaterial.hh"               32 #include "G4DNAMolecularMaterial.hh"
 33                                                    33 
 34 //....oooOO0OOooo........oooOO0OOooo........oo     34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 35                                                    35 
 36 using namespace std;                               36 using namespace std;
 37                                                    37 
 38 //#define SANCHE_VERBOSE                           38 //#define SANCHE_VERBOSE
 39                                                    39 
 40 //....oooOO0OOooo........oooOO0OOooo........oo     40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 41                                                    41 
 42 G4DNASancheExcitationModel::G4DNASancheExcitat     42 G4DNASancheExcitationModel::G4DNASancheExcitationModel(const G4ParticleDefinition*,
 43                                                    43                                                        const G4String& nam) :
 44     G4VEmModel(nam)                            <<  44     G4VEmModel(nam), isInitialised(false)
 45 {                                                  45 {
 46   fpWaterDensity = nullptr;                    <<  46   fpWaterDensity = 0;
 47                                                    47 
 48   SetLowEnergyLimit(2.*eV);                        48   SetLowEnergyLimit(2.*eV);
 49   SetHighEnergyLimit(100*eV);                      49   SetHighEnergyLimit(100*eV);
 50   nLevels = 9;                                     50   nLevels = 9;
 51                                                    51 
 52   verboseLevel = 0;                                52   verboseLevel = 0;
 53   // Verbosity scale:                              53   // Verbosity scale:
 54   // 0 = nothing                                   54   // 0 = nothing
 55   // 1 = warning for energy non-conservation       55   // 1 = warning for energy non-conservation
 56   // 2 = details of energy budget                  56   // 2 = details of energy budget
 57   // 3 = calculation of cross sections, file o     57   // 3 = calculation of cross sections, file openings, sampling of atoms
 58   // 4 = entering in methods                       58   // 4 = entering in methods
 59                                                    59 
 60 #ifdef SANCHE_VERBOSE                              60 #ifdef SANCHE_VERBOSE
 61   if (verboseLevel > 0)                            61   if (verboseLevel > 0)
 62   {                                                62   {
 63     G4cout << "Sanche Excitation model is cons     63     G4cout << "Sanche Excitation model is constructed "
 64            << G4endl                               64            << G4endl
 65            << "Energy range: "                     65            << "Energy range: "
 66            << LowEnergyLimit() / eV << " eV -      66            << LowEnergyLimit() / eV << " eV - "
 67            << HighEnergyLimit() / eV << " eV"      67            << HighEnergyLimit() / eV << " eV"
 68            << G4endl;                              68            << G4endl;
 69   }                                                69   }
 70 #endif                                             70 #endif
 71                                                    71   
 72   fParticleChangeForGamma = nullptr;           <<  72   fParticleChangeForGamma = 0;
 73   fpWaterDensity = nullptr;                    <<  73   fpWaterDensity = 0;
 74                                                    74 
 75   // Selection of stationary mode                  75   // Selection of stationary mode
 76                                                    76 
 77   statCode = false;                                77   statCode = false;
 78 }                                                  78 }
 79                                                    79 
 80 //....oooOO0OOooo........oooOO0OOooo........oo     80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 81                                                    81 
 82 G4DNASancheExcitationModel::~G4DNASancheExcita     82 G4DNASancheExcitationModel::~G4DNASancheExcitationModel()
 83 = default;                                     <<  83 {
                                                   >>  84 }
 84                                                    85 
 85 //....oooOO0OOooo........oooOO0OOooo........oo     86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 86                                                    87 
 87 void                                               88 void
 88 G4DNASancheExcitationModel::                       89 G4DNASancheExcitationModel::
 89 Initialise(const G4ParticleDefinition* /*parti     90 Initialise(const G4ParticleDefinition* /*particle*/,
 90            const G4DataVector& /*cuts*/)           91            const G4DataVector& /*cuts*/)
 91 {                                                  92 {
 92                                                    93   
 93 #ifdef SANCHE_VERBOSE                              94 #ifdef SANCHE_VERBOSE
 94   if (verboseLevel > 3)                            95   if (verboseLevel > 3)
 95   {                                                96   {
 96     G4cout << "Calling G4DNASancheExcitationMo     97     G4cout << "Calling G4DNASancheExcitationModel::Initialise()"
 97            << G4endl;                              98            << G4endl;
 98   }                                                99   }
 99 #endif                                            100 #endif
100                                                   101   
101   // Energy limits                                102   // Energy limits
102                                                   103 
103   if (LowEnergyLimit() < 2.*eV)                   104   if (LowEnergyLimit() < 2.*eV)
104   {                                               105   {
105     G4Exception("*** WARNING : the G4DNASanche    106     G4Exception("*** WARNING : the G4DNASancheExcitationModel class is not "
106                 "validated below 2 eV !",         107                 "validated below 2 eV !",
107                 "", JustWarning, "");             108                 "", JustWarning, "");
108   }                                               109   }
109                                                   110 
110   if (HighEnergyLimit() > 100.*eV)                111   if (HighEnergyLimit() > 100.*eV)
111   {                                               112   {
112     G4cout << "G4DNASancheExcitationModel: hig    113     G4cout << "G4DNASancheExcitationModel: high energy limit decreased from " <<
113     HighEnergyLimit()/eV << " eV to " << 100.     114     HighEnergyLimit()/eV << " eV to " << 100. << " eV" << G4endl;
114     SetHighEnergyLimit(100.*eV);                  115     SetHighEnergyLimit(100.*eV);
115   }                                               116   }
116                                                   117 
117   //                                              118   //
118 #ifdef SANCHE_VERBOSE                             119 #ifdef SANCHE_VERBOSE
119   if (verboseLevel > 0)                           120   if (verboseLevel > 0)
120   {                                               121   {
121     G4cout << "Sanche Excitation model is init    122     G4cout << "Sanche Excitation model is initialized " << G4endl
122     << "Energy range: "                           123     << "Energy range: "
123     << LowEnergyLimit() / eV << " eV - "          124     << LowEnergyLimit() / eV << " eV - "
124     << HighEnergyLimit() / eV << " eV"            125     << HighEnergyLimit() / eV << " eV"
125     << G4endl;                                    126     << G4endl;
126   }                                               127   }
127 #endif                                            128 #endif
128                                                   129 
129   // Initialize water density pointer             130   // Initialize water density pointer
130   fpWaterDensity = G4DNAMolecularMaterial::Ins    131   fpWaterDensity = G4DNAMolecularMaterial::Instance()->
131       GetNumMolPerVolTableFor(G4Material::GetM    132       GetNumMolPerVolTableFor(G4Material::GetMaterial("G4_WATER"));
132                                                   133 
133   if (isInitialised) {return;}                    134   if (isInitialised) {return;}
134                                                   135 
135   fParticleChangeForGamma = GetParticleChangeF    136   fParticleChangeForGamma = GetParticleChangeForGamma();
136   isInitialised = true;                           137   isInitialised = true;
137                                                   138 
138   const char *path = G4FindDataDir("G4LEDATA") << 139   char *path = getenv("G4LEDATA");
139   std::ostringstream eFullFileName;               140   std::ostringstream eFullFileName;
140   eFullFileName << path << "/dna/sigma_excitat    141   eFullFileName << path << "/dna/sigma_excitationvib_e_sanche.dat";
141   std::ifstream input(eFullFileName.str().c_st    142   std::ifstream input(eFullFileName.str().c_str());
142                                                   143 
143   if (!input)                                     144   if (!input)
144   {                                               145   {
145     G4Exception("G4DNASancheExcitationModel::I    146     G4Exception("G4DNASancheExcitationModel::Initialise","em0003",
146         FatalException,"Missing data file:/dna    147         FatalException,"Missing data file:/dna/sigma_excitationvib_e_sanche.dat");
147   }                                               148   }
148                                                   149 
149   // March 25th, 2014 - Vaclav Stepan, Sebasti    150   // March 25th, 2014 - Vaclav Stepan, Sebastien Incerti
150   // Added clear for MT                           151   // Added clear for MT
151   tdummyVec.clear();                              152   tdummyVec.clear();
152   //                                              153   //
153                                                   154 
154   G4double t;                                     155   G4double t;
155   G4double xs;                                    156   G4double xs;
156                                                   157 
157   while(!input.eof())                             158   while(!input.eof())
158   {                                               159   {
159     input>>t;                                     160     input>>t;
160     tdummyVec.push_back(t);                       161     tdummyVec.push_back(t);
161                                                   162 
162     fEnergyLevelXS.emplace_back();             << 163     fEnergyLevelXS.push_back(std::vector<G4double>());
163     fEnergyTotalXS.push_back(0);                  164     fEnergyTotalXS.push_back(0);
164     std::vector<G4double>& levelXS = fEnergyLe    165     std::vector<G4double>& levelXS = fEnergyLevelXS.back();
165     levelXS.reserve(9);                           166     levelXS.reserve(9);
166                                                   167 
167     // G4cout<<t;                                 168     // G4cout<<t;
168                                                   169 
169     for(size_t i = 0 ; i < 9 ;++i)                170     for(size_t i = 0 ; i < 9 ;++i)
170     {                                             171     {
171       input>>xs;                                  172       input>>xs;
172       levelXS.push_back(xs);                      173       levelXS.push_back(xs);
173       fEnergyTotalXS.back() += xs;                174       fEnergyTotalXS.back() += xs;
174       // G4cout <<"  " << levelXS[i];             175       // G4cout <<"  " << levelXS[i];
175     }                                             176     }
176                                                   177 
177     // G4cout << G4endl;                          178     // G4cout << G4endl;
178   }                                               179   }
179 }                                                 180 }
180                                                   181 
181 //....oooOO0OOooo........oooOO0OOooo........oo    182 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
182                                                   183 
183 G4double G4DNASancheExcitationModel::CrossSect    184 G4double G4DNASancheExcitationModel::CrossSectionPerVolume(const G4Material* material,
184                                                   185                                                            const G4ParticleDefinition*
185 #ifdef SANCHE_VERBOSE                             186 #ifdef SANCHE_VERBOSE
186                                                   187                                                            particleDefinition
187 #endif                                            188 #endif
188                                                   189                                                            ,
189                                                   190                                                            G4double ekin,
190                                                   191                                                            G4double,
191                                                   192                                                            G4double)
192 {                                                 193 {
193 #ifdef SANCHE_VERBOSE                             194 #ifdef SANCHE_VERBOSE
194   if (verboseLevel > 3)                           195   if (verboseLevel > 3)
195   {                                               196   {
196     G4cout << "Calling CrossSectionPerVolume()    197     G4cout << "Calling CrossSectionPerVolume() of G4DNASancheExcitationModel"
197            << G4endl;                             198            << G4endl;
198   }                                               199   }
199 #endif                                            200 #endif
200                                                   201 
201   // Calculate total cross section for model      202   // Calculate total cross section for model
202                                                   203 
203   G4double sigma = 0.;                            204   G4double sigma = 0.;
204                                                   205 
205   G4double waterDensity = (*fpWaterDensity)[ma    206   G4double waterDensity = (*fpWaterDensity)[material->GetIndex()];
206                                                   207 
207   if (ekin >= LowEnergyLimit() && ekin <= High    208   if (ekin >= LowEnergyLimit() && ekin <= HighEnergyLimit())
208     sigma =  TotalCrossSection(ekin);             209     sigma =  TotalCrossSection(ekin);
209                                                   210 
210 #ifdef SANCHE_VERBOSE                             211 #ifdef SANCHE_VERBOSE
211   if (verboseLevel > 2)                           212   if (verboseLevel > 2)
212   {                                               213   {
213     G4cout << "_______________________________    214     G4cout << "__________________________________" << G4endl;
214     G4cout << "=== G4DNASancheExcitationModel     215     G4cout << "=== G4DNASancheExcitationModel - XS INFO START" << G4endl;
215     G4cout << "=== Kinetic energy(eV)=" << eki    216     G4cout << "=== Kinetic energy(eV)=" << ekin/eV << " particle : " << particleDefinition->GetParticleName() << G4endl;
216     G4cout << "=== Cross section per water mol    217     G4cout << "=== Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
217     G4cout << "=== Cross section per water mol    218     G4cout << "=== Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) << G4endl;
218     G4cout << "=== G4DNASancheExcitationModel     219     G4cout << "=== G4DNASancheExcitationModel - XS INFO END" << G4endl;
219   }                                               220   }
220 #endif                                            221 #endif
221                                                   222 
222   return sigma*2.*waterDensity;                   223   return sigma*2.*waterDensity;
223   // see papers for factor 2 description (liqu    224   // see papers for factor 2 description (liquid phase)
224 }                                                 225 }
225                                                   226 
226 //....oooOO0OOooo........oooOO0OOooo........oo    227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
227                                                   228 
228 void G4DNASancheExcitationModel::SampleSeconda    229 void G4DNASancheExcitationModel::SampleSecondaries(std::vector<
229                                                   230                                                        G4DynamicParticle*>*,
230                                                   231                                                    const G4MaterialCutsCouple*,
231                                                   232                                                    const G4DynamicParticle* aDynamicElectron,
232                                                   233                                                    G4double,
233                                                   234                                                    G4double)
234 {                                                 235 {
235 #ifdef SANCHE_VERBOSE                             236 #ifdef SANCHE_VERBOSE
236   if (verboseLevel > 3)                           237   if (verboseLevel > 3)
237   {                                               238   {
238     G4cout << "Calling SampleSecondaries() of     239     G4cout << "Calling SampleSecondaries() of G4DNASancheExcitationModel"
239            << G4endl;                             240            << G4endl;
240   }                                               241   }
241 #endif                                            242 #endif
242                                                   243 
243   G4double electronEnergy0 = aDynamicElectron-    244   G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
244   G4int level = RandomSelect(electronEnergy0);    245   G4int level = RandomSelect(electronEnergy0);
245   G4double excitationEnergy = VibrationEnergy(    246   G4double excitationEnergy = VibrationEnergy(level); // levels go from 0 to 8
246   G4double newEnergy = electronEnergy0 - excit    247   G4double newEnergy = electronEnergy0 - excitationEnergy;
247                                                   248 
248   /*                                              249   /*
249    if (electronEnergy0 < highEnergyLimit)         250    if (electronEnergy0 < highEnergyLimit)
250    {                                              251    {
251      if (newEnergy >= lowEnergyLimit)             252      if (newEnergy >= lowEnergyLimit)
252      {                                            253      {
253        fParticleChangeForGamma->ProposeMomentu    254        fParticleChangeForGamma->ProposeMomentumDirection(aDynamicElectron->GetMomentumDirection());
254        fParticleChangeForGamma->SetProposedKin    255        fParticleChangeForGamma->SetProposedKineticEnergy(newEnergy);
255        fParticleChangeForGamma->ProposeLocalEn    256        fParticleChangeForGamma->ProposeLocalEnergyDeposit(excitationEnergy);
256      }                                            257      }
257                                                   258 
258      else                                         259      else
259      {                                            260      {
260        fParticleChangeForGamma->ProposeTrackSt    261        fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
261        fParticleChangeForGamma->ProposeLocalEn    262        fParticleChangeForGamma->ProposeLocalEnergyDeposit(electronEnergy0);
262      }                                            263      }
263    }                                              264    }
264    */                                             265    */
265                                                   266 
266   if (electronEnergy0 <= HighEnergyLimit() &&     267   if (electronEnergy0 <= HighEnergyLimit() && newEnergy>0.)
267   {                                               268   {
268                                                   269 
269     if (!statCode)                                270     if (!statCode)     
270     {                                             271     {     
271       fParticleChangeForGamma->ProposeMomentum    272       fParticleChangeForGamma->ProposeMomentumDirection(aDynamicElectron->GetMomentumDirection());
272       fParticleChangeForGamma->SetProposedKine    273       fParticleChangeForGamma->SetProposedKineticEnergy(newEnergy);
273       fParticleChangeForGamma->ProposeLocalEne    274       fParticleChangeForGamma->ProposeLocalEnergyDeposit(excitationEnergy);
274     }                                             275     }
275                                                   276 
276     else                                          277     else 
277     {                                             278     {
278       fParticleChangeForGamma->ProposeMomentum    279       fParticleChangeForGamma->ProposeMomentumDirection(aDynamicElectron->GetMomentumDirection());
279       fParticleChangeForGamma->SetProposedKine    280       fParticleChangeForGamma->SetProposedKineticEnergy(electronEnergy0);
280       fParticleChangeForGamma->ProposeLocalEne    281       fParticleChangeForGamma->ProposeLocalEnergyDeposit(excitationEnergy);
281     }                                             282     }
282                                                   283 
283   }                                               284   }
284                                                   285 
285   //                                              286   //
286 }                                                 287 }
287                                                   288 
288 //....oooOO0OOooo........oooOO0OOooo........oo    289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289                                                   290 
290 G4double G4DNASancheExcitationModel::PartialCr    291 G4double G4DNASancheExcitationModel::PartialCrossSection(G4double t,
291                                                   292                                                          G4int level)
292 {                                                 293 {
293   // Protection against out of boundary access    294   // Protection against out of boundary access
294   if (t/eV==tdummyVec.back()) t=t*(1.-1e-12);     295   if (t/eV==tdummyVec.back()) t=t*(1.-1e-12);
295   //                                              296   //
296                                                   297 
297   auto t2 = std::upper_bound(tdummyVec.begin() << 298   std::vector<G4double>::iterator t2 = std::upper_bound(tdummyVec.begin(),
298                                                   299                                                       tdummyVec.end(), t / eV);
299   auto t1 = t2 - 1;                            << 300   std::vector<G4double>::iterator t1 = t2 - 1;
300                                                   301 
301   size_t i1 = t1 - tdummyVec.begin();             302   size_t i1 = t1 - tdummyVec.begin();
302   size_t i2 = t2 - tdummyVec.begin();             303   size_t i2 = t2 - tdummyVec.begin();
303                                                   304 
304   G4double sigma = LinInterpolate((*t1), (*t2)    305   G4double sigma = LinInterpolate((*t1), (*t2),
305                                 t / eV,           306                                 t / eV,
306                                 fEnergyLevelXS    307                                 fEnergyLevelXS[i1][level],
307                                 fEnergyLevelXS    308                                 fEnergyLevelXS[i2][level]);
308                                                   309 
309   static const G4double conv_factor =  1e-16 *    310   static const G4double conv_factor =  1e-16 * cm * cm;
310                                                   311 
311   sigma *= conv_factor;                           312   sigma *= conv_factor;
312   if (sigma == 0.) sigma = 1e-30;                 313   if (sigma == 0.) sigma = 1e-30;
313   return (sigma);                                 314   return (sigma);
314 }                                                 315 }
315                                                   316 
316 //....oooOO0OOooo........oooOO0OOooo........oo    317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
317                                                   318 
318 G4double G4DNASancheExcitationModel::TotalCros    319 G4double G4DNASancheExcitationModel::TotalCrossSection(G4double t)
319 {                                                 320 {
320   // Protection against out of boundary access    321   // Protection against out of boundary access
321   if (t/eV==tdummyVec.back()) t=t*(1.-1e-12);     322   if (t/eV==tdummyVec.back()) t=t*(1.-1e-12);
322   //                                              323   //
323                                                   324 
324   auto t2 = std::upper_bound(tdummyVec.begin() << 325   std::vector<G4double>::iterator t2 = std::upper_bound(tdummyVec.begin(),
325                                                   326                                                       tdummyVec.end(), t / eV);
326   auto t1 = t2 - 1;                            << 327   std::vector<G4double>::iterator t1 = t2 - 1;
327                                                   328 
328   size_t i1 = t1 - tdummyVec.begin();             329   size_t i1 = t1 - tdummyVec.begin();
329   size_t i2 = t2 - tdummyVec.begin();             330   size_t i2 = t2 - tdummyVec.begin();
330                                                   331 
331   G4double sigma = LinInterpolate((*t1), (*t2)    332   G4double sigma = LinInterpolate((*t1), (*t2),
332                                 t / eV,           333                                 t / eV,
333                                 fEnergyTotalXS    334                                 fEnergyTotalXS[i1],
334                                 fEnergyTotalXS    335                                 fEnergyTotalXS[i2]);
335                                                   336 
336   static const G4double conv_factor =  1e-16 *    337   static const G4double conv_factor =  1e-16 * cm * cm;
337                                                   338 
338   sigma *= conv_factor;                           339   sigma *= conv_factor;
339   if (sigma == 0.) sigma = 1e-30;                 340   if (sigma == 0.) sigma = 1e-30;
340   return (sigma);                                 341   return (sigma);
341 }                                                 342 }
342                                                   343 
343 //....oooOO0OOooo........oooOO0OOooo........oo    344 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
344                                                   345 
345 G4double G4DNASancheExcitationModel::Vibration    346 G4double G4DNASancheExcitationModel::VibrationEnergy(G4int level)
346 {                                                 347 {
347   static G4double energies[9] = { 0.01, 0.024,    348   static G4double energies[9] = { 0.01, 0.024, 0.061, 0.092, 0.204, 0.417, 0.460,
348                            0.500, 0.835 };        349                            0.500, 0.835 };
349   return (energies[level] * eV);                  350   return (energies[level] * eV);
350 }                                                 351 }
351                                                   352 
352 //....oooOO0OOooo........oooOO0OOooo........oo    353 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
353                                                   354 
354 G4int G4DNASancheExcitationModel::RandomSelect    355 G4int G4DNASancheExcitationModel::RandomSelect(G4double k)
355 {                                                 356 {
356                                                   357 
357   // Level Selection Counting can be done here    358   // Level Selection Counting can be done here !
358                                                   359 
359   G4int i = nLevels;                              360   G4int i = nLevels;
360   G4double value = 0.;                            361   G4double value = 0.;
361   std::deque<G4double> values;                    362   std::deque<G4double> values;
362                                                   363 
363   while (i > 0)                                   364   while (i > 0)
364   {                                               365   {
365     i--;                                          366     i--;
366     G4double partial = PartialCrossSection(k,     367     G4double partial = PartialCrossSection(k, i);
367     values.push_front(partial);                   368     values.push_front(partial);
368     value += partial;                             369     value += partial;
369   }                                               370   }
370                                                   371 
371   value *= G4UniformRand();                       372   value *= G4UniformRand();
372                                                   373 
373   i = nLevels;                                    374   i = nLevels;
374                                                   375 
375   while (i > 0)                                   376   while (i > 0)
376   {                                               377   {
377     i--;                                          378     i--;
378     if (values[i] > value)                        379     if (values[i] > value)
379     {                                             380     {
380       //outcount<<i<<"  "<<VibrationEnergy(i)<    381       //outcount<<i<<"  "<<VibrationEnergy(i)<<G4endl;
381       return i;                                   382       return i;
382     }                                             383     }
383     value -= values[i];                           384     value -= values[i];
384   }                                               385   }
385                                                   386 
386   //outcount<<0<<"  "<<VibrationEnergy(0)<<G4e    387   //outcount<<0<<"  "<<VibrationEnergy(0)<<G4endl;
387                                                   388 
388   return 0;                                       389   return 0;
389 }                                                 390 }
390                                                   391 
391 //....oooOO0OOooo........oooOO0OOooo........oo    392 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
392                                                   393 
393 G4double G4DNASancheExcitationModel::Sum(G4dou    394 G4double G4DNASancheExcitationModel::Sum(G4double k)
394 {                                                 395 {
395   G4double totalCrossSection = 0.;                396   G4double totalCrossSection = 0.;
396                                                   397 
397   for (G4int i = 0; i < nLevels; i++)             398   for (G4int i = 0; i < nLevels; i++)
398   {                                               399   {
399     totalCrossSection += PartialCrossSection(k    400     totalCrossSection += PartialCrossSection(k, i);
400   }                                               401   }
401                                                   402 
402   return totalCrossSection;                       403   return totalCrossSection;
403 }                                                 404 }
404                                                   405 
405 //....oooOO0OOooo........oooOO0OOooo........oo    406 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
406                                                   407 
407 G4double G4DNASancheExcitationModel::LinInterp    408 G4double G4DNASancheExcitationModel::LinInterpolate(G4double e1,
408                                                   409                                                     G4double e2,
409                                                   410                                                     G4double e,
410                                                   411                                                     G4double xs1,
411                                                   412                                                     G4double xs2)
412 {                                                 413 {
413   G4double a = (xs2 - xs1) / (e2 - e1);           414   G4double a = (xs2 - xs1) / (e2 - e1);
414   G4double b = xs2 - a * e2;                      415   G4double b = xs2 - a * e2;
415   G4double value = a * e + b;                     416   G4double value = a * e + b;
416   // G4cout<<"interP >>  "<<e1<<"  "<<e2<<"  "    417   // G4cout<<"interP >>  "<<e1<<"  "<<e2<<"  "<<e<<"  "
417   // <<xs1<<"  "<<xs2<<"  "<<a<<"  "<<b<<"  "<    418   // <<xs1<<"  "<<xs2<<"  "<<a<<"  "<<b<<"  "<<value<<G4endl;
418                                                   419 
419   return value;                                   420   return value;
420 }                                                 421 }
421                                                   422 
422                                                   423