// // tests.cpp // mc_electron // // Created by Christian Reiling on 17.10.18. // Copyright © 2018 Christian Reiling. All rights reserved. // #include "tests.h" void runTests() { string outputFilePath = "/Users/ChristianReiling/Documents/Masterarbeit/CodeTesting/Data/"; TestSimulation TEST; TEST.injection (100000, outputFilePath + "injection.dat"); TEST.decaySpectrum(100000, outputFilePath + "decaySpectrum.dat"); TEST.rejectionBetaDecay(100000, outputFilePath + "rejectionBetaDecay.dat"); TEST.maxwellBoltzmann(100000, outputFilePath + "maxwellBoltzmann.dat"); TEST.SigmaTot_m2(10000, outputFilePath + "sigmaTot_m2.dat", -3, 9); TEST.MFP_m(10000, outputFilePath + "MFP_m.dat", -3, 9); } void TestSimulation::injection (int numParticles, string outputFilePath) { ofstream outFile; outFile.open (outputFilePath.c_str()); for (int i = 0;i= EmaxPower) { cerr<<"TestSimulation::getMFP_m: Power of lower energy bound \">=\" upper energy bound."< speed; for (int i=0;i<=numPoints;i++) { power = EminPower + i*distance; energy_eV = pow(10,power); speed = 0,0, calcV_msFromEkin_eV(energy_eV, me_eV); P2.setSpeed_ms(speed); sigma_m2 = Inter.getSigmaTot_m2(); outFile<= EmaxPower) { cerr<<"TestSimulation::getMFP_m: Power of lower energy bound \">=\" upper energy bound."< speed; for (int i=0;i<=numPoints;i++) { power = EminPower + i*distance; energy_eV = pow(10,power); speed = 0,0, calcV_msFromEkin_eV(energy_eV, me_eV); P2.setSpeed_ms(speed); MFP_m = getMFP_m(Inter); outFile<