5#ifndef OUTPUTSTREAMSEQUENCERSVC_H
6#define OUTPUTSTREAMSEQUENCERSVC_H
13#include "GaudiKernel/ServiceHandle.h"
14#include "Gaudi/Property.h"
15#include "GaudiKernel/IIncidentListener.h"
34 using IService::interfaceID;
47 virtual StatusCode
initialize() override final;
49 virtual StatusCode
finalize() override final;
52 virtual
void handle(
const Incident& ) override final;
66 std::string
setRangeID(
const EventContext& ctx,
const std::string & rangeID);
98 "Name of the incident that signals the next Event Range start" };
101 "If True, keep info about Ranges for getRangeReport() calls"};
106 this,
"ReplaceRangeMode",
false,
107 "If True, everything between [ and ] in the output filename is treated "
108 "as a comma-separated list, and the range_idth element of the list is "
Maintain a set of objects, one per slot.
std::pair< std::string, std::string > RangeReport_t
void publishRangeReport(const std::string &outputFile)
SG::SlotSpecificObj< std::string, SG::InvalidSlot::Enabled > m_rangeIDinSlot
EventRange ID for all slots.
bool inUse() const
Is the service in active use? (true after the first range incident is handled).
OutputStreamSequencerSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
std::string buildSequenceFileName(const EventContext &ctx, const std::string &)
Returns sequenced file name for output stream.
virtual void handle(const Incident &) override final
Incident service handle.
RangeReport_ptr getRangeReport()
std::string m_lastFileName
Recently constructed full file name (useful in single threaded processing).
std::string currentRangeID(const EventContext &ctx) const
The current Event Range ID (only one range is returned).
StringProperty m_incidentName
SequenceIncidentName, incident name for triggering file sequencing.
ServiceHandle< MetaDataSvc > m_metaDataSvc
int m_fileSequenceNumber
The event sequence number.
BooleanProperty m_replaceRangeMode
Flag to put in ReplaceRangeMode (i.e.
virtual StatusCode finalize() override final
Required of all Gaudi services:
std::string incidentName() const
The name of the incident that starts a new event sequence.
std::string m_currentRangeID
Current EventRange ID constructed on the last NextRange incident.
const std::string & lastIncident()
Last incident type that was handled.
virtual ~OutputStreamSequencerSvc()
Destructor.
BooleanProperty m_reportingOn
Flag to switch on storage of reporting info in fnToRangeId.
static bool inConcurrentEventsMode()
Are there concurrent events? (threads>1).
std::string m_lastIncident
Last incident type that was handled.
std::string setRangeID(const EventContext &ctx, const std::string &rangeID)
set the RangeID (possibly temporarily) so the right Range Filename may be generated
std::unique_ptr< RangeReport_t > RangeReport_ptr
std::map< std::string, std::string >::iterator m_finishedRange
virtual StatusCode initialize() override final
Required of all Gaudi services:
std::map< std::string, std::string > m_fnToRangeId
Maintain a set of objects, one per slot.