ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
EventBookkeeperTools
EventBookkeeperTools
CutBookkeepersLocalCache.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef EVENT_BOOKKEEPER_TOOLS__CUT_BOOKKEEPERS_LOCAL_CACHE_H
6
#define EVENT_BOOKKEEPER_TOOLS__CUT_BOOKKEEPERS_LOCAL_CACHE_H
7
9
#include <
xAODCutFlow/CutBookkeeperContainer.h
>
10
#include <
xAODCutFlow/CutBookkeeperAuxContainer.h
>
11
12
14
struct
CutBookkeepersLocalCache
final
15
{
16
std::vector<std::unique_ptr<xAOD::CutBookkeeperContainer>>
cont
;
17
std::vector<std::unique_ptr<xAOD::CutBookkeeperAuxContainer>>
aux
;
18
19
bool
empty
()
const
{
return
cont
.empty(); }
20
std::size_t
size
()
const
{
return
cont
.size(); }
21
xAOD::CutBookkeeperContainer
*
at
(std::size_t n)
const
{
return
cont
.at(n).get(); }
22
void
clear
() {
cont
.clear();
aux
.clear(); }
23
24
// Helper function to initialise the cache
25
static
void
prepareContainers
(
CutBookkeepersLocalCache
&target,
26
size_t
size
,
27
bool
extend =
false
)
28
{
29
if
(!target.empty() && !extend) {
30
return
;
31
}
32
33
size_t
toAdd =
size
- target.size();
34
for
(std::size_t i = 0; i < toAdd; ++i) {
35
auto
container = std::make_unique<xAOD::CutBookkeeperContainer>();
36
auto
auxContainer = std::make_unique<xAOD::CutBookkeeperAuxContainer>();
37
container->
setStore
(auxContainer.get());
38
target.cont.push_back(std::move(container));
39
target.aux.push_back(std::move(auxContainer));
40
}
41
}
42
};
43
44
#endif
// EVENT_BOOKKEEPER_TOOLS__CUT_BOOKKEEPERS_LOCAL_CACHE_H
CutBookkeeperAuxContainer.h
CutBookkeeperContainer.h
SG::AuxVectorData::setStore
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
Definition
AuxVectorData.cxx:116
xAOD::CutBookkeeperContainer
CutBookkeeperContainer_v1 CutBookkeeperContainer
Define the latest version of the CutBookkeeperContainer class.
Definition
CutBookkeeperContainer.h:18
CutBookkeepersLocalCache
Helper in-memory structure.
Definition
CutBookkeepersLocalCache.h:15
CutBookkeepersLocalCache::clear
void clear()
Definition
CutBookkeepersLocalCache.h:22
CutBookkeepersLocalCache::empty
bool empty() const
Definition
CutBookkeepersLocalCache.h:19
CutBookkeepersLocalCache::cont
std::vector< std::unique_ptr< xAOD::CutBookkeeperContainer > > cont
Definition
CutBookkeepersLocalCache.h:16
CutBookkeepersLocalCache::size
std::size_t size() const
Definition
CutBookkeepersLocalCache.h:20
CutBookkeepersLocalCache::aux
std::vector< std::unique_ptr< xAOD::CutBookkeeperAuxContainer > > aux
Definition
CutBookkeepersLocalCache.h:17
CutBookkeepersLocalCache::at
xAOD::CutBookkeeperContainer * at(std::size_t n) const
Definition
CutBookkeepersLocalCache.h:21
CutBookkeepersLocalCache::prepareContainers
static void prepareContainers(CutBookkeepersLocalCache &target, size_t size, bool extend=false)
Definition
CutBookkeepersLocalCache.h:25
Generated on
for ATLAS Offline Software by
1.17.0