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 29 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 160 of file OutputStreamSequencerSvc.cxx.
167 std::lock_guard lockg(
m_mutex );
169 std::string fileNameCore = orgFileName, fileNameExt;
170 std::size_t sepPos = orgFileName.find(
'[');
171 if (sepPos != std::string::npos) {
172 fileNameCore = orgFileName.substr(0, sepPos);
173 fileNameExt = orgFileName.substr(sepPos);
175 std::ostringstream
n;
176 n << fileNameCore <<
"." << rangeID << fileNameExt;
◆ currentRangeID()
std::string OutputStreamSequencerSvc::currentRangeID |
( |
| ) |
const |
The current Event Range ID (only one range is returned)
Definition at line 187 of file OutputStreamSequencerSvc.cxx.
189 if( !
inUse() )
return "";
190 auto slot = Gaudi::Hive::currentContext().slot();
191 if( slot == EventContext::INVALID_CONTEXT_ID ) slot = 0;
192 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 84 of file OutputStreamSequencerSvc.cxx.
86 auto slot = Gaudi::Hive::currentContext().slot();
87 bool has_context = ( slot != EventContext::INVALID_CONTEXT_ID );
89 if( !has_context ) slot = 0;
92 << (!has_context?
" NO event context":
"") );
96 const FileIncident* fileInc =
dynamic_cast<const FileIncident*
>(&inc);
97 if (fileInc !=
nullptr) {
98 rangeID = fileInc->fileName();
99 ATH_MSG_DEBUG(
"Requested (through incident) Next Event Range filename extension: " << rangeID);
102 if( rangeID ==
"dummy" ) {
108 bool disconnect {
true };
110 throw GaudiException(
"Cannot transition MetaData",
name(), StatusCode::FAILURE);
118 std::lock_guard lockg(
m_mutex );
120 if( rangeID.empty() ) {
121 std::ostringstream
n;
124 ATH_MSG_DEBUG(
"Default next event range filename extension: " << rangeID);
140 bool disconnect {
false };
142 if( !
m_metaDataSvc->transitionMetaDataFile(
"" , disconnect ).isSuccess() ) {
143 throw GaudiException(
"Cannot transition MetaData",
name(), StatusCode::FAILURE);
147 else if( inc.type() == IncidentType::BeginProcessing ) {
150 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 74 of file OutputStreamSequencerSvc.cxx.
75 return Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents() > 1;
◆ initialize()
StatusCode OutputStreamSequencerSvc::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Required of all Gaudi services:
Definition at line 31 of file OutputStreamSequencerSvc.cxx.
36 if (!incsvc.retrieve().isSuccess()) {
38 return(StatusCode::FAILURE);
42 incsvc->addListener(
this, IncidentType::BeginProcessing, 100);
48 return StatusCode::FAILURE;
62 return(StatusCode::SUCCESS);
◆ inUse()
bool OutputStreamSequencerSvc::inUse |
( |
| ) |
const |
◆ lastIncident()
const std::string& OutputStreamSequencerSvc::lastIncident |
( |
| ) |
|
|
inline |
◆ publishRangeReport()
void OutputStreamSequencerSvc::publishRangeReport |
( |
const std::string & |
outputFile | ) |
|
◆ 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 198 of file OutputStreamSequencerSvc.cxx.
200 auto slot = Gaudi::Hive::currentContext().slot();
201 if( slot == EventContext::INVALID_CONTEXT_ID ) slot = 0;
202 std::lock_guard lockg(
m_mutex );
204 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 96 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 99 of file OutputStreamSequencerSvc.h.
The documentation for this class was generated from the following files: