ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ByteStreamEventStorageOutputSvc Class Reference

This class provides the services for writing FullEventFragment into file. This class implements the interface ByteStreamOutputSvc for the conversion service to write the output to a file. More...

#include <ByteStreamEventStorageOutputSvc.h>

Inheritance diagram for ByteStreamEventStorageOutputSvc:
Collaboration diagram for ByteStreamEventStorageOutputSvc:

Classes

struct  EventCache
 

Public Member Functions

 ByteStreamEventStorageOutputSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Constructors: More...
 
virtual ~ByteStreamEventStorageOutputSvc ()
 Destructor. More...
 
StatusCode initialize () override
 Required of all Gaudi Services. More...
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 
virtual bool putEvent (const RawEvent *re) override
 Implementation of the ByteStreamOutputSvc interface method putEvent. More...
 
virtual bool putEvent (const RawEvent *re, const EventContext &ctx) override
 
StatusCode io_reinit () override
 

Private Member Functions

StatusCode reinit ()
 reinitialize the service when a fork() occurred/was-issued More...
 
bool initDataWriter (const EventContext *ctx=nullptr)
 initialize EventStorage's DataWriter More...
 
bool initDataWriterContents (const xAOD::EventInfo *, const ByteStreamMetadata *)
 
const ByteStreamMetadatagetByteStreamMetadata ()
 
const ByteStreamMetadatagetByteStreamMetadata (const EventContext &ctx)
 
void updateDataWriterParameters (DataWriterParameters &) const
 Create DataWriter parameters from job properties. More...
 
void updateDataWriterParameters (DataWriterParameters &params, const xAOD::EventInfo &evtInfo) const
 Create DataWriter parameters from EventInfo. More...
 
void updateDataWriterParameters (DataWriterParameters &params, const ByteStreamMetadata &metaData) const
 Create DataWriter parameters from MetaData. More...
 

Private Attributes

Gaudi::Property< std::string > m_inputDir
 < directory for the data files More...
 
Gaudi::Property< std::string > m_projectTag
 Application Name. More...
 
Gaudi::Property< std::string > m_appName
 File Tag. More...
 
Gaudi::Property< std::string > m_fileTag
 stream type More...
 
Gaudi::Property< std::string > m_streamType
 stream name More...
 
Gaudi::Property< std::string > m_streamName
 eformat event version to produce, "v40" for run1, or "current" More...
 
Gaudi::Property< std::string > m_eformatVersion
 EventStorage BS version to produce, "v5" for run1, or "current". More...
 
Gaudi::Property< std::string > m_eventStorageVersion
 stream name for multiple output More...
 
Gaudi::Property< std::string > m_bsOutputStreamName
 
Gaudi::Property< std::string > m_simpleFileName
 use this string for filename, not from the "AgreedFileName" More...
 
Gaudi::Property< int > m_lumiBlockNumber
 run number More...
 
Gaudi::Property< int > m_run {this, "RunNumber", 0, "part of filename"}
 Dump fragments. More...
 
Gaudi::Property< bool > m_dump {this, "DumpFlag", false, "dump fragments"}
 Write eventless files. More...
 
Gaudi::Property< bool > m_writeEventless
 Compress events. More...
 
Gaudi::Property< bool > m_compressEvents {this, "CompressEvents", false, ""}
 number of MB per file More...
 
Gaudi::Property< unsigned int > m_maxFileMB
 number of events per file More...
 
Gaudi::Property< unsigned int > m_maxFileNE
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey
 
SG::ReadHandleKey< ByteStreamMetadataContainerm_byteStreamMetadataKey
 
ServiceHandle< IIoComponentMgr > m_ioMgr {"IoComponentMgr", name()}
 
int m_totalEventCounter {0}
 number of event counter More...
 
bool m_isRun1 {false}
 
std::unique_ptr< ByteStreamDataWriterm_dataWriter
 pointer to DataWriter More...
 
std::mutex m_dataWriterMutex
 mutex to lock data writer during initialization or writing More...
 
SG::SlotSpecificObj< EventCachem_eventCache
 Cache of event data for each slot. More...
 

Detailed Description

This class provides the services for writing FullEventFragment into file. This class implements the interface ByteStreamOutputSvc for the conversion service to write the output to a file.

Definition at line 46 of file ByteStreamEventStorageOutputSvc.h.

Constructor & Destructor Documentation

◆ ByteStreamEventStorageOutputSvc()

ByteStreamEventStorageOutputSvc::ByteStreamEventStorageOutputSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructors:

Definition at line 29 of file ByteStreamEventStorageOutputSvc.cxx.

31  : base_class(name, pSvcLocator) {
32 }

◆ ~ByteStreamEventStorageOutputSvc()

virtual ByteStreamEventStorageOutputSvc::~ByteStreamEventStorageOutputSvc ( )
inlinevirtual

Destructor.

Definition at line 56 of file ByteStreamEventStorageOutputSvc.h.

56 {}

Member Function Documentation

◆ finalize()

