39 theLogPrimEnergyVector.clear();
40 theLogCrossSectionVector.clear();
41 theLogSecondEnergyMatrix.clear();
42 theLogProbMatrix.clear();
43 theLogProbMatrixIndex.clear();
46 is_scat_proj_to_proj_case =aBool;
52 theLogPrimEnergyVector.clear();
53 theLogCrossSectionVector.clear();
54 theLogSecondEnergyMatrix.clear();
55 theLogProbMatrix.clear();
61 theLogPrimEnergyVector.clear();
62 theLogCrossSectionVector.clear();
63 theLogSecondEnergyMatrix.clear();
64 theLogProbMatrix.clear();
65 theLogProbMatrixIndex.clear();
72 std::vector< double>* aLogProbVector,
size_t n_pro_decade){
77 theLogPrimEnergyVector.push_back(aLogPrimEnergy);
78 theLogCrossSectionVector.push_back(aLogCS);
79 theLogSecondEnergyMatrix.push_back(aLogSecondEnergyVector);
80 theLogProbMatrix.push_back(aLogProbVector);
82 std::vector< size_t>* aLogProbVectorIndex = 0;
85 if (n_pro_decade > 0 && aLogProbVector->size()>0) {
86 aLogProbVectorIndex =
new std::vector< size_t>();
87 dlog=std::log(10.)/n_pro_decade;
89 log0Vector.push_back(log_val);
93 aLogProbVectorIndex->push_back(theInterpolator->
FindPosition(log_val,(*aLogProbVector)));
98 log0Vector.push_back(0.);
100 theLogProbMatrixIndex.push_back(aLogProbVectorIndex);
110 std::vector< double>*& aLogProbVector, std::vector< size_t>*& aLogProbVectorIndex)
111 {
if (i>= nb_of_PrimEnergy)
return false;
113 aLogPrimEnergy = theLogPrimEnergyVector[i];
114 aLogCS = theLogCrossSectionVector[i];
115 aLogSecondEnergyVector = theLogSecondEnergyMatrix[i];
116 aLogProbVector = theLogProbMatrix[i];
117 aLogProbVectorIndex = theLogProbMatrixIndex[i];
125 { std::fstream FileOutput(file_name, std::ios::out);
126 FileOutput<<std::setiosflags(std::ios::scientific);
127 FileOutput<<std::setprecision(6);
128 FileOutput<<theLogPrimEnergyVector.size()<<
G4endl;
129 for (
size_t i=0;i<theLogPrimEnergyVector.size();i++){
130 FileOutput<<std::exp(theLogPrimEnergyVector[i])/
MeV<<
'\t'<<std::exp(theLogCrossSectionVector[i])<<
G4endl;
132 FileOutput<<theLogSecondEnergyMatrix[i]->size()<<
G4endl;
133 for (
size_t j=0;j<theLogSecondEnergyMatrix[i]->size();j++){
134 FileOutput<<std::exp((*theLogSecondEnergyMatrix[i])[j]);
136 if (j1<10) FileOutput<<
'\t';
142 if (j1>0) FileOutput<<
G4endl;
144 FileOutput<<theLogProbMatrix[i]->size()<<
G4endl;
145 for (
size_t j=0;j<theLogProbMatrix[i]->size();j++){
146 FileOutput<<std::exp((*theLogProbMatrix[i])[j]);
148 if (j1<10) FileOutput<<
'\t';
154 if (j1>0) FileOutput<<
G4endl;
163 { std::fstream FileOutput(file_name, std::ios::in);
167 theLogPrimEnergyVector.clear();
168 theLogCrossSectionVector.clear();
169 theLogSecondEnergyMatrix.clear();
170 theLogProbMatrix.clear();
172 for (
size_t i=0; i<n1;i++){
175 theLogPrimEnergyVector.push_back(E);
176 theLogCrossSectionVector.push_back(CS);
178 theLogSecondEnergyMatrix.push_back(
new std::vector<G4double>());
179 theLogProbMatrix.push_back(
new std::vector<G4double>());
181 for (
size_t j=0; j<n2;j++){
184 theLogSecondEnergyMatrix[i]->push_back(E1);
187 for (
size_t j=0; j<n2;j++){
190 theLogProbMatrix[i]->push_back(prob);
G4bool GetData(unsigned int i, G4double &aPrimEnergy, G4double &aCS, G4double &log0, std::vector< double > *&aLogSecondEnergyVector, std::vector< double > *&aLogProbVector, std::vector< size_t > *&aLogProbVectorIndex)
void Read(G4String file_name)
void AddData(G4double aPrimEnergy, G4double aCS, std::vector< double > *aLogSecondEnergyVector, std::vector< double > *aLogProbVector, size_t n_pro_decade=0)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
size_t FindPosition(G4double &x, std::vector< G4double > &x_vec, size_t ind_min=0, size_t ind_max=0)
G4AdjointCSMatrix(G4bool aBool)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static G4AdjointInterpolator * GetInstance()
static constexpr double MeV
void Write(G4String file_name)