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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/hadronic/models/particle_hp/src/G4ParticleHPFFFissionFS.cc (Version 11.3.0) and /processes/hadronic/models/particle_hp/src/G4ParticleHPFFFissionFS.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 // neutron_hp -- source file                       26 // neutron_hp -- source file
 27 // J.P. Wellisch, Nov-1996                         27 // J.P. Wellisch, Nov-1996
 28 // A prototype of the low energy neutron trans     28 // A prototype of the low energy neutron transport model.
 29 //                                                 29 //
 30 // P. Arce, June-2014 Conversion neutron_hp to     30 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
 31 //                                                 31 //
 32 #include "G4ParticleHPFFFissionFS.hh"              32 #include "G4ParticleHPFFFissionFS.hh"
 33                                                << 
 34 #include "G4ParticleHPManager.hh"                  33 #include "G4ParticleHPManager.hh"
 35 #include "G4SystemOfUnits.hh"                      34 #include "G4SystemOfUnits.hh"
 36                                                    35 
 37 G4ParticleHPFFFissionFS::~G4ParticleHPFFFissio     36 G4ParticleHPFFFissionFS::~G4ParticleHPFFFissionFS()
 38 {                                                  37 {
 39   auto it = FissionProductYieldData.begin();   <<  38     std::map<G4int,std::map<G4double,std::map<G4int,G4double >* >* >::iterator it = FissionProductYieldData.begin();
 40   while (it != FissionProductYieldData.end())  <<  39     while ( it != FissionProductYieldData.end() ) { // Loop checking, 11.05.2015, T. Koi
 41     std::map<G4double, std::map<G4int, G4doubl <<  40         std::map<G4double,std::map<G4int,G4double>* >* firstLevel = it->second;
 42     if (firstLevel != nullptr) {               <<  41         if ( firstLevel ) {
 43       auto it2 = firstLevel->begin();          <<  42             std::map<G4double,std::map<G4int,G4double>*>::iterator it2 = firstLevel->begin();
 44       while (it2 != firstLevel->end()) {  // L <<  43             while ( it2 != firstLevel->end() ) { // Loop checking, 11.05.2015, T. Koi
 45         delete it2->second;                    <<  44                 delete it2->second;
 46         it2->second = 0;                       <<  45                 it2->second = 0;
 47         firstLevel->erase(it2);                <<  46                 firstLevel->erase(it2);
 48         it2 = firstLevel->begin();             <<  47                 it2=firstLevel->begin();
 49       }                                        <<  48             }
                                                   >>  49         }
                                                   >>  50         delete firstLevel;
                                                   >>  51         it->second = 0;
                                                   >>  52         FissionProductYieldData.erase(it);
                                                   >>  53         it = FissionProductYieldData.begin();
                                                   >>  54     }
                                                   >>  55     
                                                   >>  56     std::map< G4int , std::map< G4double , G4int >* >::iterator ii = mMTInterpolation.begin();
                                                   >>  57     while ( ii != mMTInterpolation.end() ) { // Loop checking, 11.05.2015, T. Koi
                                                   >>  58         delete ii->second;
                                                   >>  59         mMTInterpolation.erase(ii);
                                                   >>  60         ii = mMTInterpolation.begin();
 50     }                                              61     }
 51     delete firstLevel;                         << 
 52     it->second = 0;                            << 
 53     FissionProductYieldData.erase(it);         << 
 54     it = FissionProductYieldData.begin();      << 
 55   }                                            << 
 56                                                << 
 57   auto ii = mMTInterpolation.begin();          << 
 58   while (ii != mMTInterpolation.end()) {  // L << 
 59     delete ii->second;                         << 
 60     mMTInterpolation.erase(ii);                << 
 61     ii = mMTInterpolation.begin();             << 
 62   }                                            << 
 63 }                                                  62 }
 64                                                    63 
 65 void G4ParticleHPFFFissionFS::Init(G4double A, <<  64 void G4ParticleHPFFFissionFS::Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String & , G4ParticleDefinition*)
 66                                    const G4Str << 
 67 {                                                  65 {
 68   // G4cout << "G4ParticleHPFFFissionFS::Init" <<  66    //G4cout << "G4ParticleHPFFFissionFS::Init" << G4endl;
 69   G4String aString = "FF";                     <<  67    G4String aString = "FF";
 70                                                    68 
 71   G4String tString = dirName;                  <<  69    G4String tString = dirName;
 72   G4bool dbool;                                <<  70    G4bool dbool;
 73   G4ParticleHPDataUsed aFile =                 <<  71    G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aString , dbool);
 74     theNames.GetName(static_cast<G4int>(A), st <<  72    G4String filename = aFile.GetName();
 75   G4String filename = aFile.GetName();         <<  73    theBaseA = aFile.GetA();
 76   theBaseA = aFile.GetA();                     <<  74    theBaseZ = aFile.GetZ();
 77   theBaseZ = aFile.GetZ();                     <<  75 
 78                                                <<  76 //3456
 79   // 3456                                      <<  77    if ( !dbool || ( Z < 2.5 && ( std::abs(theBaseZ-Z)>0.0001 || std::abs(theBaseA-A)>0.0001) ) )
 80   if (!dbool || (Z < 2.5 && (std::abs(theBaseZ <<  78    {
 81     hasAnyData = false;                        <<  79       hasAnyData = false;
 82     hasFSData = false;                         <<  80       hasFSData = false; 
 83     hasXsec = false;                           <<  81       hasXsec = false;
 84     return;  // no data for exactly this isoto <<  82       return; // no data for exactly this isotope.
 85   }                                            <<  83    }
 86   // std::ifstream theData(filename, std::ios: <<  84    //std::ifstream theData(filename, std::ios::in);
 87   std::istringstream theData(std::ios::in);    <<  85    std::istringstream theData(std::ios::in);
 88   G4ParticleHPManager::GetInstance()->GetDataS <<  86    G4ParticleHPManager::GetInstance()->GetDataStream(filename,theData);
 89   G4double dummy;                              <<  87    G4double dummy;
 90   if (!theData) {                              <<  88    if ( !theData )
 91     // theData.close();                        <<  89    {
 92     hasFSData = false;                         <<  90       //theData.close();
 93     hasXsec = false;                           <<  91       hasFSData = false;
 94     hasAnyData = false;                        <<  92       hasXsec = false;
 95     return;  // no data for this FS for this i <<  93       hasAnyData = false;
 96   }                                            <<  94       return; // no data for this FS for this isotope
 97                                                <<  95    }
 98   hasFSData = true;                            <<  96 
 99   //          MT              Energy           <<  97 
100   // std::map< int , std::map< double , std::m <<  98    hasFSData = true; 
101   while (theData.good())  // Loop checking, 11 <<  99       //          MT              Energy            FPS    Yield
102   {                                            << 100       //std::map< int , std::map< double , std::map< int , double >* >* > FisionProductYieldData; 
103     G4int iMT, iMF;                            << 101    while ( theData.good() ) // Loop checking, 11.05.2015, T. Koi
104     G4int imax;                                << 102    {
105     // Reading the data                        << 103       G4int iMT, iMF;
106     //          MT       MF       AWR          << 104       G4int imax;
107     theData >> iMT >> iMF >> dummy;            << 105       //Reading the data
108     //         nBlock                          << 106       //         MT       MF       AWR
109     theData >> imax;                           << 107       theData >> iMT >> iMF >> dummy;
110     // if ( !theData.good() ) continue;        << 108       //         nBlock 
111     //         Ei                   FPS     Yi << 109       theData >> imax;
112     auto mEnergyFSPData = new std::map<G4doubl << 110       //if ( !theData.good() ) continue;
113                                                << 111       //        Ei                   FPS     Yield
114     auto mInterporation = new std::map<G4doubl << 112       std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = new std::map< G4double , std::map< G4int , G4double >* >;
115     for (G4int i = 0; i <= imax; i++) {        << 113 
116       G4double YY = 0.0;                       << 114       std::map< G4double , G4int >* mInterporation = new std::map< G4double , G4int >;
117       G4double Ei;                             << 115       for ( G4int i = 0 ; i <= imax ; i++ ) 
118       G4int jmax;                              << 116       {
119       G4int ip;                                << 117        
120       //        energy of incidence neutron    << 118          G4double YY=0.0; 
121       theData >> Ei;                           << 119          G4double Ei;
122       //        Number of data set followings  << 120          G4int jmax;
123       theData >> jmax;                         << 121          G4int ip;
124       //         interpolation scheme          << 122          //        energy of incidence neutron
125       theData >> ip;                           << 123          theData >> Ei;
126       mInterporation->insert(std::pair<G4doubl << 124          //        Number of data set followings 
127       //         nNumber  nIP                  << 125          theData >> jmax;
128       auto mFSPYieldData = new std::map<G4int, << 126          //         interpolation scheme
129       for (G4int j = 0; j < jmax; j++) {       << 127          theData >> ip;
130         G4int FSP;                             << 128          mInterporation->insert( std::pair<G4double,G4int>(Ei*eV,ip) );
131         G4int mFSP;                            << 129          //         nNumber  nIP
132         G4double Y;                            << 130          std::map<G4int,G4double>* mFSPYieldData = new std::map<G4int,G4double>;
133         theData >> FSP >> mFSP >> Y;           << 131          for ( G4int j = 0 ; j < jmax ; j++ ) 
134         G4int k = FSP * 100 + mFSP;            << 132          {
135         YY = YY + Y;                           << 133             G4int FSP;
136         // if ( iMT == 454 )G4cout << iMT << " << 134             G4int mFSP;
137         // YY << G4endl;                       << 135             G4double Y;
138         mFSPYieldData->insert(std::pair<G4int, << 136             theData >> FSP >> mFSP >> Y;
                                                   >> 137             G4int k = FSP*100+mFSP;
                                                   >> 138             YY = YY + Y;
                                                   >> 139             //if ( iMT == 454 )G4cout << iMT << " " << i << " " << j << " " <<  k << " " << Y << " " << YY << G4endl;
                                                   >> 140             mFSPYieldData->insert( std::pair<G4int,G4double>( k , YY ) );
                                                   >> 141          }
                                                   >> 142          mEnergyFSPData->insert( std::pair<G4double,std::map<G4int,G4double>*>(Ei*eV,mFSPYieldData) ); 
139       }                                           143       }
140       mEnergyFSPData->insert(                  << 
141         std::pair<G4double, std::map<G4int, G4 << 
142     }                                          << 
143                                                   144 
144     FissionProductYieldData.insert(            << 145       FissionProductYieldData.insert( std::pair< G4int , std::map< G4double , std::map< G4int , G4double >* >* > (iMT,mEnergyFSPData));
145       std::pair<G4int, std::map<G4double, std: << 146       mMTInterpolation.insert( std::pair<G4int,std::map<G4double,G4int>*> (iMT,mInterporation) ); 
146     mMTInterpolation.insert(std::pair<G4int, s << 147    } 
147   }                                            << 148    //theData.close();
148   // theData.close();                          << 
149 }                                                 149 }
150                                                << 150   
151 G4DynamicParticleVector* G4ParticleHPFFFission << 151 G4DynamicParticleVector * G4ParticleHPFFFissionFS::ApplyYourself(G4int nNeutrons)
152 {                                              << 152 {  
153   G4DynamicParticleVector* aResult;            << 153    G4DynamicParticleVector * aResult;
154   //    G4cout <<"G4ParticleHPFFFissionFS::App << 154 //    G4cout <<"G4ParticleHPFFFissionFS::ApplyYourself +"<<G4endl;
155   aResult = G4ParticleHPFissionBaseFS::ApplyYo << 155    aResult = G4ParticleHPFissionBaseFS::ApplyYourself(nNeutrons);    
156   return aResult;                              << 156    return aResult;
157 }                                                 157 }
158                                                   158 
159 void G4ParticleHPFFFissionFS::GetAFissionFragm << 159 void G4ParticleHPFFFissionFS::GetAFissionFragment( G4double energy , G4int& fragZ , G4int& fragA , G4int& fragM )
160                                                << 
161 {                                                 160 {
162   // G4cout << "G4ParticleHPFFFissionFS::GetAF << 161    //G4cout << "G4ParticleHPFFFissionFS::GetAFissionFragment " << G4endl;
163                                                   162 
164   G4double rand = G4UniformRand();             << 163    G4double rand =G4UniformRand();
165   // G4cout << rand << G4endl;                 << 164    //G4cout << rand << G4endl;
166                                                   165 
167   auto ptr = FissionProductYieldData.find(454) << 166    std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = FissionProductYieldData.find( 454 )->second;
168   if (ptr == FissionProductYieldData.end())    << 167     
169     return;                                    << 168    //It is not clear that the treatment of the scheme 2 on two-dimensional interpolation. 
170                                                << 169    //So, here just use the closest energy point array of yield data. 
171   auto mEnergyFSPData = ptr->second;           << 170    //TK120531
172                                                << 171    G4double key_energy = DBL_MAX;
173   // It is not clear that the treatment of the << 172    if ( mEnergyFSPData->size() == 1 )
174   // So, here just use the closest energy poin << 173    {
175   // TK120531                                  << 174       key_energy = mEnergyFSPData->begin()->first;
176   G4double key_energy = DBL_MAX;               << 175    }
177   if (mEnergyFSPData->size() == 1) {           << 176    else
178     key_energy = mEnergyFSPData->cbegin()->fir << 177    {
179   }                                            << 178       //Find closest energy point
180   else {                                       << 179       G4double Dmin=DBL_MAX; 
181     // Find closest energy point               << 180       G4int i = 0;
182     G4double Dmin = DBL_MAX;                   << 181       for ( std::map< G4double , std::map< G4int , G4double >* >::iterator it = mEnergyFSPData->begin() ; 
183     for (auto it = mEnergyFSPData->cbegin(); i << 182       it != mEnergyFSPData->end() ; it++ )
184       G4double e = (it->first);                << 183       {
185       G4double d = std::fabs(energy - e);      << 184          G4double e = (it->first);
186       if (d < Dmin) {                          << 185          G4double d = std::fabs ( energy - e ); 
187         Dmin = d;                              << 186          if ( d < Dmin ) 
188         key_energy = e;                        << 187          {
                                                   >> 188             Dmin = d;
                                                   >> 189             key_energy = e;
                                                   >> 190          }
                                                   >> 191          i++;
189       }                                           192       }
190     }                                          << 193    }
191   }                                            << 
192                                                   194 
193   std::map<G4int, G4double>* mFSPYieldData = ( << 195    std::map<G4int,G4double>* mFSPYieldData = (*mEnergyFSPData)[key_energy];
194                                                   196 
195   G4int ifrag = 0;                             << 197    G4int ifrag=0;
196   G4double ceilling =                          << 198    G4double ceilling = mFSPYieldData->rbegin()->second; // Because of numerical accuracy, this is not always 2
197     mFSPYieldData->rbegin()->second;  // Becau << 199    for ( std::map<G4int,G4double>::iterator it = mFSPYieldData->begin() ; it != mFSPYieldData->end() ; it++ )
198   for (auto it = mFSPYieldData->cbegin(); it ! << 200    {
199     // if ( ( rand - it->second/ceilling ) < 1 << 201       //if ( ( rand - it->second/ceilling ) < 1.0e-6 ) std::cout << rand - it->second/ceilling << std::endl;
200     // std::endl;                              << 202       if ( rand <= it->second/ceilling ) 
201     if (rand <= it->second / ceilling) {       << 203       {  
202       // G4cout << it->first << " " << it->sec << 204          //G4cout << it->first << " " << it->second/ceilling << G4endl;
203       ifrag = it->first;                       << 205          ifrag = it->first;
204       break;                                   << 206          break;
205     }                                          << 207       }
206   }                                            << 208    }
207                                                   209 
208   fragZ = ifrag / 100000;                      << 210    fragZ = ifrag/100000;
209   fragA = (ifrag % 100000) / 100;              << 211    fragA = (ifrag%100000)/100;
210   fragM = (ifrag % 100);                       << 212    fragM = (ifrag%100);
211                                                   213 
212   // G4cout << fragZ << " " << fragA << " " << << 214    //G4cout << fragZ << " " << fragA << " " << fragM << G4endl;
213 }                                                 215 }
214                                                   216