StatusCode ByteStreamEventStorageOutputSvc::finalize ( )
override

Definition at line 109 of file ByteStreamEventStorageOutputSvc.cxx.

109  {
110  // clean up
111  ATH_MSG_DEBUG("deleting DataWriter");
112  m_dataWriter.reset();
113  ATH_MSG_INFO("number of events written: " << m_totalEventCounter);
114  return StatusCode::SUCCESS;
115 }

◆ getByteStreamMetadata() [1/2]

const ByteStreamMetadata * ByteStreamEventStorageOutputSvc::getByteStreamMetadata ( )
private

Definition at line 291 of file ByteStreamEventStorageOutputSvc.cxx.

292 {
294 
295  if (!metaDataCont.isValid()) return nullptr;
296 
297  if (metaDataCont->size() > 1)
298  ATH_MSG_WARNING("Multiple run parameters in MetaDataStore. "
299  "Bytestream format only supports one. Arbitrarily "
300  "choosing first.");
301 
302  return metaDataCont->front();
303 }

◆ getByteStreamMetadata() [2/2]

const ByteStreamMetadata * ByteStreamEventStorageOutputSvc::getByteStreamMetadata ( const EventContext &  ctx)
private

Definition at line 307 of file ByteStreamEventStorageOutputSvc.cxx.

309 {
311 
312  if (!metaDataCont.isValid()) return nullptr;
313 
314  if (metaDataCont->size() > 1)
315  ATH_MSG_WARNING("Multiple run parameters in MetaDataStore. "
316  "Bytestream format only supports one. Arbitrarily "
317  "choosing first.");
318 
319  return metaDataCont->front();
320 }

◆ initDataWriter()

bool ByteStreamEventStorageOutputSvc::initDataWriter ( const EventContext *  ctx = nullptr)
private

initialize EventStorage's DataWriter

Definition at line 119 of file ByteStreamEventStorageOutputSvc.cxx.

119  {
120  // Called on first event. Reads run parameters first event and/or first event
121  const xAOD::EventInfo* eventInfo = ctx == nullptr
123  : SG::get(m_eventInfoKey, *ctx);
124  if (eventInfo == nullptr) ATH_MSG_WARNING("failed to retrieve EventInfo");
125 
126  const ByteStreamMetadata* metaData = ctx == nullptr ? getByteStreamMetadata() : getByteStreamMetadata(*ctx);
127  if (metaData == nullptr)
128  ATH_MSG_WARNING("failed to retrieve ByteStreamMetaData");
129 
130  // Now open a file for writing from retrieved parameters
131  return initDataWriterContents(eventInfo, metaData);
132 }

◆ initDataWriterContents()

bool ByteStreamEventStorageOutputSvc::initDataWriterContents ( const xAOD::EventInfo evtInfo,
const ByteStreamMetadata metaData 
)
private

Definition at line 136 of file ByteStreamEventStorageOutputSvc.cxx.

138  {
139  // check that we have sufficient information to do what we need
140  if (evtInfo or metaData)
141  ATH_MSG_DEBUG("Looking up data writer parameters");
142  else
143  throw std::runtime_error("Cannot write data without run parameters");
144 
145  // The heirarchy of run/lumiblock number, GNARR
146  //
147  // 1) User override
148  // 2) Event data
149  // 3) File metadata
150  // 4) default = unknown = 0
151  //
152  // Go from 4 to 1 and overwrite
154  if (metaData != nullptr) updateDataWriterParameters(params, *metaData);
155  if (evtInfo != nullptr) updateDataWriterParameters(params, *evtInfo);
157 
159 
160  bool result = m_dataWriter->good();
161  if (result)
162  ATH_MSG_DEBUG("initialized output stream to file with name "
163  << params.fileNameCore);
164  else
165  ATH_MSG_ERROR("Unable to initialize file");
166 
167  return result;
168 }

◆ initialize()

StatusCode ByteStreamEventStorageOutputSvc::initialize ( )
override

Required of all Gaudi Services.

Definition at line 36 of file ByteStreamEventStorageOutputSvc.cxx.

