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
96f90f16
Commit
96f90f16
authored
2 years ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
DigiManager: Add function to access digi branch as array.
parent
b2439e1a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1068
DigiManager: Add function to access digi branch as array.
Pipeline
#20746
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/base/CMakeLists.txt
+15
-13
15 additions, 13 deletions
core/base/CMakeLists.txt
core/base/CbmDigiManager.h
+20
-0
20 additions, 0 deletions
core/base/CbmDigiManager.h
reco/detectors/sts/CbmRecoSts.cxx
+2
-3
2 additions, 3 deletions
reco/detectors/sts/CbmRecoSts.cxx
with
37 additions
and
16 deletions
core/base/CMakeLists.txt
+
15
−
13
View file @
96f90f16
...
...
@@ -17,11 +17,11 @@ set(SRCS
CbmMatchRecoToMC.cxx
CbmTrackingDetectorInterfaceBase.cxx
draw/CbmDrawHist.cxx
report/CbmReport.cxx
report/CbmReport.cxx
report/CbmStudyReport.cxx
report/CbmSimulationReport.cxx
report/CbmTextReportElement.cxx
report/CbmHtmlReportElement.cxx
report/CbmHtmlReportElement.cxx
report/CbmLatexReportElement.cxx
utils/CbmUtils.cxx
utils/CbmGeometryUtils.cxx
...
...
@@ -32,22 +32,24 @@ set(SRCS
set
(
LIBRARY_NAME CbmBase
)
set
(
LINKDEF
${
LIBRARY_NAME
}
LinkDef.h
)
set
(
PUBLIC_DEPENDENCIES
CbmData
set
(
PUBLIC_DEPENDENCIES
CbmData
FairRoot::Base
ROOT::Core
ROOT::Gpad
GSL
ROOT::Core
ROOT::Gpad
ROOT::Hist
)
set
(
PRIVATE_DEPENDENCIES
FairLogger::FairLogger
FairRoot::GeoBase
set
(
PRIVATE_DEPENDENCIES
FairLogger::FairLogger
FairRoot::GeoBase
Boost::filesystem
ROOT::Geom
ROOT::Graf
ROOT::MathCore
ROOT::RIO
ROOT::Geom
ROOT::Graf
ROOT::MathCore
ROOT::RIO
ROOT::Tree
)
...
...
This diff is collapsed.
Click to expand it.
core/base/CbmDigiManager.h
+
20
−
0
View file @
96f90f16
...
...
@@ -23,6 +23,7 @@
#include
<boost/any.hpp>
// for any_cast, bad_any_cast (ptr...
#include
<boost/exception/exception.hpp>
// for clone_impl, error_info_inje...
#include
<gsl/span>
#include
<iosfwd>
// for string
#include
<map>
// for map, map<>::mapped_type
#include
<vector>
// for vector
...
...
@@ -69,6 +70,25 @@ public:
return
nullptr
;
}
template
<
class
Digi
>
gsl
::
span
<
const
Digi
>
GetArray
()
const
{
assert
(
fIsInitialised
);
ECbmModuleId
system
=
Digi
::
GetSystem
();
auto
branch
=
fBranches
.
find
(
system
);
if
(
branch
==
fBranches
.
end
())
{
LOG
(
error
)
<<
"Failed to find branch for Digi of type "
<<
Digi
::
GetClassName
();
return
{};
}
boost
::
any
container
=
branch
->
second
->
GetBranchContainer
();
LOG_IF
(
fatal
,
container
.
type
()
!=
typeid
(
const
std
::
vector
<
Digi
>*
))
<<
"Digis of type "
<<
Digi
::
GetClassName
()
<<
" not stored with std::vector"
;
return
*
boost
::
any_cast
<
const
std
::
vector
<
Digi
>*>
(
container
);
}
/** @brief Access to a digi branch
** @param system System identifier
** @return Digi branch
...
...
This diff is collapsed.
Click to expand it.
reco/detectors/sts/CbmRecoSts.cxx
+
2
−
3
View file @
96f90f16
...
...
@@ -518,14 +518,13 @@ void CbmRecoSts::ProcessData(CbmEvent* event)
// --- Number of input digis
fTimer
.
Start
();
Int_t
nDigis
=
(
event
?
event
->
GetNofData
(
ECbmDataType
::
kStsDigi
)
:
fDigiManager
->
GetNofDigis
(
ECbmModuleId
::
kSts
));
auto
digis
=
fDigiManager
->
GetArray
<
CbmStsDigi
>
();
// --- Distribute digis to modules
//#pragma omp parallel for schedule(static) if(fParallelism_enabled)
for
(
Int_t
iDigi
=
0
;
iDigi
<
nDigis
;
iDigi
++
)
{
Int_t
digiIndex
=
(
event
?
event
->
GetIndex
(
ECbmDataType
::
kStsDigi
,
iDigi
)
:
iDigi
);
const
CbmStsDigi
*
digi
=
fDigiManager
->
Get
<
const
CbmStsDigi
>
(
digiIndex
);
assert
(
digi
);
const
CbmStsDigi
*
digi
=
&
digis
[
digiIndex
];
// Check system ID. There are pulser digis in which will be ignored here.
Int_t
systemId
=
CbmAddress
::
GetSystemId
(
digi
->
GetAddress
());
...
...
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