ATLAS Offline Software
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
AthenaOutputStream Class Reference

algorithm that marks for write data objects in SG More...

#include <AthenaOutputStream.h>

Inheritance diagram for AthenaOutputStream:
Collaboration diagram for AthenaOutputStream:

Public Types

typedef std::vector< SG::DataProxy * > Items
 
typedef std::vector< std::pair< std::string, std::string > > TypeKeyPairs
 

Public Member Functions

 AthenaOutputStream (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm Constructor. More...
 
virtual ~AthenaOutputStream ()
 Standard Destructor. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Types

typedef ServiceHandle< IClassIDSvc > IClassIDSvc_t
 
typedef std::map< std::string, unsigned int > CounterMapType
 map to record number of writes per object More...
 
typedef std::recursive_mutex mutex_t
 mutex for this Stream write() and handle() methods More...
 

Protected Member Functions

void itemListHandler (Gaudi::Details::PropertyBase &)
 Handler for ItemNames Property. More...
 
void excludeListHandler (Gaudi::Details::PropertyBase &)
 Handler for ItemNames Property. More...
 
void compressionListHandlerHigh (Gaudi::Details::PropertyBase &)
 Handler for ItemNames Property. More...
 
void compressionListHandlerLow (Gaudi::Details::PropertyBase &)
 Handler for ItemNames Property. More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

ServiceHandle< StoreGateSvcm_dataStore
 handle to the StoreGateSvc store where the data we want to write out resides More...
 
ServiceHandle< StoreGateSvcm_metadataStore
 
ServiceHandle< StoreGateSvc > * m_currentStore
 
ServiceHandle< IItemListSvcm_itemSvc
 
ServiceHandle< MetaDataSvcm_metaDataSvc
 
ServiceHandle< IDictLoaderSvcm_dictLoader
 
ServiceHandle< ITPCnvSvcm_tpCnvSvc
 
std::string m_persName
 Name of the persistency service capable to write data from the store. More...
 
StringProperty m_writingTool
 Name of the OutputStreamTool used for writing. More...
 
std::string m_outputName
 Name of the output file. More...
 
std::string m_outputAttributes
 
IClassIDSvc_t m_pCLIDSvc
 
ServiceHandle< OutputStreamSequencerSvcm_outSeqSvc
 
StringProperty m_streamName {this, "StreamName", "", "name of the output stream"}
 Stream name (defaults to algorithm name) More...
 
StringArrayProperty m_itemList {this,"ItemList",{},"List of items to write","OutputStreamItemList"}
 Vector of item names. More...
 
StringArrayProperty m_metadataItemList {this,"MetadataItemList",{},"List of metadata items to write","OutputStreamItemList"}
 Vector of item names. More...
 
StringArrayProperty m_excludeList {this,"ExcludeList",{},"List of metadata items to write","OrderedSet<std::string>"}
 Vector of item names. More...
 
StringArrayProperty m_compressionListHigh
 Vector of item names. More...
 
StringArrayProperty m_compressionListLow
 Vector of item names. More...
 
unsigned int m_compressionBitsHigh
 Number of mantissa bits in the float compression. More...
 
unsigned int m_compressionBitsLow
 Number of mantissa bits in the float compression. More...
 
StringArrayProperty m_transientItems
 List of items that are known to be present in the transient store (and hence we can make input dependencies on them). More...
 
ToolHandle< SG::IFolderm_p2BWritten
 the top-level folder with items to be written More...
 
ToolHandle< SG::IFolderm_decoder
 the top-level folder with items to be written More...
 
ToolHandle< SG::IFolderm_compressionDecoderHigh
 the top-level folder with items to be compressed high More...
 
ToolHandle< SG::IFolderm_compressionDecoderLow
 the top-level folder with items to be compressed low More...
 
ToolHandle< SG::IFolderm_transient
 Decoded list of transient ids. More...
 
std::multimap< CLID, std::string > m_CLIDKeyPairs
 map of (clid,key) pairs to be excluded (comes from m_excludeList) More...
 
IDataSelector m_objects
 Collection of objects being selected. More...
 
IDataSelector m_altObjects
 Objects overridden by ‘exact’ handling. More...
 
std::vector< std::unique_ptr< DataObject > > m_ownedObjects
 Collection of DataObject instances owned by this service. More...
 
std::atomic< int > m_events
 Number of events written to this output stream. More...
 
bool m_forceRead
 set to true to force read of data objects in item list More...
 
bool m_extendProvenanceRecord
 set to false to omit adding the current DataHeader into the DataHeader history this will cause the input file to be neglected for back navigation (replace mode). More...
 
bool m_writeOnExecute
 set to true to trigger streaming of data on execute() More...
 
bool m_writeOnFinalize
 set to true to trigger streaming of data on finalize() More...
 
bool m_itemListFromTool
 set to write out everything in input DataHeader More...
 
bool m_checkNumberOfWrites
 set to true to check for number of times each object is written More...
 
CounterMapType m_objectWriteCounter
 
ToolHandle< IAthenaOutputStreamToolm_streamer
 pointer to AthenaOutputStreamTool More...
 
ToolHandleArray< IAthenaOutputToolm_helperTools
 vector of AlgTools that that are executed by this stream More...
 
bool m_writeMetadataAndDisconnect = false
 
std::map< unsigned, std::string > m_slotRangeMap
 map of filenames assigned to active slots More...
 
std::map< std::string, std::string > m_rangeIDforRangeFN
 map of RangeIDs (as used by the Sequencer) for each Range filename generated More...
 
std::map< std::string, std::unique_ptr< IAthenaOutputStreamTool > > m_streamerMap
 map of streamerTools handling event ranges in MT More...
 
mutex_t m_mutex
 
StringArrayProperty m_acceptNames
 Vector of names of Algorithms that this stream accepts. More...
 
StringArrayProperty m_requireNames
 Vector of names of Algorithms that this stream requires. More...
 
StringArrayProperty m_vetoNames
 Vector of names of Algorithms that this stream is vetoed by. More...
 
ServiceHandle< IDecisionSvcm_decSvc
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::WriteHandleKey< SG::SelectionVetoesm_selVetoesKey { this, "SelVetoesKey", "" }
 Key used for recording selected dynamic variable information to the event store. More...
 
SG::WriteHandleKey< SG::CompressionInfom_compInfoKey { this, "CompInfoKey", "" }
 Key used for recording lossy float compressed variable information to the event store. More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

implement IAlgorithm

virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode execute () override
 
virtual StatusCode stop () override
 
virtual StatusCode write ()
 Stream the data. More...
 
void clearSelection ()
 Clear list of selected objects. More...
 
StatusCode collectAllObjects ()
 Collect data objects for output streamer list. More...
 
IDataSelector * selectedObjects ()
 Return the list of selected objects. More...
 
virtual void handle (const Incident &incident) override
 Incident service handle listening for MetaDataStop. More...
 
virtual StatusCode io_reinit () override
 Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2)) More...
 
virtual StatusCode io_finalize () override
 
StatusCode addItemObjects (const SG::FolderItem &, SG::SelectionVetoes &vetoes, SG::CompressionInfo &compInfo)
 Add item data objects to output streamer list. More...
 
void handleVariableSelection (const SG::IConstAuxStore &auxstore, SG::DataProxy &itemProxy, const std::string &tns, const std::string &aux_attr, SG::SelectionVetoes &vetoes) const
 
void tokenizeAtSep (std::vector< std::string > &, const std::string &, const std::string &) const
 tokenize a string based on a substring More...
 
bool matchKey (const std::vector< std::string > &key, const std::string &proxyName) const
 Try to match a DataProxy name to a vector of strings. More...
 
void writeMetaData (const std::string &outputFN="")
 Write MetaData for this stream (by default) or for a substream outputFN (in ES mode) More...
 
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. More...
 
void finalizeRange (const std::string &rangeFN)
 
void loadDict (CLID clid)
 Helper function to load dictionaries (both transient and persistent) for a given type. More...
 

Detailed Description

algorithm that marks for write data objects in SG

Author
srini.nosp@m.r@bn.nosp@m.l.gov
Id
AthenaOutputStream.h,v 1.12 2008-12-15 19:14:58 binet Exp

Definition at line 56 of file AthenaOutputStream.h.

Member Typedef Documentation

◆ CounterMapType

typedef std::map<std::string, unsigned int> AthenaOutputStream::CounterMapType
protected

map to record number of writes per object

Definition at line 143 of file AthenaOutputStream.h.

◆ IClassIDSvc_t

typedef ServiceHandle<IClassIDSvc> AthenaOutputStream::IClassIDSvc_t
protected

Definition at line 84 of file AthenaOutputStream.h.

◆ Items

Definition at line 61 of file AthenaOutputStream.h.

◆ mutex_t

typedef std::recursive_mutex AthenaOutputStream::mutex_t
protected

mutex for this Stream write() and handle() methods

Definition at line 164 of file AthenaOutputStream.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ TypeKeyPairs

typedef std::vector<std::pair<std::string, std::string> > AthenaOutputStream::TypeKeyPairs

Definition at line 189 of file AthenaOutputStream.h.

Constructor & Destructor Documentation

◆ AthenaOutputStream()

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

Standard algorithm Constructor.

Definition at line 155 of file AthenaOutputStream.cxx.

156  : FilteredAlgorithm(name, pSvcLocator),
157  m_dataStore("StoreGateSvc", name),
158  m_metadataStore("MetaDataStore", name),
160  m_itemSvc("ItemListSvc", name),
161  m_metaDataSvc("MetaDataSvc", name),
162  m_dictLoader("AthDictLoaderSvc", name),
163  m_tpCnvSvc("AthTPCnvSvc", name),
165  m_pCLIDSvc("ClassIDSvc", name),
166  m_outSeqSvc("OutputStreamSequencerSvc", name),
167  m_p2BWritten(string("SG::Folder/") + name + string("_TopFolder"), this),
168  m_decoder(string("SG::Folder/") + name + string("_excluded"), this),
169  m_compressionDecoderHigh(string("SG::Folder/") + name + string("_compressed_high"), this),
170  m_compressionDecoderLow(string("SG::Folder/") + name + string("_compressed_low"), this),
171  m_transient(string("SG::Folder/") + name + string("_transient"), this),
172  m_events(0),
173  m_streamer(string("AthenaOutputStreamTool/") + name + string("Tool"), this),
174  m_helperTools(this)
175 {
176  assert(pSvcLocator);
177  declareProperty("TransientItems", m_transientItems);
178  declareProperty("OutputFile", m_outputName="DidNotNameOutput.root");
179  declareProperty("EvtConversionSvc", m_persName="EventPersistencySvc");
180  declareProperty("WritingTool", m_streamer);
181  declareProperty("Store", m_dataStore);
182  declareProperty("MetadataStore", m_metadataStore);
183  declareProperty("ForceRead", m_forceRead=true);
184  declareProperty("ExtendProvenanceRecord", m_extendProvenanceRecord=true);
185  declareProperty("WriteOnExecute", m_writeOnExecute=true);
186  declareProperty("WriteOnFinalize", m_writeOnFinalize=false);
187  declareProperty("TakeItemsFromInput", m_itemListFromTool=false);
188  declareProperty("CheckNumberOfWrites", m_checkNumberOfWrites=true);
189  declareProperty("HelperTools", m_helperTools);
190  declareProperty("CompressionListHigh", m_compressionListHigh);
191  declareProperty("CompressionListLow", m_compressionListLow);
192  declareProperty("CompressionBitsHigh", m_compressionBitsHigh = 7);
193  declareProperty("CompressionBitsLow", m_compressionBitsLow = 15);
194 
195  // Associate action handlers with the AcceptAlgs,
196  // RequireAlgs & VetoAlgs properties
197  m_itemList.declareUpdateHandler(&AthenaOutputStream::itemListHandler, this);
198  m_excludeList.declareUpdateHandler(&AthenaOutputStream::excludeListHandler, this);
201 }

