73 lines
1.4 KiB
C++
73 lines
1.4 KiB
C++
//
|
|
// simulation.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 20.09.18.
|
|
// Copyright © 2018 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef simulation_h
|
|
#define simulation_h
|
|
|
|
#include <stdio.h>
|
|
#include <math.h>
|
|
#include <deque>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
#include <dirent.h>
|
|
#include "blitz/array.h"
|
|
#include "blitz/tinyvec2.h"
|
|
#include <random/uniform.h>
|
|
#include <random/normal.h>
|
|
|
|
#include "parameter.h"
|
|
#include "katrin.h"
|
|
#include "particle.h"
|
|
|
|
|
|
|
|
class Simulation: public Parameter
|
|
{
|
|
public:
|
|
~Simulation(){};
|
|
Simulation() {
|
|
numInjectedParticles = 0;
|
|
rngUni.seed(seed);
|
|
logging = false;
|
|
};
|
|
void initLogger(void);
|
|
void doit(void);
|
|
|
|
|
|
protected:
|
|
// Simulation
|
|
Katrin Kat;
|
|
ranlib::Uniform<double> rngUni;
|
|
ranlib::NormalUnit<double> rngNormal;
|
|
int numInjectedParticles;
|
|
std::deque<Particle> particleQue;
|
|
|
|
Particle inject();
|
|
double getBetaDecayEnergyRejection_eV();
|
|
double EnergyDistributionBetaDecay(double Ekin_eV);
|
|
double FermiFunction(double Z, double Ekin_eV);
|
|
double getEnergyBoltzmann_eV();
|
|
|
|
bool move(Particle *inputParticle);
|
|
bool movedOutside(blitz::TinyVector<double,3> loc_m);
|
|
int getInteraction(Particle inPutParticle);
|
|
|
|
|
|
|
|
// Logging
|
|
bool logging;
|
|
std::vector<std::ofstream> outStream;
|
|
std::vector<double> zLogValues;
|
|
void logParticle(Particle *inputParticle,blitz::TinyVector<double,3> oldLoc_m);
|
|
std::string getTimeString();
|
|
};
|
|
|
|
#endif
|