Files
katrin-plasma/src/mc_electron/logger_builder.cpp
T
Christian bd64d5390f Finished DCS_Ionization Container.
Removed Energy Cut off for T2+ Ions.
Tested Population loggers.
2019-06-06 16:33:42 +02:00

46 lines
1.5 KiB
C++

//
// logger_builder.cpp
// mc_electron
//
// Created by Christian Reiling on 18.05.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#include "logger_builder.hpp"
#include "multiz_particle_logger.h"
#include "sf_particle_logger.h"
#include "off_particle_logger.h"
Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
Particle_Logger_Manager ParticleLogger;
H5_Particles *h5part = h5f->get_h5part();
ParticleLogger.add(build_eLogger(h5part));
ParticleLogger.add(new Off_Particle_Logger(tritiumI));
ParticleLogger.add(new Off_Particle_Logger(tritium2I));
return (ParticleLogger);
}
Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5part) {
Particle_Logger_Base *res;
if (h5part->get_logging() == false) {
res = new Off_Particle_Logger(electron);
} else if(h5part->get_numberZBins() == -1){
res = new SF_Particle_Logger(electron, h5part->get_h5g_z());
} else {
res = new MuliZ_Particle_Logger(electron, h5part->get_numberZBins(), h5part->get_zValues(), h5part->get_h5g_z());
}
return (res);
}
Population_Logger_Manager Population_Logger_Builder::build(H5_File *h5f, Population_Manager *populations) {
Population_Logger_Manager Population_Logger;
H5_Populations *h5pop = h5f->get_h5pop();
Thermal_Base *T2I_population = static_cast<Thermal_Base*>(populations->find(tritium2I));
Population_Logger.add(new Thermal_Population_Logger(T2I_population, h5pop->get_h5g_pop()));
return (Population_Logger);
}