36  {
37  ATH_MSG_INFO("Initializing");
38 
40 
43 
44  // register this service for 'I/O' events
45  ATH_CHECK(m_ioMgr.retrieve());
46  ATH_CHECK(m_ioMgr->io_register(this));
47 
48  // Register output file's name with the I/O manager
49  if (!m_simpleFileName.empty()) {
52  ATH_MSG_VERBOSE("io_register[" << this->name() << "]("
53  << m_simpleFileName << ") [ok]");
54  }
55 
56  // validate m_eformatVersion
57  const std::vector< std::string > choices_ef{"current", "v40", "run1"};
58  if (std::find(choices_ef.begin(), choices_ef.end(), m_eformatVersion)
59  == choices_ef.end()) {
60  ATH_MSG_FATAL("Unexpected value for EformatVersion property: "
61  << m_eformatVersion);
62  return StatusCode::FAILURE;
63  }
64  ATH_MSG_INFO("eformat version to use: \"" << m_eformatVersion << "\"");
65 
66  // validate m_eventStorageVersion
67  const std::vector< std::string > choices_es{"current", "v5", "run1"};
68  if (std::find(choices_es.begin(), choices_es.end(), m_eventStorageVersion)
69  == choices_es.end()) {
70  ATH_MSG_FATAL("Unexpected value for EventStorageVersion property: "
72  return StatusCode::FAILURE;
73  }
74  ATH_MSG_INFO("event storage (BS) version to use: \""
75  << m_eventStorageVersion << "\"");
76 
77  m_isRun1 = (m_eformatVersion == "v40" or m_eformatVersion == "run1");
78 
79  ATH_CHECK(reinit());
80 
81  return StatusCode::SUCCESS;
82 }

◆ io_reinit()

StatusCode ByteStreamEventStorageOutputSvc::io_reinit ( )
override

Definition at line 253 of file ByteStreamEventStorageOutputSvc.cxx.

253  {
254  ATH_MSG_INFO("I/O reinitialization...");
255 
256  if (!m_ioMgr->io_hasitem(this)) {
257  ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
258  return StatusCode::FAILURE;
259  }
260 
261  if (!m_simpleFileName.empty()) {
262  std::string outputFile = m_simpleFileName;
263  ATH_MSG_INFO("I/O reinitialization, file = " << outputFile);
264  std::string &fname = outputFile;
265  if (!m_ioMgr->io_contains(this, fname)) {
266  ATH_MSG_ERROR("IoComponentMgr does not know about [" << fname << "] !");
267  return(StatusCode::FAILURE);
268  }
269  if (!m_ioMgr->io_retrieve(this, fname).isSuccess()) {
270  ATH_MSG_FATAL("Could not retrieve new value for [" << fname << "] !");
271  return(StatusCode::FAILURE);
272  }
273  // all good... copy over.
274  // modify directory
275  m_inputDir.setValue(outputFile.substr(0, outputFile.find_last_of("/")));
276  // FIXME: modify file name, not done for now because of
277  // IoUtils.update_io_registry vs. merge conflict.
278  //m_simpleFileName.setValue(
279  // outputFile.substr(outputFile.find_last_of("/") + 1));
280  }
281  ATH_MSG_DEBUG("Deleting DataWriter");
282  m_dataWriter.reset();
283 
284  ATH_CHECK(reinit());
285 
286  return StatusCode::SUCCESS;
287 }

◆ putEvent() [1/2]

bool ByteStreamEventStorageOutputSvc::putEvent ( const RawEvent re)
overridevirtual

Implementation of the ByteStreamOutputSvc interface method putEvent.

Definition at line 172 of file ByteStreamEventStorageOutputSvc.cxx.

172  {
173  // Read the next event.
174  return putEvent(re, Gaudi::Hive::currentContext());
175 }

◆ putEvent() [2/2]

bool ByteStreamEventStorageOutputSvc::putEvent ( const RawEvent re,
const EventContext &  ctx 
)
overridevirtual

Definition at line 179 of file ByteStreamEventStorageOutputSvc.cxx.

180  {
181  // Read the next event.
184 
185  EventCache* cache = m_eventCache.get(ctx);
186  cache->releaseEvent();
187 
188  // we need the size and the start of the event to give to the data writer
189  cache->size = re->fragment_size_word();
190  ATH_MSG_DEBUG("event size = " << cache->size << ", start = " << re->start());
191 
192  if (m_isRun1) {
193  // convert to current eformat
194  // allocate some extra space just in case
195  ATH_MSG_DEBUG("converting Run 1 format ");
196 
197  cache->size += 128;
198  cache->buffer = std::make_unique< DataType[] >(cache->size);
199  ATH_MSG_DEBUG("created buffer 0x"
200  << std::hex << cache->buffer.get() << std::dec);
201 
202  // This builds no-checksum headers, should use the same
203  // checksum type as original event
205  re->start(), cache->buffer.get(), cache->size);
206  ATH_MSG_DEBUG("filled buffer");
207 
208  if (cache->size == 0) {
209  // not enough space in buffer
210  ATH_MSG_ERROR("Failed to convert event, buffer is too small");
211  return false;
212  }
213 
214  ATH_MSG_DEBUG("event size after conversion = " << cache->size
215  << " version = " << cache->buffer.get()[3]);
216 
217  } else {
218  cache->buffer = std::make_unique< DataType[] >(cache->size);
219  std::copy(re->start(), re->start() + cache->size, cache->buffer.get());
220  }
221 
222  {
223  // multiple data writers concurrently sounds like a bad idea
224  std::lock_guard< std::mutex > lock(m_dataWriterMutex);
225 
226  // make sure the data writer is ready
227  ATH_MSG_DEBUG("looking up data writer");
228  if (!m_dataWriter) {
229  if (!initDataWriter(&ctx)) {
230  ATH_MSG_ERROR("Failed to initialize DataWriter");
231  return false;
232  }
233  }
234 
235  // write event to disk
236  EventStorage::DWError write_result = m_dataWriter->putData(
237  sizeof(DataType) * cache->size,
238  reinterpret_cast< void* >(cache->buffer.get()));
239 
240  // Report success or failure
241  if (write_result != EventStorage::DWOK) {
242  ATH_MSG_ERROR("Failed to write event to DataWriter");
243  return false;
244  }
246  }
247 
248  return true;
249 }

