Commit b119e5d3 authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Stopped xAODWriterAlg from re-creating the output object type names on every event.

It was wasteful to call SG::normalizedTypeinfoName(...) as many times as the code did.
Now the algorithm just caches the type names of the written objects. Trading a little
bit of memory for less CPU cycles.


Former-commit-id: 7602a2433b08be69caa04fe10a4f17d734e515a2
parent b3a3e836
...@@ -94,8 +94,7 @@ namespace CP { ...@@ -94,8 +94,7 @@ namespace CP {
} }
// Record it to the output for the current event. // Record it to the output for the current event.
ANA_CHECK( m_event.record( const_cast< void* >( obj ), ANA_CHECK( m_event.record( const_cast< void* >( obj ), item.typeName,
SG::normalizedTypeinfoName( *( item.type ) ),
item.name, m_basketSize, m_splitLevel ) ); item.name, m_basketSize, m_splitLevel ) );
} }
...@@ -174,6 +173,7 @@ namespace CP { ...@@ -174,6 +173,7 @@ namespace CP {
<< itemMatch[ 1 ] << "\"" ); << itemMatch[ 1 ] << "\"" );
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
item.typeName = SG::normalizedTypeinfoName( *( item.type ) );
// Check if the item is available. // Check if the item is available.
static const bool SILENT = true; static const bool SILENT = true;
......
...@@ -70,6 +70,8 @@ namespace CP { ...@@ -70,6 +70,8 @@ namespace CP {
std::string name; std::string name;
/// Type of the written object /// Type of the written object
const std::type_info* type; const std::type_info* type;
/// Type name of the written object
std::string typeName;
}; // struct Item }; // struct Item
/// Object to write the output file with /// Object to write the output file with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment