Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Computing
cbmroot
Commits
57dcd2c7
Commit
57dcd2c7
authored
1 year ago
by
Sergey Gorbunov
Browse files
Options
Downloads
Patches
Plain Diff
Kf refit: proper initialization of the no-field case
parent
043446e8
No related branches found
No related tags found
1 merge request
!1904
Ca: update of the track fit utilities
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
algo/ca/core/pars/CaField.cxx
+4
-1
4 additions, 1 deletion
algo/ca/core/pars/CaField.cxx
algo/ca/core/pars/CaField.h
+14
-5
14 additions, 5 deletions
algo/ca/core/pars/CaField.h
reco/L1/catools/CaToolsField.h
+6
-1
6 additions, 1 deletion
reco/L1/catools/CaToolsField.h
with
24 additions
and
7 deletions
algo/ca/core/pars/CaField.cxx
+
4
−
1
View file @
57dcd2c7
...
...
@@ -17,13 +17,16 @@ using namespace cbm::algo::ca;
//
template
<
typename
DataT
>
bool
FieldRegion
<
DataT
>::
fgForceUseOfOriginalField
=
false
;
template
<
typename
DataT
>
std
::
function
<
std
::
tuple
<
double
,
double
,
double
>
(
double
x
,
double
y
,
double
z
)
>
FieldRegion
<
DataT
>::
fgO
d
iginalField
([](
double
,
double
,
double
)
{
FieldRegion
<
DataT
>::
fgO
r
iginalField
([](
double
,
double
,
double
)
{
assert
(
false
&&
"ca::FieldRegion: The original field is not set, use cbm::ca::tools::SetCbmField()"
);
return
std
::
tuple
(
kfdefs
::
Undef
<
double
>
,
kfdefs
::
Undef
<
double
>
,
kfdefs
::
Undef
<
double
>
);
});
template
<
typename
DataT
>
bool
FieldRegion
<
DataT
>::
fgIsZeroOriginalField
=
false
;
//----------------------------------------------------------------------------------------------------------------------
//
...
...
This diff is collapsed.
Click to expand it.
algo/ca/core/pars/CaField.h
+
14
−
5
View file @
57dcd2c7
...
...
@@ -220,7 +220,13 @@ namespace cbm::algo::ca
FieldValue
<
DataT
>
Get
(
const
DataT
&
x
,
const
DataT
&
y
,
const
DataT
&
z
)
const
;
/// Is the field region empty?
bool
IsZeroField
()
const
{
return
fIsZeroField
;
}
bool
IsZeroField
()
const
{
if
(
fgForceUseOfOriginalField
||
fUseOriginalField
)
{
return
fgIsZeroOriginalField
;
}
return
fIsZeroField
;
}
/// Interpolates the magnetic field by three nodal points and sets the result to this FieldRegion object
/// The result is a quadratic interpolation of the field as a function of z
...
...
@@ -278,9 +284,11 @@ namespace cbm::algo::ca
static
void
ForceUseOfOriginalField
(
bool
v
=
true
)
{
fgForceUseOfOriginalField
=
v
;
}
/// Set the original field
static
void
SetOriginalField
(
std
::
function
<
std
::
tuple
<
double
,
double
,
double
>
(
double
x
,
double
y
,
double
z
)
>
f
)
static
void
SetOriginalField
(
std
::
function
<
std
::
tuple
<
double
,
double
,
double
>
(
double
x
,
double
y
,
double
z
)
>
f
,
bool
isZeroField
)
{
fgOdiginalField
=
f
;
fgOriginalField
=
f
;
fgIsZeroOriginalField
=
isZeroField
;
}
/// \brief Copies all/one entries from the other class
...
...
@@ -295,7 +303,8 @@ namespace cbm::algo::ca
public
:
static
bool
fgForceUseOfOriginalField
;
static
std
::
function
<
std
::
tuple
<
double
,
double
,
double
>
(
double
x
,
double
y
,
double
z
)
>
fgOdiginalField
;
static
std
::
function
<
std
::
tuple
<
double
,
double
,
double
>
(
double
x
,
double
y
,
double
z
)
>
fgOriginalField
;
static
bool
fgIsZeroOriginalField
;
// TODO: Probably it's better to have arrays instead of separate fvec values? (S.Zharko)
// Bx(z) = cx0 + cx1*(z-z0) + cx2*(z-z0)^2
...
...
@@ -368,7 +377,7 @@ namespace cbm::algo::ca
}
// CopyBase
/// \brief Explicit instantiation declarations for FieldRegion class with specific template types to ensure proper fgO
d
iginalField definition
/// \brief Explicit instantiation declarations for FieldRegion class with specific template types to ensure proper fgO
r
iginalField definition
extern
template
class
FieldRegion
<
fvec
>;
extern
template
class
FieldRegion
<
float
>;
extern
template
class
FieldRegion
<
double
>;
...
...
This diff is collapsed.
Click to expand it.
reco/L1/catools/CaToolsField.h
+
6
−
1
View file @
57dcd2c7
...
...
@@ -37,7 +37,12 @@ namespace cbm::ca::tools
return
std
::
tuple
(
0.
,
0.
,
0.
);
}
};
ca
::
FieldRegion
<
ca
::
fvec
>::
SetOriginalField
(
fld
);
if
(
FairRunAna
::
Instance
()
->
GetField
())
{
ca
::
FieldRegion
<
ca
::
fvec
>::
SetOriginalField
(
fld
,
false
);
}
else
{
ca
::
FieldRegion
<
ca
::
fvec
>::
SetOriginalField
(
fld
,
true
);
}
}
}
// namespace cbm::ca::tools
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