◆ ~AthenaOutputStream()

AthenaOutputStream::~AthenaOutputStream ( )
virtual

Standard Destructor.

Definition at line 204 of file AthenaOutputStream.cxx.

204  {
205  m_streamerMap.clear();
206 }

Member Function Documentation

◆ addItemObjects()

StatusCode AthenaOutputStream::addItemObjects ( const SG::FolderItem item,
SG::SelectionVetoes vetoes,
SG::CompressionInfo compInfo 
)
private

Add item data objects to output streamer list.

Handle variable selections. Both variable selection and lossy float compression are limited to event data for the time being

Definition at line 765 of file AthenaOutputStream.cxx.

768 {
769  // anything after a dot is a list of dynamic Aux attributes, separated by dots
770  size_t dotpos = item.key().find('.');
771  string item_key, aux_attr;
772  if( dotpos != string::npos ) {
773  item_key = item.key().substr(0, dotpos+1);
774  aux_attr = item.key().substr(dotpos+1);
775  } else {
776  item_key = item.key();
777  }
778  CLID item_id = item.id();
779  ATH_MSG_DEBUG("addItemObjects(" << item_id << ",\"" << item_key << "\") called");
780  ATH_MSG_DEBUG(" Key:" << item_key );
781  if( aux_attr.size() ) {
782  ATH_MSG_DEBUG(" Aux Attr:" << aux_attr );
783  }
784  static const std::string wildCard = "*";
785  std::set<std::string> clidKeys;
786  for (SG::IFolder::const_iterator iter = m_decoder->begin(), iterEnd = m_decoder->end();
787  iter != iterEnd; ++iter) {
788  if (iter->id() == item_id) {
789  clidKeys.insert(iter->key());
790  }
791  }
792 
793  // Here we build the list of attributes for the lossy float compression
794  // Note that we do not allow m_compressionBitsHigh >= m_compressionBitsLow
795  // Otherwise is, in any case, a logical error and they'd potentially overwrite each other
796  std::map< unsigned int, std::set< std::string > > comp_attr_map;
797  comp_attr_map[ m_compressionBitsHigh ] = buildCompressionSet( m_compressionDecoderHigh, item_id, item_key );
798  comp_attr_map[ m_compressionBitsLow ] = buildCompressionSet( m_compressionDecoderLow, item_id, item_key );
799 
800  // Print some debugging information regarding the lossy float compression configuration
801  for( const auto& it : comp_attr_map ) {
802  ATH_MSG_DEBUG(" Comp Attr " << it.second.size() << " with " << it.first << " mantissa bits.");
803  if ( it.second.size() > 0 ) {
804  for( const auto& attr : it.second ) {
805  ATH_MSG_DEBUG(" >> " << attr);
806  }
807  }
808  }
809 
810  // For MetaData objects of type T that are kept in MetaContainers get the MetaCont<T> ID
811  const CLID remapped_item_id = m_metaDataSvc->remapMetaContCLID( item_id );
813  SG::ProxyMap map;
814  bool gotProxies = false;
815  // Look for the clid in storegate
816  SG::DataProxy* match = (*m_currentStore)->proxy(remapped_item_id, item_key, true);
817  if (match != nullptr) {
818  map.insert({item_key, match});
819  iter = map.begin();
820  end = map.end();
821  gotProxies = true;
822  }
823  // Look for the clid in storegate
824  if (!gotProxies && ((*m_currentStore)->proxyRange(remapped_item_id, iter, end)).isSuccess()) {
825  gotProxies = true;
826  }
827  if (gotProxies) {
828  bool added = false, removed = false;
829  // For item list entry
830  // Check for wildcard within string, i.e. 'xxx*yyy', and save the matching parts
831  std::vector<std::string> keyTokens;
832  keyTokens.reserve(2);
833  std::vector<std::string> xkeyTokens;
834  xkeyTokens.reserve(2);
835  ATH_MSG_VERBOSE("Calling tokenizeAtStep( " << keyTokens << ", " << item_key << ", " << wildCard << ")" );
836  this->tokenizeAtSep( keyTokens, item_key, wildCard );
837  ATH_MSG_VERBOSE("Done calling tokenizeAtStep( " << keyTokens << ", " << item_key << ", " << wildCard << ")" );
838  // Now loop over any found proxies
839  for (; iter != end; ++iter) {
840  SG::DataProxy* itemProxy(iter->second);
841  string proxyName = itemProxy->name();
842  string stream;
843  if( m_currentStore == &m_metadataStore ) {
844  // only check metadata keys
845  stream = m_metaDataSvc->removeStreamFromKey(proxyName); // can modify proxyName
846  }
847  // Does this key match the proxy key name - allow for wildcarding and aliases
848  bool keyMatch = ( item_key == "*" ||
849  item_key == proxyName ||
850  itemProxy->hasAlias(item_key) );
851  if (!keyMatch) {
852  ATH_MSG_VERBOSE("Calling matchKey( " << keyTokens << ", " << proxyName << ")" );
853  keyMatch = matchKey(keyTokens, proxyName);
854  ATH_MSG_VERBOSE("Done calling matchKey( " << keyTokens << ", " << proxyName << ") with result: " << keyMatch );
855  }
856 
857  // Now undo the flag based on a similar analysis of excluded wildcard keys
858  bool xkeyMatch = false;
859  for (std::set<std::string>::const_iterator c2k_it = clidKeys.begin(), c2k_itEnd = clidKeys.end();
860  keyMatch && c2k_it != c2k_itEnd; ++c2k_it) {
861  if (*c2k_it == wildCard) {
862  xkeyMatch = true; // wildcard first
863  } else {
864  // Look for wildcard in key
865  std::string::size_type xsep = c2k_it->find(wildCard);
866  // If wildcard not found, then check whether the second is an excluded key
867  if (xsep == std::string::npos) {
868  if (*c2k_it == proxyName) {
869  xkeyMatch = true;
870  }
871  } else { // Otherwise take before and after wildcard for later use
872  this->tokenizeAtSep( xkeyTokens, *c2k_it, wildCard );
873  ATH_MSG_DEBUG("x Proxy name=" << proxyName );
874  xkeyMatch = matchKey(xkeyTokens, proxyName);
875  }
876  }
877  }
878  if( !stream.empty() and stream != m_outputName ) {
879  // reject keys that are marked for a different output stream
880  ATH_MSG_DEBUG("Rejecting key: " << itemProxy->name() << " in output: " << m_outputName);
881  xkeyMatch = true;
882  }
883  // All right, it passes key match find in itemList, but not in excludeList
884  if (keyMatch && !xkeyMatch) {
885  if (m_forceRead && itemProxy->isValid()) {
886  if (nullptr == itemProxy->accessData()) {
887  ATH_MSG_ERROR(" Could not get data object for id " << remapped_item_id << ",\"" << proxyName);
888  }
889  }
890  if (nullptr != itemProxy->object()) {
891  if( std::find(m_objects.begin(), m_objects.end(), itemProxy->object()) == m_objects.end() &&
892  std::find(m_altObjects.begin(), m_altObjects.end(), itemProxy->object()) == m_altObjects.end() )
893  {
894  if( item_id != remapped_item_id ) {
895  // For MetaCont<T>: -
896  // create a temporary DataObject for an entry in the container to pass to CnvSvc
897  DataBucketBase* dbb = static_cast<DataBucketBase*>( itemProxy->object() );
898  const MetaContBase* metaCont = static_cast<MetaContBase*>( dbb->cast( ClassID_traits<MetaContBase>::ID() ) );
899  void* obj = metaCont? metaCont->getAsVoid( m_outSeqSvc->currentRangeID() ) : nullptr;
900  if( obj ) {
901  auto altbucket = std::make_unique<AltDataBucket>(
902  obj, item_id, *CLIDRegistry::CLIDToTypeinfo(item_id), proxyName );
903  m_objects.push_back( altbucket.get() );
904  m_ownedObjects.push_back( std::move(altbucket) );
905  m_altObjects.push_back( itemProxy->object() ); // only for duplicate prevention
906  } else {
907  ATH_MSG_ERROR("Failed to retrieve object from MetaCont with key=" << item_key << ", for EventRangeID=" << m_outSeqSvc->currentRangeID() );
908  return StatusCode::FAILURE;
909  }
910  } else if (item.exact()) {
911  // If the exact flag is set, make a new DataObject
912  // holding the object as the requested type.
913  DataBucketBase* dbb = dynamic_cast<DataBucketBase*> (itemProxy->object());
914  if (!dbb) std::abort();
915  void* ptr = dbb->cast (item_id);
916  if (!ptr) {
917  // Hard cast
918  ptr = dbb->object();
919  }
920  auto altbucket =
921  std::make_unique<AltDataBucket>
922  (ptr, item_id,
923  *CLIDRegistry::CLIDToTypeinfo (item_id),
924  *itemProxy);
925  m_objects.push_back(altbucket.get());
926  m_ownedObjects.push_back (std::move(altbucket));
927  m_altObjects.push_back (itemProxy->object());
928  }
929  else
930  m_objects.push_back(itemProxy->object());
931  ATH_MSG_DEBUG(" Added object " << item_id << ",\"" << proxyName << "\"");
932  }
933 
934  // Build ItemListSvc string
935  std::string tn;
936  std::stringstream tns;
937  if (!m_pCLIDSvc->getTypeNameOfID(item_id, tn).isSuccess()) {
938  ATH_MSG_ERROR(" Could not get type name for id "
939  << item_id << ",\"" << proxyName);
940  tns << item_id << '_' << proxyName;
941  } else {
942  tn += '_' + proxyName;
943  tns << tn;
944  }
945 
949  if ((*m_currentStore)->storeID() == StoreID::EVENT_STORE &&
950  item_key.find( RootAuxDynIO::AUX_POSTFIX ) == ( item_key.size() - 4 )) {
951 
952  const SG::IConstAuxStore* auxstore( nullptr );
953  try {
954  SG::fromStorable( itemProxy->object(), auxstore, true );
955  } catch( const std::exception& ) {
956  ATH_MSG_DEBUG( "Error in casting object with CLID "
957  << itemProxy->clID() << " to SG::IConstAuxStore*" );
958  auxstore = nullptr;
959  }
960 
961  if (auxstore) {
962  handleVariableSelection (*auxstore, *itemProxy,
963  tns.str(), aux_attr,
964  vetoes);
965 
966  // Here comes the compression logic using ThinningInfo
967  // Get a hold of all AuxIDs for this store (static, dynamic etc.)
968  const SG::auxid_set_t allVars = auxstore->getAuxIDs();
969 
970  // Get a handle on the compression information for this store
971  std::string key = item_key;
972  key.erase (key.size()-4, 4);
973 
974  // Build the compression list, retrieve the relevant AuxIDs and
975  // store it in the relevant map that is going to be inserted into
976  // the ThinningCache later on by the ThinningCacheTool
978  compression.setCompressedAuxIDs( comp_attr_map );
979  for( const auto& it : compression.getCompressedAuxIDs( allVars ) ) {
980  if( it.second.size() > 0 ) { // insert only if the set is non-empty
981  compInfo[ key ][ it.first ] = it.second;
982  ATH_MSG_DEBUG( "Container " << key << " has " << it.second.size() <<
983  " variables that'll be lossy float compressed"
984  " with " << it.first << " mantissa bits" );
985  }
986  } // End of loop over variables to be lossy float compressed
987  } // End of lossy float compression logic
988 
989  }
990 
991  added = true;
992  if (m_checkNumberOfWrites) {
994  if (cit == m_objectWriteCounter.end()) {
995  // First time through
996  m_objectWriteCounter.insert(CounterMapType::value_type(tn, 1));
997  } else {
998  // set to next iteration (to avoid double counting)
999  // StreamTools will eliminate duplicates.
1000  (*cit).second = m_events + 1;
1001  }
1002  }
1003  if (m_itemSvc->addStreamItem(this->name(),tns.str()).isFailure()) {
1004  ATH_MSG_WARNING("Unable to record item " << tns.str() << " in Svc");
1005  }
1006  }
1007  } else if (keyMatch && xkeyMatch) {
1008  removed = true;
1009  }
1010  } // proxy loop
1011  if (!added && !removed) {
1012  ATH_MSG_DEBUG(" No object matching " << item_id << ",\"" << item_key << "\" found");
1013  } else if (removed) {
1014  ATH_MSG_DEBUG(" Object being excluded based on property setting "
1015  << item_id << ",\"" << item_key << "\". Skipping");
1016  }
1017  } else {
1018  ATH_MSG_DEBUG(" Failed to receive proxy iterators from StoreGate for "
1019  << item_id << ",\"" << item_key << "\". Skipping");
1020  }
1021  return StatusCode::SUCCESS;
1022 }