◆ queryInterface()

StatusCode ByteStreamEventStorageOutputSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
override

Definition at line 459 of file ByteStreamEventStorageOutputSvc.cxx.

460  {
461 
462  if ( !ppvInterface ) return StatusCode::FAILURE;
463 
464  // find indirect interfaces :
465  if (ByteStreamOutputSvc::interfaceID().versionMatch(riid)) {
466  *ppvInterface = dynamic_cast<ByteStreamOutputSvc*>(this);
467  } else if (base_class::queryInterface(riid, ppvInterface).isSuccess()) {
468  return StatusCode::SUCCESS;
469  } else {
470  // Interface is not directly available: try out a base class
471  return ::AthService::queryInterface(riid, ppvInterface);
472  }
473  addRef();
474  return StatusCode::SUCCESS;
475 }

◆ reinit()

StatusCode ByteStreamEventStorageOutputSvc::reinit ( )
private

reinitialize the service when a fork() occurred/was-issued

Definition at line 86 of file ByteStreamEventStorageOutputSvc.cxx.

86  {
87  ATH_MSG_INFO("Reinitialization...");
88  return StatusCode::SUCCESS;
89 }

◆ stop()

StatusCode ByteStreamEventStorageOutputSvc::stop ( )
override

Definition at line 93 of file ByteStreamEventStorageOutputSvc.cxx.

93  {
94  // Check whether anything has been written and whether the user wants metadata
95  // only files
96  if (m_dataWriter == 0 and m_writeEventless) {
97  const ByteStreamMetadata* metaData = getByteStreamMetadata();
98 
99  // Try to write metadata to eventless file
100  bool dWok = initDataWriterContents(nullptr, metaData);
101  if (!dWok) ATH_MSG_WARNING("Could not write Metadata for eventless file");
102  }
103 
104  return StatusCode::SUCCESS;
105 }

◆ updateDataWriterParameters() [1/3]

void ByteStreamEventStorageOutputSvc::updateDataWriterParameters ( DataWriterParameters params) const
private

Create DataWriter parameters from job properties.

Definition at line 324 of file ByteStreamEventStorageOutputSvc.cxx.

325  {
326 
327  if (m_eventStorageVersion == "v5" or m_eventStorageVersion == "run1")
328  params.version = 5;
329  else params.version = 0;
330 
331  params.writingPath = m_inputDir;
332 
333  if (m_run != 0) params.rPar.run_number = m_run;
334  ATH_MSG_DEBUG("Run number: " << params.rPar.run_number);
335 
336  if (m_lumiBlockNumber != 0) params.lumiBlockNumber = m_lumiBlockNumber;
337  ATH_MSG_DEBUG("LB number: " << params.lumiBlockNumber);
338 
339  if (!m_streamType.empty()) params.streamType = m_streamType;
340  if (!m_streamName.empty()) params.streamName = m_streamName;
341 
342  if (params.streamType.empty()) params.streamType = "Single";
343  if (params.streamName.empty()) params.streamName = "Stream";
344 
345  params.stream = params.streamType + "_" + params.streamName;
346 
347  if (!m_projectTag.empty()) params.project = m_projectTag;
348 
349  params.applicationName = m_appName;
350 
351  if (!m_simpleFileName.empty()) {
352  // set up for simple file name
353  boost::shared_ptr<EventStorage::SimpleFileName> simple_file_name(
354  new EventStorage::SimpleFileName(m_simpleFileName));
355  params.theFNCB = simple_file_name;
356  } else {
357  // set up for production file name
358  daq::RawFileName fileNameObj(
359  params.project,
360  params.rPar.run_number,
361  params.streamType,
362  params.streamName,
363  params.lumiBlockNumber,
364  params.applicationName);
365  params.fileNameCore = fileNameObj.fileNameCore();
366  }
367 
368  params.compression = m_compressEvents
370  : EventStorage::NONE;
371 
372  params.maxFileMB = m_maxFileMB;
373  params.maxFileNE = params.rPar.max_events = m_maxFileNE;
374 }

◆ updateDataWriterParameters() [2/3]

void ByteStreamEventStorageOutputSvc::updateDataWriterParameters ( DataWriterParameters params,
const ByteStreamMetadata metaData 
) const
private

Create DataWriter parameters from MetaData.

Definition at line 424 of file ByteStreamEventStorageOutputSvc.cxx.

