ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsTruth
src
decoratorUtils.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ACTSTRACK_SAFEDECORATOR_H
6
#define ACTSTRACK_SAFEDECORATOR_H
10
11
12
13
#include "
AthContainers/AuxElement.h
"
14
#include "
StoreGate/WriteDecorHandleKey.h
"
15
#include "
StoreGate/WriteDecorHandle.h
"
16
#include "
StoreGate/ReadDecorHandleKey.h
"
17
#include "
StoreGate/ReadDecorHandle.h
"
18
#include "GaudiKernel/EventContext.h"
19
20
#include <iostream>
21
#include <utility>
22
#include <vector>
23
24
#include <cstdlib>
25
26
namespace
ActsTrk
{
27
28
// convenience method to create several decorator handles from keys
29
template
<
class
T_Cont,
class
T>
30
std::vector<SG::WriteDecorHandle<T_Cont,T> >
31
createDecorators
(
const
std::vector<
SG::WriteDecorHandleKey<T_Cont>
> &keys,
32
const
EventContext &ctx) {
33
std::vector<SG::WriteDecorHandle<T_Cont,T> > out;
34
out.reserve(keys.size());
35
for
(
const
SG::WriteDecorHandleKey<T_Cont>
&a_key : keys) {
36
out.emplace_back(a_key,ctx);
37
if
(not out.back().isValid()) {
38
std::stringstream
msg
;
39
msg
<<
"Failed to create decorator handdle "
<< a_key.key();
40
throw
std::runtime_error(
msg
.str() );
41
}
42
}
43
return
out;
44
}
45
46
47
// convenience method to create several decorator handle keys.
48
template
<
class
T_Parent,
class
T_Cont>
49
void
createDecoratorKeys
(T_Parent &parent,
50
const
SG::ReadHandleKey<T_Cont>
&container_key,
51
const
std::string &prefix,
52
const
std::vector<std::string> &decor_names,
53
std::vector<
SG::WriteDecorHandleKey<T_Cont>
> &decor_out) {
54
decor_out.clear();
55
decor_out.reserve(decor_names.size());
56
for
(
const
std::string &a_decor_name : decor_names) {
57
assert( !a_decor_name.empty() );
58
decor_out.emplace_back(container_key.
key
()+
"."
+prefix+a_decor_name);
59
// need to declare handles, otherwise the scheduler would not pick up the data dependencies
60
// introduced by the decorations
61
parent.declare(decor_out.back());
62
decor_out.back().setOwner(&parent);
63
decor_out.back().initialize().ignore();
64
}
65
}
66
}
67
#endif
AuxElement.h
Base class for elements of a container that can have aux data.
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
ReadDecorHandle.h
Handle class for reading a decoration on an object.
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition
StoreGate/StoreGate/WriteDecorHandleKey.h:90
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::createDecoratorKeys
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)
Definition
decoratorUtils.h:49
ActsTrk::createDecorators
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
Definition
decoratorUtils.h:31
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0