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
a512080d
Commit
a512080d
authored
8 months ago
by
Pierre Morfouace
Browse files
Options
Downloads
Patches
Plain Diff
starting spline correction for Z
parent
53fbf529
No related branches found
No related tags found
1 merge request
!27
Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPLib/Detectors/PISTA/TICPhysics.cxx
+34
-6
34 additions, 6 deletions
NPLib/Detectors/PISTA/TICPhysics.cxx
NPLib/Detectors/PISTA/TICPhysics.h
+5
-0
5 additions, 0 deletions
NPLib/Detectors/PISTA/TICPhysics.h
with
39 additions
and
6 deletions
NPLib/Detectors/PISTA/TICPhysics.cxx
+
34
−
6
View file @
a512080d
...
...
@@ -47,6 +47,7 @@ TICPhysics::TICPhysics()
m_PreTreatedData
(
new
TICData
),
m_EventPhysics
(
this
),
m_FPMW_Section
(
-
1
),
m_Z_SPLINE_CORRECTION
(
false
),
m_NumberOfDetectors
(
0
){
}
...
...
@@ -91,28 +92,33 @@ void TICPhysics::BuildPhysicalEvent() {
fIC_raw
[
i
]
=
m_PreTreatedData
->
GetIC_Charge
(
i
);
fIC
[
i
]
=
gain
*
m_PreTreatedData
->
GetIC_Charge
(
i
);
//fIC[i] = m_PreTreatedData->GetIC_Charge(i);
}
if
(
fIC
[
1
]
>
0
&&
fIC
[
5
]
>
0
){
DE
=
0.5
*
(
fIC_raw
[
0
]
+
fIC_raw
[
1
]
+
fIC_raw
[
2
]
+
fIC_raw
[
3
])
+
fIC_raw
[
4
];
Eres
=
fIC_raw
[
5
]
+
fIC_raw
[
6
]
+
fIC_raw
[
7
]
+
fIC_raw
[
8
]
+
fIC_raw
[
9
];
double
scalor
=
Cal
->
GetValue
(
"IC/ETOT_SCALING
"
,
0
);
double
scalor
=
Cal
->
GetValue
(
"IC/ETOT_SCALING
_SEC"
+
NPL
::
itoa
(
m_FPMW_Section
)
,
0
);
for
(
int
i
=
0
;
i
<
10
;
i
++
){
Etot
+=
fIC
[
i
];
}
Etot
=
scalor
*
Etot
;
//DE = 0.5*(fIC[0] + fIC[1] + fIC[2] + fIC[3]) + fIC[4];
//Eres = fIC[5] + fIC[6] + fIC[7] + fIC[8] + fIC[9];
//Etot = 0.02411*(0.8686*fIC_raw[0]+0.7199*fIC_raw[1]+0.6233*fIC_raw[2]+0.4697*fIC_raw[3]+0.9787*fIC_raw[4]+0.9892*fIC_raw[5]+2.1038*fIC_raw[6]+1.9429*fIC_raw[7]+1.754*fIC_raw[8]+2.5*fIC_raw[9]);
if
(
m_Z_SPLINE_CORRECTION
&&
Eres
>
3000
&&
Eres
<
15000
){
Chio_Z
=
DE
*
m_Zspline
->
Eval
(
8000
)
/
m_Zspline
->
Eval
(
Eres
);
}
else
Chio_Z
=
-
1000
;
}
else
{
DE
=
-
100
;
Eres
=
-
100
;
Etot
=
-
100
;
Chio_Z
=
-
1000
;
}
m_FPMW_Section
=
-
1
;
...
...
@@ -191,7 +197,12 @@ void TICPhysics::ReadAnalysisConfig() {
m_E_Threshold
=
atof
(
DataBuffer
.
c_str
());
cout
<<
whatToDo
<<
" "
<<
m_E_Threshold
<<
endl
;
}
else
if
(
whatToDo
==
"LOAD_Z_SPLINE"
){
AnalysisConfigFile
>>
DataBuffer
;
m_Z_SPLINE_PATH
=
DataBuffer
;
cout
<<
"*** Loading Z spline ***"
<<
endl
;
LoadZSpline
();
}
else
{
ReadingStatus
=
false
;
}
...
...
@@ -200,11 +211,28 @@ void TICPhysics::ReadAnalysisConfig() {
}
///////////////////////////////////////////////////////////////////////////
void
TICPhysics
::
LoadZSpline
(){
TString
filename
=
m_Z_SPLINE_PATH
;
TFile
*
ifile
=
new
TFile
(
filename
,
"read"
);
if
(
ifile
->
IsOpen
()){
m_Z_SPLINE_CORRECTION
=
true
;
m_Zspline
=
(
TSpline3
*
)
ifile
->
FindObjectAny
(
"Z_spline"
);
cout
<<
"*** "
<<
m_Zspline
->
GetName
()
<<
" is loaded!"
<<
endl
;
}
else
cout
<<
"File "
<<
filename
<<
" not found!"
<<
endl
;
ifile
->
Close
();
}
///////////////////////////////////////////////////////////////////////////
void
TICPhysics
::
Clear
()
{
DE
=
0
;
Eres
=
0
;
Etot
=
0
;
Chio_Z
=
0
;
for
(
int
i
=
0
;
i
<
11
;
i
++
){
fIC
[
i
]
=
0
;
fIC_raw
[
i
]
=
0
;
...
...
@@ -253,11 +281,11 @@ void TICPhysics::AddParameterToCalibrationManager() {
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
for
(
int
section
=
0
;
section
<
20
;
section
++
){
Cal
->
AddParameter
(
"IC"
,
"ETOT_SCALING_SEC"
+
NPL
::
itoa
(
section
),
"IC_ETOT_SCALING_SEC"
+
NPL
::
itoa
(
section
));
for
(
int
segment
=
0
;
segment
<
11
;
segment
++
){
Cal
->
AddParameter
(
"IC"
,
"SEC"
+
NPL
::
itoa
(
section
)
+
"_SEG"
+
NPL
::
itoa
(
segment
+
1
)
+
"_ALIGN"
,
"IC_SEC"
+
NPL
::
itoa
(
section
)
+
"_SEG"
+
NPL
::
itoa
(
segment
+
1
)
+
"_ALIGN"
);
}
}
Cal
->
AddParameter
(
"IC"
,
"ETOT_SCALING"
,
"IC_ETOT_SCALING"
);
}
///////////////////////////////////////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
NPLib/Detectors/PISTA/TICPhysics.h
+
5
−
0
View file @
a512080d
...
...
@@ -64,6 +64,7 @@ class TICPhysics : public TObject, public NPL::VDetector {
double
DE
;
double
Eres
;
double
Etot
;
double
Chio_Z
;
double
fIC
[
11
];
double
fIC_raw
[
11
];
//!
private
:
...
...
@@ -128,6 +129,7 @@ class TICPhysics : public TObject, public NPL::VDetector {
void
SetFPMWSection
(
int
section
)
{
m_FPMW_Section
=
section
;}
int
GetFPMWSection
()
{
return
m_FPMW_Section
;}
void
LoadZSpline
();
// objects are not written in the TTree
private
:
...
...
@@ -148,6 +150,9 @@ class TICPhysics : public TObject, public NPL::VDetector {
private
:
int
m_NumberOfDetectors
;
//!
int
m_FPMW_Section
;
//!
string
m_Z_SPLINE_PATH
;
//!
bool
m_Z_SPLINE_CORRECTION
;
//!
TSpline3
*
m_Zspline
;
//!
// Static constructor to be passed to the Detector Factory
public
:
...
...
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