Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPIsoData.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// neutron_hp -- source file
27// J.P. Wellisch, Nov-1996
28// A prototype of the low energy neutron transport model.
29//
30//080901 Avoiding troubles which caused by G4PhysicsVecotor of length 0 by T. Koi
31//
32#include "G4NeutronHPIsoData.hh"
33#include "G4SystemOfUnits.hh"
35
36 //G4bool G4NeutronHPIsoData::Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
38 {
39 theChannelData = 0;
40 G4double abundance = abun/100.;
41 G4String filename;
42 G4bool result = true;
43 //G4NeutronHPDataUsed aFile = theNames.GetName(A, Z, dirName, aFSType, result);
44 G4NeutronHPDataUsed aFile = theNames.GetName(A, Z, M, dirName, aFSType, result);
45 filename = aFile.GetName();
46// if(filename=="") return false;
47 std::ifstream theChannel(filename);
48
49 if(Z==1 && (aFile.GetZ()!=Z || std::abs(aFile.GetA()-A)>0.0001) )
50 {
51 if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
52 //080901 TKDB No more necessary below protection, cross sections set to 0 in G4NeutronHPNames
53 //And below two lines causes trouble with G4PhysicsVector
54 //theChannel.close();
55 //return false;
56 }
57 if(!theChannel) {theChannel.close(); return false;}
58 // accommodating deficiencie of some compilers
59 if(theChannel.eof()) {theChannel.close(); return false;}
60 if(!theChannel) {theChannel.close(); return false;}
61 G4int dummy;
62 theChannel >> dummy >> dummy;
63 theChannelData = new G4NeutronHPVector;
64 G4int nData;
65 theChannel >> nData;
66 theChannelData->Init(theChannel, nData, eV, abundance*barn);
67// G4cout << "Channel Data Statistics: "<<theChannelData->GetVectorLength()<<G4endl;
68// G4cout << "Channel data"<<G4endl;
69// G4int hpw;
70// G4cin >> hpw;
71// theChannelData->Dump();
72 theChannel.close();
73 return result;
74 }
75
76 //void G4NeutronHPIsoData::Init(G4int A, G4int Z, G4double abun) //fill PhysicsVector for this Isotope
77 void G4NeutronHPIsoData::Init(G4int A, G4int Z, G4int M, G4double abun) //fill PhysicsVector for this Isotope
78 {
79 G4String dirName;
80 if(!getenv("G4NEUTRONHPDATA"))
81 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
82 G4String baseName = getenv("G4NEUTRONHPDATA");
83 dirName = baseName+"/Fission";
84 //if(Z>89)
85 if(Z>87) //TK Modifed for ENDF VII.0
86 {
87 //Init(A, Z, abun, dirName, "/CrossSection/");
88 Init(A, Z, M, abun, dirName, "/CrossSection");
89 }
90 else
91 {
92 theChannelData = new G4NeutronHPVector;
93 }
94 theFissionData = theChannelData;
95 theChannelData = 0; // fast fix for double delete; revisit later. @@@@@@@
96 dirName = baseName+"/Capture";
97 //Init(A, Z, abun, dirName, "/CrossSection/");
98 Init(A, Z, M, abun, dirName, "/CrossSection");
99 theCaptureData = theChannelData;
100 theChannelData = 0;
101 dirName = baseName+"/Elastic";
102 //Init(A, Z, abun, dirName, "/CrossSection/");
103 Init(A, Z, M, abun, dirName, "/CrossSection");
104 theElasticData = theChannelData;
105 theChannelData = 0;
106 dirName = baseName+"/Inelastic";
107 //Init(A, Z, abun, dirName, "/CrossSection/");
108 Init(A, Z, M, abun, dirName, "/CrossSection");
109 theInelasticData = theChannelData;
110 theChannelData = 0;
111
112// if(theInelasticData!=0) G4cout << "Inelastic Data Statistics: "<<theInelasticData->GetVectorLength()<<G4endl;
113// if(theElasticData!=0) G4cout << "Elastic Data Statistics: "<<theElasticData->GetVectorLength()<<G4endl;
114// if(theCaptureData!=0) G4cout << "Capture Data Statistics: "<<theCaptureData->GetVectorLength()<<G4endl;
115// if(theFissionData!=0) G4cout << "Fission Data Statistics: "<<theFissionData->GetVectorLength()<<G4endl;
116// G4cout << "Inelastic data"<<G4endl;
117// if(theInelasticData!=0) theInelasticData->Dump();
118// G4cout << "Elastic data"<<G4endl;
119// if(theElasticData!=0) theElasticData->Dump();
120// G4cout << "Capture data"<<G4endl;
121// if(theCaptureData!=0) theCaptureData->Dump();
122// G4cout << "Fission data"<<G4endl;
123// if(theFissionData!=0) theFissionData->Dump();
124
125 }
126
128 {
129 G4bool dbool;
130 return (theNames.GetName(A, Z, base, rest, dbool)).GetName();
131 }
132
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
G4String GetName(G4int A, G4int Z, G4String base, G4String rest)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void Init(std::ifstream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)