// // vec3_container.cpp // mc_electron // // Created by Christian Reiling on 02.09.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #include "vec3_container.hpp" #include "read_system.h" Vec3_Container::Vec3_Container(int num_z_bins, int num_r_bins, int num_phi_bins, std::string load_path) { z_scale = Lin_Scale(z_WGTS_start_m, z_WGTS_end_m, num_z_bins); r_scale = Lin_Scale(0, r_WGTS_m, num_r_bins); phi_scale = Lin_Scale(0, 180, num_phi_bins); int num_tot_bins = num_z_bins * num_r_bins * num_phi_bins; data = new vec3[num_tot_bins]; load_data(load_path); } Vec3_Container::~Vec3_Container() { delete[] data; } void Vec3_Container::load_data(std::string load_path) { int num_tot_bins = z_scale.get_number_bins() * r_scale.get_number_bins() * phi_scale.get_number_bins(); bool *check_array = new bool[num_tot_bins]; for (int i = 0; i< num_tot_bins; i++) { check_array[i] = false; } std::ifstream importStream(load_path); if (!importStream.good()) { std::stringstream ss; ss<<"Vec3_Container::load_data: Could not open file. \n loadFilePath= "<>temp_bin && ss>>temp_x) && (ss>>temp_y && ss>>temp_z)) { data[temp_bin] = vec3(temp_x, temp_y, temp_z); check_array[temp_bin] = true; } else { std::cout<<"Vec3_Container::load_data: Warning could not read line in inputFile. \nloadFilePath\t"<