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
fb1b4379
Commit
fb1b4379
authored
7 months ago
by
Sergei Zharko
Browse files
Options
Downloads
Patches
Plain Diff
CbmEnumArray.h
parent
ca01620b
No related branches found
No related tags found
1 merge request
!1931
Adding KF-setup to the ca::Parameters
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/base/utils/CbmEnumArray.h
+58
-0
58 additions, 0 deletions
core/base/utils/CbmEnumArray.h
reco/kfnew/CbmKfTrackingSetupBuilder.cxx
+5
-7
5 additions, 7 deletions
reco/kfnew/CbmKfTrackingSetupBuilder.cxx
with
63 additions
and
7 deletions
core/base/utils/CbmEnumArray.h
0 → 100644
+
58
−
0
View file @
fb1b4379
/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Sergei Zharko [committer] */
/// @file CaEnumArray.h
/// @brief Array indexed by a generic enum class
/// @since 22.05.2024
/// @author Sergei Zharko <s.zharko@gsi.de>
#pragma once // include this header only once per compilation unit
#include
<boost/serialization/array.hpp>
#include
<boost/serialization/base_object.hpp>
#include
<array>
namespace
cbm
::
core
{
/// \class cbm::algo::ca::EnumArray
/// \brief Class of arrays, which can be accessed by an enum class entry as an index
/// \note The enum-array must contain an entry kEND, which represents the number of the enumeration entries and
/// is used, as an array size
/// \tparam E The enum class type
/// \tparam T Type of data in the underlying array
template
<
class
E
,
class
T
>
class
EnumArray
:
public
std
::
array
<
T
,
static_cast
<
std
::
size_t
>
(
E
::
END
)
>
{
using
U
=
typename
std
::
underlying_type
<
E
>::
type
;
///< Underlying type of enumeration
using
Arr
=
std
::
array
<
T
,
static_cast
<
std
::
size_t
>
(
E
::
END
)
>
;
public:
/// \brief Mutable access operator, indexed by enum entry
/// \param entry Enum entry for the element
T
&
operator
[](
const
E
&
entry
)
{
return
Arr
::
operator
[](
static_cast
<
U
>
(
entry
));
}
/// \brief Mutable access operator, indexed by underlying index type
/// \param index Index of the element
T
&
operator
[](
U
index
)
{
return
Arr
::
operator
[](
index
);
}
/// \brief Constant access operator, indexed by enum entry
/// \param entry Enum entry for the element
const
T
&
operator
[](
const
E
&
entry
)
const
{
return
Arr
::
operator
[](
static_cast
<
U
>
(
entry
));
}
/// \brief Constant access operator, indexed by underlying index type
/// \param index Index of the element
const
T
&
operator
[](
U
index
)
const
{
return
Arr
::
operator
[](
index
);
}
/// \brief Convertion operator to the base array class
operator
Arr
&
()
const
{
return
*
this
;
}
private
:
friend
class
boost
::
serialization
::
access
;
template
<
typename
Archive
>
void
serialize
(
Archive
&
ar
,
const
unsigned
int
/*version*/
)
{
ar
&
boost
::
serialization
::
base_object
<
Arr
>
(
*
this
);
}
};
}
// namespace cbm::core
This diff is collapsed.
Click to expand it.
reco/kfnew/CbmKfTrackingSetupBuilder.cxx
+
5
−
7
View file @
fb1b4379
...
...
@@ -73,13 +73,11 @@ try {
}
for
(
int
iSt
=
0
;
iSt
<
pIfs
->
GetNtrackingStations
();
++
iSt
)
{
fBuilder
.
AddLayer
(
GeoLayer
<
ETrackingDetID
>
{.
fDetID
=
detID
,
// ca::Tracking detector id scheme
.
fLocID
=
iSt
,
// ca::Tracking station indexing
.
fZref
=
pIfs
->
GetZref
(
iSt
),
.
fZmin
=
pIfs
->
GetZmin
(
iSt
),
.
fZmax
=
pIfs
->
GetZmax
(
iSt
),
.
fXmax
=
std
::
max
(
std
::
fabs
(
pIfs
->
GetXmin
(
iSt
)),
std
::
fabs
(
pIfs
->
GetXmax
(
iSt
))),
.
fYmax
=
std
::
max
(
std
::
fabs
(
pIfs
->
GetYmin
(
iSt
)),
std
::
fabs
(
pIfs
->
GetYmax
(
iSt
)))});
GeoLayer
<
ETrackingDetID
>
{
detID
,
// ca::Tracking detector id scheme
iSt
,
// ca::Tracking station indexing
pIfs
->
GetZref
(
iSt
),
pIfs
->
GetZmin
(
iSt
),
pIfs
->
GetZmax
(
iSt
),
std
::
max
(
std
::
fabs
(
pIfs
->
GetXmin
(
iSt
)),
std
::
fabs
(
pIfs
->
GetXmax
(
iSt
))),
std
::
max
(
std
::
fabs
(
pIfs
->
GetYmin
(
iSt
)),
std
::
fabs
(
pIfs
->
GetYmax
(
iSt
)))});
}
};
CollectStations
(
fbUseMvd
?
CbmMvdTrackingInterface
::
Instance
()
:
nullptr
,
ETrackingDetID
::
Mvd
);
...
...
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