13 gStyle->SetPalette(1);
14 gROOT->SetStyle(
"Plain");
18 using Table = map<int,array<map<int,double>, 2>>;
21 system (
"rm -rf output.root");
22 system (
"hadd output.root output_*.root");
49 TFile
f(
"output.root");
52 TDirectoryFile*
d =
dynamic_cast<TDirectoryFile*
>(
f.Get(
"ntuple") );
53 TTree*
tPhys =
dynamic_cast<TTree*
> (d->Get(
"ntuple_1") );
54 tPhys->SetBranchAddress(
"x",&xphy);
55 tPhys->SetBranchAddress(
"y",&yphy);
56 tPhys->SetBranchAddress(
"z",&zphy);
57 tPhys->SetBranchAddress(
"edep",&EnergyDeposit);
58 tPhys->SetBranchAddress(
"diffKin",&kineticEnergyDifference);
59 tPhys->SetBranchAddress(
"volumeName",&flagVolume);
60 tPhys->SetBranchAddress(
"CopyNumber",©N);
61 tPhys->SetBranchAddress(
"EventID",&EventIDp);
91 else if( isRightStrand )
112 if(isDeoxyribode || isPhosphate)
117 if(physTable[EventIDp][strand][copyN] < 17.5)
122 if(CopyNumTable.empty())
124 CopyNumTable.insert(pair<int,int>(copyN,strand));
125 resultPhysTable[
EventIDp][strand].push_back(copyN);
132 auto itCopyNumTable = CopyNumTable.find(copyN);
133 if (itCopyNumTable != CopyNumTable.end())
135 if (itCopyNumTable->second == strand)
143 CopyNumTable.insert(pair<int,int>(copyN,strand));
144 resultPhysTable[
EventIDp][strand].push_back(copyN);
148 TTree*
tChem =
dynamic_cast<TTree*
> (d->Get(
"ntuple_2") );
149 tChem->SetBranchAddress(
"x",&xrad);
150 tChem->SetBranchAddress(
"y",&yrad);
151 tChem->SetBranchAddress(
"z",&zrad);
152 tChem->SetBranchAddress(
"EventID",&EventIDc);
161 for(
const auto& moleculeIt : fMolecules)
163 if(moleculeIt.fPosition == DNAElement)
166 if(moleculeIt.fName ==
"deoxyribose1")
170 else if(moleculeIt.fName ==
"deoxyribose2")
176 string msg =
"Unknown DNA component";
177 throw std::runtime_error(msg);
180 if(rdomN.Rndm() > 0.42)
185 if (!CopyNumTable.empty())
190 auto itCopyNumTable = CopyNumTable.find(moleculeIt.fCopyNumber);
192 if (itCopyNumTable != CopyNumTable.end())
194 if (itCopyNumTable->second == strand)
201 resultChemTable[
EventIDc][strand].push_back(
202 moleculeIt.fCopyNumber);
208 ofstream
ofile(
"SDDFormat.txt");
212 <<
"SDD version, SDDv1.0;\n"
213 <<
"Software, chromatin fiber Model;\n"
214 <<
"Author contact, Carmen Villagrasa,carmen.villagrasa@irsn.fr, "
215 "02/04/2018, Melyn et al.,Sc. Rep. 7 (2017)11923;\n"
216 <<
"Simulation Details, DNA damages from direct and "
217 "indirect effects;\n"
218 <<
"Source, Monoenergetic cylinder-parallel proton beam uniformly "
219 "in 5 nm radius from left side of the cube"
220 <<
" exposing chromatin fiber. Energy: 5 keV;\n"
221 <<
"Source type, 1;\n"
222 <<
"Incident particles, 200;\n"
223 <<
"Mean particle energy, 5 keV;\n"
224 <<
"Energy distribution, M, 0;\n"
225 <<
"Particle fraction, 1.0;\n"
226 <<
"Dose or fluence, 0, 0;\n"
227 <<
"Dose rate, 0.0;\n"
228 <<
"Irradiation target, Simple spherical chromatin fiber model"
229 " in a voxel 40 nm;\n"
230 <<
"Volumes, 0,20,20,20,-20,-20,-20,2,15,15,20,-15,-15,20;\n"
231 <<
"Chromosome sizes, ;\n"
233 <<
"Cell Cycle Phase, G1/G2;\n"
234 <<
"DNA Structure, 4, 1;\n"
235 <<
"In vitro / in vivo, 0;\n"
236 <<
"Proliferation status, 1;\n"
237 <<
"Microenvironment, 27, 0.0;\n"
238 <<
"Damage definition, 1, 1, 10, -1, 0, 17.5;\n"
240 <<
"Damage and primary count, 638, 200;\n"
241 <<
"Data entries, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0;\n"
242 <<
"Data was generated in minimal output format and used as"
243 " an example. Please modify the primary particle number"
246 <<
"***EndOfHeader***;\n"
251 bool Primaryflag =
true;
252 for (
int i = 0; i < 200; i++)
254 for(
int j = 0; j < 2; j++)
256 const std::string positionAndCopyN =
"; 0, 0, 0; 3, 0, 0, ";
257 const std::string SSBType =
" 0, 1, 0";
258 if (!resultPhysTable[i][j].empty())
260 for(
int e = 0;
e < resultPhysTable[i][j].size(); ++
e)
264 ofile<<
"2, "<<i<<positionAndCopyN
265 <<resultPhysTable[i][j][
e]
266 <<
"; 0;"<<SSBType<<
"\n" ;
270 ofile<<
"0, "<<i<<positionAndCopyN
271 <<resultPhysTable[i][j][
e]
272 <<
"; 0;"<<SSBType<<
"\n" ;
276 if(resultChemTable[i][j].empty())
281 for(
int ee = 0; ee < resultChemTable[i][j].size(); ++ee)
285 ofile<<
"2, "<<i<<positionAndCopyN
286 <<resultChemTable[i][j][ee]
287 <<
"; 1;"<<SSBType<<
"\n" ;
291 ofile<<
"0, "<<i<<positionAndCopyN
292 <<resultChemTable[i][j][ee]
293 <<
"; 1;"<<SSBType<<
"\n" ;