7#ifndef ATHENASERVICES_ATHENAOUTPUTSTREAM_H
8#define ATHENASERVICES_ATHENAOUTPUTSTREAM_H
19#include "Gaudi/Property.h"
20#include "GaudiKernel/IDataSelector.h"
21#include "GaudiKernel/ServiceHandle.h"
22#include "GaudiKernel/ToolHandle.h"
30#include "GaudiKernel/IClassIDSvc.h"
31#include "GaudiKernel/IIncidentListener.h"
32#include "GaudiKernel/IIoComponent.h"
54 IIncidentListener, IIoComponent> {
58 typedef std::vector<SG::DataProxy*>
Items;
59 typedef std::vector<std::pair<std::string, std::string> >
TypeKeyPairs;
71 virtual StatusCode
finalize()
override;
72 virtual StatusCode
execute()
override;
76 virtual StatusCode
write();
90 virtual void handle(
const Incident& incident)
override;
112 StringProperty
m_streamName{
this,
"StreamName",
"",
"Name of the output stream"};
115 StringArrayProperty
m_itemList{
this,
"ItemList", {},
"List of items to write",
"OutputStreamItemList"};
118 StringArrayProperty
m_metadataItemList{
this,
"MetadataItemList", {},
"List of metadata items to write",
"OutputStreamItemList"};
122 "RegEx pattern to select processing tags for which DataHeader should retain provenances"};
128 StringArrayProperty
m_compressionListLow{
this,
"CompressionListLow", {},
"Lossy float compression list (low)"};
131 UnsignedIntegerProperty
m_compressionBitsHigh{
this,
"CompressionBitsHigh", 7,
"Lossy float compression bits (high)"};
134 UnsignedIntegerProperty
m_compressionBitsLow{
this,
"CompressionBitsLow", 15,
"Lossy float compression bits (low)"};
141 StringProperty
m_outputName{
this,
"OutputFile",
"DidNotNameOutput.root",
"Name of the output file"};
144 StringProperty
m_persName{
this,
"EvtConversionSvc",
"EventPersistencySvc",
"Name of the persistency service writing data"};
147 BooleanProperty
m_forceRead{
this,
"ForceRead",
true,
"Force read data objects in ItemList"};
154 BooleanProperty
m_itemListFromTool{
this,
"TakeItemsFromInput",
false,
"Write everything in input DataHeader to output"};
186 ToolHandleArray<IAthenaOutputTool>
m_helperTools{
this,
"HelperTools", {},
"List of AlgTools used by this stream"};
202 std::map< std::string, std::unique_ptr<IAthenaOutputStreamTool> >
m_streamerMap;
223 {
this,
"SelVetoesKey",
"" };
228 {
this,
"CompInfoKey",
"" };
238 const std::string& aux_attr,
247 const std::string& item_key)
const;
260 bool simpleMatch(
const std::string& pattern,
const std::string& text);
uint32_t CLID
The Class ID type.
This file contains the class definition for the OutputStreamSequencerSvc class.
Property holding a SG store/key/clid from which a WriteHandle is made.
IDataSelector m_objects
Collection of objects being selected.
void excludeListHandler(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
ServiceHandle< StoreGateSvc > m_metadataStore
virtual StatusCode finalize() override
StringProperty m_streamName
Stream name (defaults to algorithm name)
UnsignedIntegerProperty m_compressionBitsLow
Number of mantissa bits in the float compression.
UnsignedIntegerProperty m_compressionBitsHigh
Number of mantissa bits in the float compression.
StringArrayProperty m_transientItems
List of items that are known to be present in the transient store (and hence we can make input depend...
ToolHandle< SG::IFolder > m_compressionDecoderLow
The top-level folder with items to be compressed low.
ToolHandle< SG::IFolder > m_p2BWritten
The top-level folder with items to be written.
StringArrayProperty m_compressionListLow
Vector of item names.
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
std::vector< std::pair< std::string, std::string > > TypeKeyPairs
ServiceHandle< MetaDataSvc > m_metaDataSvc
Handles to all the necessary services.
BooleanProperty m_itemListFromTool
Set to write out everything in input DataHeader.
StringProperty m_keepProvenances
Provenance record selection.
IDataSelector * selectedObjects()
Return the list of selected objects.
StringProperty m_outputName
Name of the output file.
virtual ~AthenaOutputStream()
Standard Destructor.
std::map< std::string, std::unique_ptr< IAthenaOutputStreamTool > > m_streamerMap
map of streamerTools handling event ranges in MT
std::map< unsigned, std::string > m_slotRangeMap
map of filenames assigned to active slots
virtual void handle(const Incident &incident) override
Incident service handle listening for MetaDataStop.
std::set< std::string > buildCompressionSet(const ToolHandle< SG::IFolder > &handle, const CLID &item_id, const std::string &item_key) const
Helper function for building the compression lists.
AthenaOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
ToolHandleArray< IAthenaOutputTool > m_helperTools
vector of AlgTools that that are executed by this stream
ToolHandle< SG::IFolder > m_compressionDecoderHigh
The top-level folder with items to be compressed high.
std::vector< SG::DataProxy * > Items
typedefs
void clearSelection()
Clear list of selected objects.
StringArrayProperty m_itemList
Vector of item names.
ServiceHandle< IClassIDSvc > m_pCLIDSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
void handleVariableSelection(const SG::IConstAuxStore &auxstore, SG::DataProxy &itemProxy, const std::string &aux_attr, SG::SelectionVetoes &vetoes) const
Here we build the vetoed AuxIDs.
ServiceHandle< IDictLoaderSvc > m_dictLoader
IDataSelector m_altObjects
Objects overridden by ‘exact’ handling.
void compressionListHandlerLow(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
StatusCode addItemObjects(const SG::FolderItem &, SG::SelectionVetoes &vetoes, SG::CompressionInfo &compInfo)
Add item data objects to output streamer list.
StringProperty m_persName
Name of the persistency service capable to write data from the store.
BooleanProperty m_forceRead
set to true to force read of data objects in item list
void loadDict(CLID clid)
Helper function to load dictionaries (both transient and persistent) for a given type.
bool m_writeMetadataAndDisconnect
std::recursive_mutex mutex_t
ServiceHandle< ITPCnvSvc > m_tpCnvSvc
std::multimap< CLID, std::string > m_CLIDKeyPairs
Map of (clid,key) pairs to be excluded (comes from m_excludeList)
StatusCode collectAllObjects()
Collect data objects for output streamer list.
std::string m_outputAttributes
Output attributes.
StringArrayProperty m_compressionListHigh
Vector of item names.
ServiceHandle< StoreGateSvc > * m_currentStore
StringArrayProperty m_metadataItemList
Vector of item names.
std::vector< std::unique_ptr< DataObject > > m_ownedObjects
Collection of DataObject instances owned by this service.
ServiceHandle< OutputStreamSequencerSvc > m_outSeqSvc
std::map< std::string, std::string > m_rangeIDforRangeFN
map of RangeIDs (as used by the Sequencer) for each Range filename generated
ToolHandle< SG::IFolder > m_transient
Decoded list of transient ids.
ServiceHandle< StoreGateSvc > m_dataStore
Handle to the StoreGateSvc store where the data we want to write out resides.
virtual StatusCode initialize() override
mutex_t m_mutex
mutex for this Stream write() and handle() methods
virtual StatusCode execute() override
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
SG::WriteHandleKey< SG::CompressionInfo > m_compInfoKey
Key used for recording lossy float compressed variable information to the event store.
bool simpleMatch(const std::string &pattern, const std::string &text)
Glob-style matcher, where the only meta-character is '*'.
void compressionListHandlerHigh(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
SG::WriteHandleKey< SG::SelectionVetoes > m_selVetoesKey
Key used for recording selected dynamic variable information to the event store.
virtual StatusCode io_finalize() override
virtual StatusCode write()
Stream the data.
BooleanProperty m_extendProvenanceRecord
Set to false to omit adding the current DataHeader into the DataHeader history This will cause the in...
void finalizeRange(const std::string &rangeFN)
std::atomic< int > m_events
Number of events written to this output stream.
void itemListHandler(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
void writeMetaData(const std::string &outputFN="")
Write MetaData for this stream (by default) or for a substream outputFN (in ES mode)
a Folder item (data object) is identified by the clid/key pair
Interface providing I/O for a generic auxiliary store.
Interface for const operations on an auxiliary store.
a run-time configurable list of data objects
Property holding a SG store/key/clid from which a WriteHandle is made.
std::unordered_map< std::string, SG::auxid_set_t > SelectionVetoes
Map of vetoed variables.
std::unordered_map< std::string, SG::ThinningInfo::compression_map_t > CompressionInfo
Map of compressed variables and their compression levels.