Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -139,7 +139,7 @@ G4NuclearDecayChannel::G4NuclearDecayChannel
|
||||
G4double theBR,
|
||||
G4double theFFN,
|
||||
G4bool betaS,
|
||||
RandGeneral* randBeta,
|
||||
CLHEP::RandGeneral* randBeta,
|
||||
G4double theQtransition,
|
||||
G4int A,
|
||||
G4int Z,
|
||||
@@ -271,8 +271,8 @@ G4DecayProducts *G4NuclearDecayChannel::DecayIt (G4double theParentMass)
|
||||
// Load-up the details of the parent and daughter particles if they have not
|
||||
// been defined properly.
|
||||
//
|
||||
if (parent == NULL) FillParent();
|
||||
if (daughters == NULL) FillDaughters();
|
||||
if (parent == 0) FillParent();
|
||||
if (daughters == 0) FillDaughters();
|
||||
//
|
||||
//
|
||||
// We want to ensure that the difference between the total
|
||||
@@ -296,7 +296,7 @@ G4DecayProducts *G4NuclearDecayChannel::DecayIt (G4double theParentMass)
|
||||
//
|
||||
// Define a product vector.
|
||||
//
|
||||
G4DecayProducts *products = NULL;
|
||||
G4DecayProducts *products = 0;
|
||||
//
|
||||
//
|
||||
// Depending upon the number of daughters, select the appropriate decay
|
||||
@@ -325,7 +325,7 @@ G4DecayProducts *G4NuclearDecayChannel::DecayIt (G4double theParentMass)
|
||||
G4cerr <<"Number of daughters in decay = " <<numberOfDaughters <<G4endl;
|
||||
G4Exception(__FILE__, G4inttostring(__LINE__), FatalException, "G4NuclearDecayChannel::DecayIt");
|
||||
}
|
||||
if ((products == NULL) && (GetVerboseLevel()>0)) {
|
||||
if ((products == 0) && (GetVerboseLevel()>0)) {
|
||||
G4cerr << "G4NuclearDecayChannel::DecayIt ";
|
||||
G4cerr << *parent_name << " can not decay " << G4endl;
|
||||
DumpInfo();
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#include "globals.hh"
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
#include <sstream>
|
||||
|
||||
const G4double G4RIsotopeTable::levelTolerance = 2.0*keV;
|
||||
|
||||
@@ -152,12 +152,10 @@ G4IsotopeProperty* G4RIsotopeTable::GetIsotope(G4int Z, G4int A, G4double E)
|
||||
//
|
||||
G4String G4RIsotopeTable::GetIsotopeName(G4int Z, G4int A, G4double E)
|
||||
{
|
||||
G4String name;
|
||||
char val[50];
|
||||
std::ostrstream os(val,50);
|
||||
std::ostringstream os;
|
||||
os.setf(std::ios::fixed);
|
||||
os <<"A"<< A << "Z" << Z <<'[' << std::setprecision(1) << E/keV << ']' << '\0';
|
||||
name = val;
|
||||
os <<"A"<< A << "Z" << Z <<'[' << std::setprecision(1) << E/keV << ']';
|
||||
G4String name = os.str();
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cerr <<"G4RIsotopeTable::GetIsotope Name: ";
|
||||
G4cerr <<name <<G4endl;
|
||||
@@ -177,10 +175,9 @@ G4double G4RIsotopeTable::GetMeanLifeTime (G4int Z, G4int A, G4double& aE)
|
||||
}
|
||||
G4String dirName = getenv("G4RADIOACTIVEDATA");
|
||||
|
||||
char val[100];
|
||||
std::ostrstream os(val,100);
|
||||
os <<dirName <<"/z" <<Z <<".a" <<A <<'\0';
|
||||
G4String file(val);
|
||||
std::ostringstream os;
|
||||
os <<dirName <<"/z" <<Z <<".a" <<A ;
|
||||
G4String file = os.str();
|
||||
std::ifstream DecaySchemeFile(file);
|
||||
|
||||
if (!DecaySchemeFile )
|
||||
@@ -210,7 +207,7 @@ G4double G4RIsotopeTable::GetMeanLifeTime (G4int Z, G4int A, G4double& aE)
|
||||
|
||||
if (inputChars[0] != '#' && inputLine.length() != 0)
|
||||
{
|
||||
std::istrstream tmpstream(inputLine);
|
||||
std::istringstream tmpstream(inputLine);
|
||||
// tmpstream = inputLine;
|
||||
tmpstream >>recordType >>a >>b;
|
||||
if (recordType == "P")
|
||||
|
||||
@@ -102,10 +102,12 @@
|
||||
#include "G4HadTmpUtil.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <strstream>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
using namespace CLHEP;
|
||||
|
||||
const G4double G4RadioactiveDecay::levelTolerance =2.0*keV;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -126,7 +128,7 @@ G4RadioactiveDecay::G4RadioactiveDecay
|
||||
|
||||
theRadioactiveDecaymessenger = new G4RadioactiveDecaymessenger(this);
|
||||
theIsotopeTable = new G4RIsotopeTable();
|
||||
aPhysicsTable = NULL;
|
||||
aPhysicsTable = 0;
|
||||
pParticleChange = &fParticleChangeForRadDecay;
|
||||
|
||||
//
|
||||
@@ -171,7 +173,7 @@ G4RadioactiveDecay::G4RadioactiveDecay
|
||||
//
|
||||
G4RadioactiveDecay::~G4RadioactiveDecay()
|
||||
{
|
||||
if (aPhysicsTable != NULL)
|
||||
if (aPhysicsTable != 0)
|
||||
{
|
||||
aPhysicsTable->clearAndDestroy();
|
||||
delete aPhysicsTable;
|
||||
@@ -543,7 +545,7 @@ G4double G4RadioactiveDecay::GetMeanFreePath (const G4Track& aTrack,
|
||||
pathlength = ( rKineticEnergy + 1.0)* aCtau;
|
||||
} else if ( rKineticEnergy > LowestBinValue) {
|
||||
// check if aPhysicsTable exists
|
||||
if (aPhysicsTable == NULL) BuildPhysicsTable(*aParticleDef);
|
||||
if (aPhysicsTable == 0) BuildPhysicsTable(*aParticleDef);
|
||||
// beta is in the range valid for PhysicsTable
|
||||
pathlength = aCtau *
|
||||
((*aPhysicsTable)(0))-> GetValue(rKineticEnergy,isOutRange);
|
||||
@@ -577,7 +579,7 @@ G4double G4RadioactiveDecay::GetMeanFreePath (const G4Track& aTrack,
|
||||
void G4RadioactiveDecay::BuildPhysicsTable(const G4ParticleDefinition&)
|
||||
{
|
||||
// if aPhysicsTableis has already been created, do nothing
|
||||
if (aPhysicsTable != NULL) return;
|
||||
if (aPhysicsTable != 0) return;
|
||||
|
||||
// create aPhysicsTable
|
||||
if (GetVerboseLevel()>1) G4cerr <<" G4Decay::BuildPhysicsTable() "<< G4endl;
|
||||
@@ -633,10 +635,9 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
std::sort( LoadedNuclei.begin(), LoadedNuclei.end() );
|
||||
// sort needed to allow binary_search
|
||||
|
||||
char val[100];
|
||||
std::ostrstream os(val,100);
|
||||
std::ostringstream os;
|
||||
os <<dirName <<"/z" <<Z <<".a" <<A <<'\0';
|
||||
G4String file(val);
|
||||
G4String file = os.str();
|
||||
|
||||
|
||||
std::ifstream DecaySchemeFile(file);
|
||||
@@ -649,7 +650,7 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
//
|
||||
{
|
||||
G4cerr <<"G4RadoactiveDecay::LoadDecayTable() : cannot find ion radioactive decay file " <<G4endl;
|
||||
theDecayTable = NULL;
|
||||
theDecayTable = 0;
|
||||
return theDecayTable;
|
||||
}
|
||||
//
|
||||
@@ -691,7 +692,7 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
inputLine = inputLine.strip(1);
|
||||
if (inputChars[0] != '#' && inputLine.length() != 0)
|
||||
{
|
||||
std::istrstream tmpStream(inputLine);
|
||||
std::istringstream tmpStream(inputLine);
|
||||
if (inputChars[0] == 'P')
|
||||
//
|
||||
//
|
||||
@@ -923,8 +924,8 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
// Go through the decay table and make sure that the branching ratios are
|
||||
// correctly normalised.
|
||||
//
|
||||
G4VDecayChannel *theChannel = NULL;
|
||||
G4NuclearDecayChannel *theNuclearDecayChannel = NULL;
|
||||
G4VDecayChannel *theChannel = 0;
|
||||
G4NuclearDecayChannel *theNuclearDecayChannel = 0;
|
||||
G4String mode = "";
|
||||
G4int j = 0;
|
||||
G4double theBR = 0.0;
|
||||
@@ -1010,12 +1011,12 @@ void G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition &theParent
|
||||
G4bool stable = false;
|
||||
G4int i;
|
||||
G4int j;
|
||||
G4VDecayChannel *theChannel = NULL;
|
||||
G4NuclearDecayChannel *theNuclearDecayChannel = NULL;
|
||||
G4ITDecayChannel *theITChannel = NULL;
|
||||
G4BetaMinusDecayChannel *theBetaMinusChannel = NULL;
|
||||
G4BetaPlusDecayChannel *theBetaPlusChannel = NULL;
|
||||
G4AlphaDecayChannel *theAlphaChannel = NULL;
|
||||
G4VDecayChannel *theChannel = 0;
|
||||
G4NuclearDecayChannel *theNuclearDecayChannel = 0;
|
||||
G4ITDecayChannel *theITChannel = 0;
|
||||
G4BetaMinusDecayChannel *theBetaMinusChannel = 0;
|
||||
G4BetaPlusDecayChannel *theBetaPlusChannel = 0;
|
||||
G4AlphaDecayChannel *theAlphaChannel = 0;
|
||||
G4RadioactiveDecayMode theDecayMode;
|
||||
// G4NuclearLevelManager levelManager;
|
||||
//const G4NuclearLevel* level;
|
||||
@@ -1123,7 +1124,7 @@ void G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition &theParent
|
||||
// Decay mode is beta-.
|
||||
//
|
||||
theBetaMinusChannel = new G4BetaMinusDecayChannel (0, aParentNucleus,
|
||||
brs[1], 0.*MeV, 0.*MeV, 1, false, NULL);
|
||||
brs[1], 0.*MeV, 0.*MeV, 1, false, 0);
|
||||
theDecayTable->Insert(theBetaMinusChannel);
|
||||
|
||||
break;
|
||||
@@ -1134,7 +1135,7 @@ void G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition &theParent
|
||||
// Decay mode is beta+ + EC.
|
||||
//
|
||||
theBetaPlusChannel = new G4BetaPlusDecayChannel (GetVerboseLevel(), aParentNucleus,
|
||||
brs[2], 0.*MeV, 0.*MeV, 1, false, NULL);
|
||||
brs[2], 0.*MeV, 0.*MeV, 1, false, 0);
|
||||
theDecayTable->Insert(theBetaPlusChannel);
|
||||
break;
|
||||
|
||||
@@ -1372,7 +1373,7 @@ G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4
|
||||
}
|
||||
G4DecayTable *theDecayTable = theParticleDef->GetDecayTable();
|
||||
|
||||
if (theDecayTable == NULL || theDecayTable->entries() == 0 )
|
||||
if (theDecayTable == 0 || theDecayTable->entries() == 0 )
|
||||
{
|
||||
//
|
||||
//
|
||||
@@ -1517,7 +1518,7 @@ G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4
|
||||
G4double currentTime = 0.;
|
||||
G4int ndecaych;
|
||||
G4DynamicParticle* asecondaryparticle;
|
||||
// G4DecayProducts* products = NULL;
|
||||
// G4DecayProducts* products = 0;
|
||||
std::vector<G4DynamicParticle*> secondaryparticles;
|
||||
std::vector<G4double> pw;
|
||||
std::vector<G4double> ptime;
|
||||
@@ -1583,7 +1584,7 @@ G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4
|
||||
// a temprary products buffer and its contents is transfered to
|
||||
// the products at the end of the loop
|
||||
//
|
||||
G4DecayProducts *tempprods = NULL;
|
||||
G4DecayProducts *tempprods = 0;
|
||||
|
||||
// calculate the decay rate of the isotope
|
||||
// one need to fold the the source bias function with the decaytime
|
||||
@@ -1615,7 +1616,7 @@ G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4
|
||||
G4DecayTable *theDecayTable = parentNucleus->GetDecayTable();
|
||||
ndecaych = G4int(theDecayTable->entries()*G4UniformRand());
|
||||
G4VDecayChannel *theDecayChannel = theDecayTable->GetDecayChannel(ndecaych);
|
||||
if (theDecayChannel == NULL)
|
||||
if (theDecayChannel == 0)
|
||||
{
|
||||
// Decay channel not found.
|
||||
#ifdef G4VERBOSE
|
||||
|
||||
+5
-4
@@ -24,7 +24,8 @@
|
||||
//
|
||||
#include "G4RadioactiveDecaymessenger.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger
|
||||
@@ -179,13 +180,13 @@ void G4RadioactiveDecaymessenger::SetNewValue (G4UIcommand *command, G4String ne
|
||||
else if (command==analoguemcCmd) {
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
std::istrstream is((char*)t);
|
||||
std::istringstream is(t);
|
||||
is >> vl;
|
||||
theRadioactiveDecayContainer->SetAnalogueMonteCarlo(vl!=0);}
|
||||
else if (command==fbetaCmd) {
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
std::istrstream is((char*)t);
|
||||
std::istringstream is(t);
|
||||
is >> vl;
|
||||
theRadioactiveDecayContainer->SetFBeta(vl!=0);}
|
||||
else if (command==avolumeCmd) {theRadioactiveDecayContainer->
|
||||
@@ -199,7 +200,7 @@ void G4RadioactiveDecaymessenger::SetNewValue (G4UIcommand *command, G4String ne
|
||||
else if (command==brbiasCmd) {
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
std::istrstream is((char*)t);
|
||||
std::istringstream is(t);
|
||||
is >> vl;
|
||||
theRadioactiveDecayContainer->SetBRBias(vl!=0);}
|
||||
else if (command==sourcetimeprofileCmd) {theRadioactiveDecayContainer->
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
#include "G4UIcmdWithNucleusLimits.hh"
|
||||
#include <strstream>
|
||||
#include <sstream>
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4UIcmdWithNucleusLimits::G4UIcmdWithNucleusLimits
|
||||
@@ -54,8 +54,7 @@ G4NucleusLimits G4UIcmdWithNucleusLimits::
|
||||
G4int aMax;
|
||||
G4int zMin;
|
||||
G4int zMax;
|
||||
const char* t = paramString;
|
||||
std::istrstream is((char*)t);
|
||||
std::istringstream is(paramString);
|
||||
is >> aMin >> aMax >> zMin >> zMax;
|
||||
return G4NucleusLimits(aMin,aMax,zMin,zMax);
|
||||
}
|
||||
@@ -64,11 +63,10 @@ G4NucleusLimits G4UIcmdWithNucleusLimits::
|
||||
G4String G4UIcmdWithNucleusLimits::ConvertToString
|
||||
(G4NucleusLimits defLimits)
|
||||
{
|
||||
char st[100];
|
||||
std::ostrstream os(st,100);
|
||||
std::ostringstream os;
|
||||
os << defLimits.GetAMin() << " " << defLimits.GetAMax()
|
||||
<< defLimits.GetZMin() << " " << defLimits.GetZMax()<< '\0';
|
||||
G4String vl = st;
|
||||
<< defLimits.GetZMin() << " " << defLimits.GetZMax() ;
|
||||
G4String vl = os.str();
|
||||
return vl;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user