37 return StatusCode::FAILURE;
41 m_event = std::make_unique<xAOD::TEvent>();
48 return StatusCode::SUCCESS;
62 if (event ==
nullptr) {
63 ATH_MSG_FATAL(
"event pointer is not of TEvent type - writing is not yet implemented for RNTuple" );
64 return StatusCode::FAILURE;
70 static const bool SILENT =
true;
71 static const bool METADATA =
false;
72 const void* obj =
event->getOutputObject( item.name, *( item.type ),
75 obj =
event->getInputObject( item.name, *( item.type ),
SILENT,
78 event->getInputObject( item.name, *( item.type ),
SILENT,
84 ATH_MSG_FATAL(
"Couldn't retrieve object \"" << item.name <<
"\"" );
85 return StatusCode::FAILURE;
89 static constexpr bool OVERWRITE =
false;
90 static constexpr bool IS_OWNER =
true;
92 item.name, OVERWRITE, METADATA, IS_OWNER ) );
98 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
112 return StatusCode::FAILURE;
119 return StatusCode::SUCCESS;
125 for(
const std::string& stringItem :
m_itemList ) {
128 static const std::regex itemRegex(
"([^#]+)#([^\\.]+\\.?)(.*)" );
129 std::smatch itemMatch;
130 if( ! std::regex_match( stringItem, itemMatch, itemRegex ) ) {
132 <<
"\" is not of the form: \"Type#Name\"" );
133 return StatusCode::FAILURE;
136 << itemMatch[ 2 ] << itemMatch[ 3 ] );
141 for(
const auto& sys : sysVector ) {
150 if( itemMatch[ 3 ] !=
"" ) {
152 <<
", \"" << itemMatch[ 3 ]
154 m_event->setAuxItemList( key, itemMatch[ 3 ] );
160 TClass* cl = TClass::GetClass( itemMatch[ 1 ].
str().c_str() );
162 ATH_MSG_FATAL(
"Type \"" << itemMatch[ 1 ] <<
"\" not found" );
163 return StatusCode::FAILURE;
165 item.
type = cl->GetTypeInfo();
168 << itemMatch[ 1 ] <<
"\"" );
169 return StatusCode::FAILURE;
174 static const bool SILENT =
true;
175 static const bool METADATA =
false;
177 if (event ==
nullptr) {
178 ATH_MSG_FATAL(
"event pointer is not of TEvent type - writing is not yet implemented for RNTuple" );
179 return StatusCode::FAILURE;
181 if( event->getOutputObject( item.
name, *( item.
type ), METADATA ) ||
186 << key <<
"\" for writing" );
191 if( key == itemMatch[ 2 ] ) {
198 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
ServiceHandle< StoreGateSvc > & evtStore()
bool m_itemListInitialized
Internal flag.
StatusCode setup()
Function setting up the algorithm while processing the first event.
std::unique_ptr< xAOD::TEvent > m_event
Object to write the output file with.
StatusCode finalize() override
Function finalising the algorithm.
std::vector< Item > m_writtenItemList
Item list being written after the first event.
StatusCode execute() override
Function executing the algorithm.
Gaudi::Property< std::vector< std::string > > m_itemList
Item list to write to the output file.
SysListHandle m_systematicsList
The systematic list to consider during execution.
Gaudi::Property< std::string > m_outputStreamName
Name of the output stream to write to.
StatusCode initialize() override
Function initialising the algorithm.
Tool for accessing xAOD files outside of Athena.
Select isolated Photons, Electrons and Muons.
@ SILENT
don't print anything and return success
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
std::string name
Name of the written object.
const std::type_info * type
Type of the written object.
std::string typeName
Type name of the written object.