◆ buildCompressionSet()

std::set< std::string > AthenaOutputStream::buildCompressionSet ( const ToolHandle< SG::IFolder > &  handle,
const CLID item_id,
const std::string &  item_key 
) const
private

Helper function for building the compression lists.

Here we build the list of attributes for the float compression CompressionList follows the same logic as the ItemList We find the matching keys, read the string after "Aux.", tokenize by "." and build an std::set of these to be communicated to ThinningInfo elsewhere in the code.

Definition at line 1030 of file AthenaOutputStream.cxx.

1033 {
1034  // Create an empty result
1035  std::set<std::string> result;
1036 
1037  // Check the item is indeed Aux.
1038  if(item_key.find("Aux.") == string::npos) {
1039  return result;
1040  }
1041 
1042  // First the high compression list
1043  for (SG::IFolder::const_iterator iter = handle->begin(), iterEnd = handle->end();
1044  iter != iterEnd; ++iter) {
1045  // First match the IDs for early rejection.
1046  if (iter->id() != item_id) {
1047  continue;
1048  }
1049  // Then find the compression item key and the compression list string
1050  size_t seppos = iter->key().find('.');
1051  string comp_item_key{""}, comp_str{""};
1052  if(seppos != string::npos) {
1053  comp_item_key = iter->key().substr(0, seppos+1);
1054  comp_str = iter->key().substr(seppos+1);
1055  } else {
1056  comp_item_key = iter->key();
1057  }
1058  // Proceed only if the keys match and the
1059  // compression list string is not empty
1060  if (!comp_str.empty() && comp_item_key == item_key) {
1061  std::stringstream ss(comp_str);
1062  std::string attr;
1063  while( std::getline(ss, attr, '.') ) {
1064  result.insert(attr);
1065  }
1066  }
1067  }
1068 
1069  // All done, return the result
1070  return result;
1071 }

◆ clearSelection()

void AthenaOutputStream::clearSelection ( )

Clear list of selected objects.

Definition at line 697 of file AthenaOutputStream.cxx.

697  {
698  m_objects.erase(m_objects.begin(), m_objects.end());
699  m_ownedObjects.clear();
700  m_altObjects.clear();
701 }

◆ collectAllObjects()

StatusCode AthenaOutputStream::collectAllObjects ( )

Collect data objects for output streamer list.

Definition at line 703 of file AthenaOutputStream.cxx.

703  {
704  if (m_itemListFromTool) {
705  if (!m_streamer->getInputItemList(&*m_p2BWritten).isSuccess()) {
706  ATH_MSG_WARNING("collectAllObjects() could not get ItemList from Tool.");
707  }
708  }
709 
710  auto vetoes = std::make_unique<SG::SelectionVetoes>();
711  auto compInfo = std::make_unique<SG::CompressionInfo>();
712 
713  m_p2BWritten->updateItemList(true);
714  std::vector<CLID> folderclids;
715  // Collect all objects that need to be persistified:
716  //FIXME refactor: move this in folder. Treat as composite
717  for (SG::IFolder::const_iterator i = m_p2BWritten->begin(), iEnd = m_p2BWritten->end(); i != iEnd; ++i) {
718  ATH_CHECK( addItemObjects(*i, *vetoes, *compInfo) );
719  folderclids.push_back(i->id());
720  }
721 
722  // FIXME This is a bruteforce hack to remove items erroneously
723  // added somewhere in the morass of the addItemObjects logic
724  IDataSelector prunedList;
725  for (auto it = m_objects.begin(); it != m_objects.end(); ++it) {
726  if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())!=folderclids.end()) {
727  if (SG::isTransientKey ((*it)->name())) {
728  ATH_MSG_ERROR("Request to write transient object key " <<
729  (*it)->name() << " ignored");
730  }
731  else {
732  prunedList.push_back(*it); // build new list that is correct
733  }
734  }
735  else {
736  ATH_MSG_DEBUG("Object " << (*it)->clID() <<","<< (*it)->name() << " found that was not in itemlist");
737  }
738  }
739  m_objects.clear(); // clear previous list
740  for (auto it = prunedList.begin(); it != prunedList.end(); ++it) {
741  if ((*it)->name().length() > 4 && (*it)->name().substr((*it)->name().length() - 4) == "Aux.") {
742  m_objects.push_back(*it); // first copy aux store new into previous
743  }
744  }
745  for (auto it = prunedList.begin(); it != prunedList.end(); ++it) {
746  if ((*it)->name().length() <= 4 || (*it)->name().substr((*it)->name().length() - 4) != "Aux.") {
747  m_objects.push_back(*it); // then copy others new into previous
748  }
749  }
750 
751  // If there were any variable selections, record the information in SG.
752  if (!vetoes->empty()) {
753  ATH_CHECK( SG::makeHandle (m_selVetoesKey).record (std::move (vetoes)) );
754  }
755 
756  // Store the lossy float compression information in the SG.
757  if (!compInfo->empty()) {
758  ATH_CHECK( SG::makeHandle (m_compInfoKey).record (std::move (compInfo)) );
759  }
760 
761  return StatusCode::SUCCESS;
762 }

◆ compressionListHandlerHigh()

void AthenaOutputStream::compressionListHandlerHigh ( Gaudi::Details::PropertyBase &  )
protected

Handler for ItemNames Property.

Definition at line 1144 of file AthenaOutputStream.cxx.

1144  {
1145  IProperty *pAsIProp(nullptr);
1146  if ((m_compressionDecoderHigh.retrieve()).isFailure() ||
1147  nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_compressionDecoderHigh)) ||
1148  (pAsIProp->setProperty("ItemList", m_compressionListHigh.toString())).isFailure()) {
1149  throw GaudiException("Folder property [ItemList] not found", name(), StatusCode::FAILURE);
1150  }
1151 }

◆ compressionListHandlerLow()

void AthenaOutputStream::compressionListHandlerLow ( Gaudi::Details::PropertyBase &  )
protected

Handler for ItemNames Property.

Definition at line 1153 of file AthenaOutputStream.cxx.

1153  {
1154  IProperty *pAsIProp(nullptr);
1155  if ((m_compressionDecoderLow.retrieve()).isFailure() ||
1156  nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_compressionDecoderLow)) ||
1157  (pAsIProp->setProperty("ItemList", m_compressionListLow.toString())).isFailure()) {
1158  throw GaudiException("Folder property [ItemList] not found", name(), StatusCode::FAILURE);
1159  }
1160 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ excludeListHandler()

void AthenaOutputStream::excludeListHandler ( Gaudi::Details::PropertyBase &  )
protected

Handler for ItemNames Property.

Definition at line 1135 of file AthenaOutputStream.cxx.

1135  {
1136  IProperty *pAsIProp(nullptr);
1137  if ((m_decoder.retrieve()).isFailure() ||
1138  nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_decoder)) ||
1139  (pAsIProp->setProperty("ItemList", m_excludeList.toString())).isFailure()) {
1140  throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE);
1141  }
1142 }

◆ execute()

StatusCode AthenaOutputStream::execute ( )
overridevirtual

Reimplemented from FilteredAlgorithm.

Reimplemented in AthenaConditionStream.

Definition at line 552 of file AthenaOutputStream.cxx.

552  {
553  bool failed = false;
554  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
555  if (!tool->preExecute().isSuccess()) {
556  failed = true;
557  }
558  }
559  // Test whether this event should be output
561  if (write().isFailure()) {
562  failed = true;
563  }
564  }
565  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
566  if(!tool->postExecute().isSuccess()) {
567  failed = true;
568  }
569  }
571  writeMetaData();
573  // finalize will disconnect output
574  if( !finalize().isSuccess() ) {
575  failed = true;
576  }
577  }
578  if (failed) {
579  return(StatusCode::FAILURE);
580  }
581  return(StatusCode::SUCCESS);
582 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode AthenaOutputStream::finalize ( )
overridevirtual

Reimplemented from FilteredAlgorithm.

Reimplemented in AthenaConditionStream.

Definition at line 526 of file AthenaOutputStream.cxx.

527 {
528  bool failed = false;
529  ATH_MSG_DEBUG("finalize: Optimize output");
530  // Connect the output file to the service
531  if (!m_streamer->finalizeOutput().isSuccess()) {
532  failed = true;
533  }
534  ATH_MSG_DEBUG("finalize: end optimize output");
535  if (!m_helperTools.release().isSuccess()) {
536  failed = true;
537  }
538  if (!m_streamer.release().isSuccess()) {
539  failed = true;
540  }
541  if (failed) {
542  return(StatusCode::FAILURE);
543  }
544  m_objects.clear();
545  m_objects.shrink_to_fit();
546  m_ownedObjects.clear();
547  m_altObjects.clear();
548  return(StatusCode::SUCCESS);
549 }

