|
ATLAS Offline Software
|
this class is OBSOLETE. Use AthenaOutputStream with writeOnExecute=false and writeOnFinalize=true instead. out stream specialized for condition data. Write data at finalize only
More...
#include <AthenaConditionStream.h>
|
ServiceHandle< StoreGateSvc > | m_dataStore |
| handle to the StoreGateSvc store where the data we want to write out resides More...
|
|
ServiceHandle< StoreGateSvc > | m_metadataStore |
|
ServiceHandle< StoreGateSvc > * | m_currentStore |
|
ServiceHandle< IItemListSvc > | m_itemSvc |
|
ServiceHandle< MetaDataSvc > | m_metaDataSvc |
|
ServiceHandle< IDictLoaderSvc > | m_dictLoader |
|
ServiceHandle< ITPCnvSvc > | m_tpCnvSvc |
|
ServiceHandle< IIncidentSvc > | m_incidentSvc |
|
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< OutputStreamSequencerSvc > | m_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::IFolder > | m_p2BWritten |
| the top-level folder with items to be written More...
|
|
ToolHandle< SG::IFolder > | m_decoder |
| the top-level folder with items to be written More...
|
|
ToolHandle< SG::IFolder > | m_compressionDecoderHigh |
| the top-level folder with items to be compressed high More...
|
|
ToolHandle< SG::IFolder > | m_compressionDecoderLow |
| the top-level folder with items to be compressed low More...
|
|
ToolHandle< SG::IFolder > | m_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< IAthenaOutputStreamTool > | m_streamer |
| pointer to AthenaOutputStreamTool More...
|
|
ToolHandleArray< IAthenaOutputTool > | m_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 |
|
|
virtual StatusCode | initialize () 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...
|
|
this class is OBSOLETE. Use AthenaOutputStream with writeOnExecute=false and writeOnFinalize=true instead. out stream specialized for condition data. Write data at finalize only
- Author
- srini.nosp@m.r@bn.nosp@m.l.gov
- Id
- AthenaConditionStream.h,v 1.2 2008-09-24 18:36:04 binet Exp
Definition at line 21 of file AthenaConditionStream.h.
◆ CounterMapType
◆ IClassIDSvc_t
◆ Items
◆ mutex_t
◆ TypeKeyPairs
◆ AthenaConditionStream()
AthenaConditionStream::AthenaConditionStream |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AthenaConditionStream()
AthenaConditionStream::~AthenaConditionStream |
( |
| ) |
|
|
virtual |
◆ addItemObjects()
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 769 of file AthenaOutputStream.cxx.
774 size_t dotpos =
item.key().find(
'.');
775 string item_key, aux_attr;
776 if( dotpos != string::npos ) {
777 item_key =
item.key().substr(0, dotpos+1);
778 aux_attr =
item.key().substr(dotpos+1);
780 item_key =
item.key();
783 ATH_MSG_DEBUG(
"addItemObjects(" << item_id <<
",\"" << item_key <<
"\") called");
785 if( aux_attr.size() ) {
788 static const std::string wildCard =
"*";
789 std::set<std::string> clidKeys;
791 iter != iterEnd; ++iter) {
792 if (iter->id() == item_id) {
793 clidKeys.insert(iter->key());
800 std::map< unsigned int, std::set< std::string > > comp_attr_map;
805 for(
const auto&
it : comp_attr_map ) {
806 ATH_MSG_DEBUG(
" Comp Attr " <<
it.second.size() <<
" with " <<
it.first <<
" mantissa bits.");
807 if (
it.second.size() > 0 ) {
808 for(
const auto& attr :
it.second ) {
818 bool gotProxies =
false;
821 if (
match !=
nullptr) {
822 map.insert({item_key,
match});
828 if (!gotProxies && ((*m_currentStore)->proxyRange(remapped_item_id, iter,
end)).isSuccess()) {
832 bool added =
false, removed =
false;
835 std::vector<std::string> keyTokens;
836 keyTokens.reserve(2);
837 std::vector<std::string> xkeyTokens;
838 xkeyTokens.reserve(2);
839 ATH_MSG_VERBOSE(
"Calling tokenizeAtStep( " << keyTokens <<
", " << item_key <<
", " << wildCard <<
")" );
841 ATH_MSG_VERBOSE(
"Done calling tokenizeAtStep( " << keyTokens <<
", " << item_key <<
", " << wildCard <<
")" );
843 for (; iter !=
end; ++iter) {
845 string proxyName = itemProxy->name();
852 bool keyMatch = ( item_key ==
"*" ||
853 item_key == proxyName ||
854 itemProxy->hasAlias(item_key) );
856 ATH_MSG_VERBOSE(
"Calling matchKey( " << keyTokens <<
", " << proxyName <<
")" );
857 keyMatch =
matchKey(keyTokens, proxyName);
858 ATH_MSG_VERBOSE(
"Done calling matchKey( " << keyTokens <<
", " << proxyName <<
") with result: " << keyMatch );
862 bool xkeyMatch =
false;
863 for (std::set<std::string>::const_iterator c2k_it = clidKeys.begin(), c2k_itEnd = clidKeys.end();
864 keyMatch && c2k_it != c2k_itEnd; ++c2k_it) {
865 if (*c2k_it == wildCard) {
869 std::string::size_type xsep = c2k_it->find(wildCard);
871 if (xsep == std::string::npos) {
872 if (*c2k_it == proxyName) {
878 xkeyMatch =
matchKey(xkeyTokens, proxyName);
888 if (keyMatch && !xkeyMatch) {
890 if (
nullptr == itemProxy->accessData()) {
891 ATH_MSG_ERROR(
" Could not get data object for id " << remapped_item_id <<
",\"" << proxyName);
894 if (
nullptr != itemProxy->object()) {
898 if( item_id != remapped_item_id ) {
905 auto altbucket = std::make_unique<AltDataBucket>(
911 ATH_MSG_ERROR(
"Failed to retrieve object from MetaCont with key=" << item_key <<
", for EventRangeID=" <<
m_outSeqSvc->currentRangeID() );
912 return StatusCode::FAILURE;
914 }
else if (
item.exact()) {
918 if (!dbb) std::abort();
919 void*
ptr = dbb->
cast (item_id);
925 std::make_unique<AltDataBucket>
934 m_objects.push_back(itemProxy->object());
935 ATH_MSG_DEBUG(
" Added object " << item_id <<
",\"" << proxyName <<
"\"");
940 std::stringstream tns;
941 if (!
m_pCLIDSvc->getTypeNameOfID(item_id, tn).isSuccess()) {
943 << item_id <<
",\"" << proxyName);
944 tns << item_id <<
'_' << proxyName;
946 tn +=
'_' + proxyName;
961 << itemProxy->clID() <<
" to SG::IConstAuxStore*" );
975 std::string
key = item_key;
976 key.erase (
key.size()-4, 4);
983 for(
const auto&
it :
compression.getCompressedAuxIDs( allVars ) ) {
984 if(
it.second.size() > 0 ) {
985 compInfo[
key ][
it.first ] =
it.second;
987 " variables that'll be lossy float compressed"
988 " with " <<
it.first <<
" mantissa bits" );
1007 if (
m_itemSvc->addStreamItem(this->name(),tns.str()).isFailure()) {
1011 }
else if (keyMatch && xkeyMatch) {
1015 if (!added && !removed) {
1016 ATH_MSG_DEBUG(
" No object matching " << item_id <<
",\"" << item_key <<
"\" found");
1017 }
else if (removed) {
1018 ATH_MSG_DEBUG(
" Object being excluded based on property setting "
1019 << item_id <<
",\"" << item_key <<
"\". Skipping");
1022 ATH_MSG_DEBUG(
" Failed to receive proxy iterators from StoreGate for "
1023 << item_id <<
",\"" << item_key <<
"\". Skipping");
1025 return StatusCode::SUCCESS;
◆ buildCompressionSet()
std::set< std::string > AthenaOutputStream::buildCompressionSet |
( |
const ToolHandle< SG::IFolder > & |
handle, |
|
|
const CLID & |
item_id, |
|
|
const std::string & |
item_key |
|
) |
| const |
|
privateinherited |
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 1034 of file AthenaOutputStream.cxx.
1039 std::set<std::string>
result;
1042 if(item_key.find(
"Aux.") == string::npos) {
1048 iter != iterEnd; ++iter) {
1050 if (iter->id() != item_id) {
1054 size_t seppos = iter->key().find(
'.');
1055 string comp_item_key{
""}, comp_str{
""};
1056 if(seppos != string::npos) {
1057 comp_item_key = iter->key().substr(0, seppos+1);
1058 comp_str = iter->key().substr(seppos+1);
1060 comp_item_key = iter->key();
1064 if (!comp_str.empty() && comp_item_key == item_key) {
1065 std::stringstream
ss(comp_str);
1067 while( std::getline(
ss, attr,
'.') ) {
◆ clearSelection()
void AthenaOutputStream::clearSelection |
( |
| ) |
|
|
inherited |
◆ collectAllObjects()
StatusCode AthenaOutputStream::collectAllObjects |
( |
| ) |
|
|
inherited |
Collect data objects for output streamer list.
Definition at line 707 of file AthenaOutputStream.cxx.
710 ATH_MSG_WARNING(
"collectAllObjects() could not get ItemList from Tool.");
714 auto vetoes = std::make_unique<SG::SelectionVetoes>();
715 auto compInfo = std::make_unique<SG::CompressionInfo>();
718 std::vector<CLID> folderclids;
723 folderclids.push_back(
i->id());
728 IDataSelector prunedList;
730 if (
std::find(folderclids.begin(),folderclids.end(),(*it)->clID())!=folderclids.end()) {
733 (*it)->name() <<
" ignored");
736 prunedList.push_back(*
it);
740 ATH_MSG_DEBUG(
"Object " << (*it)->clID() <<
","<< (*it)->name() <<
" found that was not in itemlist");
744 for (
auto it = prunedList.begin();
it != prunedList.end(); ++
it) {
745 if ((*it)->name().length() > 4 && (*it)->name().substr((*it)->name().length() - 4) ==
"Aux.") {
749 for (
auto it = prunedList.begin();
it != prunedList.end(); ++
it) {
750 if ((*it)->name().length() <= 4 || (*it)->name().substr((*it)->name().length() - 4) !=
"Aux.") {
756 if (!vetoes->empty()) {
761 if (!compInfo->empty()) {
765 return StatusCode::SUCCESS;
◆ compressionListHandlerHigh()
void AthenaOutputStream::compressionListHandlerHigh |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
protectedinherited |
◆ compressionListHandlerLow()
void AthenaOutputStream::compressionListHandlerLow |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
protectedinherited |
◆ excludeListHandler()
void AthenaOutputStream::excludeListHandler |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
protectedinherited |
Handler for ItemNames Property.
Definition at line 1139 of file AthenaOutputStream.cxx.
1140 IProperty *pAsIProp(
nullptr);
1141 if ((
m_decoder.retrieve()).isFailure() ||
1142 nullptr == (pAsIProp =
dynamic_cast<IProperty*
>(&*
m_decoder)) ||
1143 (pAsIProp->setProperty(
"ItemList",
m_excludeList.toString())).isFailure()) {
1144 throw GaudiException(
"Folder property [itemList] not found",
name(), StatusCode::FAILURE);
◆ execute()
StatusCode AthenaConditionStream::execute |
( |
| ) |
|
|
virtual |
◆ finalize()
StatusCode AthenaConditionStream::finalize |
( |
| ) |
|
|
virtual |
◆ finalizeRange()
void AthenaOutputStream::finalizeRange |
( |
const std::string & |
rangeFN | ) |
|
|
privateinherited |
Definition at line 444 of file AthenaOutputStream.cxx.
453 ATH_MSG_INFO(
"Finished writing Event Sequence to " << rangeFN);
455 strm_iter->second->finalizeOutput().ignore();
456 strm_iter->second->finalize().ignore();
◆ handle()
void AthenaOutputStream::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtualinherited |
Incident service handle listening for MetaDataStop.
Definition at line 368 of file AthenaOutputStream.cxx.
372 std::unique_lock<mutex_t> lock(
m_mutex);
374 if( inc.type() ==
"MetaDataStop" ) {
395 EventContext::ContextID_t slot = inc.context().slot();
396 if( slot == EventContext::INVALID_CONTEXT_ID ) {
397 throw GaudiException(
"Received Incident with invalid slot in ES mode",
name(), StatusCode::FAILURE);
399 auto count_events_in_range = [&](
const std::string&
range) {
401 [&](
auto&
el){return el.second == range;} );
403 if( inc.type() == IncidentType::BeginProcessing ) {
408 if( !rangeFN.empty() and rangeFN != newRangeFN ) {
409 ATH_MSG_INFO(
"Slot range change: '" << rangeFN <<
"' -> '" << newRangeFN <<
"'");
414 if( count_events_in_range(rangeFN) == 1 ) {
418 ATH_MSG_INFO(
"slot " << slot <<
" processing event in range: " << newRangeFN);
423 else if( inc.type() == IncidentType::EndProcessing ) {
432 if( count_events_in_range(rangeFN) == 1 ) {
439 ATH_MSG_DEBUG(
"Leaving incident handler for " << inc.type());
◆ handleVariableSelection()
Definition at line 1077 of file AthenaOutputStream.cxx.
1085 if( aux_attr.size() ) {
1086 std::stringstream
ss(aux_attr);
1088 while( std::getline(
ss, attr,
'.') ) {
1090 std::stringstream temp;
1091 temp << tns << attr;
1092 if (
m_itemSvc->addStreamItem(this->name(),temp.str()).isFailure()) {
1103 std::string
key = itemProxy.
name();
1104 if (
key.size() >= 4 &&
key.compare (
key.size()-4, 4,
"Aux.")==0)
1106 key.erase (
key.size()-4, 4);
1122 if ( !selected.
test( auxid ) ) {
◆ initialize()
StatusCode AthenaOutputStream::initialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 211 of file AthenaOutputStream.cxx.
267 IProperty *pAsIProp =
dynamic_cast<IProperty*
> (&*
m_transient);
270 return StatusCode::FAILURE;
278 const std::string&
k =
item.key();
279 if (
k.find(
'*') != std::string::npos)
continue;
280 if (
k.find(
'.') != std::string::npos)
continue;
282 if (titem.id() ==
item.id() && titem.key() ==
k) {
294 IProperty *pAsIProp =
dynamic_cast<IProperty*
> (&*
m_transient);
297 return StatusCode::FAILURE;
313 m_incidentSvc->addListener(
this, IncidentType::BeginProcessing, 95);
314 m_incidentSvc->addListener(
this, IncidentType::EndProcessing, 95);
319 if(m_compressionBitsHigh < 5 || m_compressionBitsHigh > 23) {
320 ATH_MSG_INFO(
"Float compression mantissa bits for high compression " <<
325 if(m_compressionBitsLow < 5 || m_compressionBitsLow > 23) {
326 ATH_MSG_INFO(
"Float compression mantissa bits for low compression " <<
332 ATH_MSG_ERROR(
"Float compression mantissa bits for low compression " <<
335 return StatusCode::FAILURE;
338 ATH_MSG_VERBOSE(
"Both high and low float compression lists are empty. Float compression will NOT be applied.");
340 ATH_MSG_INFO(
"Either high or low (or both) float compression lists are defined. Float compression will be applied.");
358 return StatusCode::SUCCESS;
◆ io_finalize()
StatusCode AthenaOutputStream::io_finalize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 1248 of file AthenaOutputStream.cxx.
1251 if (!
tool->preFinalize().isSuccess()) {
1255 const Incident metaDataStopIncident(
name(),
"MetaDataStop");
1256 this->
handle(metaDataStopIncident);
1261 return StatusCode::SUCCESS;
◆ io_reinit()
StatusCode AthenaOutputStream::io_reinit |
( |
| ) |
|
|
overridevirtualinherited |
Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2)
)
Definition at line 1231 of file AthenaOutputStream.cxx.
1240 if (!
tool->postInitialize().isSuccess()) {
1244 return StatusCode::SUCCESS;
◆ itemListHandler()
void AthenaOutputStream::itemListHandler |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
protectedinherited |
Handler for ItemNames Property.
Definition at line 1129 of file AthenaOutputStream.cxx.
1131 IProperty *pAsIProp(
nullptr);
1133 nullptr == (pAsIProp =
dynamic_cast<IProperty*
>(&*
m_p2BWritten)) ||
1134 (pAsIProp->setProperty(
m_itemList)).isFailure()) {
1135 throw GaudiException(
"Folder property [itemList] not found",
name(), StatusCode::FAILURE);
◆ loadDict()
void AthenaOutputStream::loadDict |
( |
CLID |
clid | ) |
|
|
privateinherited |
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 1270 of file AthenaOutputStream.cxx.
1275 std::unique_ptr<ITPCnvBase> tpcnv =
m_tpCnvSvc->t2p_cnv_unique (clid);
◆ matchKey()
bool AthenaOutputStream::matchKey |
( |
const std::vector< std::string > & |
key, |
|
|
const std::string & |
proxyName |
|
) |
| const |
|
privateinherited |
Try to match a DataProxy name to a vector of strings.
Definition at line 1188 of file AthenaOutputStream.cxx.
1190 bool keyMatch =
true;
1193 std::vector<std::string>::const_iterator itrEnd =
key.cend();
1194 std::vector<std::string>::const_iterator itr =
key.cbegin();
1198 std::string::size_type proxyNamePos=0;
1199 while ( itr != itrEnd &&
1200 std::string::npos != ( proxyNamePos = proxyName.find(*itr, proxyNamePos) )
1203 ATH_MSG_VERBOSE(
"If we are at the begin iterator and the first element is Not an empty string");
1204 if ( !(
key.front().empty()) && itr ==
key.cbegin() && proxyNamePos != 0 ) {
1206 ATH_MSG_VERBOSE(
"We had to match a precise name at the beginning, but didn't find it at the beginning");
1210 if ( !(
key.back().empty()) && itr == --(
key.cend()) && (proxyNamePos+itr->size()!=proxyName.size()) ) {
1212 ATH_MSG_VERBOSE(
"We had to match a precise name at the end, but didn't find it at the end");
1215 ATH_MSG_VERBOSE(
"Found a match of subkey: " << *itr <<
" in string: " << proxyName
1216 <<
" at position: " << proxyNamePos );
1218 proxyNamePos += itr->size();
1222 if ( itr != itrEnd ) {
1224 ATH_MSG_VERBOSE(
"Couldn't match every sub-string... return: " << keyMatch);
1226 else {
ATH_MSG_VERBOSE(
"Did match every sub-string... return: " << keyMatch); }
◆ selectedObjects()
IDataSelector* AthenaOutputStream::selectedObjects |
( |
| ) |
|
|
inlineinherited |
◆ stop()
StatusCode AthenaOutputStream::stop |
( |
| ) |
|
|
overridevirtualinherited |
◆ tokenizeAtSep()
void AthenaOutputStream::tokenizeAtSep |
( |
std::vector< std::string > & |
subStrings, |
|
|
const std::string & |
portia, |
|
|
const std::string & |
sepstr |
|
) |
| const |
|
privateinherited |
tokenize a string based on a substring
Definition at line 1166 of file AthenaOutputStream.cxx.
1171 if (portia.starts_with( sepstr )) {
1172 subStrings.push_back(
"");
1174 boost::char_separator<char> csep(sepstr.c_str());
1175 boost::tokenizer<char_separator<char>>
tokens(portia, csep);
1176 for (
const std::string&
t :
tokens) {
1178 subStrings.push_back(
t);
1181 if ( portia.size() >= sepstr.size() &&
1182 portia.compare( portia.size() - sepstr.size(), sepstr.size(), sepstr) == 0 ) {
1183 subStrings.push_back(
"");
◆ write()
StatusCode AthenaOutputStream::write |
( |
| ) |
|
|
virtualinherited |
Stream the data.
Definition at line 592 of file AthenaOutputStream.cxx.
597 std::unique_lock<mutex_t> lock(
m_mutex);
609 IProperty *mstreamer_props =
dynamic_cast<IProperty*
> (&*
m_streamer);
610 IProperty *streamer_props =
dynamic_cast<IProperty*
> (&*streamer);
611 for (
const auto& prop : mstreamer_props->getProperties() ) {
612 ATH_CHECK( streamer_props->setProperty( *prop ) );
614 if( !streamer or streamer->initialize().isFailure()
617 return StatusCode::FAILURE;
630 std::vector<std::unique_ptr<DataObject> > ownedObjects = std::move(
m_ownedObjects );
634 bool checkCountError =
false;
637 unsigned int lastCount = 0;
640 bool isError =
false;
642 lastCount = (*cit).second;
644 }
else if (lastCount != (*cit).second) {
647 checkCountError =
true;
651 << (*cit).first <<
", " << (*cit).second <<
" should be: " << lastCount);
653 ATH_MSG_DEBUG(
" Object/count: " << (*cit).first <<
", " << (*cit).second);
656 if (checkCountError) {
657 ATH_MSG_FATAL(
"Check number of writes failed. See messages above "
658 "to identify which container is not always written");
659 return(StatusCode::FAILURE);
675 return StatusCode::FAILURE;
680 if (!currentStatus.isSuccess()) {
681 if (!currentStatus.isRecoverable()) {
688 bool doCommit =
false;
694 return(StatusCode::FAILURE);
697 return(StatusCode::SUCCESS);
◆ writeMetaData()
void AthenaOutputStream::writeMetaData |
( |
const std::string & |
outputFN = "" | ) |
|
|
privateinherited |
Write MetaData for this stream (by default) or for a substream outputFN (in ES mode)
Definition at line 465 of file AthenaOutputStream.cxx.
471 if (!
tool->preFinalize().isSuccess()) {
472 throw GaudiException(
"Cannot finalize helper tool",
name(), StatusCode::FAILURE);
476 throw GaudiException(
"Failed on MetaDataSvc prepareOutput",
name(), StatusCode::FAILURE);
483 if (
write().isFailure()) {
484 throw GaudiException(
"Cannot write on finalize",
name(), StatusCode::FAILURE);
491 size_t pos = DHFWriteIncidentfileName.find(
':');
492 if(
pos != std::string::npos ) DHFWriteIncidentfileName = DHFWriteIncidentfileName.substr(
pos+1);
493 FileIncident incident(
name(),
"WriteDataHeaderForms", DHFWriteIncidentfileName);
501 throw GaudiException(
"Unable to connect metadata services",
name(), StatusCode::FAILURE);
504 m_outputAttributes =
"[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData][AttributeListKey=]";
506 IProperty *pAsIProp(
nullptr);
508 nullptr == (pAsIProp =
dynamic_cast<IProperty*
>(&*
m_p2BWritten)) ||
510 throw GaudiException(
"Folder property [metadataItemList] not found",
name(), StatusCode::FAILURE);
512 if (
write().isFailure()) {
513 throw GaudiException(
"Cannot write metadata",
name(), StatusCode::FAILURE);
522 throw GaudiException(
"Unable to re-connect services",
name(), StatusCode::FAILURE);
525 if ((pAsIProp->setProperty(
m_itemList)).isFailure()) {
526 throw GaudiException(
"Folder property [itemList] not found",
name(), StatusCode::FAILURE);
◆ m_altObjects
IDataSelector AthenaOutputStream::m_altObjects |
|
protectedinherited |
◆ m_checkNumberOfWrites
bool AthenaOutputStream::m_checkNumberOfWrites |
|
protectedinherited |
set to true to check for number of times each object is written
Definition at line 140 of file AthenaOutputStream.h.
◆ m_CLIDKeyPairs
std::multimap<CLID,std::string> AthenaOutputStream::m_CLIDKeyPairs |
|
protectedinherited |
map of (clid,key) pairs to be excluded (comes from m_excludeList)
Definition at line 117 of file AthenaOutputStream.h.
◆ m_compInfoKey
Key used for recording lossy float compressed variable information to the event store.
Definition at line 174 of file AthenaOutputStream.h.
◆ m_compressionBitsHigh
unsigned int AthenaOutputStream::m_compressionBitsHigh |
|
protectedinherited |
◆ m_compressionBitsLow
unsigned int AthenaOutputStream::m_compressionBitsLow |
|
protectedinherited |
◆ m_compressionDecoderHigh
ToolHandle<SG::IFolder> AthenaOutputStream::m_compressionDecoderHigh |
|
protectedinherited |
◆ m_compressionDecoderLow
ToolHandle<SG::IFolder> AthenaOutputStream::m_compressionDecoderLow |
|
protectedinherited |
◆ m_compressionListHigh
StringArrayProperty AthenaOutputStream::m_compressionListHigh |
|
protectedinherited |
◆ m_compressionListLow
StringArrayProperty AthenaOutputStream::m_compressionListLow |
|
protectedinherited |
◆ m_currentStore
◆ m_dataStore
◆ m_decoder
◆ m_dictLoader
◆ m_events
std::atomic<int> AthenaOutputStream::m_events |
|
protectedinherited |
◆ m_excludeList
StringArrayProperty AthenaOutputStream::m_excludeList {this,"ExcludeList",{},"List of metadata items to write","OrderedSet<std::string>"} |
|
protectedinherited |
◆ m_extendProvenanceRecord
bool AthenaOutputStream::m_extendProvenanceRecord |
|
protectedinherited |
◆ m_forceRead
bool AthenaOutputStream::m_forceRead |
|
protectedinherited |
◆ m_helperTools
◆ m_incidentSvc
◆ m_itemList
StringArrayProperty AthenaOutputStream::m_itemList {this,"ItemList",{},"List of items to write","OutputStreamItemList"} |
|
protectedinherited |
◆ m_itemListFromTool
bool AthenaOutputStream::m_itemListFromTool |
|
protectedinherited |
◆ m_itemSvc
◆ m_metadataItemList
StringArrayProperty AthenaOutputStream::m_metadataItemList {this,"MetadataItemList",{},"List of metadata items to write","OutputStreamItemList"} |
|
protectedinherited |
◆ m_metadataStore
◆ m_metaDataSvc
◆ m_mutex
mutex_t AthenaOutputStream::m_mutex |
|
protectedinherited |
◆ m_objects
IDataSelector AthenaOutputStream::m_objects |
|
protectedinherited |
◆ m_objectWriteCounter
◆ m_outputAttributes
std::string AthenaOutputStream::m_outputAttributes |
|
protectedinherited |
◆ m_outputName
std::string AthenaOutputStream::m_outputName |
|
protectedinherited |
◆ m_outSeqSvc
◆ m_ownedObjects
std::vector<std::unique_ptr<DataObject> > AthenaOutputStream::m_ownedObjects |
|
protectedinherited |
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 125 of file AthenaOutputStream.h.
◆ m_p2BWritten
ToolHandle<SG::IFolder> AthenaOutputStream::m_p2BWritten |
|
protectedinherited |
◆ m_pCLIDSvc
◆ m_persName
std::string AthenaOutputStream::m_persName |
|
protectedinherited |
Name of the persistency service capable to write data from the store.
Definition at line 76 of file AthenaOutputStream.h.
◆ m_rangeIDforRangeFN
std::map< std::string, std::string > AthenaOutputStream::m_rangeIDforRangeFN |
|
protectedinherited |
◆ m_selVetoesKey
Key used for recording selected dynamic variable information to the event store.
Definition at line 169 of file AthenaOutputStream.h.
◆ m_slotRangeMap
std::map< unsigned, std::string > AthenaOutputStream::m_slotRangeMap |
|
protectedinherited |
◆ m_streamer
◆ m_streamerMap
◆ m_streamName
StringProperty AthenaOutputStream::m_streamName {this, "StreamName", "", "name of the output stream"} |
|
protectedinherited |
◆ m_tpCnvSvc
◆ m_transient
ToolHandle<SG::IFolder> AthenaOutputStream::m_transient |
|
protectedinherited |
◆ m_transientItems
StringArrayProperty AthenaOutputStream::m_transientItems |
|
protectedinherited |
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 105 of file AthenaOutputStream.h.
◆ m_writeMetadataAndDisconnect
bool AthenaOutputStream::m_writeMetadataAndDisconnect = false |
|
protectedinherited |
◆ m_writeOnExecute
bool AthenaOutputStream::m_writeOnExecute |
|
protectedinherited |
◆ m_writeOnFinalize
bool AthenaOutputStream::m_writeOnFinalize |
|
protectedinherited |
◆ m_writingTool
StringProperty AthenaOutputStream::m_writingTool |
|
protectedinherited |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::map< std::string, std::string > m_rangeIDforRangeFN
map of RangeIDs (as used by the Sequencer) for each Range filename generated
void writeMetaData(const std::string &outputFN="")
Write MetaData for this stream (by default) or for a substream outputFN (in ES mode)
std::string m_outputAttributes
constexpr char AUX_POSTFIX[]
Common post-fix for the names of auxiliary containers in StoreGate.
std::string find(const std::string &s)
return a remapped string
StatusCode addItemObjects(const SG::FolderItem &, SG::SelectionVetoes &vetoes, SG::CompressionInfo &compInfo)
Add item data objects to output streamer list.
unsigned int m_compressionBitsHigh
Number of mantissa bits in the float compression.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
bool isTransientKey(const std::string &key)
Test to see if a key is transoent.
void tokenizeAtSep(std::vector< std::string > &, const std::string &, const std::string &) const
tokenize a string based on a substring
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
ToolHandle< SG::IFolder > m_decoder
the top-level folder with items to be written
StringArrayProperty m_itemList
Vector of item names.
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.
ServiceHandle< StoreGateSvc > m_dataStore
handle to the StoreGateSvc store where the data we want to write out resides
StringArrayProperty m_compressionListLow
Vector of item names.
virtual void * object()=0
std::string m_persName
Name of the persistency service capable to write data from the store.
bool matchKey(const std::vector< std::string > &key, const std::string &proxyName) const
Try to match a DataProxy name to a vector of strings.
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
ItemList::const_iterator const_iterator
void loadDict(CLID clid)
Helper function to load dictionaries (both transient and persistent) for a given type.
#define ATH_MSG_VERBOSE(x)
virtual StatusCode initialize()
T * cast(SG::IRegisterTransient *irt=0, bool isConst=true)
Return the contents of the DataBucket, converted to type T.
StringArrayProperty m_transientItems
List of items that are known to be present in the transient store (and hence we can make input depend...
IDataSelector m_objects
Collection of objects being selected.
StringArrayProperty m_metadataItemList
Vector of item names.
ServiceHandle< StoreGateSvc > * m_currentStore
std::map< std::string, DataProxy * > ProxyMap
StatusCode collectAllObjects()
Collect data objects for output streamer list.
bool m_checkNumberOfWrites
set to true to check for number of times each object is written
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
StringArrayProperty m_compressionListHigh
Vector of item names.
bool m_forceRead
set to true to force read of data objects in item list
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
ServiceHandle< OutputStreamSequencerSvc > m_outSeqSvc
unsigned int m_compressionBitsLow
Number of mantissa bits in the float compression.
size_t auxid_t
Identifier for a particular aux data item.
bool m_extendProvenanceRecord
set to false to omit adding the current DataHeader into the DataHeader history this will cause the in...
AthenaOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
ServiceHandle< IItemListSvc > m_itemSvc
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
std::map< unsigned, std::string > m_slotRangeMap
map of filenames assigned to active slots
::StatusCode StatusCode
StatusCode definition for legacy code.
Default, invalid implementation of ClassID_traits.
bool m_itemListFromTool
set to write out everything in input DataHeader
ToolHandleArray< IAthenaOutputTool > m_helperTools
vector of AlgTools that that are executed by this stream
std::vector< std::unique_ptr< DataObject > > m_ownedObjects
Collection of DataObject instances owned by this service.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void handleVariableSelection(const SG::IConstAuxStore &auxstore, SG::DataProxy &itemProxy, const std::string &tns, const std::string &aux_attr, SG::SelectionVetoes &vetoes) const
uint32_t CLID
The Class ID type.
bool m_writeMetadataAndDisconnect
ToolHandle< SG::IFolder > m_transient
Decoded list of transient ids.
void finalizeRange(const std::string &rangeFN)
ServiceHandle< IIncidentSvc > m_incidentSvc
std::string m_outputName
Name of the output file.
Class helping in dealing with dynamic branch selection.
ServiceHandle< StoreGateSvc > m_metadataStore
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
ServiceHandle< ITPCnvSvc > m_tpCnvSvc
virtual const name_type & name() const override final
Retrieve data object key == string.
StringProperty m_streamName
Stream name (defaults to algorithm name)
IDataSelector m_altObjects
Objects overridden by ‘exact’ handling.
ServiceHandle< IDictLoaderSvc > m_dictLoader
ServiceHandle< MetaDataSvc > m_metaDataSvc
std::atomic< int > m_events
Number of events written to this output stream.
ToolHandle< SG::IFolder > m_compressionDecoderHigh
the top-level folder with items to be compressed high
#define ATH_MSG_WARNING(x)
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for
virtual StatusCode execute() override
std::map< std::string, std::unique_ptr< IAthenaOutputStreamTool > > m_streamerMap
map of streamerTools handling event ranges in MT
CounterMapType m_objectWriteCounter
A set of aux data identifiers.
virtual StatusCode write()
Stream the data.
SG::WriteHandleKey< SG::SelectionVetoes > m_selVetoesKey
Key used for recording selected dynamic variable information to the event store.
Interface for const operations on an auxiliary store.
bool m_writeOnFinalize
set to true to trigger streaming of data on finalize()
a Folder item (data object) is identified by the clid/key pair
StringArrayProperty m_excludeList
Vector of item names.
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
ProxyMap::const_iterator ConstProxyIterator
bool match(std::string s1, std::string s2)
match the individual directories of two strings
virtual void handle(const Incident &incident) override
Incident service handle listening for MetaDataStop.
ToolHandle< SG::IFolder > m_p2BWritten
the top-level folder with items to be written
void clearSelection()
Clear list of selected objects.
ToolHandle< SG::IFolder > m_compressionDecoderLow
the top-level folder with items to be compressed low
bool test(bit_t bit) const
Test to see if a bit is set.
SG::WriteHandleKey< SG::CompressionInfo > m_compInfoKey
Key used for recording lossy float compressed variable information to the event store.