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
75567f75
Commit
75567f75
authored
1 month ago
by
Theodore Efremov
Browse files
Options
Downloads
Patches
Plain Diff
[AlPhaPha] Added loading of generic vector feature and loading of the eval of the zspline
parent
0d108535
No related branches found
No related tags found
No related merge requests found
Pipeline
#385651
canceled
1 month ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPLib/Detectors/PISTA/TICPhysics.cxx
+54
-3
54 additions, 3 deletions
NPLib/Detectors/PISTA/TICPhysics.cxx
NPLib/Detectors/PISTA/TICPhysics.h
+5
-1
5 additions, 1 deletion
NPLib/Detectors/PISTA/TICPhysics.h
with
59 additions
and
4 deletions
NPLib/Detectors/PISTA/TICPhysics.cxx
+
54
−
3
View file @
75567f75
...
...
@@ -300,6 +300,14 @@ void TICPhysics::ReadAnalysisConfig() {
cout
<<
"*** Loading Z spline ***"
<<
endl
;
m_Z_SPLINE_CORRECTION
=
LoadSpline
(
m_Zspline
,
m_number_zspline
,
m_Z_SPLINE_PATH
);
}
else
if
(
whatToDo
==
"LOAD_Z_SPLINE_EVAL"
){
AnalysisConfigFile
>>
DataBuffer
;
m_Z_SPLINE_EVAL_PATH
=
DataBuffer
;
cout
<<
"*** Loading Z spline eval position***"
<<
endl
;
m_Z_SPLINE_EVAL
=
LoadVector
(
m_Z_spline_eval
,
m_Z_SPLINE_EVAL_PATH
);
}
else
{
ReadingStatus
=
false
;
}
...
...
@@ -342,14 +350,57 @@ bool TICPhysics::LoadSpline(vector<TSpline3*> &iSpline, int &NSpline , string Pa
}
}
///////////////////////////////////////////////////////////////////////////
template
<
typename
T
>
bool
TICPhysics
::
LoadVector
(
vector
<
T
>
&
vec
,
const
string
&
Path
){
std
::
ifstream
file
(
Path
);
if
(
!
file
.
is_open
())
{
return
false
;
// File couldn't be opened
}
T
value
;
vec
.
clear
();
std
::
string
line
;
while
(
std
::
getline
(
file
,
line
))
{
std
::
istringstream
iss
(
line
);
while
(
iss
>>
value
)
{
vec
.
push_back
(
value
);
}
}
file
.
close
();
return
!
vec
.
empty
();
}
///////////////////////////////////////////////////////////////////////////
double
TICPhysics
::
ApplyZSpline
(){
double
DEcorr
;
double
FF_DEcorr0
[
m_number_zspline
];
for
(
int
i
=
0
;
i
<
m_number_zspline
;
i
++
){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
8500
);
}
if
(
m_Z_SPLINE_EVAL
==
true
){
for
(
int
i
=
0
;
i
<
m_number_zspline
;
i
++
){
cout
<<
m_Z_spline_eval
[
i
]
<<
endl
;
if
(
i
<
m_Z_spline_eval
.
size
()){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
m_Z_spline_eval
[
i
]);
}
else
if
(
m_Data_Year
==
2024
){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
12000
);
}
else
if
(
m_Data_Year
==
2023
){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
8500
);
}
}
// end loop spline
}
// end cond spline eval
else
if
(
m_Data_Year
==
2023
){
for
(
int
i
=
0
;
i
<
m_number_zspline
;
i
++
){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
8500
);
}
}
else
if
(
m_Data_Year
==
2024
){
for
(
int
i
=
0
;
i
<
m_number_zspline
;
i
++
){
FF_DEcorr0
[
i
]
=
m_Zspline
[
i
]
->
Eval
(
12000
);
}
}
double
DEspline0
;
double
Eval_DEspline
;
int
index
=
0
;
...
...
This diff is collapsed.
Click to expand it.
NPLib/Detectors/PISTA/TICPhysics.h
+
5
−
1
View file @
75567f75
...
...
@@ -150,6 +150,7 @@ class TICPhysics : public TObject, public NPL::VDetector {
double
GetY
()
{
return
m_Y
;}
bool
LoadSpline
(
vector
<
TSpline3
*>
&
iSpline
,
int
&
NSpline
,
string
Path
);
template
<
typename
T
>
bool
LoadVector
(
vector
<
T
>
&
vec
,
const
string
&
Path
);
double
ApplyZSpline
();
void
ApplyXYCorrections
();
...
...
@@ -170,8 +171,11 @@ class TICPhysics : public TObject, public NPL::VDetector {
int
m_FPMW_Section
;
//!
int
m_number_zspline
;
//!
string
m_Z_SPLINE_PATH
;
//!
bool
m_Z_SPLINE_CORRECTION
;
//!
string
m_Z_SPLINE_EVAL_PATH
;
//!
bool
m_Z_SPLINE_CORRECTION
=
false
;
//!
bool
m_Z_SPLINE_EVAL
=
false
;
//!
vector
<
TSpline3
*>
m_Zspline
=
vector
<
TSpline3
*>
(
50
);
//!
vector
<
Double_t
>
m_Z_spline_eval
;
//!
double
m_Eres_Threshold
;
//!
//Time temporary variable
...
...
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