Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NeuRad_tests
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
0
Merge Requests
0
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
Vratislav Chudoba
NeuRad_tests
Commits
bab4d184
Commit
bab4d184
authored
Feb 17, 2017
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some scripts changed. Probably also optimized.
parent
73459264
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
21 deletions
+64
-21
cal1ePeaks.cxx
macros_W/cal1ePeaks.cxx
+15
-9
calPeaksVoltage.cxx
macros_W/calPeaksVoltage.cxx
+22
-3
extract1DHists.cxx
macros_W/extract1DHists.cxx
+6
-5
showHistOutput.cxx
macros_W/showHistOutput.cxx
+21
-4
No files found.
macros_W/cal1ePeaks.cxx
View file @
bab4d184
...
...
@@ -7,35 +7,37 @@ void cal1ePeaks()
{
TString
location
=
"../data/WPT_tests"
;
TString
suffix
=
"_nonLin"
;
//name of input root file
TString
iFile
;
iFile
.
Form
(
"%s/680pF_11okt_measure_with_opt_grease/HV1000_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000
.root"
,
location
.
Data
());
iFile
.
Form
(
"%s/680pF_11okt_measure_with_opt_grease/HV1000_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000
%s.root"
,
location
.
Data
(),
suffix
.
Data
());
// iFile.Form("%s/680pF_11okt_measure_with_opt_grease/HV950_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000.root", location.Data());
// iFile.Form("%s/680pF_11okt_measure_with_opt_grease/HV900_Sci_mounted_Am241in_front_10cm_thr28_nxtrim1_11oct_30min_0000.root", location.Data());
//name of file with calibration parameters
TString
oFile
=
"cal1e_HV1000.par"
;
TString
oFile
=
"cal1e_HV1000
_nonLin
.par"
;
// TString oFile = "cal1e_HV950.par";
// TString oFile = "cal1e_HV900.par";
//name of file with peak ranges
TString
pFile
=
"peaksRange1000HV.par"
;
TString
pFile
=
"
../parameters/
peaksRange1000HV.par"
;
// TString pFile = "../parameters/peaksRange950HV.par";
// TString pFile = "";
//2D histogram to be calibrated
// TString histName = "adcAllWoBaseline";
TString
histName
=
"fhCalAdcAllWoBaselineNonLinear"
;
ofstream
calFile
;
calFile
.
open
(
oFile
.
Data
());
if
(
calFile
.
is_open
())
{
Info
(
"cal
Peaks
"
,
"Calibration parameters will be saved in %s."
,
oFile
.
Data
());
Info
(
"cal
1ePeaks.cxx
"
,
"Calibration parameters will be saved in %s."
,
oFile
.
Data
());
}
else
{
Error
(
"cal
Peaks
"
,
"File %s was not open."
,
oFile
.
Data
());
Error
(
"cal
1ePeaks.cxx
"
,
"File %s was not open."
,
oFile
.
Data
());
return
;
}
//2D histogram to be calibrated
TString
histName
=
"adcAllWoBaseline"
;
//xaxis range
const
Double_t
xmin
=
0
;
const
Double_t
xmax
=
600.
;
...
...
@@ -47,7 +49,7 @@ void cal1ePeaks()
if
(
useParFile
)
{
parFile
.
open
(
pFile
.
Data
());
if
(
!
parFile
.
is_open
())
{
Error
(
"cal
Peaks
"
,
"File with input parameters %s was not open."
,
pFile
.
Data
());
Error
(
"cal
1ePeaks.cxx
"
,
"File with input parameters %s was not open."
,
pFile
.
Data
());
return
;
}
Info
(
"calPeaks"
,
"File with peak ranges %s will be loaded."
,
pFile
.
Data
());
...
...
@@ -56,6 +58,10 @@ void cal1ePeaks()
///////////////////////////////////////////////////////////
TFile
*
fr
=
new
TFile
(
iFile
.
Data
());
if
(
fr
->
IsZombie
())
{
Error
(
"cal1ePeaks.cxx"
,
"Files %s was not open."
,
iFile
.
Data
());
return
;
}
TH2D
*
h2
=
(
TH2D
*
)
fr
->
Get
(
histName
.
Data
());
...
...
macros_W/calPeaksVoltage.cxx
View file @
bab4d184
...
...
@@ -2,15 +2,19 @@
#include <vector> // std::vector
#include <algorithm>
using
namespace
std
;
void
calPeaksVoltage
()
{
TString
inFile
=
"histOutput680.root"
;
TString
inFile
=
"
parameters/
histOutput680.root"
;
// TString inFile = "histOutput.root";
TString
outFile
=
"calGraphs680.root"
;
TString
outFile
=
"
../parameters/
calGraphs680.root"
;
// TString outFile = "calGraphs.root";
TString
outPeaksFile
=
"parameters/halfVoltPositions680.par"
;
TFile
*
fr
=
new
TFile
(
inFile
.
Data
());
if
(
fr
->
IsZombie
())
{
Error
(
"calPeaksVoltage.cxx"
,
"File %s was not open correctly."
,
inFile
.
Data
());
...
...
@@ -42,7 +46,14 @@ void calPeaksVoltage()
cWork
[
i
]
->
cd
(
1
);
}
ofstream
calFile
;
calFile
.
open
(
outPeaksFile
.
Data
());
if
(
calFile
.
is_open
())
{
Info
(
"calPeaksVoltage.cxx"
,
"Positions of 0.5V peak will be saved in %s."
,
outPeaksFile
.
Data
());
}
else
{
Error
(
"calPeaksVoltage.cxx"
,
"File %s was not open."
,
outPeaksFile
.
Data
());
return
;
}
TFile
fw
(
outFile
.
Data
(),
"RECREATE"
);
if
(
fw
.
IsZombie
())
{
...
...
@@ -51,6 +62,8 @@ void calPeaksVoltage()
}
TString
gName
;
Double_t
x
,
y
;
for
(
Int_t
i
=
0
;
i
<
64
;
i
++
)
{
hch
[
i
]
->
GetXaxis
()
->
SetRangeUser
(
100
,
2000
);
Int_t
cNumber
=
i
/
6
;
...
...
@@ -60,6 +73,10 @@ void calPeaksVoltage()
if
(
i
==
42
)
{
gr
[
i
]
=
searchPeaks
(
hch
[
i
],
0.08
);
}
//take a peak corresponding to 0.5 V for 680 pF
gr
[
i
]
->
GetPoint
(
1
,
x
,
y
);
calFile
<<
i
<<
"
\t
"
<<
x
<<
endl
;
// cout << i << "\t" << x << endl;
fw
.
cd
();
gName
.
Form
(
"gcal%d"
,
i
);
gr
[
i
]
->
SetName
(
gName
.
Data
());
...
...
@@ -68,6 +85,8 @@ void calPeaksVoltage()
fw
.
Close
();
calFile
.
close
();
return
;
}
...
...
macros_W/extract1DHists.cxx
View file @
bab4d184
...
...
@@ -3,17 +3,18 @@ void extract1DHists()
//output in channel units
// TString outputFile = "histOutput.root";
// TString outputFile = "
histOutput680.root";
TString
outputFile
=
"parameters/
histOutput680.root"
;
//output in 1e units
TString
outputFile
=
"histOutput1e.root"
;
// TString outputFile = "histOutput1e_HV1000.root";
// TString outputFile = "histOutput1e_HV950.root";
// TString histName = "adcAllWoBaseline";
TString
histName
=
"adcAllWoBaseline"
;
// TString histName = "cal1eAdcAllWoBaseline";
TString
location
=
"../data/WPT_tests"
;
//
TString suffix = "";
TString
suffix
=
"_HV1000"
;
TString
suffix
=
""
;
//
TString suffix = "_HV1000";
TString
f0
,
f1
,
f2
,
f3
,
f4
,
f10
,
f11
,
f12
,
f13
,
...
...
macros_W/showHistOutput.cxx
View file @
bab4d184
void
showHistOutput
()
{
TFile
*
fr
=
new
TFile
(
"histOutput.root"
);
//channel units
//TString fName = "histOutput.root";
// TString fName = "histOutput680.root";
TString
fName
=
"histOutput47.root"
;
const
Double_t
xmin
=
100.
;
const
Double_t
xmax
=
2000.
;
//1e units
// TString fName = "histOutput1e_HV1000.root";
//TString fName = "histOutput1e_HV950.root";
// const Double_t xmin = 0.5;
// const Double_t xmax = 12.;
TFile
*
fr
=
new
TFile
(
fName
.
Data
());
if
(
fr
->
IsZombie
())
{
Error
(
"showHistOutput.cxx"
,
"Files %s was not open."
,
fName
.
Data
());
return
;
}
TH1D
*
hch
[
64
];
TString
histName
;
...
...
@@ -17,9 +37,6 @@ void showHistOutput()
const
Int_t
pads
=
9
;
const
Int_t
noCanvas
=
64
/
pads
+
1
;
const
Double_t
xmin
=
100
;
const
Double_t
xmax
=
2000.
;
TCanvas
*
cWork
[
noCanvas
];
for
(
Int_t
i
=
0
;
i
<
noCanvas
;
i
++
)
{
cName
.
Form
(
"can%d"
,
i
);
...
...
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