◆ finalizeRange()

void AthenaOutputStream::finalizeRange ( const std::string &  rangeFN)
private

Definition at line 446 of file AthenaOutputStream.cxx.

447 {
448  ATH_MSG_DEBUG("Writing MetaData to " << rangeFN);
449  // MN: not calling StopMetaDataIncident here but directly writeMetaData() - OK for Sim, check others
450  // metadata tools like CutFlowSvc are not able to handle this yet
451  const std::string rememberID = m_outSeqSvc->setRangeID( m_rangeIDforRangeFN[ rangeFN ] );
452  writeMetaData( rangeFN );
453  m_outSeqSvc->setRangeID( rememberID );
454 
455  ATH_MSG_INFO("Finished writing Event Sequence to " << rangeFN);
456  auto strm_iter = m_streamerMap.find( rangeFN );
457  strm_iter->second->finalizeOutput().ignore();
458  strm_iter->second->finalize().ignore();
459  m_streamerMap.erase( strm_iter );
460  m_outSeqSvc->publishRangeReport( rangeFN );
461 }

◆ handle()

void AthenaOutputStream::handle ( const Incident &  incident)
overridevirtual

Incident service handle listening for MetaDataStop.

Definition at line 370 of file AthenaOutputStream.cxx.

371 {
372  ATH_MSG_DEBUG("handle() incident type: " << inc.type());
373  // mutex shared with write() which is called from writeMetaData
374  std::unique_lock<mutex_t> lock(m_mutex);
375 
376  if( inc.type() == "MetaDataStop" ) {
377  if( m_outSeqSvc->inUse() ) {
378  if( m_outSeqSvc->inConcurrentEventsMode() ) {
379  // EventService MT - write metadata and close all remaining substreams
380  while( m_streamerMap.size() > 0 ) {
381  finalizeRange( m_streamerMap.begin()->first );
382  }
383  return;
384  }
385  if( m_outSeqSvc->lastIncident() == "EndEvent" ) {
386  // in r22 EndEvent comes before output writing
387  // - queue metadata writing and disconnect for after Event write
389  return;
390  }
391  }
392  // not in Event Service
393  writeMetaData();
394  }
395  else if( m_outSeqSvc->inUse() ) {
396  // Handle Event Ranges for Event Service
397  EventContext::ContextID_t slot = inc.context().slot();
398  if( slot == EventContext::INVALID_CONTEXT_ID ) {
399  throw GaudiException("Received Incident with invalid slot in ES mode", name(), StatusCode::FAILURE);
400  }
401  auto count_events_in_range = [&](const std::string& range) {
402  return std::count_if(m_slotRangeMap.cbegin(), m_slotRangeMap.cend(),
403  [&](auto& el){return el.second == range;} );
404  };
405  if( inc.type() == IncidentType::BeginProcessing ) {
406  // get the current/old range filename for this slot
407  const std::string rangeFN = m_slotRangeMap[ slot ];
408  // build the new range filename for this slot
409  const std::string newRangeFN = m_outSeqSvc->buildSequenceFileName( m_outputName );
410  if( !rangeFN.empty() and rangeFN != newRangeFN ) {
411  ATH_MSG_INFO("Slot range change: '" << rangeFN << "' -> '" << newRangeFN << "'");
412  ATH_MSG_DEBUG("There are " << m_slotRangeMap.size() << " slots in use");
413  for(auto range : m_slotRangeMap ) {
414  ATH_MSG_DEBUG("Slot: " << range.first << " FN=" << range.second);
415  }
416  if( count_events_in_range(rangeFN) == 1 ) {
417  finalizeRange( rangeFN );
418  }
419  }
420  ATH_MSG_INFO("slot " << slot << " processing event in range: " << newRangeFN);
421  m_slotRangeMap[ slot ] = newRangeFN;
422  // remember the RangeID for this slot so we can write metadata *after* a range change
423  m_rangeIDforRangeFN[ newRangeFN ] = m_outSeqSvc->currentRangeID();
424  }
425  else if( inc.type() == IncidentType::EndProcessing ) {
426  ATH_MSG_DEBUG("There are " << m_slotRangeMap.size() << " slots in use");
427  for(auto range : m_slotRangeMap ) {
428  ATH_MSG_DEBUG("Slot: " << range.first << " FN=" << range.second);
429  }
430  if( m_slotRangeMap.size() > 1 ) {
431  // if there are multiple slots, we can detect if the range ended with this event
432  // - except the last range, because there is no next range to clear the slot map
433  const std::string rangeFN = m_slotRangeMap[ slot ];
434  if( count_events_in_range(rangeFN) == 1 ) {
435  finalizeRange( rangeFN );
436  m_slotRangeMap[ slot ].clear();
437  }
438  }
439  }
440  }
441  ATH_MSG_DEBUG("Leaving incident handler for " << inc.type());
442 }

◆ handleVariableSelection()

void AthenaOutputStream::handleVariableSelection ( const SG::IConstAuxStore auxstore,
SG::DataProxy itemProxy,
const std::string &  tns,
const std::string &  aux_attr,
SG::SelectionVetoes vetoes 
) const
private

Definition at line 1073 of file AthenaOutputStream.cxx.

1078 {
1079  // collect dynamic Aux selection (parse the line, attributes separated by dot)
1080  std::set<std::string> attributes;
1081  if( aux_attr.size() ) {
1082  std::stringstream ss(aux_attr);
1083  std::string attr;
1084  while( std::getline(ss, attr, '.') ) {
1085  attributes.insert(attr);
1086  std::stringstream temp;
1087  temp << tns << attr;
1088  if (m_itemSvc->addStreamItem(this->name(),temp.str()).isFailure()) {
1089  ATH_MSG_WARNING("Unable to record item " << temp.str() << " in Svc");
1090  }
1091  }
1092  }
1093 
1094  // Return early if there's no selection.
1095  if (attributes.empty()) {
1096  return;
1097  }
1098 
1099  std::string key = itemProxy.name();
1100  if (key.size() >= 4 && key.compare (key.size()-4, 4, "Aux.")==0)
1101  {
1102  key.erase (key.size()-4, 4);
1103  }
1104 
1105  // Find the entry for the selection.
1106  SG::auxid_set_t& vset = vetoes[key];
1107 
1108  // Form the veto mask for this object.
1110  sel.selectAux (attributes);
1111 
1112  // Get all the AuxIDs that we know of and the selected ones
1113  SG::auxid_set_t all = auxstore.getAuxIDs();
1114  SG::auxid_set_t selected = sel.getSelectedAuxIDs( all );
1115 
1116  // Loop over all and build a list of vetoed AuxIDs from non selected ones
1117  for( const SG::auxid_t auxid : all ) {
1118  if ( !selected.test( auxid ) ) {
1119  vset.insert( auxid );
1120  }
1121  }
1122 }

◆ initialize()

StatusCode AthenaOutputStream::initialize ( )
overridevirtual

Reimplemented from FilteredAlgorithm.

Definition at line 209 of file AthenaOutputStream.cxx.

209  {
211  ATH_MSG_DEBUG("In initialize");
212  // Reset the number of events written
213  m_events = 0;
214 
215  // set up the SG service:
216  ATH_CHECK( m_dataStore.retrieve() );
217  ATH_MSG_DEBUG("Found " << m_dataStore.typeAndName() << " store.");
218  assert(static_cast<bool>(m_dataStore));
219  if (!m_metadataItemList.value().empty()) {
220  ATH_CHECK( m_metadataStore.retrieve() );
221  ATH_MSG_DEBUG("Found " << m_metadataStore.typeAndName() << " store.");
222  assert(static_cast<bool>(m_metadataStore));
223  }
224 
225  // set up the CLID service:
226  ATH_CHECK( m_pCLIDSvc.retrieve() );
227 
228  ATH_CHECK( m_dictLoader.retrieve() );
229  ATH_CHECK( m_tpCnvSvc.retrieve() );
230 
231  // set up the ItemListSvc service:
232  assert(static_cast<bool>(m_pCLIDSvc));
233  ATH_CHECK( m_itemSvc.retrieve() );
234  assert(static_cast<bool>(m_itemSvc));
235 
236  // set up the OutputStreamSequencer service:
237  ATH_CHECK( m_outSeqSvc.retrieve() );
238  assert(static_cast<bool>(m_outSeqSvc));
239 
240  // Get Output Stream tool for writing
241  ATH_CHECK( m_streamer.retrieve() );
242  ATH_CHECK( m_streamer->connectServices(m_dataStore.typeAndName(), m_persName, m_extendProvenanceRecord) );
243 
244  ATH_CHECK( m_helperTools.retrieve() );
245  ATH_MSG_INFO("Found " << m_helperTools << endmsg << "Data output: " << m_outputName);
246 
247  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
248  ATH_CHECK( tool->postInitialize() );
249  }
250 
251  // Register this algorithm for 'I/O' events
252  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
253  ATH_CHECK( iomgr.retrieve() );
254  ATH_CHECK( iomgr->io_register(this) );
255  ATH_CHECK( iomgr->io_register(this, IIoComponentMgr::IoMode::WRITE, m_outputName) );
256  ATH_CHECK( this->io_reinit() );
257 
258  // Add an explicit input dependency for everything in our item list
259  // that we know from the configuration is in the transient store.
260  // We don't want to add everything on the list, because configurations
261  // often initialize this with a maximal static list of everything
262  // that could possibly be written.
263  {
264  ATH_CHECK( m_transient.retrieve() );
265  IProperty *pAsIProp = dynamic_cast<IProperty*> (&*m_transient);
266  if (!pAsIProp) {
267  ATH_MSG_FATAL ("Bad folder interface");
268  return StatusCode::FAILURE;
269  }
270  ATH_CHECK (pAsIProp->setProperty("ItemList", m_transientItems.toString()));
271 
272  for (const SG::FolderItem& item : *m_p2BWritten) {
273  // Load ROOT dictionaries now.
274  loadDict (item.id());
275 
276  const std::string& k = item.key();
277  if (k.find('*') != std::string::npos) continue;
278  if (k.find('.') != std::string::npos) continue;
279  for (const SG::FolderItem& titem : *m_transient) {
280  if (titem.id() == item.id() && titem.key() == k) {
281  DataObjID id (item.id(), m_dataStore.name() + "+" + k);
282  this->addDependency (id, Gaudi::DataHandle::Reader);
283  break;
284  }
285  }
286  }
287  m_transient->clear();
288  }
289 
290  // Also load dictionaries for metadata classes.
291  if (!m_metadataItemList.value().empty()) {
292  IProperty *pAsIProp = dynamic_cast<IProperty*> (&*m_transient);
293  if (!pAsIProp) {
294  ATH_MSG_FATAL ("Bad folder interface");
295  return StatusCode::FAILURE;
296  }
297  ATH_CHECK (pAsIProp->setProperty("ItemList", m_metadataItemList.toString()));
298  for (const SG::FolderItem& item : *m_transient) {
299  loadDict (item.id());
300  }
301  m_transient->clear();
302  }
303 
304  // Also make sure we have the dictionary for Token.
305  m_dictLoader->load_type ("Token");
306 
307  // listen to event range incidents if incident name is configured
308  if( !m_outSeqSvc->incidentName().empty() ) {
309  ServiceHandle<IIncidentSvc> incsvc("IncidentSvc", this->name());
310  if (!incsvc.retrieve().isSuccess()) {
311  ATH_MSG_FATAL("Cannot get IncidentSvc.");
312  return(StatusCode::FAILURE);
313  }
314  // use priority 95 to make sure the Output Sequencer goes first (it has priority 100)
315  incsvc->addListener(this, IncidentType::BeginProcessing, 95);
316  incsvc->addListener(this, IncidentType::EndProcessing, 95);
317  }
318 
319  // Check compression settings and print some information about the configuration
320  // Both should be between [5, 23] and high compression should be < low compression
321  if(m_compressionBitsHigh < 5 || m_compressionBitsHigh > 23) {
322  ATH_MSG_INFO("Float compression mantissa bits for high compression " <<
323  "(" << m_compressionBitsHigh << ") is outside the allowed range of [5, 23].");
324  ATH_MSG_INFO("Setting it to the appropriate limit.");
326  }
327  if(m_compressionBitsLow < 5 || m_compressionBitsLow > 23) {
328  ATH_MSG_INFO("Float compression mantissa bits for low compression " <<
329  "(" << m_compressionBitsLow << ") is outside the allowed range of [5, 23].");
330  ATH_MSG_INFO("Setting it to the appropriate limit.");
332  }
334  ATH_MSG_ERROR("Float compression mantissa bits for low compression " <<
335  "(" << m_compressionBitsLow << ") is lower than or equal to high compression " <<
336  "(" << m_compressionBitsHigh << ")! Please check the configuration! ");
337  return StatusCode::FAILURE;
338  }
339  if(m_compressionListHigh.value().empty() && m_compressionListLow.value().empty()) {
340  ATH_MSG_VERBOSE("Both high and low float compression lists are empty. Float compression will NOT be applied.");
341  } else {
342  ATH_MSG_INFO("Either high or low (or both) float compression lists are defined. Float compression will be applied.");
343  ATH_MSG_INFO("High compression will use " << m_compressionBitsHigh << " mantissa bits, and " <<
344  "low compression will use " << m_compressionBitsLow << " mantissa bits.");
345  }
346 
347  // Setup stream name
348  if (m_streamName.empty()) {
349  m_streamName.setValue(this->name());
350  }
351 
352  // Set SG key for selected variable information.
353  m_selVetoesKey = "SelectionVetoes_" + m_streamName;
355 
356  m_compInfoKey = "CompressionInfo_" + m_streamName;
358 
359  ATH_MSG_DEBUG("End initialize");
360  return StatusCode::SUCCESS;
361 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ io_finalize()

