30#include "GaudiKernel/MsgStream.h"
60StatusCode print_vec (MsgStream& log,
62 const std::string& key,
63 const std::string& context)
67 log << MSG::INFO << key <<
" not in SG; ignored." <<
endmsg;
68 return StatusCode::SUCCESS;
73 std::ostringstream ost;
75 for (
unsigned i=0; i <
vec->size(); i++)
76 ost << (*
vec)[i]->m_x <<
" ";
77 log << MSG::INFO << ost.str() <<
endmsg;
79 return StatusCode::SUCCESS;
85 const std::string& key,
86 const std::string& context)
90 std::vector<ElementLink<BVec> >
el =
vec->m_el;
91 std::ostringstream
ost;
93 for (
size_t i = 0;
i <
el.size();
i++) {
94 const DMTest::B*
b = *
el[
i];
99 return StatusCode::SUCCESS;
103StatusCode remap_test (MsgStream& log, StoreGateSvc* sg)
108 ElementLinkCnv_p3<ElementLink<BVec> > elcnv;
109 std::vector<ElementLink<BVec> > el2;
110 el2.resize (
vec->m_el2_p.size());
111 for (
size_t i=0;
i <
vec->m_el2_p.size();
i++)
114 std::ostringstream ost1;
115 ost1 <<
"elv_remap: ";
116 for (
size_t i = 0;
i < el2.size();
i++) {
117 const DMTest::B*
b = *el2[
i];
118 ost1 <<
b->m_x <<
" ";
120 log << MSG::INFO << ost1.str() <<
endmsg;
122 ElementLinkVectorCnv_p1<ElementLinkVector<BVec> > elvcnv;
123 ElementLinkVector<BVec> elv2;
126 std::ostringstream ost2;
127 ost2 <<
"elv_remap v2: ";
128 for (
size_t i = 0;
i < elv2.
size();
i++) {
129 const DMTest::B*
b = *elv2[
i];
130 ost2 <<
b->m_x <<
" ";
132 log << MSG::INFO << ost2.str() <<
endmsg;
134 DataLinkCnv_p1<DataLink<BVec> > dlcnv;
135 std::vector<DataLink<BVec> > dl2;
136 dl2.resize (
vec->m_dl2_p.size());
137 for (
size_t i=0;
i <
vec->m_dl2_p.size();
i++)
142 assert (dl2[0].cptr() == b3);
143 assert (dl2[1].cptr() == b3);
145 return StatusCode::SUCCESS;
160 CHECK( print_vec<BVec> (
msg(), sg,
"bvec", name()) );
161 CHECK( print_vec<BDer> (
msg(), sg,
"bder", name()) );
162 CHECK( print_vec<DVec> (
msg(), sg,
"dvec", name()) );
163 CHECK( print_vec<DDer> (
msg(), sg,
"dder", name()) );
166 CHECK( print_vec<BVec> (
msg(), sg,
"bder", name()) );
167 CHECK( print_vec<BVec> (
msg(), sg,
"dvec", name()) );
168 CHECK( print_vec<BVec> (
msg(), sg,
"dder", name()) );
169 CHECK( print_vec<DVec> (
msg(), sg,
"dder", name()) );
171 CHECK( print_elvec (
msg(), sg,
"elvec", name()) );
175 return StatusCode::SUCCESS;
std::vector< size_t > vec
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
This file contains the class definition for the DataLinkCnv_p1 class and DataLinkVectorCnv_p1 class.
Class used for testing the new DataVector inheritance scheme.
Class used for testing the new DataVector inheritance scheme.
Class used for testing the new DataVector inheritance scheme.
Class used for testing new ElementLink.
This file contains the class definition for the ElementLinkCnv_p3 class.
This file contains the class definition for the ElementLinkVectorCnv_p1 class.
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
static std::string name()
Return the name of class T as a string.
DMTestRead(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode execute() override
Algorithm event processing.
virtual void persToTrans(const PersDLink_t *pers, DLink_t *trans, MsgStream &log) const override
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
void persToTrans(const PersLinkVect_t &pers, LinkVect_t &trans, MsgStream &log) const
The Athena Transient Store API.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
DataVector< DMTest::B > BVec
A DataVector containing the base class, B.
::StatusCode StatusCode
StatusCode definition for legacy code.