44 return StatusCode::SUCCESS;
55 static const C::Accessor<int> anInt2 (
"anInt2");
56 static const C::Accessor<int> anInt10 (
"anInt10");
57 static const C::Accessor<int> dInt1 (
"dInt1");
58 static const C::Accessor<int> dInt100 (
"dInt100");
59 static const C::Accessor<int> dInt150 (
"dInt150");
60 static const C::Accessor<int> dInt200 (
"dInt200");
64 std::vector<std::string> names;
70 names.push_back (
r.getName(auxid));
74 for (
const C* c : *ctrig) {
75 std::ostringstream ost;
76 std::print (ost,
" anInt1 {} aFloat: {} anInt2: {} dInt1: {}",
77 c->anInt(), c->aFloat(), anInt2(*c), dInt1(*c));
78 if (dInt100.isAvailable(*c))
79 std::print (ost,
" dInt100: {}", dInt100(*c));
80 if (dInt150.isAvailable(*c))
81 std::print (ost,
" dInt150: {}", dInt150(*c));
82 if (dInt200.isAvailable(*c))
83 std::print (ost,
" dInt200: {}", dInt200(*c));
84 if (anInt10.isAvailable(*c))
85 std::print (ost,
" anInt10: {}", anInt10(*c));
90 auto ctrignew = std::make_unique<CVec>();
91 auto trig_store = std::make_unique<CTrigAuxContainer>();
92 ctrignew->setStore (trig_store.get());
93 for (
size_t i = 0; i < ctrig->size(); i++) {
94 ctrignew->push_back (
new C);
95 *ctrignew->back() = *(*ctrig)[i];
99 std::move(trig_store)) );
109 return StatusCode::SUCCESS;
120 static const C::Accessor<int> anInt10 (
"anInt10");
121 std::ostringstream ost;
123 for (
const C* c : *
vec) {
124 std::print (ost,
" {}", c->anInt());
125 if (anInt10.isAvailable(*c))
126 std::print (ost,
"({})", anInt10(*c));
131 auto vecnew = std::make_unique<CVecWithData>();
132 auto store = std::make_unique<CAuxContainer>();
133 vecnew->setStore (store.get());
134 for (
size_t i = 0; i <
vec->size(); i++) {
135 vecnew->push_back (
new C);
136 *vecnew->back() = *(*vec)[i];
143 return StatusCode::SUCCESS;
155 std::vector<std::string> names;
157 names.push_back (
r.getName(auxid));
159 std::ostringstream ost3;
160 std::println (ost3,
"gvec aux items: {:n:s}", names);
161 for (
const G* g : *gvec) {
162 std::println (ost3,
" anInt {} gFloat {} gvFloat {:n}",
163 g->anInt(), g->gFloat(), g->gvFloat());
168 auto gvecnew = std::make_unique<GVec>();
169 auto gstore = std::make_unique<GAuxContainer>();
170 gvecnew->setStore (gstore.get());
171 for (
size_t i = 0; i < gvec->size(); i++) {
172 gvecnew->push_back (
new G);
173 *gvecnew->back() = *(*gvec)[i];
177 std::move(gstore)) );
180 return StatusCode::SUCCESS;
188StatusCode xAODTestRead::read_cview()
const
191 ATH_MSG_INFO(
"(No {}cview view container.)", m_readPrefix );
192 return StatusCode::SUCCESS;
195 const CView* cview =
nullptr;
196 static const C::Accessor<int> anInt10 (
"anInt10");
197 CHECK(
evtStore()->retrieve (cview, m_readPrefix +
"cview") );
198 std::ostringstream ost;
199 std::print (ost,
"{}cview:", m_readPrefix);
200 for (
const C* c : *cview) {
201 std::print (ost,
" {}", c->anInt());
202 if (anInt10.isAvailable(*c))
203 std::print (ost,
"({})", anInt10(*c));
207 if (!m_writePrefix.empty()) {
210 m_writePrefix +
"cview", LOCKED));
213 return StatusCode::SUCCESS;
223 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
Handle mappings between names and auxid_t.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
Test writing a container with metadata.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
std::vector< size_t > vec
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Test for xAOD auto schema evolution.
Test for xAOD auto schema evolution.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
ServiceHandle< StoreGateSvc > & evtStore()
StatusCode read_cvec_with_data(const EventContext &ctx) const
Test reading container with additional data.
SG::WriteHandleKey< DMTest::CVec > m_ctrigWriteKey
SG::WriteHandleKey< DMTest::GVec > m_gvecWriteKey
SG::ReadHandleKey< DMTest::GVec > m_gvecReadKey
virtual StatusCode finalize() override
Algorithm finalization; called at the end of the job.
SG::WriteHandleKey< DMTest::CVecWithData > m_cvecWDWriteKey
StatusCode read_gvec(const EventContext &ctx) const
Test reading GVec object.
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
SG::ReadHandleKey< DMTest::CVecWithData > m_cvecWDReadKey
SG::ReadHandleKey< DMTest::CVec > m_ctrigReadKey
Test reading view container.
Handle mappings between names and auxid_t.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
size_t auxid_t
Identifier for a particular aux data item.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Algorithm to test reading xAOD data.