35 return StatusCode::FAILURE;
45 return StatusCode::SUCCESS;
63 static const bool SILENT =
true;
64 static const bool METADATA =
false;
65 const void* obj =
event->getOutputObject( item.name, *( item.type ),
68 obj =
event->getInputObject( item.name, *( item.type ),
SILENT,
71 event->getInputObject( item.name, *( item.type ),
SILENT,
77 ATH_MSG_FATAL(
"Couldn't retrieve object \"" << item.name <<
"\"" );
78 return StatusCode::FAILURE;
82 static constexpr bool OVERWRITE =
false;
83 static constexpr bool IS_OWNER =
true;
85 item.name, OVERWRITE, METADATA, IS_OWNER ) );
91 return StatusCode::FAILURE;
95 return StatusCode::SUCCESS;
105 return StatusCode::FAILURE;
112 return StatusCode::SUCCESS;
118 for(
const std::string& stringItem :
m_itemList ) {
121 static const std::regex itemRegex(
"([^#]+)#([^\\.]+\\.?)(.*)" );
122 std::smatch itemMatch;
123 if( ! std::regex_match( stringItem, itemMatch, itemRegex ) ) {
125 <<
"\" is not of the form: \"Type#Name\"" );
126 return StatusCode::FAILURE;
129 << itemMatch[ 2 ] << itemMatch[ 3 ] );
134 for(
const auto& sys : sysVector ) {
143 if( itemMatch[ 3 ] !=
"" ) {
145 <<
", \"" << itemMatch[ 3 ]
147 m_event.setAuxItemList( key, itemMatch[ 3 ] );
153 TClass* cl = TClass::GetClass( itemMatch[ 1 ].
str().c_str() );
155 ATH_MSG_FATAL(
"Type \"" << itemMatch[ 1 ] <<
"\" not found" );
156 return StatusCode::FAILURE;
158 item.type = cl->GetTypeInfo();
161 << itemMatch[ 1 ] <<
"\"" );
162 return StatusCode::FAILURE;
167 static const bool SILENT =
true;
168 static const bool METADATA =
false;
170 if( event->getOutputObject( item.name, *( item.type ), METADATA ) ||
171 event->getInputObject( item.name, *( item.type ),
SILENT,
175 << key <<
"\" for writing" );
180 if( key == itemMatch[ 2 ] ) {
187 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.
StatusCode finalize() override
Function finalising the algorithm.
std::vector< Item > m_writtenItemList
Item list being written after the first event.
xAOD::TEvent m_event
Object to write the output file with.
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...