425  {
426  ATH_MSG_DEBUG("Parsing run parameters from metadata:\n" << metaData);
427 
428  params.rPar.run_number = metaData.getRunNumber();
429  params.lumiBlockNumber = metaData.getLumiBlock();
430 
431  const std::string stream = metaData.getStream();
432  const std::string::size_type split = stream.find('_');
433 
434  if (split != std::string::npos and params.streamType.empty())
435  params.streamType = stream.substr(0,split);
436 
437  if (split != std::string::npos and params.streamName.empty())
438  params.streamName = stream.substr(split+1);
439 
440  params.project = metaData.getProject();
441  params.maxFileNE = params.rPar.max_events = metaData.getMaxEvents();
442 
443  params.rPar.rec_enable = metaData.getRecEnable();
444  params.rPar.trigger_type = metaData.getTriggerType();
445  params.rPar.beam_type = metaData.getBeamType();
446  if (metaData.getBeamEnergy() != 0)
447  params.rPar.beam_energy = metaData.getBeamEnergy();
448 
449  params.rPar.detector_mask_LS = metaData.getDetectorMask();
450  params.rPar.detector_mask_MS = metaData.getDetectorMask2();
451 
452  for (const std::string& fmd : metaData.getFreeMetaDataStrings())
453  params.fmdStrings.push_back(fmd);
454  // if(fmd.find("Compression=") == std::string::npos)
455 }

◆ updateDataWriterParameters() [3/3]

void ByteStreamEventStorageOutputSvc::updateDataWriterParameters ( DataWriterParameters params,
const xAOD::EventInfo evtInfo 
) const
private

Create DataWriter parameters from EventInfo.

Definition at line 378 of file ByteStreamEventStorageOutputSvc.cxx.

379  {
380  ATH_MSG_DEBUG("Parsing run parameters from EventInfo" << eventInfo);
381 
382  params.rPar.run_number = eventInfo.runNumber();
383  params.lumiBlockNumber = eventInfo.lumiBlock();
384 
385  for (const xAOD::EventInfo::StreamTag& tag : eventInfo.streamTags())
386  if(!tag.type().empty()) {
387  params.streamType = tag.type();
388  break;
389  }
390 
391  for (const xAOD::EventInfo::StreamTag& tag : eventInfo.streamTags())
392  if (!tag.name().empty()) {
393  params.streamName = tag.name();
394  break;
395  }
396 
397  for (const auto& tag : eventInfo.detDescrTags())
398  params.fmdStrings.push_back(tag.first + ' ' + tag.second);
399 
400  params.rPar.trigger_type = eventInfo.level1TriggerType();
401  params.rPar.detector_mask_LS = eventInfo.detectorMask();
402  params.rPar.detector_mask_MS = eventInfo.detectorMaskExt();
403 
404  std::string event_type = "Event type: sim/data - ";
405  if (eventInfo.eventType(xAOD::EventInfo::EventType::IS_SIMULATION))
406  event_type += "is sim";
407  else event_type += "is data";
408 
409  event_type += " , testbeam/atlas - ";
410  if (eventInfo.eventType(xAOD::EventInfo::EventType::IS_TESTBEAM))
411  event_type += "is testbeam";
412  else event_type += "is atlas";
413 
414  event_type += " , calibration/physics - ";
415  if (eventInfo.eventType(xAOD::EventInfo::EventType::IS_CALIBRATION))
416  event_type += "is calibration";
417  else event_type += "is physics";
418 
419  params.fmdStrings.push_back(event_type);
420 }

Member Data Documentation

◆ m_appName

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_appName
private
Initial value:
{this, "AppName", "",
"part of filename"}

File Tag.

Definition at line 84 of file ByteStreamEventStorageOutputSvc.h.

◆ m_bsOutputStreamName

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_bsOutputStreamName
private
Initial value:
{this, "BSOutputStreamName",
name(), "stream name for multiple output"}

Definition at line 111 of file ByteStreamEventStorageOutputSvc.h.

◆ m_byteStreamMetadataKey

SG::ReadHandleKey< ByteStreamMetadataContainer > ByteStreamEventStorageOutputSvc::m_byteStreamMetadataKey
private
Initial value:
{this,
"ByteStreamMetadataKey", "MetaDataStore+ByteStreamMetadata",
"Key for bytestream metadata object in metadata store"}

Definition at line 146 of file ByteStreamEventStorageOutputSvc.h.

◆ m_compressEvents

Gaudi::Property<bool> ByteStreamEventStorageOutputSvc::m_compressEvents {this, "CompressEvents", false, ""}
private

number of MB per file

Definition at line 133 of file ByteStreamEventStorageOutputSvc.h.

◆ m_dataWriter

std::unique_ptr<ByteStreamDataWriter> ByteStreamEventStorageOutputSvc::m_dataWriter
private

pointer to DataWriter

Definition at line 159 of file ByteStreamEventStorageOutputSvc.h.

◆ m_dataWriterMutex

std::mutex ByteStreamEventStorageOutputSvc::m_dataWriterMutex
private

mutex to lock data writer during initialization or writing

Definition at line 162 of file ByteStreamEventStorageOutputSvc.h.

