Files
katrin-plasma/src/mc_electron/population4_container.hpp
T
Christian 578d673b65 Moved serial mode to target mcelecron_serial.
Implemented parallelization with mpi.
2019-07-18 14:02:19 +02:00

63 lines
1.9 KiB
C++

//
// population4_container.hpp
// mc_electron
//
// Created by Christian Reiling on 11.06.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#ifndef population4_container_hpp
#define population4_container_hpp
#include "log_scale.h"
#include "katrin_geo.h"
#include "timer.hpp"
struct loc_bins {
int z_bin;
int r_bin;
int phi_bin;
};
class Pop4_Container {
double *data;
Lin_Scale z_scale, r_scale, phi_scale;
Log_Scale E_scale;
int z_offset, r_offset, phi_offset, total_data_size;
public:
//Pop4_Container() {};
Pop4_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins);
~Pop4_Container();
Pop4_Container(const Pop4_Container& other);
Pop4_Container& operator=(const Pop4_Container& other);
void increase_value(const double &value, const vec3 &loc_m, const double &E_eV);
void increase_value(const double &value, const vec3 &loc1_m, const vec3 &loc2_m, const double &E_eV);
double get_value(const vec3 &loc_m, const double &E_eV);
double get_value_sum(const vec3 &loc_m);
void set_value_by_bin(double value, int z_bin, int r_bin, int phi_bin, int E_bin) {data[calc_data_bin(z_bin, r_bin, phi_bin, E_bin)] = value;}
double get_value_by_bin(int z_bin, int r_bin, int phi_bin, int E_bin) {return data[calc_data_bin(z_bin, r_bin, phi_bin, E_bin)];}
loc_bins get_loc_bins(const vec3 &loc_m);
int get_num_E_bins() {return E_scale.get_number_bins();}
double get_lower_E_boarder_eV(int E_bin) {return E_scale.get_lower_bin_bound(E_bin);}
double get_upper_E_boarder_eV(int E_bin) {return E_scale.get_upper_bin_bound(E_bin);}
Lin_Scale get_z_scale(){return z_scale;}
Lin_Scale get_r_scale(){return r_scale;}
Lin_Scale calc_phi_scale(){return phi_scale;}
Log_Scale get_E_scale(){return E_scale;}
int calc_data_bin(int z_bin, int r_bin, int phi_bin, int E_bin);
public:
int get_total_data_size() {return total_data_size;}
double *get_array() {return data;}
};
#endif /* population4_container_hpp */