Bug fixes.
This commit is contained in:
@@ -14,15 +14,8 @@ void runTests() {
|
||||
TEST.decaySpectrum(100000, outputFilePath + "decaySpectrum.dat");
|
||||
TEST.rejectionBetaDecay(100000, outputFilePath + "rejectionBetaDecay.dat");
|
||||
TEST.maxwellBoltzmann(100000, outputFilePath + "maxwellBoltzmann.dat");
|
||||
|
||||
TestParticle TESTPART;
|
||||
TESTPART.sigmaEla_m2 (0, 20e3, 100000, outputFilePath + "sigmaEla_m2.dat");
|
||||
TESTPART.randomTheta (18.6e3, 100000, outputFilePath + "randomTheta.dat");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TestSimulation::injection (int numParticles, std::string outputFilePath) {
|
||||
std::ofstream outFile;
|
||||
outFile.open (outputFilePath);
|
||||
@@ -54,6 +47,7 @@ void TestSimulation::rejectionBetaDecay(int numDecays, std::string outputFilePat
|
||||
outFile.close();
|
||||
}
|
||||
|
||||
|
||||
void TestSimulation::maxwellBoltzmann(int numDecays, std::string outputFilePath) {
|
||||
std::ofstream outFile;
|
||||
outFile.open (outputFilePath);
|
||||
@@ -63,30 +57,3 @@ void TestSimulation::maxwellBoltzmann(int numDecays, std::string outputFilePath)
|
||||
outFile.close();
|
||||
}
|
||||
|
||||
void TestParticle::sigmaEla_m2 (double Emin_eV, double Emax_eV, int numpoints, std::string outputFilePath) {
|
||||
double E_eV,Estep_eV;
|
||||
Estep_eV = Emax_eV/(numpoints-1);
|
||||
m_eV = me_eV;
|
||||
std::ofstream outFile;
|
||||
outFile.open (outputFilePath);
|
||||
|
||||
for (int i = 0;i<numpoints;i++) {
|
||||
E_eV = i*Estep_eV;
|
||||
v_ms = calcV_ms(E_eV) , 0 , 0;
|
||||
outFile << E_eV<<";"<<getSigmaEla_m2() <<std::endl;
|
||||
}
|
||||
outFile.close();
|
||||
}
|
||||
|
||||
void TestParticle::randomTheta (double E_eV, int numCalculations, std::string outputFilePath) {
|
||||
std::ofstream outFile;
|
||||
m_eV = me_eV;
|
||||
v_ms = calcV_ms(E_eV) , 0 , 0;
|
||||
ranlib::Uniform<double> rngUni;
|
||||
rngUni.seed(2342395328);
|
||||
outFile.open (outputFilePath);
|
||||
for (int i = 0;i<numCalculations;i++) {
|
||||
outFile << getRandomTheta(&rngUni) <<std::endl;
|
||||
}
|
||||
outFile.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user