StatusCode AthenaOutputStream::io_finalize ( )
overridevirtual

Definition at line 1249 of file AthenaOutputStream.cxx.

1249  {
1250  ATH_MSG_INFO("I/O finalization...");
1251  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
1252  if (!tool->preFinalize().isSuccess()) {
1253  ATH_MSG_ERROR("Cannot finalize helper tool");
1254  }
1255  }
1256  const Incident metaDataStopIncident(name(), "MetaDataStop");
1257  this->handle(metaDataStopIncident);
1258  ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", this->name());
1259  if (!incSvc.retrieve().isSuccess()) {
1260  ATH_MSG_FATAL("Cannot get the IncidentSvc");
1261  return StatusCode::FAILURE;
1262  }
1263  incSvc->removeListener(this, "MetaDataStop");
1264  if (m_dataStore->clearStore().isFailure()) {
1265  ATH_MSG_WARNING("Cannot clear the DataStore");
1266  }
1267  return StatusCode::SUCCESS;
1268 }

◆ io_reinit()

StatusCode AthenaOutputStream::io_reinit ( )
overridevirtual

Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2))

Definition at line 1227 of file AthenaOutputStream.cxx.

1227  {
1228  ATH_MSG_INFO("I/O reinitialization...");
1229  // For 'write on finalize', we set up listener for 'MetaDataStop'
1230  // and perform write at this point. This happens at 'stop' of the
1231  // event selector. RDS 04/2010
1232  // Set to be listener for end of event
1233  ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", this->name());
1234  if (!incSvc.retrieve().isSuccess()) {
1235  ATH_MSG_FATAL("Cannot get the IncidentSvc");
1236  return StatusCode::FAILURE;
1237  }
1238  incSvc->removeListener(this, "MetaDataStop"); // Remove any existing listener to avoid handling the incident multiple times
1239  incSvc->addListener(this, "MetaDataStop", 50);
1240  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
1241  if (!tool->postInitialize().isSuccess()) {
1242  ATH_MSG_ERROR("Cannot initialize helper tool");
1243  }
1244  }
1245  return StatusCode::SUCCESS;
1246 }

◆ isEventAccepted()

bool FilteredAlgorithm::isEventAccepted ( ) const
inherited

Test whether this event should be output.

Definition at line 128 of file FilteredAlgorithm.cxx.

129 {
130  bool result = true;
131  const EventContext& ctx = this->getContext();
132  if (ctx.valid()) {
133  result = m_decSvc->isEventAccepted(this->name(),ctx);
134  //ATH_MSG_DEBUG("res=" << result << " n=" << this->name() << " sl=" << ctx.slot() << " evt=" << ctx.eventID().event_number());
135  } else {
136  ATH_MSG_DEBUG("Not a threaded app");
137  result = m_decSvc->isEventAccepted(this->name());
138  }
139 
140  return result;
141 }

◆ itemListHandler()

void AthenaOutputStream::itemListHandler ( Gaudi::Details::PropertyBase &  )
protected

Handler for ItemNames Property.

Definition at line 1125 of file AthenaOutputStream.cxx.

1125  {
1126  // Assuming concrete SG::Folder also has an itemList property
1127  IProperty *pAsIProp(nullptr);
1128  if ((m_p2BWritten.retrieve()).isFailure() ||
1129  nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_p2BWritten)) ||
1130  (pAsIProp->setProperty(m_itemList)).isFailure()) {
1131  throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE);
1132  }
1133 }

◆ loadDict()

void AthenaOutputStream::loadDict ( CLID  clid)
private

Helper function to load dictionaries (both transient and persistent) for a given type.

We want to to this explicitly during initialization to avoid sporadic failures seen loading dictionaries while multiple threads are running. See ATEAM-697 and ATEAM-749.

Definition at line 1276 of file AthenaOutputStream.cxx.

1277 {
1278  m_dictLoader->load_type (clid);
1279 
1280  // Also load the persistent class dictionary, if applicable.
1281  std::unique_ptr<ITPCnvBase> tpcnv = m_tpCnvSvc->t2p_cnv_unique (clid);
1282  if (tpcnv) {
1283  m_dictLoader->load_type (tpcnv->persistentTInfo());
1284  }
1285 }

◆ matchKey()

bool AthenaOutputStream::matchKey ( const std::vector< std::string > &  key,
const std::string &  proxyName 
) const
private

Try to match a DataProxy name to a vector of strings.

Definition at line 1184 of file AthenaOutputStream.cxx.

