29#include "Gaudi/Property.h"
58 return StatusCode::FAILURE;
61 O_WRONLY | O_CREAT | O_TRUNC,
62 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
66 "write permissions.");
67 return StatusCode::FAILURE;
70 return StatusCode::SUCCESS;
79 if (close(
m_ofd) < 0) {
84 return StatusCode::SUCCESS;
91 const EventContext& ctx = Gaudi::Hive::currentContext();
104 std::string collName = collectionName(*ei);
105 std::string::size_type pos = collName.rfind (
"/");
106 if (pos != std::string::npos) {
107 collName.erase (0, pos+1);
110 std::string
buf = std::format(
116 nevts,
"collectionName", collName,
117 nevts,
"tupleName", tupleName(*ei),
118 nevts,
"RunNumber", *runnbr,
119 nevts,
"EventNumber", *evtnbr,
124 throw std::runtime_error(
"Empty buffer in RootAsciiDumperAlgHandle::execute");
128 throw std::runtime_error(
"Failed to write buffer to file descriptor");
136 std::ostringstream bufv;
137 for (int32_t ii = 0; ii < *el_n; ++ii) {
138 bufv << (*el_eta)[ii];
139 if (ii != (*el_n) - 1) {
152 throw std::runtime_error(
"Empty buffer in RootAsciiDumperAlgHandle::execute");
156 throw std::runtime_error(
"Failed to write buffer to file descriptor");
159 for (int32_t ii = 0; ii < *el_n; ++ii) {
161 for (std::size_t jj = 0; jj < (*el_jetcone_dr)[ii].size(); ++jj) {
162 bufv << (*el_jetcone_dr)[ii][jj];
163 if (jj + 1 < (*el_jetcone_dr)[ii].size()) {
168 if (ii + 1 < *el_n) {
181 throw std::runtime_error(
"Failed to write buffer to file descriptor");
185 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helper class to provide constant type-safe access to aux data.
uint64_t m_nentries
number of entries processed so-far
virtual StatusCode initialize()
int m_ofd
file handle to the ASCII output file
SG::ReadHandleKey< int32_t > m_el_n
number of electrons
StringProperty m_ofname
ASCII output file name.
SG::ReadHandleKey< std::vector< std::vector< float > > > m_el_jetcone_dr
jetcone dR
SG::ReadHandleKey< std::vector< float > > m_el_eta
eta of electrons
virtual StatusCode execute()
SG::ReadHandleKey< uint32_t > m_runnbr
run number
SG::ReadHandleKey< uint32_t > m_evtnbr
event number
virtual StatusCode finalize()
SG::ReadHandleKey< xAOD::EventInfo > m_eiKey
Helper class to provide constant type-safe access to aux data.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
static char buf[SIGNAL_MESSAGE_BUFSIZE]
Dump application state information on a fatal signal.