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] [ 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/G4ParticleHPFission.cc (Version 11.3.0) and /processes/hadronic/models/particle_hp/src/G4ParticleHPFission.cc (Version 11.0)


  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 // 070523 bug fix for G4FPE_DEBUG on by A. How     30 // 070523 bug fix for G4FPE_DEBUG on by A. Howard ( and T. Koi)
 31 // 08-08-06 delete unnecessary and harmed decl     31 // 08-08-06 delete unnecessary and harmed declaration; Bug Report[857]
 32 //                                                 32 //
 33 // P. Arce, June-2014 Conversion neutron_hp to     33 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
 34 //                                                 34 //
 35 #include "G4ParticleHPFission.hh"                  35 #include "G4ParticleHPFission.hh"
 36                                                << 
 37 #include "G4ParticleHPFissionFS.hh"                36 #include "G4ParticleHPFissionFS.hh"
 38 #include "G4ParticleHPManager.hh"              << 
 39 #include "G4ParticleHPThermalBoost.hh"         << 
 40 #include "G4SystemOfUnits.hh"                      37 #include "G4SystemOfUnits.hh"
                                                   >>  38 #include "G4ParticleHPManager.hh"
 41 #include "G4Threading.hh"                          39 #include "G4Threading.hh"
 42                                                    40 
 43 G4ParticleHPFission::G4ParticleHPFission() : G <<  41   G4ParticleHPFission::G4ParticleHPFission()
 44 {                                              <<  42     :G4HadronicInteraction("NeutronHPFission")
 45   SetMinEnergy(0.0);                           <<  43   ,theFission(NULL)
 46   SetMaxEnergy(20. * MeV);                     <<  44   ,numEle(0)
 47 }                                              <<  45   {
                                                   >>  46     SetMinEnergy( 0.0 );
                                                   >>  47     SetMaxEnergy( 20.*MeV );
                                                   >>  48 /*
                                                   >>  49     if(!std::getenv("G4NEUTRONHPDATA")) 
                                                   >>  50        throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
                                                   >>  51     dirName = std::getenv("G4NEUTRONHPDATA");
                                                   >>  52     G4String tString = "/Fission";
                                                   >>  53     dirName = dirName + tString;
                                                   >>  54     numEle = G4Element::GetNumberOfElements();
                                                   >>  55     //theFission = new G4ParticleHPChannel[numEle];
 48                                                    56 
 49 G4ParticleHPFission::~G4ParticleHPFission()    <<  57     //for (G4int i=0; i<numEle; i++)
 50 {                                              <<  58     //{ 
 51   // Vector is shared, only master deletes it  <<  59       //if((*(G4Element::GetElementTable()))[i]->GetZ()>89)
 52   // delete [] theFission;                     <<  60     //  if((*(G4Element::GetElementTable()))[i]->GetZ()>87) //TK modified for ENDF-VII
 53   if (!G4Threading::IsMasterThread()) {        <<  61     //  {
 54     if (theFission != nullptr) {               <<  62     //    theFission[i].Init((*(G4Element::GetElementTable()))[i], dirName);
 55       for (auto it = theFission->cbegin(); it  <<  63     //    theFission[i].Register(&theFS);
 56         delete *it;                            <<  64     //  }
                                                   >>  65     //}
                                                   >>  66 
                                                   >>  67     for ( G4int i = 0 ; i < numEle ; i++ ) 
                                                   >>  68     {
                                                   >>  69       theFission.push_back( new G4ParticleHPChannel );
                                                   >>  70       if((*(G4Element::GetElementTable()))[i]->GetZ()>87) //TK modified for ENDF-VII
                                                   >>  71       {
                                                   >>  72        (*theFission[i]).Init((*(G4Element::GetElementTable()))[i], dirName);
                                                   >>  73        (*theFission[i]).Register(&theFS);
 57       }                                            74       }
 58       theFission->clear();                     << 
 59     }                                              75     }
                                                   >>  76 */
 60   }                                                77   }
 61 }                                              <<  78   
 62                                                <<  79   G4ParticleHPFission::~G4ParticleHPFission()
 63 G4HadFinalState* G4ParticleHPFission::ApplyYou <<  80   {
 64                                                <<  81     //Vector is shared, only master deletes it
 65 {                                              <<  82     //delete [] theFission;
 66   G4ParticleHPManager::GetInstance()->OpenReac <<  83     if ( ! G4Threading::IsMasterThread() ) {
 67   const G4Material* theMaterial = aTrack.GetMa <<  84         if ( theFission != NULL ) {
 68   auto n = (G4int)theMaterial->GetNumberOfElem <<  85             for ( std::vector<G4ParticleHPChannel*>::iterator
 69   std::size_t index = theMaterial->GetElement( <<  86                 it = theFission->begin() ; it != theFission->end() ; it++ ) {
 70   if (n != 1) {                                <<  87                 delete *it;
 71     auto xSec = new G4double[n];               <<  88             }
 72     G4double sum = 0;                          <<  89             theFission->clear();
 73     G4int i;                                   <<  90         }
 74     const G4double* NumAtomsPerVolume = theMat << 
 75     G4double rWeight;                          << 
 76     G4ParticleHPThermalBoost aThermalE;        << 
 77     for (i = 0; i < n; ++i) {                  << 
 78       index = theMaterial->GetElement(i)->GetI << 
 79       rWeight = NumAtomsPerVolume[i];          << 
 80       xSec[i] = ((*theFission)[index])         << 
 81                   ->GetXsec(aThermalE.GetTherm << 
 82                                                << 
 83       xSec[i] *= rWeight;                      << 
 84       sum += xSec[i];                          << 
 85     }                                          << 
 86     G4double random = G4UniformRand();         << 
 87     G4double running = 0;                      << 
 88     for (i = 0; i < n; ++i) {                  << 
 89       running += xSec[i];                      << 
 90       index = theMaterial->GetElement(i)->GetI << 
 91       // if(random<=running/sum) break;        << 
 92       if (sum == 0 || random <= running / sum) << 
 93     }                                              91     }
 94     delete[] xSec;                             << 
 95   }                                                92   }
 96   // return theFission[index].ApplyYourself(aT <<  93   
 97   G4HadFinalState* result = ((*theFission)[ind <<  94   #include "G4ParticleHPThermalBoost.hh"
                                                   >>  95   G4HadFinalState * G4ParticleHPFission::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aNucleus )
                                                   >>  96   {
                                                   >>  97 
                                                   >>  98     G4ParticleHPManager::GetInstance()->OpenReactionWhiteBoard();
                                                   >>  99     const G4Material * theMaterial = aTrack.GetMaterial();
                                                   >> 100     G4int n = theMaterial->GetNumberOfElements();
                                                   >> 101     G4int index = theMaterial->GetElement(0)->GetIndex();
                                                   >> 102     if(n!=1)
                                                   >> 103     {
                                                   >> 104       G4double* xSec = new G4double[n];
                                                   >> 105       G4double sum=0;
                                                   >> 106       G4int i;
                                                   >> 107       const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
                                                   >> 108       G4double rWeight;    
                                                   >> 109       G4ParticleHPThermalBoost aThermalE;
                                                   >> 110       for (i=0; i<n; i++)
                                                   >> 111       {
                                                   >> 112         index = theMaterial->GetElement(i)->GetIndex();
                                                   >> 113         rWeight = NumAtomsPerVolume[i];
                                                   >> 114         xSec[i] = ((*theFission)[index])->GetXsec(aThermalE.GetThermalEnergy(aTrack,
                                                   >> 115                                                             theMaterial->GetElement(i),
                                                   >> 116                         theMaterial->GetTemperature()));
                                                   >> 117         xSec[i] *= rWeight;
                                                   >> 118         sum+=xSec[i];
                                                   >> 119       }
                                                   >> 120       G4double random = G4UniformRand();
                                                   >> 121       G4double running = 0;
                                                   >> 122       for (i=0; i<n; i++)
                                                   >> 123       {
                                                   >> 124         running += xSec[i];
                                                   >> 125         index = theMaterial->GetElement(i)->GetIndex();
                                                   >> 126         //if(random<=running/sum) break;
                                                   >> 127         if( sum == 0 ||  random <= running/sum ) break;
                                                   >> 128       }
                                                   >> 129       delete [] xSec;
                                                   >> 130     }
                                                   >> 131     //return theFission[index].ApplyYourself(aTrack);                 //-2:Marker for Fission
                                                   >> 132     G4HadFinalState* result = ((*theFission)[index])->ApplyYourself(aTrack,-2);
 98                                                   133 
 99   // Overwrite target parameters               << 134     //Overwrite target parameters
100   aNucleus.SetParameters(G4ParticleHPManager:: << 135     aNucleus.SetParameters(G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargA(),G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargZ());
101                          G4ParticleHPManager:: << 136     const G4Element* target_element = (*G4Element::GetElementTable())[index];
102   const G4Element* target_element = (*G4Elemen << 137     const G4Isotope* target_isotope=NULL;
103   const G4Isotope* target_isotope = nullptr;   << 138     G4int iele = target_element->GetNumberOfIsotopes();
104   auto iele = (G4int)target_element->GetNumber << 139     for ( G4int j = 0 ; j != iele ; j++ ) { 
105   for (G4int j = 0; j != iele; ++j) {          << 140        target_isotope=target_element->GetIsotope( j );
106     target_isotope = target_element->GetIsotop << 141        if ( target_isotope->GetN() == G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->GetTargA() ) break; 
107     if (target_isotope->GetN()                 << 142     }
108         == G4ParticleHPManager::GetInstance()- << 143     //G4cout << "Target Material of this reaction is " << theMaterial->GetName() << G4endl;
109       break;                                   << 144     //G4cout << "Target Element of this reaction is " << target_element->GetName() << G4endl;
110   }                                            << 145     //G4cout << "Target Isotope of this reaction is " << target_isotope->GetName() << G4endl;
111   aNucleus.SetIsotope(target_isotope);         << 146     aNucleus.SetIsotope( target_isotope );
112                                                   147 
113   G4ParticleHPManager::GetInstance()->CloseRea << 148     G4ParticleHPManager::GetInstance()->CloseReactionWhiteBoard();
114   return result;                               << 149     return result; 
115 }                                              << 150   }
116                                                   151 
117 const std::pair<G4double, G4double> G4Particle    152 const std::pair<G4double, G4double> G4ParticleHPFission::GetFatalEnergyCheckLevels() const
118 {                                                 153 {
119   // max energy non-conservation is mass of he << 154         // max energy non-conservation is mass of heavy nucleus
120   return std::pair<G4double, G4double>(10.0 *  << 155         //return std::pair<G4double, G4double>(5*perCent,250*GeV);
                                                   >> 156         return std::pair<G4double, G4double>(5*perCent,DBL_MAX);
                                                   >> 157 }
                                                   >> 158 /*
                                                   >> 159 void G4ParticleHPFission::addChannelForNewElement()
                                                   >> 160 {
                                                   >> 161    for ( G4int i = numEle ; i < (G4int)G4Element::GetNumberOfElements() ; i++ ) 
                                                   >> 162    {
                                                   >> 163       theFission.push_back( new G4ParticleHPChannel );
                                                   >> 164       if ( (*(G4Element::GetElementTable()))[i]->GetZ() > 87 ) //TK modified for ENDF-VII
                                                   >> 165       {
                                                   >> 166          G4cout << "G4ParticleHPFission Prepairing Data for the new element of " << (*(G4Element::GetElementTable()))[i]->GetName() << G4endl;
                                                   >> 167          (*theFission[i]).Init((*(G4Element::GetElementTable()))[i], dirName);
                                                   >> 168          (*theFission[i]).Register(&theFS);
                                                   >> 169       }
                                                   >> 170    }
                                                   >> 171    numEle = (G4int)G4Element::GetNumberOfElements();
121 }                                                 172 }
                                                   >> 173 */
122                                                   174 
123 G4int G4ParticleHPFission::GetVerboseLevel() c    175 G4int G4ParticleHPFission::GetVerboseLevel() const
124 {                                                 176 {
125   return G4ParticleHPManager::GetInstance()->G << 177    return G4ParticleHPManager::GetInstance()->GetVerboseLevel();
126 }                                                 178 }
127                                                << 179 void G4ParticleHPFission::SetVerboseLevel( G4int newValue ) 
128 void G4ParticleHPFission::SetVerboseLevel(G4in << 
129 {                                                 180 {
130   G4ParticleHPManager::GetInstance()->SetVerbo << 181    G4ParticleHPManager::GetInstance()->SetVerboseLevel(newValue);
131 }                                                 182 }
132                                                << 
133 void G4ParticleHPFission::BuildPhysicsTable(co    183 void G4ParticleHPFission::BuildPhysicsTable(const G4ParticleDefinition&)
134 {                                                 184 {
135   G4ParticleHPManager* hpmanager = G4ParticleH << 
136                                                   185 
137   theFission = hpmanager->GetFissionFinalState << 186    G4ParticleHPManager* hpmanager = G4ParticleHPManager::GetInstance();
138                                                   187 
139   if (G4Threading::IsMasterThread()) {         << 188    theFission = hpmanager->GetFissionFinalStates();
140     if (theFission == nullptr) theFission = ne << 
141                                                   189 
142     if (numEle == (G4int)G4Element::GetNumberO << 190    if ( G4Threading::IsMasterThread() ) {
143                                                   191 
144     if (theFission->size() == G4Element::GetNu << 192       if ( theFission == NULL ) theFission = new std::vector<G4ParticleHPChannel*>;
145       numEle = (G4int)G4Element::GetNumberOfEl << 
146       return;                                  << 
147     }                                          << 
148                                                   193 
149     if (G4FindDataDir("G4NEUTRONHPDATA") == nu << 194       if ( numEle == (G4int)G4Element::GetNumberOfElements() ) return;
150       throw G4HadronicException(               << 
151         __FILE__, __LINE__,                    << 
152         "Please setenv G4NEUTRONHPDATA to poin << 
153     dirName = G4FindDataDir("G4NEUTRONHPDATA") << 
154     G4String tString = "/Fission";             << 
155     dirName = dirName + tString;               << 
156                                                   195 
157     for (G4int i = numEle; i < (G4int)G4Elemen << 196       if ( theFission->size() == G4Element::GetNumberOfElements() ) {
158       theFission->push_back(new G4ParticleHPCh << 197          numEle = G4Element::GetNumberOfElements();
159       if ((*(G4Element::GetElementTable()))[i] << 198          return;
160         ((*theFission)[i])->Init((*(G4Element: << 
161         ((*theFission)[i])->Register(new G4Par << 
162       }                                           199       }
163     }                                          << 200 
164     hpmanager->RegisterFissionFinalStates(theF << 201       if ( !std::getenv("G4NEUTRONHPDATA") ) 
165   }                                            << 202           throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
166   numEle = (G4int)G4Element::GetNumberOfElemen << 203       dirName = std::getenv("G4NEUTRONHPDATA");
                                                   >> 204       G4String tString = "/Fission";
                                                   >> 205       dirName = dirName + tString;
                                                   >> 206 
                                                   >> 207       for ( G4int i = numEle ; i < (G4int)G4Element::GetNumberOfElements() ; i++ ) {
                                                   >> 208          theFission->push_back( new G4ParticleHPChannel );
                                                   >> 209          if ((*(G4Element::GetElementTable()))[i]->GetZ()>87) { //TK modified for ENDF-VII
                                                   >> 210             ((*theFission)[i])->Init((*(G4Element::GetElementTable()))[i], dirName);
                                                   >> 211             ((*theFission)[i])->Register( new G4ParticleHPFissionFS );
                                                   >> 212          }
                                                   >> 213       }
                                                   >> 214 
                                                   >> 215       hpmanager->RegisterFissionFinalStates( theFission );
                                                   >> 216 
                                                   >> 217    }
                                                   >> 218 
                                                   >> 219    numEle = G4Element::GetNumberOfElements();
167 }                                                 220 }
168                                                   221 
169 void G4ParticleHPFission::ModelDescription(std    222 void G4ParticleHPFission::ModelDescription(std::ostream& outFile) const
170 {                                                 223 {
171   outFile << "High Precision model based on Ev << 224    outFile << "High Precision model based on Evaluated Nuclear Data Files (ENDF) for induced fission reaction of neutrons below 20MeV\n";
172           << "for induced fission reaction of  << 
173 }                                                 225 }
174                                                   226