65 lines
1.3 KiB
C++
65 lines
1.3 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 "parameter.h"
|
|
#include "katrin.h"
|
|
#include "particle.h"
|
|
#include "interaction.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;
|
|
|
|
// Injection
|
|
Particle inject();
|
|
double getBetaDecayEnergyRejection_eV();
|
|
double EnergyDistributionBetaDecay(double Ekin_eV);
|
|
double FermiFunction(double Z, double Ekin_eV);
|
|
|
|
// Moving
|
|
void moveParticle(Particle *movePart, double MFP_m);
|
|
double getMFP_m(Interaction Interaction);
|
|
bool movedOutside(blitz::TinyVector<double,3> loc_m);
|
|
|
|
// Interaction
|
|
int getInteraction(Particle interPart);
|
|
|
|
// Termination
|
|
bool checkTermination(Particle termPart);
|
|
|
|
// Logging
|
|
bool logging;
|
|
std::vector<std::ofstream> outStream;
|
|
std::vector<double> zLogValues;
|
|
void logParticle(Particle *logPart,blitz::TinyVector<double,3> oldLoc_m);
|
|
std::string getTimeString();
|
|
};
|
|
|
|
#endif
|