ATLAS Offline Software
AthenaOutputStream.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "AthenaOutputStream.h"
6 
7 // Framework include files
8 #include "GaudiKernel/GaudiException.h"
9 #include "GaudiKernel/IAlgManager.h"
10 #include "GaudiKernel/IIoComponentMgr.h"
11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/IOpaqueAddress.h"
13 #include "GaudiKernel/IProperty.h"
14 #include "GaudiKernel/IClassIDSvc.h"
15 #include "GaudiKernel/ClassID.h"
16 #include "GaudiKernel/MsgStream.h"
17 #include "GaudiKernel/AlgTool.h"
18 
23 #include "AthenaKernel/ITPCnvSvc.h"
25 
26 #include "StoreGate/StoreGateSvc.h"
27 #include "StoreGate/WriteHandle.h"
28 #include "SGTools/DataProxy.h"
30 #include "SGTools/transientKey.h"
31 #include "SGTools/ProxyMap.h"
32 #include "SGTools/SGIFolder.h"
34 #include "xAODCore/AuxSelection.h"
36 
42 #include "MetaDataSvc.h"
43 #include "SelectionVetoes.h"
44 
45 #include <boost/tokenizer.hpp>
46 #include <cassert>
47 #include <sstream>
48 
49 using std::string;
50 using std::vector;
51 using boost::tokenizer;
52 using boost::char_separator;
53 
54 //****************************************************************************
55 
56 
57 namespace {
79  class AltDataBucket
80  : public DataBucketBase
81  {
82  public:
83  AltDataBucket (void* ptr, CLID clid, const std::type_info& tinfo,
84  const SG::DataProxy& proxy)
85  : m_proxy(this, makeTransientAddress(clid, proxy).release()),
86  m_ptr (ptr), m_clid (clid), m_tinfo (tinfo)
87  {
88  addRef();
89  }
90  // Extra constructor to create a temporary proxy without aliases, for objects in MetaContainers
91  AltDataBucket(void* ptr, CLID clid, const std::type_info& tinfo, const std::string& name) :
92  m_proxy(this, new SG::TransientAddress(clid, name) ),
93  m_ptr(ptr), m_clid(clid), m_tinfo(tinfo)
94  {
95  addRef();
96  }
97 
98  virtual const CLID& clID() const override { return m_clid; }
99  virtual void* object() override { return m_ptr; }
100  virtual const std::type_info& tinfo() const override { return m_tinfo; }
101  using DataBucketBase::cast;
102  virtual void* cast (CLID /*clid*/,
103  SG::IRegisterTransient* /*irt*/ = nullptr,
104  bool /*isConst*/ = true) override
105  { std::abort(); }
106  virtual void* cast (const std::type_info& tinfo,
107  SG::IRegisterTransient* /*irt*/ = nullptr,
108  bool /*isConst*/ = true) override
109  { if (tinfo == m_tinfo)
110  return m_ptr;
111  return nullptr;
112  }
113  virtual void relinquish() override {}
114  virtual void lock() override {}
115 
116 
117  private:
118  static
119  std::unique_ptr<SG::TransientAddress>
120  makeTransientAddress (CLID clid, const SG::DataProxy& oldProxy);
121 
122  SG::DataProxy m_proxy;
123  void* m_ptr;
124  CLID m_clid;
125  const std::type_info& m_tinfo;
126  };
127 
128 
129  std::unique_ptr<SG::TransientAddress>
130  AltDataBucket::makeTransientAddress (CLID clid, const SG::DataProxy& oldProxy)
131  {
132  auto newTad = std::make_unique<SG::TransientAddress>
133  (clid, oldProxy.name());
134  newTad->setAlias (oldProxy.alias());
135  for (CLID tclid : oldProxy.transientID()) {
136  // Note: this will include derived CLIDs.
137  // Strictly speaking, that's not right; however, filtering them
138  // out can break ElementLinks (for example those used by
139  // ShallowAuxContainer). One will not actually be able to get
140  // a pointer of the derived type, as the conversions in StorableConversion
141  // only support derived->base, not the other way around.
142  newTad->setTransientID (tclid);
143  }
144  return newTad;
145  }
146 
147 
148 } // anonymous namespace
149 
150 
151 //****************************************************************************
152 
153 
154 // Standard Constructor
155 AthenaOutputStream::AthenaOutputStream(const string& name, ISvcLocator* pSvcLocator)
156  : FilteredAlgorithm(name, pSvcLocator),
157  m_dataStore("StoreGateSvc", name),
158  m_metadataStore("MetaDataStore", name),
159  m_currentStore(&m_dataStore),
160  m_itemSvc("ItemListSvc", name),
161  m_metaDataSvc("MetaDataSvc", name),
162  m_dictLoader("AthDictLoaderSvc", name),
163  m_tpCnvSvc("AthTPCnvSvc", name),
164  m_outputAttributes(),
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 }
202 
203 // Standard Destructor
205  m_streamerMap.clear();
206 }
207 
208 // initialize data writer
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 }
362 
364 {
365  ATH_MSG_DEBUG("AthenaOutputStream " << this->name() << " ::stop()");
366  return StatusCode::SUCCESS;
367 }
368 
369 
370 void AthenaOutputStream::handle(const Incident& inc)
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 }
443 
444 
445 // note - this method works in any slot - MetaCont uses the filenames to find objects
446 void AthenaOutputStream::finalizeRange( const std::string & rangeFN )
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 }
462 
463 
464 // method to write MetaData for this stream
465 // in ES mode the range substream is determined by the current Event slot
466 // called from the incident handler - returns void and throws GaudiExceptions on errors
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 }
524 
525 // terminate data writer
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 }
550 
551 
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 }
583 
584 // Work entry point
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 }
695 
696 // Clear collected object list
698  m_objects.erase(m_objects.begin(), m_objects.end());
699  m_ownedObjects.clear();
700  m_altObjects.clear();
701 }
702 
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 }
763 
764 //FIXME refactor: move this in folder. Treat as composite
766  SG::SelectionVetoes& vetoes,
767  SG::CompressionInfo& compInfo)
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 }
1023 
1029 std::set<std::string>
1030 AthenaOutputStream::buildCompressionSet (const ToolHandle<SG::IFolder>& handle,
1031  const CLID& item_id,
1032  const std::string& item_key) const
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 }
1072 
1074  SG::DataProxy& itemProxy,
1075  const std::string& tns,
1076  const std::string& aux_attr,
1077  SG::SelectionVetoes& vetoes) const
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 }
1123 
1124 
1125 void AthenaOutputStream::itemListHandler(Gaudi::Details::PropertyBase& /* theProp */) {
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 }
1134 
1135 void AthenaOutputStream::excludeListHandler(Gaudi::Details::PropertyBase& /* theProp */) {
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 }
1143 
1144 void AthenaOutputStream::compressionListHandlerHigh(Gaudi::Details::PropertyBase& /* theProp */) {
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 }
1152 
1153 void AthenaOutputStream::compressionListHandlerLow(Gaudi::Details::PropertyBase& /* theProp */) {
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 }
1161 
1162 void AthenaOutputStream::tokenizeAtSep( std::vector<std::string>& subStrings,
1163  const std::string& portia,
1164  const std::string& sepstr ) const {
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 }
1183 
1184 bool AthenaOutputStream::matchKey(const std::vector<std::string>& key,
1185  const string& proxyName) const {
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 }
1226 
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 }
1247 
1248 
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 }
1269 
1270 
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 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition: IRegisterTransient.h:28
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
SGIFolder.h
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
FilteredAlgorithm
algorithm that marks for write data objects in SG
Definition: FilteredAlgorithm.h:33
RootAuxDynIO::AUX_POSTFIX
constexpr char AUX_POSTFIX[]
Common post-fix for the names of auxiliary containers in StoreGate.
Definition: RootAuxDynDefs.h:10
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
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
DataBucketBase::lock
virtual void lock()=0
If the held object derives from ILockable, call lock() on it.
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
ITPCnvSvc.h
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
IAthenaOutputTool.h
This file contains the class definition for the IAthenaOutputTool class.
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
SG::SelectionVetoes
std::unordered_map< std::string, SG::auxid_set_t > SelectionVetoes
Map of vetoed variables.
Definition: SelectionVetoes.h:50
AthenaOutputStream::m_persName
std::string m_persName
Name of the persistency service capable to write data from the store.
Definition: AthenaOutputStream.h:77
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
OutputStreamSequencerSvc.h
This file contains the class definition for the OutputStreamSequencerSvc class.
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
SG::DataProxy::accessData
DataObject * accessData()
Access DataObject on-demand using conversion service.
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
AthenaOutputStream::initialize
virtual StatusCode initialize() override
Definition: AthenaOutputStream.cxx:209
SG::DataProxy::isValid
bool isValid() const
called by destructor
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
AthenaOutputStream.h
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
FilteredAlgorithm::initialize
virtual StatusCode initialize()
Definition: FilteredAlgorithm.cxx:46
ITPCnvBase.h
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
transientKey.h
ProxyMap.h
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
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
IAthenaOutputStreamTool.h
Interface to an output stream tool.
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
WriteHandle.h
Handle class for recording to StoreGate.
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
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
IItemListSvc.h
AthenaOutputStream::AthenaOutputStream
AthenaOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
Definition: AthenaOutputStream.cxx:155
RootAuxDynDefs.h
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
IAuxStoreIO.h
Interface providing I/O for a generic auxiliary store.
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
SG::DataProxy::alias
AliasCont_t alias() const
access set of proxy aliases Returns a COPY of the alias set.
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
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::io_finalize
virtual StatusCode io_finalize() override
Definition: AthenaOutputStream.cxx:1249
SG::DataProxy::clID
CLID clID() const
Retrieve clid.
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::CompressionInfo
std::unordered_map< std::string, SG::ThinningInfo::compression_map_t > CompressionInfo
Map of compressed variables and their compression levels.
Definition: CompressionInfo.h:37
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
AthenaOutputStream::stop
virtual StatusCode stop() override
Definition: AthenaOutputStream.cxx:363
xAOD::AuxSelection
Class helping in dealing with dynamic branch selection.
Definition: AuxSelection.h:31
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AuxCompression.h
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
CLIDRegistry.h
a static registry of CLID->typeName entries. NOT for general use. Use ClassIDSvc instead.
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64
MetaDataSvc.h
This file contains the class definition for the MetaDataSvc class.
AuxSelection.h
SG::DataProxy::hasAlias
bool hasAlias(const std::string &key) const
Test to see if a given string is in the alias set.
IDictLoaderSvc.h
AthenaOutputStream::m_events
std::atomic< int > m_events
Number of events written to this output stream.
Definition: AthenaOutputStream.h:128
SG::DataProxy::transientID
bool transientID(CLID id) const
return the list of transient IDs (primary or symLinked):
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
ITPCnvBase::persistentTInfo
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for
AthenaOutputStream::execute
virtual StatusCode execute() override
Definition: AthenaOutputStream.cxx:552
TransientAddress.h
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
IAuxStore.h
Interface for non-const operations on an auxiliary store.
DataBucketBase::relinquish
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
DataBucketBase::tinfo
virtual const std::type_info & tinfo() const =0
Return the type_info for the stored object.
collListGuids.attributes
attributes
Definition: collListGuids.py:46
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
SelectionVetoes.h
merge.status
status
Definition: merge.py:17
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
IConstAuxStore.h
Interface for const operations on an auxiliary store.
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
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
StoreGateSvc.h
SG::FolderItem
a Folder item (data object) is identified by the clid/key pair
Definition: SGFolderItem.h:24
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
AthenaOutputStream::~AthenaOutputStream
virtual ~AthenaOutputStream()
Standard Destructor.
Definition: AthenaOutputStream.cxx:204
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
DataProxy.h