LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
convert.C
Go to the documentation of this file.
1
void
ReadASCII
(TString source_file_ascii, TString output_file_root)
2
{
3
4
// This macro converts the results of the simulation stored in ASCII files to ROOT files.
5
ifstream
in
;
6
in.open(source_file_ascii);
7
8
Float_t
x
,
y
,
z
,
edep
;
9
Int_t
nlines
= 0;
10
TFile *
f
=
new
TFile(output_file_root,
"RECREATE"
);
11
TH2F *
h20
=
new
TH2F(
"h20"
,
"h20"
,801,-100.125,100.125, 801, -100.125, 100.125);
12
13
while
(1) {
14
in >> x >> y >> z >>
edep
;
15
if
(!in.good())
break
;
16
// if (edep !=0.) printf("x=%8f, y=%8f, edep=%8f\n",x,y,edep);
17
18
h20->Fill(x,y,edep);
19
nlines++;
20
}
21
printf
(
" found %d points\n"
,nlines);
22
23
in.close();
24
25
f->Write();
26
}
x
Float_t x
Definition:
compare.C:6
y
Float_t y
Definition:
compare.C:6
z
Double_t z
Definition:
plot.C:276
f
TFile f
Definition:
plotHisto.C:6
nlines
nlines
Definition:
comparison_ascii.C:57
printf
printf("%d Experimental points found\n", nlines)
ReadASCII
void ReadASCII(TString source_file_ascii, TString output_file_root)
Definition:
convert.C:1
edep
Double_t edep
Definition:
macro.C:13
in
ifstream in
Definition:
comparison.C:7
h20
TH1F * h20
Definition:
plot.C:45
geant4.10.06.p01
examples
advanced
brachytherapy
comparison
convert.C
Generated on Thu May 2 2024 20:59:32 for LArSoft by
1.8.11