This class provides configuration properties to enable OutputStream file sequences.
More...
#include <OutputStreamSequencerSvc.h>
This class provides configuration properties to enable OutputStream file sequences.
Definition at line 32 of file OutputStreamSequencerSvc.h.
◆ RangeReport_ptr
◆ RangeReport_t
◆ OutputStreamSequencerSvc()
OutputStreamSequencerSvc::OutputStreamSequencerSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~OutputStreamSequencerSvc()
OutputStreamSequencerSvc::~OutputStreamSequencerSvc |
( |
| ) |
|
|
virtual |
◆ buildSequenceFileName()
std::string OutputStreamSequencerSvc::buildSequenceFileName |
( |
const std::string & |
orgFileName | ) |
|
Returns sequenced file name for output stream.
Definition at line 170 of file OutputStreamSequencerSvc.cxx.
177 std::lock_guard lockg(
m_mutex );
179 std::string fileNameCore = orgFileName, fileNameExt;
180 std::size_t sepPos = orgFileName.find(
'[');
181 if (sepPos != std::string::npos) {
182 fileNameCore = orgFileName.substr(0, sepPos);
183 fileNameExt = orgFileName.substr(sepPos);
185 std::ostringstream
n;
186 n << fileNameCore <<
"." << rangeID << fileNameExt;
◆ currentRangeID()
std::string OutputStreamSequencerSvc::currentRangeID |
( |
| ) |
const |
The current Event Range ID (only one range is returned)
Definition at line 197 of file OutputStreamSequencerSvc.cxx.
199 if( !
inUse() )
return "";
200 auto slot = Gaudi::Hive::currentContext().slot();
201 if( slot == EventContext::INVALID_CONTEXT_ID ) slot = 0;
202 std::lock_guard lockg(
m_mutex );
◆ finalize()
StatusCode OutputStreamSequencerSvc::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ getRangeReport()
◆ handle()
void OutputStreamSequencerSvc::handle |
( |
const Incident & |
inc | ) |
|
|
finaloverridevirtual |
Incident service handle.
Definition at line 94 of file OutputStreamSequencerSvc.cxx.
96 auto slot = Gaudi::Hive::currentContext().slot();
97 bool has_context = ( slot != EventContext::INVALID_CONTEXT_ID );
99 if( !has_context ) slot = 0;
102 << (!has_context?
" NO event context":
"") );
106 const FileIncident* fileInc =
dynamic_cast<const FileIncident*
>(&inc);
107 if (fileInc !=
nullptr) {
108 rangeID = fileInc->fileName();
109 ATH_MSG_DEBUG(
"Requested (through incident) Next Event Range filename extension: " << rangeID);
112 if( rangeID ==
"dummy" ) {
118 bool disconnect {
true };
120 throw GaudiException(
"Cannot transition MetaData",
name(), StatusCode::FAILURE);
128 std::lock_guard lockg(
m_mutex );
130 if( rangeID.empty() ) {
131 std::ostringstream
n;
134 ATH_MSG_DEBUG(
"Default next event range filename extension: " << rangeID);
150 bool disconnect {
false };
152 if( !
m_metaDataSvc->transitionMetaDataFile(
"" , disconnect ).isSuccess() ) {
153 throw GaudiException(
"Cannot transition MetaData",
name(), StatusCode::FAILURE);
157 else if( inc.type() == IncidentType::BeginProcessing ) {
160 std::lock_guard lockg(
m_mutex );
◆ incidentName()
std::string OutputStreamSequencerSvc::incidentName |
( |
| ) |
const |
|
inline |
◆ inConcurrentEventsMode()
bool OutputStreamSequencerSvc::inConcurrentEventsMode |
( |
| ) |
|
|
static |
Are there concurrent events? (threads>1)
Definition at line 84 of file OutputStreamSequencerSvc.cxx.
85 return Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1;
◆ initialize()
StatusCode OutputStreamSequencerSvc::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Required of all Gaudi services:
Definition at line 30 of file OutputStreamSequencerSvc.cxx.
35 if (!incsvc.retrieve().isSuccess()) {
37 return(StatusCode::FAILURE);
41 incsvc->addListener(
this, IncidentType::BeginProcessing, 100);
47 return StatusCode::FAILURE;
61 return(StatusCode::SUCCESS);
◆ interfaceID()
static const InterfaceID& OutputStreamSequencerSvc::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ inUse()
bool OutputStreamSequencerSvc::inUse |
( |
| ) |
const |
◆ lastIncident()
const std::string& OutputStreamSequencerSvc::lastIncident |
( |
| ) |
|
|
inline |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ publishRangeReport()
void OutputStreamSequencerSvc::publishRangeReport |
( |
const std::string & |
outputFile | ) |
|
◆ queryInterface()
StatusCode OutputStreamSequencerSvc::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
finaloverridevirtual |
Required of all Gaudi services: see Gaudi documentation for details.
Definition at line 72 of file OutputStreamSequencerSvc.cxx.
77 return(::AthService::queryInterface(riid, ppvInterface));
80 return(StatusCode::SUCCESS);
◆ setRangeID()
std::string OutputStreamSequencerSvc::setRangeID |
( |
const std::string & |
rangeID | ) |
|
set the RangeID (possibly temporarily) so the right Range Filename may be generated
Definition at line 208 of file OutputStreamSequencerSvc.cxx.
210 auto slot = Gaudi::Hive::currentContext().slot();
211 if( slot == EventContext::INVALID_CONTEXT_ID ) slot = 0;
212 std::lock_guard lockg(
m_mutex );
214 throw std::runtime_error(
"OutputStreamSequencer::setRangeID(): slot out of range");
◆ m_currentRangeID
std::string OutputStreamSequencerSvc::m_currentRangeID |
|
private |
◆ m_fileSequenceNumber
int OutputStreamSequencerSvc::m_fileSequenceNumber |
|
private |
◆ m_finishedRange
std::map<std::string,std::string>::iterator OutputStreamSequencerSvc::m_finishedRange |
|
private |
◆ m_fnToRangeId
std::map<std::string,std::string> OutputStreamSequencerSvc::m_fnToRangeId |
|
private |
◆ m_incidentName
StringProperty OutputStreamSequencerSvc::m_incidentName |
|
private |
Initial value:{this, "SequenceIncidentName", "",
"Name of the incident that signals the next Event Range start" }
SequenceIncidentName, incident name for triggering file sequencing.
Definition at line 102 of file OutputStreamSequencerSvc.h.
◆ m_lastFileName
std::string OutputStreamSequencerSvc::m_lastFileName |
|
private |
◆ m_lastIncident
std::string OutputStreamSequencerSvc::m_lastIncident |
|
private |
◆ m_metaDataSvc
◆ m_mutex
std::mutex OutputStreamSequencerSvc::m_mutex |
|
mutableprivate |
◆ m_rangeIDinSlot
std::vector<std::string> OutputStreamSequencerSvc::m_rangeIDinSlot |
|
private |
◆ m_reportingOn
BooleanProperty OutputStreamSequencerSvc::m_reportingOn |
|
private |
Initial value:{this, "ReportingOn", false,
"If True, keep info about Ranges for getRangeReport() calls"}
Flag to switch on storage of reporting info in fnToRangeId.
Definition at line 105 of file OutputStreamSequencerSvc.h.
The documentation for this class was generated from the following files: