19#define __STDC_FORMAT_MACROS
28#include "Gaudi/Property.h"
44 ISvcLocator* pSvcLocator ) :
62 "Name of the ascii file where the content of the "
63 "ROOT n-tuple file will be dumped.");
82 return StatusCode::FAILURE;
85 O_WRONLY | O_CREAT | O_TRUNC,
86 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
90 "write permissions.");
91 return StatusCode::FAILURE;
94 return StatusCode::SUCCESS;
103 if (close(
m_ofd) < 0) {
108 return StatusCode::SUCCESS;
120 return StatusCode::RECOVERABLE;
125 return StatusCode::RECOVERABLE;
130 return StatusCode::RECOVERABLE;
134 if (!
evtStore()->retrieve(ei,
"EventInfo").isSuccess()) {
136 return StatusCode::RECOVERABLE;
140 std::string collName = collectionName(*ei);
141 std::string::size_type pos = collName.rfind (
"/");
142 if (pos != std::string::npos) {
143 collName.erase (0, pos+1);
148 int buf_sz = asprintf
150 "%03" PRId64
".%s = %s\n"
151 "%03" PRId64
".%s = %s\n"
152 "%03" PRId64
".%s = %u\n"
153 "%03" PRId64
".%s = %u\n"
154 "%03" PRId64
".%s = %i\n",
160 tupleName(*ei).c_str(),
179 return StatusCode::RECOVERABLE;
183 "el_jetcone_dr").isSuccess()) {
185 return StatusCode::RECOVERABLE;
189 std::stringstream bufv;
190 for (int32_t ii = 0; ii < *
m_el_n; ++ii) {
191 bufv << (*m_el_eta)[ii];
197 int buf_sz = asprintf
199 "%03" PRId64
".%s = [%s]\n",
211 std::stringstream bufv;
212 for (int32_t ii = 0; ii < *
m_el_n; ++ii) {
217 bufv << (*m_el_jetcone_dr)[ii][jj];
228 int buf_sz = asprintf
230 "%03" PRId64
".%s = [%s]\n",
241 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const uint32_t * m_runnbr
run number
const std::vector< std::vector< float > > * m_el_jetcone_dr
jetcone dR
virtual StatusCode finalize()
int m_ofd
file handle to the ASCII output file
const int32_t * m_el_n
number of electrons
virtual StatusCode execute()
std::string m_ofname
ASCII output file name.
const std::vector< float > * m_el_eta
eta of electrons
RootAsciiDumperAlg()
Default constructor:
const uint32_t * m_evtnbr
event number
uint64_t m_nentries
number of entries processed so-far
virtual ~RootAsciiDumperAlg()
Destructor:
virtual StatusCode initialize()
SG::Accessor< T, ALLOC > Accessor
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.
EventInfo_v1 EventInfo
Definition of the latest event info version.