14#include <TVirtualCollectionProxy.h>
15#include <TGenCollectionProxy.h>
28 ATH_MSG_DEBUG(
"Will be fixing dynamic variables in container(s):" );
33 std::vector< std::string > keys(
m_constKeys.size() );
36 return key.key(); } );
44 return StatusCode::SUCCESS;
51 auto ioHandles =
m_ioKeys.makeHandles();
52 assert( constHandles.size() == ioHandles.size() );
55 for( std::size_t i = 0; i < constHandles.size(); ++i ) {
64 if( constHandle->size() == 0 ) {
69 const std::string& cname = constHandle.
key();
70 const size_t size = constHandle->size();
74 for(
SG::auxid_t auxid : ioHandle->getDynamicAuxIDs() ) {
81 << reg.getName( auxid ) <<
"\"" );
84 const void* vecPtr = ioHandle->getIOData( auxid );
93 ::TVirtualCollectionProxy* proxy = cl->GetCollectionProxy();
95 ATH_MSG_FATAL(
"Couldn't get collection proxy for variable \""
96 << reg.getName( auxid ) <<
"\"" );
97 return StatusCode::FAILURE;
101 ::TVirtualCollectionProxy::TPushPop helper( proxy,
106 if( proxy->Size() == size ) {
110 << reg.getName( auxid ) <<
"\": "
115 ::TGenCollectionProxy* genProxy =
116 dynamic_cast< ::TGenCollectionProxy*
>( proxy );
119 <<
"\" doesn't have a TGenCollectionProxy. "
120 <<
"Variable not fixed!" );
125 static const ::Bool_t FORCE_DELETE = kFALSE;
126 genProxy->Resize( size, FORCE_DELETE );
128 << reg.getName( auxid ) <<
"\" after resize: "
130 ATH_MSG_DEBUG(
"Fixed variable: \"" << cname << reg.getName( auxid )
136 return StatusCode::SUCCESS;
153 if(
m_dicts.size() <= auxid ) {
154 m_dicts.resize( auxid + 1,
nullptr );
157 m_noDict.resize( auxid + 1,
false );
162 static const ::Bool_t LOAD = kTRUE;
163 static const ::Bool_t SILENT = kTRUE;
164 ::TClass* cl = ::TClass::GetClass( reg.getVecTypeName( auxid ).c_str(),
172 << reg.getName( auxid ) <<
"\"" );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Handle mappings between names and auxid_t.
Handle class for reading from StoreGate.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
std::vector< bool > m_noDict
Flag showing which variables don't have a dictionary for them.
SG::ReadHandleKeyArray< SG::IConstAuxStore > m_constKeys
Containers to access with the SG::IConstAuxStore interface.
StatusCode execute() override
Function executing the algorithm.
::TClass * getClass(SG::auxid_t auxid)
Get the dictionary describing an auxiliary vector variable.
StatusCode initialize() override
Function initialising the algorithm.
SG::ReadHandleKeyArray< SG::IAuxStoreIO > m_ioKeys
Containers to access with the SG::IAuxStoreIO interface.
std::vector< ::TClass * > m_dicts
Cache of the dictionaries used.
size_t auxid_t
Identifier for a particular aux data item.