1185  {
1186  bool keyMatch = true; // default return
1187 
1188  // Get an iterator to the first (not zeroth!) string in the vector
1189  std::vector<std::string>::const_iterator itrEnd = key.cend();
1190  std::vector<std::string>::const_iterator itr = key.cbegin();
1191 
1192  // Walk through the whole proxyName string and try to match to all sub-keys
1193  // We are using that: std::string::npos!=string.find("") is always true
1194  std::string::size_type proxyNamePos=0;
1195  while ( itr != itrEnd &&
1196  std::string::npos != ( proxyNamePos = proxyName.find(*itr, proxyNamePos) )
1197  ) {
1198  // If we are at the begin iterator and the first element is Not an empty string
1199  ATH_MSG_VERBOSE("If we are at the begin iterator and the first element is Not an empty string");
1200  if ( !(key.front().empty()) && itr == key.cbegin() && proxyNamePos != 0 ) {
1201  // We had to match a precise name at the beginning, but didn't find it at the beginning
1202  ATH_MSG_VERBOSE("We had to match a precise name at the beginning, but didn't find it at the beginning");
1203  break;
1204  }
1205  // If we are at the end iterator and the last element is Not an empty string
1206  if ( !(key.back().empty()) && itr == --(key.cend()) && (proxyNamePos+itr->size()!=proxyName.size()) ) {
1207  // We had to match a precise name at the end, but didn't find it at the end
1208  ATH_MSG_VERBOSE("We had to match a precise name at the end, but didn't find it at the end");
1209  break;
1210  }
1211  ATH_MSG_VERBOSE("Found a match of subkey: " << *itr << " in string: " << proxyName
1212  << " at position: " << proxyNamePos );
1213  // If we have a good match, increment the iterator and the search position
1214  proxyNamePos += itr->size();
1215  ++itr;
1216  }
1217  // Didn't find everything
1218  if ( itr != itrEnd ) {
1219  keyMatch = false;
1220  ATH_MSG_VERBOSE("Couldn't match every sub-string... return: " << keyMatch);
1221  }
1222  else { ATH_MSG_VERBOSE("Did match every sub-string... return: " << keyMatch); }
1223 
1224  return(keyMatch);
1225 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ selectedObjects()

IDataSelector* AthenaOutputStream::selectedObjects ( )
inline

Return the list of selected objects.

Definition at line 210 of file AthenaOutputStream.h.

210  {
211  return &m_objects;
212  }

◆ stop()

StatusCode AthenaOutputStream::stop ( )
overridevirtual

Definition at line 363 of file AthenaOutputStream.cxx.

364 {
365  ATH_MSG_DEBUG("AthenaOutputStream " << this->name() << " ::stop()");
366  return StatusCode::SUCCESS;
367 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tokenizeAtSep()

void AthenaOutputStream::tokenizeAtSep ( std::vector< std::string > &  subStrings,
const std::string &  portia,
const std::string &  sepstr 
) const
private

tokenize a string based on a substring

Definition at line 1162 of file AthenaOutputStream.cxx.

1164  {
1165  subStrings.clear(); // clear from previous iteration step
1166  // If the portia starts with a wildcard, add an empty string
1167  if (portia.starts_with( sepstr )) {
1168  subStrings.push_back("");
1169  }
1170  boost::char_separator<char> csep(sepstr.c_str());
1171  boost::tokenizer<char_separator<char>> tokens(portia, csep);
1172  for (const std::string& t : tokens) {
1173  //ATH_MSG_VERBOSE("Now on token: " << t);
1174  subStrings.push_back(t);
1175  }
1176  // If the portia ends with a wildcard, add an empty string
1177  if ( portia.size() >= sepstr.size() &&
1178  portia.compare( portia.size() - sepstr.size(), sepstr.size(), sepstr) == 0 ) {
1179  subStrings.push_back("");
1180  }
1181  return;
1182 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ write()

StatusCode AthenaOutputStream::write ( )
virtual

Stream the data.

Definition at line 585 of file AthenaOutputStream.cxx.

585  {
586  bool failed = false;
587  IAthenaOutputStreamTool* streamer = &*m_streamer;
588  std::string outputFN;
589 
590  std::unique_lock<mutex_t> lock(m_mutex);
591 
592  // Handle Event Ranges
593  if( m_outSeqSvc->inUse() and m_outSeqSvc->inConcurrentEventsMode() ) {
594  outputFN = m_outSeqSvc->buildSequenceFileName( m_outputName );
595  ATH_MSG_DEBUG( "Writing event sequence to " << outputFN );
596 
597  streamer = m_streamerMap[ outputFN ].get();
598  if( !streamer ) {
599  // new range, needs a new streamer tool
600  IAlgTool* st = AlgTool::Factory::create( m_streamer->type(), m_streamer->type(), m_streamer->name(), this ).release();
601  st->addRef();
602  streamer = dynamic_cast<IAthenaOutputStreamTool*>( st );
603  IProperty *mstreamer_props = dynamic_cast<IProperty*> (&*m_streamer);
604  IProperty *streamer_props = dynamic_cast<IProperty*> (&*streamer);
605  for ( const auto& prop : mstreamer_props->getProperties() ) {
606  ATH_CHECK( streamer_props->setProperty( *prop ) );
607  }
608  if( !streamer or streamer->initialize().isFailure()
609  or streamer->connectServices(m_dataStore.typeAndName(), m_persName, m_extendProvenanceRecord).isFailure() ) {
610  ATH_MSG_FATAL("Unable to initialize OutputStreamTool for " << outputFN );
611  return StatusCode::FAILURE;
612  }
613  m_streamerMap[ outputFN ].reset( streamer );
614  }
615  } else {
616  outputFN = m_outSeqSvc->buildSequenceFileName(m_outputName);
617  }
618 
619  // Clear any previously existing item list
620  clearSelection();
622 
623  // keep a local copy of the object lists so they are not overwritten when we release the lock
624  IDataSelector objects = std::move( m_objects );
625  IDataSelector altObjects = std::move( m_altObjects );
626  std::vector<std::unique_ptr<DataObject> > ownedObjects = std::move( m_ownedObjects );
627 
628  // print out info about objects collected
629  if (m_checkNumberOfWrites) {
630  bool checkCountError = false;
631  ATH_MSG_DEBUG(" Collected objects:");
632  bool first = true;
633  unsigned int lastCount = 0;
635  clast = m_objectWriteCounter.end(); cit != clast; ++cit) {
636  bool isError = false;
637  if (first) {
638  lastCount = (*cit).second;
639  first = false;
640  } else if (lastCount != (*cit).second) {
641  isError = true;
642  //Complain, but don't abort
643  checkCountError = true;
644  }
645  if (isError) {
646  ATH_MSG_ERROR(" INCORRECT Object/count: "
647  << (*cit).first << ", " << (*cit).second << " should be: " << lastCount);
648  } else {
649  ATH_MSG_DEBUG(" Object/count: " << (*cit).first << ", " << (*cit).second);
650  }
651  }
652  if (checkCountError) {
653  ATH_MSG_FATAL("Check number of writes failed. See messages above "
654  "to identify which container is not always written");
655  return(StatusCode::FAILURE);
656  }
657  }
658  // prepare before releasing lock because m_outputAttributes change in metadataStop
659  const std::string connectStr = outputFN + m_outputAttributes;
660 
661  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
662  ATH_CHECK( tool->preStream() );
663  }
664 
665  // MN: would be nice to release the Stream lock here
666  // lock.unlock();
667 
668  // Connect the output file to the service
669  if (!streamer->connectOutput(connectStr).isSuccess()) {
670  ATH_MSG_FATAL("Could not connectOutput");
671  return StatusCode::FAILURE;
672  }
673  ATH_MSG_DEBUG("connectOutput done for " + outputFN);
674  StatusCode currentStatus = streamer->streamObjects(objects, connectStr);
675  // Do final check of streaming
676  if (!currentStatus.isSuccess()) {
677  if (!currentStatus.isRecoverable()) {
678  ATH_MSG_FATAL("streamObjects failed.");
679  failed = true;
680  } else {
681  ATH_MSG_DEBUG("streamObjects failed.");
682  }
683  }
684  bool doCommit = false;
685  if (!streamer->commitOutput(doCommit).isSuccess()) {
686  ATH_MSG_FATAL("commitOutput failed.");
687  failed = true;
688  }
689  if (failed) {
690  return(StatusCode::FAILURE);
691  }
692  m_events++;
693  return(StatusCode::SUCCESS);
694 }

◆ writeMetaData()

void AthenaOutputStream::writeMetaData ( const std::string &  outputFN = "")
private

Write MetaData for this stream (by default) or for a substream outputFN (in ES mode)

Definition at line 467 of file AthenaOutputStream.cxx.

468 {
469  // use main stream tool by default, or per outputFile in ES mode
470  IAthenaOutputStreamTool* streamer = outputFN.empty()? &*m_streamer : m_streamerMap[outputFN].get();
471 
472  // Moved preFinalize of helper tools to stop - want to optimize the
473  // output file in finalize RDS 12/2009
474  for (ToolHandle<IAthenaOutputTool>& tool : m_helperTools) {
475  if (!tool->preFinalize().isSuccess()) {
476  throw GaudiException("Cannot finalize helper tool", name(), StatusCode::FAILURE);
477  }
478  }
479  if( m_metaDataSvc->prepareOutput(outputFN).isFailure() ) {
480  throw GaudiException("Failed on MetaDataSvc prepareOutput", name(), StatusCode::FAILURE);
481  }
482  // lock all metadata to prevent updates during writing
484 
485  // Always force a final commit in stop - mainly applies to AthenaPool
486  if (m_writeOnFinalize) {
487  if (write().isFailure()) { // true mean write AND commit
488  throw GaudiException("Cannot write on finalize", name(), StatusCode::FAILURE);
489  }
490  ATH_MSG_INFO("Records written: " << m_events);
491  }
492  ATH_MSG_DEBUG("metadataItemList: " << m_metadataItemList.value() );
493  if (!m_metadataItemList.value().empty()) {
495  StatusCode status = streamer->connectServices(m_metadataStore.typeAndName(), m_persName, false);
496  if (status.isFailure()) {
497  throw GaudiException("Unable to connect metadata services", name(), StatusCode::FAILURE);
498  }
499  m_checkNumberOfWrites = false;
500  m_outputAttributes = "[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData][AttributeListKey=]";
501  m_p2BWritten->clear();
502  IProperty *pAsIProp(nullptr);
503  if ((m_p2BWritten.retrieve()).isFailure() ||
504  nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_p2BWritten)) ||
505  (pAsIProp->setProperty("ItemList", m_metadataItemList.toString())).isFailure()) {
506  throw GaudiException("Folder property [metadataItemList] not found", name(), StatusCode::FAILURE);
507  }
508  if (write().isFailure()) { // true mean write AND commit
509  throw GaudiException("Cannot write metadata", name(), StatusCode::FAILURE);
510  }
511  m_outputAttributes.clear();
514  if (status.isFailure()) {
515  throw GaudiException("Unable to re-connect services", name(), StatusCode::FAILURE);
516  }
517  m_p2BWritten->clear();
518  if ((pAsIProp->setProperty(m_itemList)).isFailure()) {
519  throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE);
520  }
521  ATH_MSG_INFO("Metadata records written: " << m_events);
522  }
523 }

Member Data Documentation

◆ m_acceptNames

StringArrayProperty FilteredAlgorithm::m_acceptNames
protectedinherited

Vector of names of Algorithms that this stream accepts.

Definition at line 38 of file FilteredAlgorithm.h.

◆ m_altObjects

IDataSelector AthenaOutputStream::m_altObjects
protected

Objects overridden by ‘exact’ handling.

Definition at line 122 of file AthenaOutputStream.h.

◆ m_checkNumberOfWrites

bool AthenaOutputStream::m_checkNumberOfWrites
protected

set to true to check for number of times each object is written

Definition at line 141 of file AthenaOutputStream.h.

◆ m_CLIDKeyPairs

std::multimap<CLID,std::string> AthenaOutputStream::m_CLIDKeyPairs
protected

map of (clid,key) pairs to be excluded (comes from m_excludeList)

Definition at line 118 of file AthenaOutputStream.h.

◆ m_compInfoKey

SG::WriteHandleKey<SG::CompressionInfo> AthenaOutputStream::m_compInfoKey { this, "CompInfoKey", "" }
private

Key used for recording lossy float compressed variable information to the event store.

Definition at line 175 of file AthenaOutputStream.h.

◆ m_compressionBitsHigh

unsigned int AthenaOutputStream::m_compressionBitsHigh
protected

Number of mantissa bits in the float compression.

Definition at line 101 of file AthenaOutputStream.h.

◆ m_compressionBitsLow

unsigned int AthenaOutputStream::m_compressionBitsLow
protected

Number of mantissa bits in the float compression.

Definition at line 103 of file AthenaOutputStream.h.

◆ m_compressionDecoderHigh

ToolHandle<SG::IFolder> AthenaOutputStream::m_compressionDecoderHigh
protected

the top-level folder with items to be compressed high

Definition at line 112 of file AthenaOutputStream.h.

◆ m_compressionDecoderLow

ToolHandle<SG::IFolder> AthenaOutputStream::m_compressionDecoderLow
protected

the top-level folder with items to be compressed low

Definition at line 114 of file AthenaOutputStream.h.

◆ m_compressionListHigh

StringArrayProperty AthenaOutputStream::m_compressionListHigh
protected

Vector of item names.

Definition at line 97 of file AthenaOutputStream.h.

◆ m_compressionListLow

StringArrayProperty AthenaOutputStream::m_compressionListLow
protected

Vector of item names.

Definition at line 99 of file AthenaOutputStream.h.

◆ m_currentStore

ServiceHandle<StoreGateSvc>* AthenaOutputStream::m_currentStore
protected

Definition at line 68 of file AthenaOutputStream.h.

◆ m_dataStore

ServiceHandle<StoreGateSvc> AthenaOutputStream::m_dataStore
protected

handle to the StoreGateSvc store where the data we want to write out resides

Definition at line 66 of file AthenaOutputStream.h.

◆ m_decoder

ToolHandle<SG::IFolder> AthenaOutputStream::m_decoder
protected

the top-level folder with items to be written

Definition at line 110 of file AthenaOutputStream.h.

◆ m_decSvc

ServiceHandle<IDecisionSvc> FilteredAlgorithm::m_decSvc
protectedinherited

Definition at line 44 of file FilteredAlgorithm.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dictLoader

ServiceHandle<IDictLoaderSvc> AthenaOutputStream::m_dictLoader
protected

Definition at line 73 of file AthenaOutputStream.h.

◆ m_events

