File indexing completed on 2025-01-31 09:21:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef SDDDATA_HH
0032 #define SDDDATA_HH
0033
0034 #include <string>
0035 #include <vector>
0036 #include <sstream>
0037 #include <map>
0038 #include "Damage.hh"
0039
0040 class SDDData
0041 {
0042 public:
0043
0044
0045
0046
0047
0048 struct SDDHeader
0049 {
0050 std::string sdd_version{""};
0051
0052 std::string software{""};
0053
0054 std::string author{""};
0055
0056 std::string sim_details{""};
0057
0058 std::string src_details{""};
0059 int src_type{0};
0060 std::vector<int> src_pdg;
0061 std::vector<double> src_energy;
0062 std::string energy_dist{""};
0063 std::vector<double> part_fraction;
0064 std::vector<double> dose;
0065 double dose_rate{0};
0066
0067 std::string target{""};
0068 std::vector<double> volumes;
0069 std::vector<double> chromo_size;
0070 double dna_density{0};
0071
0072 std::vector<double> cell_cycle;
0073 std::vector<int> dna_struct;
0074 int vitro_vivo{0};
0075 std::string proliferation{""};
0076 std::vector<double> microenv;
0077
0078 std::vector<double> damage_def;
0079 double time{0};
0080 std::vector<int> damage_prim_count;
0081
0082 std::vector<bool> entries;
0083
0084 std::string info{""};
0085 };
0086
0087
0088
0089
0090
0091 struct SDDDamage
0092 {
0093 std::vector<int> classification;
0094 std::vector<double> coordinates;
0095 std::vector<int> chromo_ID;
0096 std::vector<double> chromo_position;
0097 std::vector<int> cause;
0098 std::vector<int> types;
0099
0100 std::vector<int> break_spec;
0101 std::vector<int> dna_seq;
0102 std::vector<double> lesion_time;
0103
0104 std::vector<int> particles;
0105 std::vector<double> energy;
0106 std::vector<double> translation;
0107 std::vector<double> direction;
0108 std::vector<double> particle_time;
0109 };
0110
0111
0112 SDDData(std::string );
0113
0114 ~SDDData() = default;
0115
0116
0117
0118
0119 SDDHeader ReadHeader();
0120
0121
0122
0123
0124 std::map<int,unsigned long long int> GetChromosomeBpSizesMap(double &sum);
0125
0126
0127
0128
0129 double GetDose();
0130
0131
0132
0133
0134
0135 void ParseData();
0136
0137
0138
0139 std::vector<SDDDamage>& GetSDDDamage(){return data_;};
0140
0141
0142
0143
0144
0145 std::map<unsigned int,std::map<unsigned int,std::vector<Damage> > > GetAllDamage();
0146
0147 private:
0148
0149 std::string filename_;
0150 SDDHeader header_;
0151 std::vector<SDDDamage> data_;
0152
0153 void ParseLineData(std::string&);
0154
0155 void ReadString(std::ifstream&,std::string&);
0156 void ReadInt(std::ifstream&,int&);
0157 void ReadInts(std::ifstream&,std::vector<int>&);
0158 void ReadDouble(std::ifstream&,double&);
0159 void ReadDoubles(std::ifstream&,std::vector<double>&);
0160 void ReadBools(std::ifstream&,std::vector<bool>&);
0161
0162 void ExtractInts(std::string&,int,std::vector<int>&);
0163 void ExtractDoubles(std::string&,int,std::vector<double>&);
0164
0165 };
0166
0167 #endif