Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
17aeb99a
Commit
17aeb99a
authored
8 years ago
by
moukaddam
Browse files
Options
Downloads
Patches
Plain Diff
Adding a user-defined thickness of dead layer in the SimpleCalibration method
parent
d6bf6631
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPLib/Calibration/NPSiliconCalibrator.cxx
+15
-7
15 additions, 7 deletions
NPLib/Calibration/NPSiliconCalibrator.cxx
NPLib/Calibration/NPSiliconCalibrator.h
+1
-1
1 addition, 1 deletion
NPLib/Calibration/NPSiliconCalibrator.h
with
16 additions
and
8 deletions
NPLib/Calibration/NPSiliconCalibrator.cxx
+
15
−
7
View file @
17aeb99a
...
...
@@ -24,7 +24,7 @@ NPL::SiliconCalibrator::~SiliconCalibrator(){
}
//////////////////////////////////////////////
double
NPL
::
SiliconCalibrator
::
ZeroExtrapolation
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
unsigned
int
pedestal
,
unsigned
int
max_iteration
,
double
rmin
,
double
rmax
){
double
NPL
::
SiliconCalibrator
::
ZeroExtrapolation
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
unsigned
int
pedestal
,
unsigned
int
max_iteration
,
double
rmin
,
double
rmax
){
if
(
histo
->
GetEntries
()
==
0
){
coeff
.
clear
();
coeff
.
push_back
(
0
);
...
...
@@ -134,7 +134,7 @@ double NPL::SiliconCalibrator::ZeroExtrapolation(TH1* histo, NPL::CalibrationSou
return
Assume_Thickness
/
micrometer
;
}
////////////////////////////////////////////////////////////////////////////////
double
NPL
::
SiliconCalibrator
::
SimpleCalibration
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
double
rmin
,
double
rmax
){
double
NPL
::
SiliconCalibrator
::
SimpleCalibration
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
double
Assume_Thickness
,
double
rmin
,
double
rmax
){
if
(
histo
->
GetEntries
()
==
0
){
coeff
.
clear
();
coeff
.
push_back
(
0
);
...
...
@@ -157,7 +157,7 @@ double NPL::SiliconCalibrator::SimpleCalibration(TH1* histo, NPL::CalibrationSou
}
}
if
(
counts
<
3
0
){
if
(
counts
==
0
){
coeff
.
clear
();
coeff
.
push_back
(
0
);
coeff
.
push_back
(
-
1
);
...
...
@@ -175,14 +175,22 @@ double NPL::SiliconCalibrator::SimpleCalibration(TH1* histo, NPL::CalibrationSou
Source_E
[
i
]
=
CS
->
GetEnergies
()[
i
][
0
];
Source_Sig
[
i
]
=
CS
->
GetEnergiesErrors
()[
i
][
0
];
}
// Compute the new assumed energies
vector
<
double
>
Assume_E
;
// Energie calculated assuming Assume_Thickness deadlayer of Al
Assume_E
.
resize
(
source_size
,
0
);
for
(
unsigned
int
i
=
0
;
i
<
source_size
;
i
++
){
Assume_E
[
i
]
=
EL
->
Slow
(
Source_E
[
i
],
Assume_Thickness
,
0
);
// Assume_Thickness in micrometer
}
TGraphErrors
*
g
=
FitSpectrum
(
histo
,
rmin
,
rmax
);
double
dist
=
FitPoints
(
g
,
Source_E
,
Source_Sig
,
coeff
,
0
);
double
DistanceToPedestal
=
FitPoints
(
g
,
&
Assume_E
[
0
]
,
Source_Sig
,
coeff
,
0
);
delete
g
;
if
(
d
ist
!=-
3
)
return
abs
(
d
ist
);
if
(
D
ist
anceToPedestal
!=-
3
)
return
abs
(
D
ist
anceToPedestal
);
else
return
d
ist
;
return
D
ist
anceToPedestal
;
}
...
...
This diff is collapsed.
Click to expand it.
NPLib/Calibration/NPSiliconCalibrator.h
+
1
−
1
View file @
17aeb99a
...
...
@@ -26,7 +26,7 @@ namespace NPL{
// Use the Zero Extrapolation method to perform fit and return the dead layer thickness
double
ZeroExtrapolation
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
unsigned
int
pedestal
,
unsigned
int
max_iteration
=
10000
,
double
rmin
=-
1
,
double
rmax
=-
1
);
double
SimpleCalibration
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
double
rmin
=-
1
,
double
rmax
=-
1
);
double
SimpleCalibration
(
TH1
*
histo
,
NPL
::
CalibrationSource
*
CS
,
NPL
::
EnergyLoss
*
EL
,
vector
<
double
>&
coeff
,
double
Assume_Thickness
=
0
,
double
rmin
=-
1
,
double
rmax
=-
1
);
// Return distance to pedestal. Use energies in Energies to perform fit and fill coeff with the results
double
FitPoints
(
TGraphErrors
*
Graph
,
double
*
Energies
,
double
*
ErrEnergies
,
vector
<
double
>&
coeff
,
double
pedestal
=
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment