Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project Juggler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
Project Juggler
Commits
080bc329
Commit
080bc329
authored
Oct 30, 2021
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Modifications for podio-0.14 (mainly CollectionsBase)
parent
435b50d3
No related branches found
No related tags found
1 merge request
!342
Modifications for podio-0.14 (mainly CollectionsBase)
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+7
-2
7 additions, 2 deletions
CMakeLists.txt
JugBase/src/components/PodioOutput.cpp
+29
-6
29 additions, 6 deletions
JugBase/src/components/PodioOutput.cpp
JugBase/src/components/rootutils.h
+21
-8
21 additions, 8 deletions
JugBase/src/components/rootutils.h
with
57 additions
and
16 deletions
CMakeLists.txt
+
7
−
2
View file @
080bc329
cmake_minimum_required
(
VERSION 3.1
2
)
cmake_minimum_required
(
VERSION 3.1
9
)
# CMP0074: find_package() uses <PackageName>_ROOT variables
# CMP0074: find_package() uses <PackageName>_ROOT variables
cmake_policy
(
SET CMP0074 NEW
)
cmake_policy
(
SET CMP0074 NEW
)
...
@@ -9,7 +9,12 @@ set(CMAKE_CXX_STANDARD 17)
...
@@ -9,7 +9,12 @@ set(CMAKE_CXX_STANDARD 17)
find_package
(
EICD REQUIRED
)
find_package
(
EICD REQUIRED
)
find_package
(
NPDet REQUIRED
)
find_package
(
NPDet REQUIRED
)
find_package
(
podio 0.11.0 REQUIRED
)
find_package
(
podio 0.11...0.14 REQUIRED
)
add_definitions
(
"-Dpodio_VERSION_MAJOR=
${
podio_VERSION_MAJOR
}
"
)
add_definitions
(
"-Dpodio_VERSION_MINOR=
${
podio_VERSION_MINOR
}
"
)
add_definitions
(
"-Dpodio_VERSION_PATCH=
${
podio_VERSION_PATCH
}
"
)
find_package
(
ROOT COMPONENTS Core RIO Tree MathCore GenVector Geom REQUIRED
)
find_package
(
ROOT COMPONENTS Core RIO Tree MathCore GenVector Geom REQUIRED
)
find_package
(
DD4hep COMPONENTS DDG4 DDG4IO DDRec REQUIRED
)
find_package
(
DD4hep COMPONENTS DDG4 DDG4IO DDRec REQUIRED
)
find_package
(
Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep PluginJson
)
find_package
(
Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep PluginJson
)
...
...
This diff is collapsed.
Click to expand it.
JugBase/src/components/PodioOutput.cpp
+
29
−
6
View file @
080bc329
#include
"PodioOutput.h"
#include
"PodioOutput.h"
#include
"podio/podioVersion.h"
#include
"GaudiKernel/ISvcLocator.h"
#include
"GaudiKernel/ISvcLocator.h"
#include
"JugBase/PodioDataSvc.h"
#include
"JugBase/PodioDataSvc.h"
#include
"TFile.h"
#include
"TFile.h"
...
@@ -32,10 +33,21 @@ StatusCode PodioOutput::initialize() {
...
@@ -32,10 +33,21 @@ StatusCode PodioOutput::initialize() {
void
PodioOutput
::
resetBranches
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
podio
::
CollectionBase
*>>&
collections
)
{
void
PodioOutput
::
resetBranches
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
podio
::
CollectionBase
*>>&
collections
)
{
for
(
auto
&
[
collName
,
collBuffers
]
:
collections
)
{
for
(
auto
&
[
collName
,
collBuffers
]
:
collections
)
{
#if podio_VERSION_MAJOR == 0 && podio_VERSION_MINOR < 14
auto
data
=
collBuffers
->
getBufferAddress
();
auto
references
=
collBuffers
->
referenceCollections
();
auto
vecmembers
=
collBuffers
->
vectorMembers
();
#else
auto
buffers
=
collBuffers
->
getBuffers
();
auto
data
=
buffers
.
data
;
auto
references
=
buffers
.
references
;
auto
vecmembers
=
buffers
.
vectorMembers
;
#endif
if
(
m_switch
.
isOn
(
collName
))
{
if
(
m_switch
.
isOn
(
collName
))
{
// Reconnect branches and collections
// Reconnect branches and collections
m_datatree
->
SetBranchAddress
(
collName
.
c_str
(),
collBuffers
->
getBufferAddress
()
);
m_datatree
->
SetBranchAddress
(
collName
.
c_str
(),
data
);
auto
colls
=
collBuffers
->
referenceCollections
()
;
auto
colls
=
references
;
if
(
colls
)
{
if
(
colls
)
{
int
j
=
0
;
int
j
=
0
;
for
(
auto
&
c
:
(
*
colls
))
{
for
(
auto
&
c
:
(
*
colls
))
{
...
@@ -44,7 +56,7 @@ void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::
...
@@ -44,7 +56,7 @@ void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::
++
j
;
++
j
;
}
}
}
}
auto
colls_v
=
collBuffers
->
vectorM
embers
()
;
auto
colls_v
=
vecm
embers
;
if
(
colls_v
)
{
if
(
colls_v
)
{
int
j
=
0
;
int
j
=
0
;
for
(
auto
&
[
dataType
,
add
]
:
(
*
colls_v
))
{
for
(
auto
&
[
dataType
,
add
]
:
(
*
colls_v
))
{
...
@@ -60,15 +72,26 @@ void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::
...
@@ -60,15 +72,26 @@ void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::
void
PodioOutput
::
createBranches
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
podio
::
CollectionBase
*>>&
collections
)
{
void
PodioOutput
::
createBranches
(
const
std
::
vector
<
std
::
pair
<
std
::
string
,
podio
::
CollectionBase
*>>&
collections
)
{
for
(
auto
&
[
collName
,
collBuffers
]
:
collections
)
{
for
(
auto
&
[
collName
,
collBuffers
]
:
collections
)
{
#if podio_VERSION_MAJOR == 0 && podio_VERSION_MINOR < 14
auto
data
=
collBuffers
->
getBufferAddress
();
auto
references
=
collBuffers
->
referenceCollections
();
auto
vecmembers
=
collBuffers
->
vectorMembers
();
#else
auto
buffers
=
collBuffers
->
getBuffers
();
auto
data
=
buffers
.
data
;
auto
references
=
buffers
.
references
;
auto
vecmembers
=
buffers
.
vectorMembers
;
#endif
const
std
::
string
className
=
collBuffers
->
getValueTypeName
();
const
std
::
string
className
=
collBuffers
->
getValueTypeName
();
const
std
::
string
collClassName
=
"vector<"
+
className
+
"Data>"
;
const
std
::
string
collClassName
=
"vector<"
+
className
+
"Data>"
;
int
isOn
=
0
;
int
isOn
=
0
;
if
(
m_switch
.
isOn
(
collName
))
{
if
(
m_switch
.
isOn
(
collName
))
{
isOn
=
1
;
isOn
=
1
;
m_datatree
->
Branch
(
collName
.
c_str
(),
collClassName
.
c_str
(),
collBuffers
->
getBufferAddress
()
);
m_datatree
->
Branch
(
collName
.
c_str
(),
collClassName
.
c_str
(),
data
);
// Create branches for collections holding relations
// Create branches for collections holding relations
if
(
auto
refColls
=
collBuffers
->
referenceCollections
()
)
{
if
(
auto
refColls
=
references
)
{
int
j
=
0
;
int
j
=
0
;
for
(
auto
&
c
:
(
*
refColls
))
{
for
(
auto
&
c
:
(
*
refColls
))
{
const
auto
brName
=
podio
::
root_utils
::
refBranch
(
collName
,
j
);
const
auto
brName
=
podio
::
root_utils
::
refBranch
(
collName
,
j
);
...
@@ -77,7 +100,7 @@ void PodioOutput::createBranches(const std::vector<std::pair<std::string, podio:
...
@@ -77,7 +100,7 @@ void PodioOutput::createBranches(const std::vector<std::pair<std::string, podio:
}
}
}
}
// vector members
// vector members
if
(
auto
vminfo
=
collBuffers
->
vectorM
embers
()
)
{
if
(
auto
vminfo
=
vecm
embers
)
{
int
j
=
0
;
int
j
=
0
;
for
(
auto
&
[
dataType
,
add
]
:
(
*
vminfo
))
{
for
(
auto
&
[
dataType
,
add
]
:
(
*
vminfo
))
{
const
std
::
string
typeName
=
"vector<"
+
dataType
+
">"
;
const
std
::
string
typeName
=
"vector<"
+
dataType
+
">"
;
...
...
This diff is collapsed.
Click to expand it.
JugBase/src/components/rootutils.h
+
21
−
8
View file @
080bc329
#ifndef PODIO_ROOT_UTILS_H
#ifndef PODIO_ROOT_UTILS_H
#define PODIO_ROOT_UTILS_H
#define PODIO_ROOT_UTILS_H
#include
"podio/podioVersion.h"
#include
"podio/CollectionBase.h"
#include
"podio/CollectionBase.h"
#include
"podio/CollectionBranches.h"
#include
"podio/CollectionBranches.h"
...
@@ -28,19 +29,30 @@ inline std::string vecBranch(const std::string& name, size_t index) {
...
@@ -28,19 +29,30 @@ inline std::string vecBranch(const std::string& name, size_t index) {
inline
void
setCollectionAddresses
(
podio
::
CollectionBase
*
collection
,
const
CollectionBranches
&
branches
)
{
inline
void
setCollectionAddresses
(
podio
::
CollectionBase
*
collection
,
const
CollectionBranches
&
branches
)
{
if
(
auto
buffer
=
collection
->
getBufferAddress
())
{
#if podio_VERSION_MAJOR == 0 && podio_VERSION_MINOR < 14
branches
.
data
->
SetAddress
(
buffer
);
auto
data
=
collection
->
getBufferAddress
();
auto
references
=
collection
->
referenceCollections
();
auto
vecmembers
=
collection
->
vectorMembers
();
#else
auto
buffers
=
collection
->
getBuffers
();
auto
data
=
buffers
.
data
;
auto
references
=
buffers
.
references
;
auto
vecmembers
=
buffers
.
vectorMembers
;
#endif
if
(
data
)
{
branches
.
data
->
SetAddress
(
data
);
}
}
if
(
auto
refCollections
=
collection
->
referenceCollections
()
)
{
if
(
references
)
{
for
(
size_t
i
=
0
;
i
<
ref
Collection
s
->
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
ref
erence
s
->
size
();
++
i
)
{
branches
.
refs
[
i
]
->
SetAddress
(
&
(
*
ref
Collection
s
)[
i
]);
branches
.
refs
[
i
]
->
SetAddress
(
&
(
*
ref
erence
s
)[
i
]);
}
}
}
}
if
(
auto
vecMembers
=
collection
->
vectorM
embers
()
)
{
if
(
vecm
embers
)
{
for
(
size_t
i
=
0
;
i
<
vec
M
embers
->
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
vec
m
embers
->
size
();
++
i
)
{
branches
.
vecs
[
i
]
->
SetAddress
((
*
vec
M
embers
)[
i
].
second
);
branches
.
vecs
[
i
]
->
SetAddress
((
*
vec
m
embers
)[
i
].
second
);
}
}
}
}
}
}
...
@@ -48,3 +60,4 @@ inline void setCollectionAddresses(podio::CollectionBase* collection, const Coll
...
@@ -48,3 +60,4 @@ inline void setCollectionAddresses(podio::CollectionBase* collection, const Coll
}
}
#endif
#endif
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