Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AculUtils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AccullinaGroup
AculUtils
Commits
f2af59b6
Commit
f2af59b6
authored
Oct 05, 2016
by
Kostyleva D.A
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To function AculCalibration::PeaksFitting trying to add output txt file
parent
0d57c4c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
AculCalibration.cpp
AculData/AculCalibration.cpp
+22
-2
No files found.
AculData/AculCalibration.cpp
View file @
f2af59b6
...
...
@@ -143,7 +143,24 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
if
(
peaksNumber
!=
kRaNOPEAKS
)
{
Info
(
"PeaksFitting"
,
"In histogram %s was found %d peaks"
,
hSpectrum
->
GetName
(),
peaksNumber
);
return
1
;
}
//creation of output text file with positions of peaks in MeV
TString
workFile
;
//if ( (lowersubaddress == 0) && (uppersubaddress == ADDRESSNUMBER-1) ) { oFileName.Form("%s[].cal", block); }
//else {
//if (lowersubaddress == uppersubaddress) { oFileName.Form("%s[%d].cal", block, lowersubaddress); }
//else { oFileName.Form("%s[%d-%d].cal", block, lowersubaddress, uppersubaddress); }
//}
workFile
.
Form
(
"energies.txt"
);
ofstream
outenergfile
;
outenergfile
.
open
(
workFile
.
Data
());
if
(
!
outenergfile
.
is_open
())
{
Error
(
"PeaksFitting"
,
"Output file %s was not opened"
,
workFile
.
Data
());
return
0
;
}
//should be optional output
Info
(
"PeaksFitting"
,
"Number of peaks in %s: %d"
,
hSpectrum
->
GetName
(),
peaksNumber
);
...
...
@@ -238,7 +255,9 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
for
(
Int_t
i
=
0
;
i
<
peaksNumber
;
i
++
)
{
printf
(
"
\t
Peak position is
\t
%f
\n
"
,
fPeak
[
i
]);
}
}
}
outenergfile
<<
hSpectrum
->
GetName
()
<<
"
\t
"
<<
fPeak
[
0
]
<<
"
\t
"
<<
fPeak
[
1
]
<<
"
\t
"
<<
fPeak
[
2
]
<<
"
\t
"
<<
fPeak
[
3
]
<<
endl
;
// provest kontrolu pomerne polohy piku,
// jestli jsou spatne, provest urcita opatreni,
...
...
@@ -253,7 +272,8 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
return
2
;
}
}
//for
outenergfile
.
close
();
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment