LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
plot.C File Reference

Go to the source code of this file.

Typedefs

using Table = map< int, array< map< int, double >, 2 >>
 
using ResultTable = map< int, array< vector< int >, 2 >>
 

Functions

gStyle SetPalette (1)
 
gROOT SetStyle ("Plain")
 
 system ("rm -rf output.root")
 
 system ("hadd output.root output_*.root")
 
TFile f ("output.root")
 
tPhys SetBranchAddress ("x",&xphy)
 
tPhys SetBranchAddress ("y",&yphy)
 
tPhys SetBranchAddress ("z",&zphy)
 
tPhys SetBranchAddress ("edep",&EnergyDeposit)
 
tPhys SetBranchAddress ("diffKin",&kineticEnergyDifference)
 
tPhys SetBranchAddress ("volumeName",&flagVolume)
 
tPhys SetBranchAddress ("CopyNumber",&copyN)
 
tPhys SetBranchAddress ("EventID",&EventIDp)
 
 for (decltype(entryPhyNumber) i=0;i< entryPhyNumber;++i)
 
ofstream ofile ("SDDFormat.txt")
 
 if (ofile.is_open())
 
ofile close ()
 

Variables

TRandom rdomN
 
vector< MoleculefMolecules = molecule()
 
double xphy
 
double yphy
 
double zphy
 
double xChe
 
double yChe
 
double zChe
 
double xrad
 
double yrad
 
double zrad
 
map< int, int > CopyNumTable
 
Table physTable
 
ResultTable resultPhysTable
 
ResultTable resultChemTable
 
ResultTable MergedResultTable
 
double EnergyDeposit
 
double kineticEnergyDifference
 
int flagVolume
 
double copyN
 
int EventIDp
 
int EventIDc
 
TDirectoryFile * d = dynamic_cast<TDirectoryFile*>(f.Get("ntuple") )
 
TTree * tPhys = dynamic_cast<TTree*> (d->Get("ntuple_1") )
 
auto entryPhyNumber = tPhys->GetEntries()
 
bool addCopyN = true
 
TTree * tChem = dynamic_cast<TTree*> (d->Get("ntuple_2") )
 
auto entryNChem = tChem->GetEntries()
 

Typedef Documentation

using ResultTable = map<int,array<vector<int>, 2>>

Definition at line 19 of file plot.C.

using Table = map<int,array<map<int,double>, 2>>

Definition at line 18 of file plot.C.

Function Documentation

ofile close ( )
TFile f ( "output.root"  )
for ( )

Definition at line 66 of file plot.C.

References copyN, EnergyDeposit, EventIDp, and flagVolume.

67  {
68  tPhys->GetEntry(i);
69 //avoid histone
70  if(flagVolume == DNAVolumeType::histone)
71  {
72  continue;
73  }
74 //Determine the strand
75  int strand = -1;
76  bool isLeftStrand = DNAVolumeType::deoxyribose1 == flagVolume ||
77  DNAVolumeType::phosphate1 == flagVolume ||
78  DNAVolumeType::deoxyribose1_water == flagVolume ||
79  DNAVolumeType::phosphate1_water == flagVolume;
80 
81  bool isRightStrand = DNAVolumeType::deoxyribose2 == flagVolume ||
82  DNAVolumeType::phosphate2 == flagVolume ||
83  DNAVolumeType::deoxyribose2_water== flagVolume ||
84  DNAVolumeType::phosphate2_water == flagVolume;
85 
86 
87  if( isLeftStrand )
88  {
89  strand = 0;
90  }
91  else if( isRightStrand )
92  {
93  strand = 1;
94  }
95  else
96  {
97  //in case molecules are not assigned "strand"
98  continue;
99  }
100 
101 //Determine the name
102  bool isDeoxyribode = flagVolume == DNAVolumeType::deoxyribose1 ||
103  flagVolume == DNAVolumeType::deoxyribose2 ||
104  flagVolume == DNAVolumeType::deoxyribose1_water ||
105  flagVolume == DNAVolumeType::deoxyribose2_water;
106 
107  bool isPhosphate = flagVolume == DNAVolumeType::phosphate1 ||
108  flagVolume == DNAVolumeType::phosphate2 ||
109  flagVolume == DNAVolumeType::phosphate1_water||
110  flagVolume == DNAVolumeType::phosphate2_water;
111 
112  if(isDeoxyribode || isPhosphate)
113  {
114  physTable[EventIDp][strand][copyN] += EnergyDeposit;
115  }
116 
117  if(physTable[EventIDp][strand][copyN] < 17.5)
118  {
119  continue;
120  }
121 
122  if(CopyNumTable.empty())
123  {
124  CopyNumTable.insert(pair<int,int>(copyN,strand));
125  resultPhysTable[EventIDp][strand].push_back(copyN);
126  }
127  else
128  {
129  addCopyN = true;
130  }
131 
132  auto itCopyNumTable = CopyNumTable.find(copyN);
133  if (itCopyNumTable != CopyNumTable.end())
134  {
135  if (itCopyNumTable->second == strand)
136  {
137  addCopyN = false;
138  }
139  }
140 
141  if(addCopyN)
142  {
143  CopyNumTable.insert(pair<int,int>(copyN,strand));
144  resultPhysTable[EventIDp][strand].push_back(copyN);
145  }
146  }
map< int, int > CopyNumTable
Definition: plot.C:36
ResultTable resultPhysTable
Definition: plot.C:38
double copyN
Definition: plot.C:45
int EventIDp
Definition: plot.C:46
double EnergyDeposit
Definition: plot.C:42
bool addCopyN
Definition: plot.C:65
int flagVolume
Definition: plot.C:44
Table physTable
Definition: plot.C:37
TTree * tPhys
Definition: plot.C:53
if ( ofile.  is_open())