◆ m_dump

Gaudi::Property<bool> ByteStreamEventStorageOutputSvc::m_dump {this, "DumpFlag", false, "dump fragments"}
private

Write eventless files.

Definition at line 126 of file ByteStreamEventStorageOutputSvc.h.

◆ m_eformatVersion

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_eformatVersion
private
Initial value:
{this, "EformatVersion",
"current", "Version of the event format data, use \"v40\" or \"run1\" "
"for run1, \"current\" for most current version (default)."}

EventStorage BS version to produce, "v5" for run1, or "current".

Definition at line 100 of file ByteStreamEventStorageOutputSvc.h.

◆ m_eventCache

SG::SlotSpecificObj<EventCache> ByteStreamEventStorageOutputSvc::m_eventCache
private

Cache of event data for each slot.

Definition at line 188 of file ByteStreamEventStorageOutputSvc.h.

◆ m_eventInfoKey

SG::ReadHandleKey< xAOD::EventInfo > ByteStreamEventStorageOutputSvc::m_eventInfoKey
private
Initial value:
{this, "EventInfoKey",
"EventInfo", "Key for EventInfo object in event store"}

Definition at line 143 of file ByteStreamEventStorageOutputSvc.h.

◆ m_eventStorageVersion

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_eventStorageVersion
private
Initial value:
{this,
"EventStorageVersion", "current", "Version of the ByteStream file data, "
"use \"v5\" or \"run1\" for run1, \"current\" for most current version "
"(default)."}

stream name for multiple output

Definition at line 105 of file ByteStreamEventStorageOutputSvc.h.

◆ m_fileTag

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_fileTag
private
Initial value:
{this, "FileTag", "",
"part of filename"}

stream type

Definition at line 88 of file ByteStreamEventStorageOutputSvc.h.

◆ m_inputDir

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_inputDir
private
Initial value:
{this, "OutputDirectory", "",
"directory for the data files"}

< directory for the data files

Project Tag

Definition at line 76 of file ByteStreamEventStorageOutputSvc.h.

◆ m_ioMgr

ServiceHandle< IIoComponentMgr > ByteStreamEventStorageOutputSvc::m_ioMgr {"IoComponentMgr", name()}
private

Definition at line 150 of file ByteStreamEventStorageOutputSvc.h.

◆ m_isRun1

bool ByteStreamEventStorageOutputSvc::m_isRun1 {false}
private

Definition at line 156 of file ByteStreamEventStorageOutputSvc.h.

◆ m_lumiBlockNumber

Gaudi::Property<int> ByteStreamEventStorageOutputSvc::m_lumiBlockNumber
private
Initial value:
{this, "LumiBlockNumber", 0,
"part of filename"}

run number

Definition at line 119 of file ByteStreamEventStorageOutputSvc.h.

◆ m_maxFileMB

Gaudi::Property<unsigned int> ByteStreamEventStorageOutputSvc::m_maxFileMB
private
Initial value:
{this, "MaxFileMB", 10000,
"MB per file"}

number of events per file

Definition at line 136 of file ByteStreamEventStorageOutputSvc.h.

◆ m_maxFileNE

Gaudi::Property<unsigned int> ByteStreamEventStorageOutputSvc::m_maxFileNE
private
Initial value:
{this, "MaxFileNE", 100000,
"evens per file"}

Definition at line 140 of file ByteStreamEventStorageOutputSvc.h.

◆ m_projectTag

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_projectTag
private
Initial value:
{this, "ProjectTag", "",
"part of filename"}

Application Name.

Definition at line 80 of file ByteStreamEventStorageOutputSvc.h.

◆ m_run

Gaudi::Property<int> ByteStreamEventStorageOutputSvc::m_run {this, "RunNumber", 0, "part of filename"}
private

Dump fragments.

Definition at line 123 of file ByteStreamEventStorageOutputSvc.h.

◆ m_simpleFileName

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_simpleFileName
private
Initial value:
{this, "SimpleFileName", "",
"for filename not from AgreedFileName"}

use this string for filename, not from the "AgreedFileName"

luminosity block number

Definition at line 115 of file ByteStreamEventStorageOutputSvc.h.

◆ m_streamName

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_streamName
private
Initial value:
{this, "StreamName", "",
"part of filename"}

eformat event version to produce, "v40" for run1, or "current"

Definition at line 96 of file ByteStreamEventStorageOutputSvc.h.

◆ m_streamType

Gaudi::Property<std::string> ByteStreamEventStorageOutputSvc::m_streamType
private
Initial value:
{this, "StreamType", "",
"part of filename"}

stream name

Definition at line 92 of file ByteStreamEventStorageOutputSvc.h.

◆ m_totalEventCounter

int ByteStreamEventStorageOutputSvc::m_totalEventCounter {0}
private

number of event counter

Definition at line 154 of file ByteStreamEventStorageOutputSvc.h.

◆ m_writeEventless

