Added class for population logging.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// h5tb_population_meta_interface.hpp
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 03.06.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef h5tb_population_meta_interface_hpp
|
||||
#define h5tb_population_meta_interface_hpp
|
||||
|
||||
#include "error_types.h"
|
||||
|
||||
#include "hdf5.h"
|
||||
#include "hdf5_hl.h"
|
||||
|
||||
|
||||
typedef struct log_meta_bin {
|
||||
int z_bin;
|
||||
int r_bin;
|
||||
int phi_bin;
|
||||
int E_bin;
|
||||
double z_min_m;
|
||||
double z_max_m;
|
||||
double r_min_m;
|
||||
double r_max_m;
|
||||
double phi_min;
|
||||
double phi_max;
|
||||
double E_min_eV;
|
||||
double E_max_eV;
|
||||
} log_meta_bin;
|
||||
|
||||
|
||||
class H5TB_Population_Meta_Interface {
|
||||
static const size_t size;
|
||||
static const char *fieldNames[12];
|
||||
static const size_t offset[12];
|
||||
static const hid_t fieldTypes[12];
|
||||
static const hsize_t chunkSize;
|
||||
static const size_t sizes[12];
|
||||
|
||||
std::string table_name;
|
||||
hid_t *loc_id;
|
||||
|
||||
public:
|
||||
H5TB_Population_Meta_Interface() {};
|
||||
H5TB_Population_Meta_Interface(const std::string &table_name, hid_t *loc_id) {
|
||||
this->table_name = table_name;
|
||||
this->loc_id = loc_id;
|
||||
create();
|
||||
}
|
||||
private:
|
||||
void create();
|
||||
|
||||
public:
|
||||
void write(const log_meta_bin &log_meta);
|
||||
|
||||
};
|
||||
|
||||
#endif /* h5tb_population_meta_interface_hpp */
|
||||
Reference in New Issue
Block a user