Definition at line 209 of file plot.C.

References e, and util::empty().

210  {
211  ofile<<'\n'
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"
232  <<"DNA Density, ;"
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"
239  <<"Time, 2.5ns;\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"
244  "for this file;\n"
245  <<"\n"
246  <<"***EndOfHeader***;\n"
247  <<endl;
248 //For detail, please refer to Schuemann, J., et al. (2019). A New Standard DNA
249 //Damage (SDD) Data Format. Radiation Research, 191(1), 76.
250 
251  bool Primaryflag = true;
252  for (int i = 0; i < 200; i++)//for 200 primary particles
253  {
254  for(int j = 0; j < 2; j++)//for strand
255  {
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())
259  {
260  for(int e = 0; e < resultPhysTable[i][j].size(); ++e)
261  {
262  if(Primaryflag)
263  {
264  ofile<<"2, "<<i<<positionAndCopyN
265  <<resultPhysTable[i][j][e]
266  <<"; 0;"<<SSBType<<"\n" ;//physics
267  Primaryflag = false;
268  }else
269  {
270  ofile<<"0, "<<i<<positionAndCopyN
271  <<resultPhysTable[i][j][e]
272  <<"; 0;"<<SSBType<<"\n" ;
273  }
274  }
275  }
276  if(resultChemTable[i][j].empty())
277  {
278  continue;
279  }
280 
281  for(int ee = 0; ee < resultChemTable[i][j].size(); ++ee)
282  {
283  if(Primaryflag)
284  {
285  ofile<<"2, "<<i<<positionAndCopyN
286  <<resultChemTable[i][j][ee]
287  <<"; 1;"<<SSBType<<"\n" ;//chemistry
288  Primaryflag = false;
289  }else
290  {
291  ofile<<"0, "<<i<<positionAndCopyN
292  <<resultChemTable[i][j][ee]
293  <<"; 1;"<<SSBType<<"\n" ;
294  }
295  }
296  }
297  }
298 
299  ofile<<endl;
300  }
ResultTable resultChemTable
Definition: plot.C:39
ResultTable resultPhysTable
Definition: plot.C:38
ofstream ofile("SDDFormat.txt")
Float_t e
Definition: plot.C:35
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
ofstream ofile ( "SDDFormat.txt"  )
tPhys SetBranchAddress ( "x"  ,
xphy 
)
tPhys SetBranchAddress ( "y"  ,
yphy 
)
tPhys SetBranchAddress ( "z"  ,
zphy 
)
tPhys SetBranchAddress ( "edep"  ,
EnergyDeposit 
)
tPhys SetBranchAddress ( "diffKin"  ,
kineticEnergyDifference 
)
tPhys SetBranchAddress ( "volumeName"  ,
flagVolume 
)
tPhys SetBranchAddress ( "CopyNumber"  ,
copyN 
)
tChem SetBranchAddress ( "EventID"  ,
EventIDp 
)
gStyle SetPalette ( )
gROOT SetStyle ( "Plain"  )
system ( "rm -rf output.root"  )
system ( "hadd output.root output_*.root"  )

Variable Documentation

bool addCopyN = true

Definition at line 65 of file plot.C.

double copyN

Definition at line 45 of file plot.C.

Referenced by for().

map<int,int> CopyNumTable

Definition at line 36 of file plot.C.

TDirectoryFile* d = dynamic_cast<TDirectoryFile*>(f.Get("ntuple") )

Definition at line 52 of file plot.C.

double EnergyDeposit

Definition at line 42 of file plot.C.

Referenced by for().

auto entryNChem = tChem->GetEntries()

Definition at line 154 of file plot.C.

auto entryPhyNumber = tPhys->GetEntries()

Definition at line 63 of file plot.C.

int EventIDc

Definition at line 47 of file plot.C.

int EventIDp

Definition at line 46 of file plot.C.

Referenced by for().

int flagVolume

Definition at line 44 of file plot.C.

Referenced by for().

vector<Molecule> fMolecules = molecule()

Definition at line 17 of file plot.C.

Referenced by molecule().

double kineticEnergyDifference

Definition at line 43 of file plot.C.

Referenced by plot().

ResultTable MergedResultTable

Definition at line 40 of file plot.C.

Table physTable

Definition at line 37 of file plot.C.

TRandom rdomN

Definition at line 15 of file plot.C.

ResultTable resultChemTable

Definition at line 39 of file plot.C.

ResultTable resultPhysTable

Definition at line 38 of file plot.C.

TTree* tChem = dynamic_cast<TTree*> (d->Get("ntuple_2") )

Definition at line 148 of file plot.C.

TTree* tPhys = dynamic_cast<TTree*> (d->Get("ntuple_1") )

Definition at line 53 of file plot.C.

double xChe

Definition at line 28 of file plot.C.

double xphy

Definition at line 24 of file plot.C.

double xrad

Definition at line 32 of file plot.C.

double yChe

Definition at line 29 of file plot.C.

double yphy

Definition at line 25 of file plot.C.

double yrad

Definition at line 33 of file plot.C.

double zChe

Definition at line 30 of file plot.C.

double zphy

Definition at line 26 of file plot.C.

double zrad

Definition at line 34 of file plot.C.