Gaudi::Property<bool> ByteStreamEventStorageOutputSvc::m_writeEventless
private
Initial value:
{this, "WriteEventlessFiles", true,
""}

Compress events.

Definition at line 129 of file ByteStreamEventStorageOutputSvc.h.


The documentation for this class was generated from the following files:
ByteStreamEventStorageOutputSvc::initDataWriter
bool initDataWriter(const EventContext *ctx=nullptr)
initialize EventStorage's DataWriter
Definition: ByteStreamEventStorageOutputSvc.cxx:119
ByteStreamEventStorageOutputSvc::m_byteStreamMetadataKey
SG::ReadHandleKey< ByteStreamMetadataContainer > m_byteStreamMetadataKey
Definition: ByteStreamEventStorageOutputSvc.h:146
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
get_generator_info.result
result
Definition: get_generator_info.py:21
ByteStreamMetadata::getDetectorMask
uint64_t getDetectorMask() const
Definition: ByteStreamMetadata.cxx:156
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
ByteStreamEventStorageOutputSvc::m_writeEventless
Gaudi::Property< bool > m_writeEventless
Compress events.
Definition: ByteStreamEventStorageOutputSvc.h:129
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
OFFLINE_FRAGMENTS_NAMESPACE::DataType
uint32_t DataType
Definition: RawEvent.h:24
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ByteStreamEventStorageOutputSvc::m_eventCache
SG::SlotSpecificObj< EventCache > m_eventCache
Cache of event data for each slot.
Definition: ByteStreamEventStorageOutputSvc.h:188
ByteStreamEventStorageOutputSvc::m_streamType
Gaudi::Property< std::string > m_streamType
stream name
Definition: ByteStreamEventStorageOutputSvc.h:92
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
initialize
void initialize()
Definition: run_EoverP.cxx:894
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
ByteStreamEventStorageOutputSvc::m_isRun1
bool m_isRun1
Definition: ByteStreamEventStorageOutputSvc.h:156
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
ByteStreamEventStorageOutputSvc::m_totalEventCounter
int m_totalEventCounter
number of event counter
Definition: ByteStreamEventStorageOutputSvc.h:154
ByteStreamEventStorageOutputSvc::m_lumiBlockNumber
Gaudi::Property< int > m_lumiBlockNumber
run number
Definition: ByteStreamEventStorageOutputSvc.h:119
ByteStreamEventStorageOutputSvc::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: ByteStreamEventStorageOutputSvc.h:143
ByteStreamMetadata::getBeamEnergy
unsigned int getBeamEnergy() const
Definition: ByteStreamMetadata.cxx:168
ByteStreamMetadata::getFreeMetaDataStrings
const std::vector< std::string > & getFreeMetaDataStrings() const
Definition: ByteStreamMetadata.cxx:188
ByteStreamMetadata
This class is the StoreGate data object for bytestream metadata.
Definition: ByteStreamMetadata.h:25
ByteStreamEventStorageOutputSvc::m_maxFileNE
Gaudi::Property< unsigned int > m_maxFileNE
Definition: ByteStreamEventStorageOutputSvc.h:140
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ByteStreamMetadata::getMaxEvents
unsigned int getMaxEvents() const
Definition: ByteStreamMetadata.cxx:144
ByteStreamEventStorageOutputSvc::m_streamName
Gaudi::Property< std::string > m_streamName
eformat event version to produce, "v40" for run1, or "current"
Definition: ByteStreamEventStorageOutputSvc.h:96
ByteStreamEventStorageOutputSvc::m_inputDir
Gaudi::Property< std::string > m_inputDir
< directory for the data files
Definition: ByteStreamEventStorageOutputSvc.h:76
ByteStreamMetadata::getStream
const std::string & getStream() const
Definition: ByteStreamMetadata.cxx:176
ByteStreamEventStorageOutputSvc::getByteStreamMetadata
const ByteStreamMetadata * getByteStreamMetadata()
Definition: ByteStreamEventStorageOutputSvc.cxx:291
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
ByteStreamEventStorageOutputSvc::putEvent
virtual bool putEvent(const RawEvent *re) override
Implementation of the ByteStreamOutputSvc interface method putEvent.
Definition: ByteStreamEventStorageOutputSvc.cxx:172
ByteStreamEventStorageOutputSvc::reinit
StatusCode reinit()
reinitialize the service when a fork() occurred/was-issued
Definition: ByteStreamEventStorageOutputSvc.cxx:86
ByteStreamMetadata::getBeamType
unsigned int getBeamType() const
Definition: ByteStreamMetadata.cxx:164
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
ByteStreamEventStorageOutputSvc::m_run
Gaudi::Property< int > m_run
Dump fragments.
Definition: ByteStreamEventStorageOutputSvc.h:123
ByteStreamMetadata::getProject
const std::string & getProject() const
Definition: ByteStreamMetadata.cxx:180
ByteStreamMetadata::getLumiBlock
unsigned int getLumiBlock() const
Definition: ByteStreamMetadata.cxx:184
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
ByteStreamMetadata::getDetectorMask2
uint64_t getDetectorMask2() const
Definition: ByteStreamMetadata.cxx:160
ByteStreamEventStorageOutputSvc::m_eformatVersion
Gaudi::Property< std::string > m_eformatVersion
EventStorage BS version to produce, "v5" for run1, or "current".
Definition: ByteStreamEventStorageOutputSvc.h:100
ByteStreamEventStorageOutputSvc::m_dataWriter
std::unique_ptr< ByteStreamDataWriter > m_dataWriter
pointer to DataWriter
Definition: ByteStreamEventStorageOutputSvc.h:159
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ByteStreamEventStorageOutputSvc::m_simpleFileName
Gaudi::Property< std::string > m_simpleFileName
use this string for filename, not from the "AgreedFileName"
Definition: ByteStreamEventStorageOutputSvc.h:115
ByteStreamEventStorageOutputSvc::updateDataWriterParameters
void updateDataWriterParameters(DataWriterParameters &) const
Create DataWriter parameters from job properties.
Definition: ByteStreamEventStorageOutputSvc.cxx:324
ByteStreamMetadata::getRecEnable
unsigned int getRecEnable() const
Definition: ByteStreamMetadata.cxx:148
ByteStreamEventStorageOutputSvc::m_appName
Gaudi::Property< std::string > m_appName
File Tag.
Definition: ByteStreamEventStorageOutputSvc.h:84
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ByteStreamEventStorageOutputSvc::m_dataWriterMutex
std::mutex m_dataWriterMutex
mutex to lock data writer during initialization or writing
Definition: ByteStreamEventStorageOutputSvc.h:162
DataWriterParameters
Class containing parameters needed to initiate DataWriter.
Definition: ByteStreamDataWriter.h:153
offline_EventStorage_v5::ZLIB
@ ZLIB
Definition: v5_EventStorageRecords.h:41
ByteStreamEventStorageOutputSvc::m_ioMgr
ServiceHandle< IIoComponentMgr > m_ioMgr
Definition: ByteStreamEventStorageOutputSvc.h:150
ByteStreamEventStorageOutputSvc::m_eventStorageVersion
Gaudi::Property< std::string > m_eventStorageVersion
stream name for multiple output
Definition: ByteStreamEventStorageOutputSvc.h:105
ByteStreamOutputSvc::interfaceID
static const InterfaceID & interfaceID()
Retrieve interface ID.
Definition: ByteStreamOutputSvc.h:43
offline_eformat::old::convert_to_40
uint32_t convert_to_40(const uint32_t *src, uint32_t *dest, uint32_t max, eformat::CheckSum event_checksum=eformat::NO_CHECKSUM, eformat::CheckSum rob_checksum=eformat::NO_CHECKSUM)
Converts a full event fragment or a ROS fragment, from some format to v4.0 format,...
Definition: util.cxx:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ByteStreamEventStorageOutputSvc::initDataWriterContents
bool initDataWriterContents(const xAOD::EventInfo *, const ByteStreamMetadata *)
Definition: ByteStreamEventStorageOutputSvc.cxx:136
ByteStreamDataWriter::makeWriter
static std::unique_ptr< ByteStreamDataWriter > makeWriter(int version, const std::string &writingPath, const std::string &fileNameCore, const EventStorage::run_parameters_record &rPar, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE=0, unsigned int maxFileMB=0, unsigned int startIndex=1, EventStorage::CompressionType compression=EventStorage::NONE, unsigned int compLevel=1)
Factory method returning data writer instance for specified version.
Definition: ByteStreamDataWriter.cxx:69
ByteStreamMetadata::getRunNumber
unsigned int getRunNumber() const
Definition: ByteStreamMetadata.cxx:136
ByteStreamEventStorageOutputSvc::m_compressEvents
Gaudi::Property< bool > m_compressEvents
number of MB per file
Definition: ByteStreamEventStorageOutputSvc.h:133
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
ByteStreamMetadata::getTriggerType
unsigned int getTriggerType() const
Definition: ByteStreamMetadata.cxx:152
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
re
const boost::regex re(r_e)
ByteStreamEventStorageOutputSvc::m_maxFileMB
Gaudi::Property< unsigned int > m_maxFileMB
number of events per file
Definition: ByteStreamEventStorageOutputSvc.h:136
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
ByteStreamOutputSvc
This class provides the base class to services to write bytestream data. The concrete class can provi...
Definition: ByteStreamOutputSvc.h:25
calibdata.copy
bool copy
Definition: calibdata.py:27
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
ByteStreamEventStorageOutputSvc::m_projectTag
Gaudi::Property< std::string > m_projectTag
Application Name.
Definition: ByteStreamEventStorageOutputSvc.h:80
SG::get
const T * get(const ReadHandleKey< T > &key)
Convenience function to retrieve an object given a ReadHandleKey.
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
xAOD::EventInfo_v1::StreamTag
Class describing a stream tag on the event.
Definition: EventInfo_v1.h:190