std::atomic<int> AthenaOutputStream::m_events
protected

Number of events written to this output stream.

Definition at line 128 of file AthenaOutputStream.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_excludeList

StringArrayProperty AthenaOutputStream::m_excludeList {this,"ExcludeList",{},"List of metadata items to write","OrderedSet<std::string>"}
protected

Vector of item names.

Definition at line 95 of file AthenaOutputStream.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_extendProvenanceRecord

bool AthenaOutputStream::m_extendProvenanceRecord
protected

set to false to omit adding the current DataHeader into the DataHeader history this will cause the input file to be neglected for back navigation (replace mode).

Definition at line 133 of file AthenaOutputStream.h.

◆ m_forceRead

bool AthenaOutputStream::m_forceRead
protected

set to true to force read of data objects in item list

Definition at line 130 of file AthenaOutputStream.h.

◆ m_helperTools

ToolHandleArray<IAthenaOutputTool> AthenaOutputStream::m_helperTools
protected

vector of AlgTools that that are executed by this stream

Definition at line 149 of file AthenaOutputStream.h.

◆ m_itemList

StringArrayProperty AthenaOutputStream::m_itemList {this,"ItemList",{},"List of items to write","OutputStreamItemList"}
protected

Vector of item names.

Definition at line 91 of file AthenaOutputStream.h.

◆ m_itemListFromTool

bool AthenaOutputStream::m_itemListFromTool
protected

set to write out everything in input DataHeader

Definition at line 139 of file AthenaOutputStream.h.

◆ m_itemSvc

ServiceHandle<IItemListSvc> AthenaOutputStream::m_itemSvc
protected

Definition at line 70 of file AthenaOutputStream.h.

◆ m_metadataItemList

StringArrayProperty AthenaOutputStream::m_metadataItemList {this,"MetadataItemList",{},"List of metadata items to write","OutputStreamItemList"}
protected

Vector of item names.

Definition at line 93 of file AthenaOutputStream.h.

◆ m_metadataStore

ServiceHandle<StoreGateSvc> AthenaOutputStream::m_metadataStore
protected

Definition at line 67 of file AthenaOutputStream.h.

◆ m_metaDataSvc

ServiceHandle<MetaDataSvc> AthenaOutputStream::m_metaDataSvc
protected

Definition at line 71 of file AthenaOutputStream.h.

◆ m_mutex

mutex_t AthenaOutputStream::m_mutex
protected

Definition at line 165 of file AthenaOutputStream.h.

◆ m_objects

IDataSelector AthenaOutputStream::m_objects
protected

Collection of objects being selected.

Definition at line 120 of file AthenaOutputStream.h.

◆ m_objectWriteCounter

CounterMapType AthenaOutputStream::m_objectWriteCounter
protected

Definition at line 144 of file AthenaOutputStream.h.

◆ m_outputAttributes

std::string AthenaOutputStream::m_outputAttributes
protected

Definition at line 82 of file AthenaOutputStream.h.

◆ m_outputName

std::string AthenaOutputStream::m_outputName
protected

Name of the output file.

Definition at line 81 of file AthenaOutputStream.h.

◆ m_outSeqSvc

ServiceHandle<OutputStreamSequencerSvc> AthenaOutputStream::m_outSeqSvc
protected

Definition at line 86 of file AthenaOutputStream.h.

◆ m_ownedObjects

std::vector<std::unique_ptr<DataObject> > AthenaOutputStream::m_ownedObjects
protected

Collection of DataObject instances owned by this service.

FIXME: it would be simpler to just have m_objects be a vector of DataObjectSharedPtr<DataObject>, but that implies interface changes.

Definition at line 126 of file AthenaOutputStream.h.

◆ m_p2BWritten

ToolHandle<SG::IFolder> AthenaOutputStream::m_p2BWritten
protected

the top-level folder with items to be written

Definition at line 108 of file AthenaOutputStream.h.

◆ m_pCLIDSvc

IClassIDSvc_t AthenaOutputStream::m_pCLIDSvc
protected

Definition at line 85 of file AthenaOutputStream.h.

◆ m_persName

std::string AthenaOutputStream::m_persName
protected

Name of the persistency service capable to write data from the store.

Definition at line 77 of file AthenaOutputStream.h.

◆ m_rangeIDforRangeFN

std::map< std::string, std::string > AthenaOutputStream::m_rangeIDforRangeFN
protected

map of RangeIDs (as used by the Sequencer) for each Range filename generated

Definition at line 159 of file AthenaOutputStream.h.

◆ m_requireNames

StringArrayProperty FilteredAlgorithm::m_requireNames
protectedinherited

Vector of names of Algorithms that this stream requires.

Definition at line 40 of file FilteredAlgorithm.h.

◆ m_selVetoesKey

SG::WriteHandleKey<SG::SelectionVetoes> AthenaOutputStream::m_selVetoesKey { this, "SelVetoesKey", "" }
private

Key used for recording selected dynamic variable information to the event store.

Definition at line 170 of file AthenaOutputStream.h.

◆ m_slotRangeMap

std::map< unsigned, std::string > AthenaOutputStream::m_slotRangeMap
protected

map of filenames assigned to active slots

Definition at line 156 of file AthenaOutputStream.h.

◆ m_streamer

ToolHandle<IAthenaOutputStreamTool> AthenaOutputStream::m_streamer
protected

pointer to AthenaOutputStreamTool

Definition at line 147 of file AthenaOutputStream.h.

◆ m_streamerMap

std::map< std::string, std::unique_ptr<IAthenaOutputStreamTool> > AthenaOutputStream::m_streamerMap
protected

map of streamerTools handling event ranges in MT

Definition at line 162 of file AthenaOutputStream.h.

◆ m_streamName

StringProperty AthenaOutputStream::m_streamName {this, "StreamName", "", "name of the output stream"}
protected

Stream name (defaults to algorithm name)

Definition at line 89 of file AthenaOutputStream.h.

◆ m_tpCnvSvc

ServiceHandle<ITPCnvSvc> AthenaOutputStream::m_tpCnvSvc
protected

Definition at line 74 of file AthenaOutputStream.h.

◆ m_transient

ToolHandle<SG::IFolder> AthenaOutputStream::m_transient
protected

Decoded list of transient ids.

Definition at line 116 of file AthenaOutputStream.h.

◆ m_transientItems

StringArrayProperty AthenaOutputStream::m_transientItems
protected

List of items that are known to be present in the transient store (and hence we can make input dependencies on them).

Definition at line 106 of file AthenaOutputStream.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vetoNames

StringArrayProperty FilteredAlgorithm::m_vetoNames
protectedinherited

Vector of names of Algorithms that this stream is vetoed by.

Definition at line 42 of file FilteredAlgorithm.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeMetadataAndDisconnect

bool AthenaOutputStream::m_writeMetadataAndDisconnect = false
protected

Definition at line 152 of file AthenaOutputStream.h.

◆ m_writeOnExecute

bool AthenaOutputStream::m_writeOnExecute
protected

set to true to trigger streaming of data on execute()

Definition at line 135 of file AthenaOutputStream.h.

◆ m_writeOnFinalize

bool AthenaOutputStream::m_writeOnFinalize
protected

set to true to trigger streaming of data on finalize()

Definition at line 137 of file AthenaOutputStream.h.

◆ m_writingTool

StringProperty AthenaOutputStream::m_writingTool
protected

Name of the OutputStreamTool used for writing.

Definition at line 79 of file AthenaOutputStream.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthenaOutputStream::finalize
virtual StatusCode finalize() override
Definition: AthenaOutputStream.cxx:526
AthenaOutputStream::m_rangeIDforRangeFN
std::map< std::string, std::string > m_rangeIDforRangeFN
map of RangeIDs (as used by the Sequencer) for each Range filename generated
Definition: AthenaOutputStream.h:159
AthenaOutputStream::writeMetaData
void writeMetaData(const std::string &outputFN="")
Write MetaData for this stream (by default) or for a substream outputFN (in ES mode)
Definition: AthenaOutputStream.cxx:467
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AthenaOutputStream::m_outputAttributes
std::string m_outputAttributes
Definition: AthenaOutputStream.h:82
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
RootAuxDynIO::AUX_POSTFIX
constexpr char AUX_POSTFIX[]
Common post-fix for the names of auxiliary containers in StoreGate.
Definition: RootAuxDynDefs.h:10
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:56
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
AthenaOutputStream::addItemObjects
StatusCode addItemObjects(const SG::FolderItem &, SG::SelectionVetoes &vetoes, SG::CompressionInfo &compInfo)
Add item data objects to output streamer list.
Definition: AthenaOutputStream.cxx:765
AthenaOutputStream::m_compressionBitsHigh
unsigned int m_compressionBitsHigh
Number of mantissa bits in the float compression.
Definition: AthenaOutputStream.h:101
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
SG::isTransientKey
bool isTransientKey(const std::string &key)
Test to see if a key is transoent.
Definition: transientKey.h:41
AthenaOutputStream::tokenizeAtSep
void tokenizeAtSep(std::vector< std::string > &, const std::string &, const std::string &) const
tokenize a string based on a substring
Definition: AthenaOutputStream.cxx:1162
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition: StorableConversions.h:180
AthenaOutputStream::m_decoder
ToolHandle< SG::IFolder > m_decoder
the top-level folder with items to be written
Definition: AthenaOutputStream.h:110
AthenaOutputStream::m_itemList
StringArrayProperty m_itemList
Vector of item names.
Definition: AthenaOutputStream.h:91
AthenaOutputStream::buildCompressionSet
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.
Definition: AthenaOutputStream.cxx:1030
AthenaOutputStream::m_dataStore
ServiceHandle< StoreGateSvc > m_dataStore
handle to the StoreGateSvc store where the data we want to write out resides
Definition: AthenaOutputStream.h:66
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthenaOutputStream::m_pCLIDSvc
IClassIDSvc_t m_pCLIDSvc
Definition: AthenaOutputStream.h:85
AthenaOutputStream::m_compressionListLow
StringArrayProperty m_compressionListLow
Vector of item names.
Definition: AthenaOutputStream.h:99
DataBucketBase::object
virtual void * object()=0
AthenaOutputStream::m_persName
std::string m_persName
Name of the persistency service capable to write data from the store.
Definition: AthenaOutputStream.h:77
IAthenaOutputStreamTool
This is a tool that allows streaming out of DataObjects. This has been factorized out from AthenaOutp...
Definition: IAthenaOutputStreamTool.h:70
AthenaOutputStream::matchKey
bool matchKey(const std::vector< std::string > &key, const std::string &proxyName) const
Try to match a DataProxy name to a vector of strings.
Definition: AthenaOutputStream.cxx:1184
skel.it
it
Definition: skel.GENtoEVGEN.py:423
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
CLIDRegistry::CLIDToTypeinfo
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
Definition: CLIDRegistry.cxx:136
SG::IFolder::const_iterator
ItemList::const_iterator const_iterator
Definition: SGIFolder.h:32
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaOutputStream::loadDict
void loadDict(CLID clid)
Helper function to load dictionaries (both transient and persistent) for a given type.
Definition: AthenaOutputStream.cxx:1276
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
FilteredAlgorithm::initialize
virtual StatusCode initialize()
Definition: FilteredAlgorithm.cxx:46
DataBucketBase::cast
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
AthenaOutputStream::m_transientItems
StringArrayProperty m_transientItems
List of items that are known to be present in the transient store (and hence we can make input depend...
Definition: AthenaOutputStream.h:106
AthenaOutputStream::m_objects
IDataSelector m_objects
Collection of objects being selected.
Definition: AthenaOutputStream.h:120
AthenaOutputStream::m_metadataItemList
StringArrayProperty m_metadataItemList
Vector of item names.
Definition: AthenaOutputStream.h:93
xAOD::AuxCompression
Definition: AuxCompression.h:20
AthenaOutputStream::m_currentStore
ServiceHandle< StoreGateSvc > * m_currentStore
Definition: AthenaOutputStream.h:68
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::ProxyMap
std::map< std::string, DataProxy * > ProxyMap
Definition: ProxyMap.h:24
AthenaOutputStream::collectAllObjects
StatusCode collectAllObjects()
Collect data objects for output streamer list.
Definition: AthenaOutputStream.cxx:703
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthenaOutputStream::m_checkNumberOfWrites
bool m_checkNumberOfWrites
set to true to check for number of times each object is written
Definition: AthenaOutputStream.h:141
FilteredAlgorithm::isEventAccepted
bool isEventAccepted() const
Test whether this event should be output.
Definition: FilteredAlgorithm.cxx:128
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
MetaContBase
Definition: MetaCont.h:24
AthenaOutputStream::m_compressionListHigh
StringArrayProperty m_compressionListHigh
Vector of item names.
Definition: AthenaOutputStream.h:97
AthenaOutputStream::m_forceRead
bool m_forceRead
set to true to force read of data objects in item list
Definition: AthenaOutputStream.h:130
AthenaOutputStream::m_writeOnExecute
bool m_writeOnExecute
set to true to trigger streaming of data on execute()
Definition: AthenaOutputStream.h:135
AthenaOutputStream::m_streamer
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
Definition: AthenaOutputStream.h:147
AthenaOutputStream::m_outSeqSvc
ServiceHandle< OutputStreamSequencerSvc > m_outSeqSvc
Definition: AthenaOutputStream.h:86
AthenaOutputStream::m_compressionBitsLow
unsigned int m_compressionBitsLow
Number of mantissa bits in the float compression.
Definition: AthenaOutputStream.h:103
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
AthenaOutputStream::m_extendProvenanceRecord
bool m_extendProvenanceRecord
set to false to omit adding the current DataHeader into the DataHeader history this will cause the in...
Definition: AthenaOutputStream.h:133
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MetaDataSvc::ToolLockGuard
Definition: MetaDataSvc.h:257
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
AthenaOutputStream::m_itemSvc
ServiceHandle< IItemListSvc > m_itemSvc
Definition: AthenaOutputStream.h:70
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
AthenaOutputStream::m_slotRangeMap
std::map< unsigned, std::string > m_slotRangeMap
map of filenames assigned to active slots
Definition: AthenaOutputStream.h:156
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sel
sel
Definition: SUSYToolsTester.cxx:92
AthenaOutputStream::compressionListHandlerLow
void compressionListHandlerLow(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
Definition: AthenaOutputStream.cxx:1153
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
calibdata.exception
exception
Definition: calibdata.py:496
IAthenaOutputStreamTool::connectOutput
virtual StatusCode connectOutput(const std::string &outputName="")=0
Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wan...
LHEF::Reader
Pythia8::Reader Reader
Definition: Prophecy4fMerger.cxx:11
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaOutputStream::m_itemListFromTool
bool m_itemListFromTool
set to write out everything in input DataHeader
Definition: AthenaOutputStream.h:139
IAthenaOutputStreamTool::connectServices
virtual StatusCode connectServices(const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord=false)=0
Specify which data store and conversion service to use and whether to extend provenence Only use if o...
AthenaOutputStream::m_helperTools
ToolHandleArray< IAthenaOutputTool > m_helperTools
vector of AlgTools that that are executed by this stream
Definition: AthenaOutputStream.h:149
AthenaOutputStream::m_ownedObjects
std::vector< std::unique_ptr< DataObject > > m_ownedObjects
Collection of DataObject instances owned by this service.
Definition: AthenaOutputStream.h:126
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
AthenaOutputStream::excludeListHandler
void excludeListHandler(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
Definition: AthenaOutputStream.cxx:1135
AthenaOutputStream::compressionListHandlerHigh
void compressionListHandlerHigh(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
Definition: AthenaOutputStream.cxx:1144
AthenaOutputStream::handleVariableSelection
void handleVariableSelection(const SG::IConstAuxStore &auxstore, SG::DataProxy &itemProxy, const std::string &tns, const std::string &aux_attr, SG::SelectionVetoes &vetoes) const
Definition: AthenaOutputStream.cxx:1073
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthenaOutputStream::m_writeMetadataAndDisconnect
bool m_writeMetadataAndDisconnect
Definition: AthenaOutputStream.h:152
AthenaOutputStream::m_transient
ToolHandle< SG::IFolder > m_transient
Decoded list of transient ids.
Definition: AthenaOutputStream.h:116
AthenaOutputStream::finalizeRange
void finalizeRange(const std::string &rangeFN)
Definition: AthenaOutputStream.cxx:446
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
AthenaOutputStream::m_outputName
std::string m_outputName
Name of the output file.
Definition: AthenaOutputStream.h:81
AthenaOutputStream::itemListHandler
void itemListHandler(Gaudi::Details::PropertyBase &)
Handler for ItemNames Property.
Definition: AthenaOutputStream.cxx:1125
xAOD::AuxSelection
Class helping in dealing with dynamic branch selection.
Definition: AuxSelection.h:31
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
AthenaOutputStream::m_metadataStore
ServiceHandle< StoreGateSvc > m_metadataStore
Definition: AthenaOutputStream.h:67
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
AthenaOutputStream::io_reinit
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
Definition: AthenaOutputStream.cxx:1227
item
Definition: ItemListSvc.h:43
AthenaOutputStream::m_tpCnvSvc
ServiceHandle< ITPCnvSvc > m_tpCnvSvc
Definition: AthenaOutputStream.h:74
SG::DataProxy::name
virtual const name_type & name() const override final
Retrieve data object key == string.
AthenaOutputStream::m_streamName
StringProperty m_streamName
Stream name (defaults to algorithm name)
Definition: AthenaOutputStream.h:89
AthenaOutputStream::m_altObjects
IDataSelector m_altObjects
Objects overridden by ‘exact’ handling.
Definition: AthenaOutputStream.h:122
IAthenaOutputStreamTool::commitOutput
virtual StatusCode commitOutput(bool doCommit=false)=0
Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.
AthenaOutputStream::m_dictLoader
ServiceHandle< IDictLoaderSvc > m_dictLoader
Definition: AthenaOutputStream.h:73
AthenaOutputStream::m_metaDataSvc
ServiceHandle< MetaDataSvc > m_metaDataSvc
Definition: AthenaOutputStream.h:71
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
AthenaOutputStream::m_events
std::atomic< int > m_events
Number of events written to this output stream.
Definition: AthenaOutputStream.h:128
AthenaOutputStream::m_compressionDecoderHigh
ToolHandle< SG::IFolder > m_compressionDecoderHigh
the top-level folder with items to be compressed high
Definition: AthenaOutputStream.h:112
AthenaOutputStream::m_mutex
mutex_t m_mutex
Definition: AthenaOutputStream.h:165
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FilteredAlgorithm::FilteredAlgorithm
FilteredAlgorithm()
ITPCnvBase::persistentTInfo
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for
DeMoScan.first
bool first
Definition: DeMoScan.py:534
AthenaOutputStream::m_streamerMap
std::map< std::string, std::unique_ptr< IAthenaOutputStreamTool > > m_streamerMap
map of streamerTools handling event ranges in MT
Definition: AthenaOutputStream.h:162
AthenaOutputStream::m_objectWriteCounter
CounterMapType m_objectWriteCounter
Definition: AthenaOutputStream.h:144
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
collListGuids.attributes
attributes
Definition: collListGuids.py:46
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
AthenaOutputStream::write
virtual StatusCode write()
Stream the data.
Definition: AthenaOutputStream.cxx:585
AthenaOutputStream::m_selVetoesKey
SG::WriteHandleKey< SG::SelectionVetoes > m_selVetoesKey
Key used for recording selected dynamic variable information to the event store.
Definition: AthenaOutputStream.h:171
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64
AthenaOutputStream::m_writeOnFinalize
bool m_writeOnFinalize
set to true to trigger streaming of data on finalize()
Definition: AthenaOutputStream.h:137
GetLBsToIgnore.outputFN
outputFN
Definition: GetLBsToIgnore.py:225
python.PyAthena.obj
obj
Definition: PyAthena.py:135
FilteredAlgorithm::m_decSvc
ServiceHandle< IDecisionSvc > m_decSvc
Definition: FilteredAlgorithm.h:44
MetaContBase::getAsVoid
virtual void * getAsVoid(const SourceID &sid) const =0
IAthenaOutputStreamTool::streamObjects
virtual StatusCode streamObjects(const TypeKeyPairs &typeKeys, const std::string &outputName="")=0
SG::DataProxy
Definition: DataProxy.h:44
SG::FolderItem
a Folder item (data object) is identified by the clid/key pair
Definition: SGFolderItem.h:24
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthenaOutputStream::m_excludeList
StringArrayProperty m_excludeList
Vector of item names.
Definition: AthenaOutputStream.h:95
SG::IConstAuxStore::getAuxIDs
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
SG::ConstProxyIterator
ProxyMap::const_iterator ConstProxyIterator
Definition: ProxyMap.h:28
physval_make_web_display.failed
bool failed
Definition: physval_make_web_display.py:290
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
AthenaOutputStream::handle
virtual void handle(const Incident &incident) override
Incident service handle listening for MetaDataStop.
Definition: AthenaOutputStream.cxx:370
AthenaOutputStream::m_p2BWritten
ToolHandle< SG::IFolder > m_p2BWritten
the top-level folder with items to be written
Definition: AthenaOutputStream.h:108
fitman.k
k
Definition: fitman.py:528
AthenaOutputStream::clearSelection
void clearSelection()
Clear list of selected objects.
Definition: AthenaOutputStream.cxx:697
python.BeamSpotUpdate.compression
compression
Definition: BeamSpotUpdate.py:188
AthenaOutputStream::m_compressionDecoderLow
ToolHandle< SG::IFolder > m_compressionDecoderLow
the top-level folder with items to be compressed low
Definition: AthenaOutputStream.h:114
ServiceHandle< IIoComponentMgr >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.
AthenaOutputStream::m_compInfoKey
SG::WriteHandleKey< SG::CompressionInfo > m_compInfoKey
Key used for recording lossy float compressed variable information to the event store.
Definition: AthenaOutputStream.h:176