Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
EventSelectorAthenaPool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "EventContextAthenaPool.h"
13 
18 #include "PoolSvc/IPoolSvc.h"
19 #include "StoreGate/StoreGateSvc.h"
20 #include "StoreGate/ReadHandle.h"
21 #include "StoreGate/WriteHandle.h"
22 
24 
25 // Framework
26 #include "GaudiKernel/ClassID.h"
27 #include "GaudiKernel/FileIncident.h"
28 #include "GaudiKernel/IIncidentSvc.h"
29 #include "GaudiKernel/IIoComponentMgr.h"
30 #include "GaudiKernel/GaudiException.h"
31 #include "GaudiKernel/GenericAddress.h"
32 #include "GaudiKernel/StatusCode.h"
33 
34 // Pool
39 
40 #include <boost/tokenizer.hpp>
41 #include <algorithm>
42 #include <sstream>
43 #include <vector>
44 
45 
46 namespace {
48  StatusCode putEvent_ST(const IAthenaIPCTool& tool,
49  long eventNumber, const void* source,
50  size_t nbytes, unsigned int status) {
52  return sc;
53  }
54 }
55 
56 
57 //________________________________________________________________________________
58 EventSelectorAthenaPool::EventSelectorAthenaPool(const std::string& name, ISvcLocator* pSvcLocator) :
59  base_class(name, pSvcLocator)
60 {
61  declareProperty("HelperTools", m_helperTools);
62 
63  // TODO: validate if those are even used
64  m_runNo.verifier().setLower(0);
65  m_oldRunNo.verifier().setLower(0);
66  m_eventsPerRun.verifier().setLower(0);
67  m_firstEventNo.verifier().setLower(1);
68  m_firstLBNo.verifier().setLower(0);
69  m_eventsPerLB.verifier().setLower(0);
70  m_initTimeStamp.verifier().setLower(0);
71 
73  m_inputCollectionsChanged = false;
74 }
75 //________________________________________________________________________________
76 void EventSelectorAthenaPool::inputCollectionsHandler(Gaudi::Details::PropertyBase&) {
77  if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
78  m_inputCollectionsChanged = true;
79  }
80 }
81 //________________________________________________________________________________
83 }
84 //________________________________________________________________________________
87 }
88 //________________________________________________________________________________
90 
91  m_autoRetrieveTools = false;
92  m_checkToolDeps = false;
93 
94  if (m_isSecondary.value()) {
95  ATH_MSG_DEBUG("Initializing secondary event selector " << name());
96  } else {
97  ATH_MSG_DEBUG("Initializing " << name());
98  }
99 
100  if (!::AthService::initialize().isSuccess()) {
101  ATH_MSG_FATAL("Cannot initialize AthService base class.");
102  return(StatusCode::FAILURE);
103  }
104  // Check for input collection
105  if (m_inputCollectionsProp.value().empty()) {
106  ATH_MSG_FATAL("Use the property: EventSelector.InputCollections = "
107  << "[ \"<collectionName>\" ] (list of collections)");
108  return(StatusCode::FAILURE);
109  }
110  boost::char_separator<char> sep_coma(","), sep_hyph("-");
111  boost::tokenizer ranges(m_skipEventRangesProp.value(), sep_coma);
112  for( const std::string& r: ranges ) {
113  boost::tokenizer fromto(r, sep_hyph);
114  auto from_iter = fromto.begin();
115  std::stringstream strstr1( *from_iter );
116  long from, to;
117  strstr1 >> from;
118  if( ++from_iter != fromto.end() ) {
119  std::stringstream strstr2( *from_iter );
120  strstr2 >> to;
121  } else {
122  to = from;
123  }
124  m_skipEventRanges.push_back( std::pair(from,to) );
125  }
126 
127  for( auto v : m_skipEventSequenceProp.value() ) {
128  m_skipEventRanges.push_back( std::pair(v,v) );
129  }
130  std::sort(m_skipEventRanges.begin(), m_skipEventRanges.end());
131  if( msgLvl(MSG::DEBUG) ) {
132  std::stringstream skip_ranges_ss;
133  for( auto& r: m_skipEventRanges ) {
134  if( not skip_ranges_ss.str().empty() ) skip_ranges_ss << ", ";
135  skip_ranges_ss << r.first;
136  if( r.first != r.second) skip_ranges_ss << "-" << r.second;
137  }
138  if( not skip_ranges_ss.str().empty() )
139  ATH_MSG_DEBUG("Events to skip: " << skip_ranges_ss.str());
140  }
141  // CollectionType must be one of:
142  if (m_collectionType.value() != "ExplicitROOT" && m_collectionType.value() != "ImplicitROOT") {
143  ATH_MSG_FATAL("EventSelector.CollectionType must be one of: ExplicitROOT, ImplicitROOT (default)");
144  return(StatusCode::FAILURE);
145  }
146  // Get IncidentSvc
147  if (!m_incidentSvc.retrieve().isSuccess()) {
148  ATH_MSG_FATAL("Cannot get " << m_incidentSvc.typeAndName() << ".");
149  return(StatusCode::FAILURE);
150  }
151  // Listen to the Event Processing incidents
152  if (m_eventStreamingTool.empty()) {
153  m_incidentSvc->addListener(this, IncidentType::BeginProcessing, 0);
154  m_incidentSvc->addListener(this, IncidentType::EndProcessing, 0);
155  }
156 
157  // Get AthenaPoolCnvSvc
158  if (!m_athenaPoolCnvSvc.retrieve().isSuccess()) {
159  ATH_MSG_FATAL("Cannot get " << m_athenaPoolCnvSvc.typeAndName() << ".");
160  return(StatusCode::FAILURE);
161  }
162  // Get CounterTool (if configured)
163  if (!m_counterTool.empty() && !m_counterTool.retrieve().isSuccess()) {
164  ATH_MSG_FATAL("Cannot get CounterTool.");
165  return(StatusCode::FAILURE);
166  }
167  // Get HelperTools
168  if (!m_helperTools.retrieve().isSuccess()) {
169  ATH_MSG_FATAL("Cannot get " << m_helperTools);
170  return(StatusCode::FAILURE);
171  }
172  // Get SharedMemoryTool (if configured)
173  if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.retrieve().isSuccess()) {
174  ATH_MSG_FATAL("Cannot get " << m_eventStreamingTool.typeAndName() << "");
175  return(StatusCode::FAILURE);
176  } else if (m_makeStreamingToolClient.value() == -1) {
177  std::string dummyStr;
178  if (!m_eventStreamingTool->makeClient(m_makeStreamingToolClient.value(), dummyStr).isSuccess()) {
179  ATH_MSG_ERROR("Could not make AthenaPoolCnvSvc a Share Client");
180  return(StatusCode::FAILURE);
181  }
182  }
183 
184  // Ensure the xAODCnvSvc is listed in the EventPersistencySvc
185  ServiceHandle<IProperty> epSvc("EventPersistencySvc", name());
186  std::vector<std::string> propVal;
187  if (!Gaudi::Parsers::parse(propVal , epSvc->getProperty("CnvServices").toString()).isSuccess()) {
188  ATH_MSG_FATAL("Cannot get EventPersistencySvc Property for CnvServices");
189  return(StatusCode::FAILURE);
190  }
191  bool foundCnvSvc = false;
192  for (const auto& property : propVal) {
193  if (property == m_athenaPoolCnvSvc.type()) { foundCnvSvc = true; }
194  }
195  if (!foundCnvSvc) {
196  propVal.push_back(m_athenaPoolCnvSvc.type());
197  if (!epSvc->setProperty("CnvServices", Gaudi::Utils::toString(propVal)).isSuccess()) {
198  ATH_MSG_FATAL("Cannot set EventPersistencySvc Property for CnvServices");
199  return(StatusCode::FAILURE);
200  }
201  }
202 
203  // Register this service for 'I/O' events
204  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
205  if (!iomgr.retrieve().isSuccess()) {
206  ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
207  return(StatusCode::FAILURE);
208  }
209  if (!iomgr->io_register(this).isSuccess()) {
210  ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !");
211  return(StatusCode::FAILURE);
212  }
213  // Register input file's names with the I/O manager
214  const std::vector<std::string>& incol = m_inputCollectionsProp.value();
215  bool allGood = true;
216  std::string fileName, fileType;
217  for (std::size_t icol = 0, imax = incol.size(); icol < imax; icol++) {
218  if (incol[icol].substr(0, 4) == "LFN:" || incol[icol].substr(0, 4) == "FID:") {
219  m_athenaPoolCnvSvc->getPoolSvc()->lookupBestPfn(incol[icol], fileName, fileType);
220  } else {
221  fileName = incol[icol];
222  }
223  if (fileName.substr(0, 4) == "PFN:") {
224  fileName = fileName.substr(4);
225  }
226  if (!iomgr->io_register(this, IIoComponentMgr::IoMode::READ, incol[icol], fileName).isSuccess()) {
227  ATH_MSG_FATAL("could not register [" << incol[icol] << "] for output !");
228  allGood = false;
229  } else {
230  ATH_MSG_VERBOSE("io_register[" << this->name() << "](" << incol[icol] << ") [ok]");
231  }
232  }
233  if (!allGood) {
234  return(StatusCode::FAILURE);
235  }
236 
237  // Connect to PersistencySvc
238  if (!m_athenaPoolCnvSvc->getPoolSvc()->connect(pool::ITransaction::READ, IPoolSvc::kInputStream).isSuccess()) {
239  ATH_MSG_FATAL("Cannot connect to POOL PersistencySvc.");
240  return(StatusCode::FAILURE);
241  }
242  // Jump to reinit() to execute common init/reinit actions
243  m_guid = Guid::null();
244  return reinit();
245 }
246 //________________________________________________________________________________
248  ATH_MSG_DEBUG("reinitialization...");
249 
250  // reset markers
251  m_numEvt.resize(m_inputCollectionsProp.value().size(), -1);
252  for( auto& el : m_numEvt ) el = -1;
253  m_firstEvt.resize(m_inputCollectionsProp.value().size(), -1);
254  for( auto& el : m_firstEvt ) el = -1;
255 
256  // Initialize InputCollectionsIterator
257  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
258  m_curCollection = 0;
259  if (!m_firstEvt.empty()) {
260  m_firstEvt[0] = 0;
261  }
262  m_inputCollectionsChanged = false;
263  m_evtCount = 0;
264  m_headerIterator = 0;
265  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
266  ATH_MSG_INFO("Done reinitialization for shared reader client");
267  return(StatusCode::SUCCESS);
268  }
269  bool retError = false;
270  for (auto& tool : m_helperTools) {
271  if (!tool->postInitialize().isSuccess()) {
272  ATH_MSG_FATAL("Failed to postInitialize() " << tool->name());
273  retError = true;
274  }
275  }
276  if (retError) {
277  ATH_MSG_FATAL("Failed to postInitialize() helperTools");
278  return(StatusCode::FAILURE);
279  }
280 
281  // Create an m_poolCollectionConverter to read the objects in
282  m_poolCollectionConverter = getCollectionCnv();
283  if (m_poolCollectionConverter == nullptr) {
284  ATH_MSG_INFO("No Events found in any Input Collections");
285  if (m_processMetadata.value()) {
286  m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
287  if (!m_inputCollectionsProp.value().empty()) --m_inputCollectionsIterator;
288  //NOTE (wb may 2016): this will make the FirstInputFile incident correspond to last file in the collection ... if want it to be first file then move iterator to begin and then move above two lines below this incident firing
289  if (m_collectionType.value() == "ImplicitROOT" && !m_firedIncident && !m_inputCollectionsProp.value().empty()) {
290  FileIncident firstInputFileIncident(name(), "FirstInputFile", *m_inputCollectionsIterator);
291  m_incidentSvc->fireIncident(firstInputFileIncident);
292  m_firedIncident = true;
293  }
294  }
295  return(StatusCode::SUCCESS);
296  }
297  // Get DataHeader iterator
298  try {
299  m_headerIterator = &m_poolCollectionConverter->selectAll();
300  } catch (std::exception &e) {
301  ATH_MSG_FATAL("Cannot open implicit collection - check data/software version.");
302  ATH_MSG_ERROR(e.what());
303  return(StatusCode::FAILURE);
304  }
305  while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // no selected events
306  if (m_poolCollectionConverter != nullptr) {
307  m_poolCollectionConverter->disconnectDb().ignore();
308  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
309  }
310  ++m_inputCollectionsIterator;
311  m_poolCollectionConverter = getCollectionCnv();
312  if (m_poolCollectionConverter != nullptr) {
313  m_headerIterator = &m_poolCollectionConverter->selectAll();
314  } else {
315  break;
316  }
317  }
318  if (m_poolCollectionConverter == nullptr || m_headerIterator == nullptr) { // no event selected in any collection
319  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
320  m_curCollection = 0;
321  m_poolCollectionConverter = getCollectionCnv();
322  if (m_poolCollectionConverter == nullptr) {
323  return(StatusCode::SUCCESS);
324  }
325  m_headerIterator = &m_poolCollectionConverter->selectAll();
326  while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // empty collection
327  if (m_poolCollectionConverter != nullptr) {
328  m_poolCollectionConverter->disconnectDb().ignore();
329  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
330  }
331  ++m_inputCollectionsIterator;
332  m_poolCollectionConverter = getCollectionCnv();
333  if (m_poolCollectionConverter != nullptr) {
334  m_headerIterator = &m_poolCollectionConverter->selectAll();
335  } else {
336  break;
337  }
338  }
339  }
340  if (m_poolCollectionConverter == nullptr || m_headerIterator == nullptr) {
341  return(StatusCode::SUCCESS);
342  }
343  const Token& headRef = m_headerIterator->eventRef();
344  const std::string fid = headRef.dbID().toString();
345  const int tech = headRef.technology();
346  ATH_MSG_VERBOSE("reinit(): First DataHeder Token=" << headRef.toString() );
347 
348  // Check if File is BS, for which Incident is thrown by SingleEventInputSvc
349  if (tech != 0x00001000 && m_processMetadata.value() && !m_firedIncident) {
350  FileIncident firstInputFileIncident(name(), "FirstInputFile", "FID:" + fid, fid);
351  m_incidentSvc->fireIncident(firstInputFileIncident);
352  m_firedIncident = true;
353  }
354  return(StatusCode::SUCCESS);
355 }
356 //________________________________________________________________________________
358  if (m_poolCollectionConverter != nullptr) {
359  // Reset iterators and apply new query
360  m_poolCollectionConverter->disconnectDb().ignore();
361  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
362  }
363  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
364  m_curCollection = 0;
365  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
366  return(StatusCode::SUCCESS);
367  }
368  m_poolCollectionConverter = getCollectionCnv(true);
369  if (m_poolCollectionConverter == nullptr) {
370  ATH_MSG_INFO("No Events found in any Input Collections");
371  m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
372  if (!m_inputCollectionsProp.value().empty()) {
373  --m_inputCollectionsIterator; //leave iterator in state of last input file
374  }
375  } else {
376  m_headerIterator = &m_poolCollectionConverter->selectAll();
377  }
378  m_evtCount = 0;
379  delete m_endIter;
380  m_endIter = nullptr;
381  m_endIter = new EventContextAthenaPool(nullptr);
382  return(StatusCode::SUCCESS);
383 }
384 //________________________________________________________________________________
386  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
387  return(StatusCode::SUCCESS);
388  }
389  IEvtSelector::Context* ctxt(nullptr);
390  if (!releaseContext(ctxt).isSuccess()) {
391  ATH_MSG_WARNING("Cannot release context");
392  }
393  return(StatusCode::SUCCESS);
394 }
395 
396 //________________________________________________________________________________
398  if (m_processMetadata.value()) {
399  if (m_evtCount >= 0) {
400  // Assume that the end of collection file indicates the end of payload file.
401  if (m_guid != Guid::null()) {
402  // Fire EndInputFile incident
403  FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_guid.toString(), m_guid.toString());
404  m_incidentSvc->fireIncident(endInputFileIncident);
405  }
406  }
407  if (isLastFile && m_firedIncident) {
408  m_firedIncident = false;
409  }
410  }
411 }
412 
413 //________________________________________________________________________________
415  if (m_eventStreamingTool.empty() || !m_eventStreamingTool->isClient()) {
416  if (!m_counterTool.empty() && !m_counterTool->preFinalize().isSuccess()) {
417  ATH_MSG_WARNING("Failed to preFinalize() CounterTool");
418  }
419  for (auto& tool : m_helperTools) {
420  if (!tool->preFinalize().isSuccess()) {
421  ATH_MSG_WARNING("Failed to preFinalize() " << tool->name());
422  }
423  }
424  }
425  delete m_endIter; m_endIter = nullptr;
426  m_headerIterator = nullptr;
427  if (m_poolCollectionConverter != nullptr) {
428  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
429  }
430  // Release AthenaSharedMemoryTool
431  if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.release().isSuccess()) {
432  ATH_MSG_WARNING("Cannot release AthenaSharedMemoryTool");
433  }
434  // Release CounterTool
435  if (!m_counterTool.empty() && !m_counterTool.release().isSuccess()) {
436  ATH_MSG_WARNING("Cannot release CounterTool.");
437  }
438  // Release HelperTools
439  if (!m_helperTools.release().isSuccess()) {
440  ATH_MSG_WARNING("Cannot release " << m_helperTools);
441  }
442  // Release AthenaPoolCnvSvc
443  if (!m_athenaPoolCnvSvc.release().isSuccess()) {
444  ATH_MSG_WARNING("Cannot release " << m_athenaPoolCnvSvc.typeAndName() << ".");
445  }
446  // Release IncidentSvc
447  if (!m_incidentSvc.release().isSuccess()) {
448  ATH_MSG_WARNING("Cannot release " << m_incidentSvc.typeAndName() << ".");
449  }
450  // Finalize the Service base class.
451  return(::AthService::finalize());
452 }
453 
454 //________________________________________________________________________________
455 StatusCode EventSelectorAthenaPool::createContext(IEvtSelector::Context*& ctxt) const {
456  ctxt = new EventContextAthenaPool(this);
457  return(StatusCode::SUCCESS);
458 }
459 //________________________________________________________________________________
460 StatusCode EventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) const {
461  std::lock_guard<CallMutex> lockGuard(m_callLock);
462  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
463  if (m_makeStreamingToolClient.value() == -1) {
465  while (sc.isRecoverable()) {
466  usleep(1000);
467  sc = m_eventStreamingTool->lockEvent(m_evtCount);
468  }
469  }
470  // Increase event count
471  ++m_evtCount;
472  void* tokenStr = nullptr;
473  unsigned int status = 0;
474  StatusCode sc = m_eventStreamingTool->getLockedEvent(&tokenStr, status);
475  if (sc.isRecoverable()) {
476  delete [] (char*)tokenStr; tokenStr = nullptr;
477  // Return end iterator
478  ctxt = *m_endIter;
479  // This is not a real failure but a Gaudi way of handling "end of job"
480  return(StatusCode::FAILURE);
481  }
482  if (sc.isFailure()) {
483  ATH_MSG_FATAL("Cannot get NextEvent from AthenaSharedMemoryTool");
484  delete [] (char*)tokenStr; tokenStr = nullptr;
485  return(StatusCode::FAILURE);
486  }
487  if (!eventStore()->clearStore().isSuccess()) {
488  ATH_MSG_WARNING("Cannot clear Store");
489  }
490  std::unique_ptr<AthenaAttributeList> athAttrList(new AthenaAttributeList());
491  athAttrList->extend("eventRef", "string");
492  (*athAttrList)["eventRef"].data<std::string>() = std::string((char*)tokenStr);
494  if (!wh.record(std::move(athAttrList)).isSuccess()) {
495  delete [] (char*)tokenStr; tokenStr = nullptr;
496  ATH_MSG_ERROR("Cannot record AttributeList to StoreGate " << StoreID::storeName(eventStore()->storeID()));
497  return(StatusCode::FAILURE);
498  }
499  Token token;
500  token.fromString(std::string((char*)tokenStr));
501  delete [] (char*)tokenStr; tokenStr = nullptr;
502  Guid guid = token.dbID();
503  if (guid != m_guid && m_processMetadata.value()) {
504  if (m_evtCount >= 0 && m_guid != Guid::null()) {
505  // Fire EndInputFile incident
506  FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_guid.toString(), m_guid.toString());
507  m_incidentSvc->fireIncident(endInputFileIncident);
508  }
509  m_guid = guid;
510  FileIncident beginInputFileIncident(name(), "BeginInputFile", "FID:" + m_guid.toString(), m_guid.toString());
511  m_incidentSvc->fireIncident(beginInputFileIncident);
512  }
513  return(StatusCode::SUCCESS);
514  }
515  for (const auto& tool : m_helperTools) {
516  if (!tool->preNext().isSuccess()) {
517  ATH_MSG_WARNING("Failed to preNext() " << tool->name());
518  }
519  }
520  for (;;) {
521  // Handle possible file transition
523  if (sc.isRecoverable()) {
524  continue; // handles empty files
525  }
526  if (sc.isFailure()) {
527  return StatusCode::FAILURE;
528  }
529  // Increase event count
530  ++m_evtCount;
531  if (!m_counterTool.empty() && !m_counterTool->preNext().isSuccess()) {
532  ATH_MSG_WARNING("Failed to preNext() CounterTool.");
533  }
535  && (m_skipEventRanges.empty() || m_evtCount < m_skipEventRanges.front().first))
536  {
537  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isServer()) {
538  std::string token = m_headerIterator->eventRef().toString();
539  StatusCode sc;
540  while ( (sc = putEvent_ST(*m_eventStreamingTool,
541  m_evtCount - 1, token.c_str(),
542  token.length() + 1, 0)).isRecoverable() ) {
543  while (m_athenaPoolCnvSvc->readData().isSuccess()) {
544  ATH_MSG_VERBOSE("Called last readData, while putting next event in next()");
545  }
546  // Nothing to do right now, trigger alternative (e.g. caching) here? Currently just fast loop.
547  }
548  if (!sc.isSuccess()) {
549  ATH_MSG_ERROR("Cannot put Event " << m_evtCount - 1 << " to AthenaSharedMemoryTool");
550  return(StatusCode::FAILURE);
551  }
552  } else {
553  if (!m_isSecondary.value()) {
554  if (!eventStore()->clearStore().isSuccess()) {
555  ATH_MSG_WARNING("Cannot clear Store");
556  }
557  if (!recordAttributeList().isSuccess()) {
558  ATH_MSG_ERROR("Failed to record AttributeList.");
559  return(StatusCode::FAILURE);
560  }
561  }
562  }
563  StatusCode status = StatusCode::SUCCESS;
564  for (const auto& tool : m_helperTools) {
565  StatusCode toolStatus = tool->postNext();
566  if (toolStatus.isRecoverable()) {
567  ATH_MSG_INFO("Request skipping event from: " << tool->name());
568  if (status.isSuccess()) {
569  status = StatusCode::RECOVERABLE;
570  }
571  } else if (toolStatus.isFailure()) {
572  ATH_MSG_WARNING("Failed to postNext() " << tool->name());
573  status = StatusCode::FAILURE;
574  }
575  }
576  if (status.isRecoverable()) {
577  ATH_MSG_INFO("skipping event " << m_evtCount);
578  } else if (status.isFailure()) {
579  ATH_MSG_WARNING("Failed to postNext() HelperTool.");
580  } else {
581  if (!m_counterTool.empty() && !m_counterTool->postNext().isSuccess()) {
582  ATH_MSG_WARNING("Failed to postNext() CounterTool.");
583  }
584  break;
585  }
586  } else {
587  while( !m_skipEventRanges.empty() && m_evtCount >= m_skipEventRanges.front().second ) {
588  m_skipEventRanges.erase(m_skipEventRanges.begin());
589  }
590  ATH_MSG_INFO("skipping event " << m_evtCount);
591  }
592  }
593  return(StatusCode::SUCCESS);
594 }
595 //________________________________________________________________________________
596 StatusCode EventSelectorAthenaPool::next(IEvtSelector::Context& ctxt, int jump) const {
597  if (jump > 0) {
598  for (int i = 0; i < jump; i++) {
599  ATH_CHECK(next(ctxt));
600  }
601  return(StatusCode::SUCCESS);
602  }
603  return(StatusCode::FAILURE);
604 }
605 //________________________________________________________________________________
607 {
608  if( m_inputCollectionsChanged ) {
609  StatusCode rc = reinit();
610  if( rc != StatusCode::SUCCESS ) return rc;
611  }
612  else { // advance to the next (not needed after reinit)
613  // Check if we're at the end of file
614  if (m_headerIterator == nullptr || m_headerIterator->next() == 0) {
615  m_headerIterator = nullptr;
616  // Close previous collection.
617  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
618 
619  // zero the current DB ID (m_guid) before disconnect() to indicate it is no longer in use
620  const SG::SourceID old_guid = m_guid.toString();
621  m_guid = Guid::null();
622  disconnectIfFinished( old_guid );
623 
624  // check if somebody updated Inputs in the EOF incident (like VP1 does)
625  if( m_inputCollectionsChanged ) {
626  StatusCode rc = reinit();
627  if( rc != StatusCode::SUCCESS ) return rc;
628  } else {
629  // Open next file from inputCollections list.
630  ++m_inputCollectionsIterator;
631  // Create PoolCollectionConverter for input file
632  m_poolCollectionConverter = getCollectionCnv(true);
633  if (m_poolCollectionConverter == nullptr) {
634  // Return end iterator
635  ctxt = *m_endIter;
636  // This is not a real failure but a Gaudi way of handling "end of job"
637  return StatusCode::FAILURE;
638  }
639  // Get DataHeader iterator
640  m_headerIterator = &m_poolCollectionConverter->selectAll();
641 
642  // Return RECOVERABLE to mark we should still continue
643  return StatusCode::RECOVERABLE;
644  }
645  }
646  }
647  const Token& headRef = m_headerIterator->eventRef();
648  const Guid guid = headRef.dbID();
649  const int tech = headRef.technology();
650  ATH_MSG_VERBOSE("next(): DataHeder Token=" << headRef.toString() );
651 
652  if (guid != m_guid) {
653  // we are starting reading from a new DB. Check if the old one needs to be retired
654  if (m_guid != Guid::null()) {
655  // zero the current DB ID (m_guid) before trying disconnect() to indicate it is no longer in use
656  const SG::SourceID old_guid = m_guid.toString();
657  m_guid = Guid::null();
658  disconnectIfFinished( old_guid );
659  }
660  m_guid = guid;
661  m_activeEventsPerSource[guid.toString()] = 0;
662  // Fire BeginInputFile incident if current InputCollection is a payload file;
663  // otherwise, ascertain whether the pointed-to file is reachable before firing any incidents and/or proceeding
664  if (m_collectionType.value() == "ImplicitROOT") {
665  // For now, we can only deal with input metadata from POOL files, but we know we have a POOL file here
666  if (!m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
667  ATH_MSG_ERROR("Failed to set input attributes.");
668  return(StatusCode::FAILURE);
669  }
670  if (m_processMetadata.value()) {
671  FileIncident beginInputFileIncident(name(), "BeginInputFile", *m_inputCollectionsIterator, m_guid.toString());
672  m_incidentSvc->fireIncident(beginInputFileIncident);
673  }
674  } else {
675  // Check if File is BS
676  if (tech != 0x00001000 && m_processMetadata.value()) {
677  FileIncident beginInputFileIncident(name(), "BeginInputFile", "FID:" + m_guid.toString(), m_guid.toString());
678  m_incidentSvc->fireIncident(beginInputFileIncident);
679  }
680  }
681  } // end if (guid != m_guid)
682  return StatusCode::SUCCESS;
683 }
684 //________________________________________________________________________________
685 StatusCode EventSelectorAthenaPool::nextWithSkip(IEvtSelector::Context& ctxt) const {
686  ATH_MSG_DEBUG("EventSelectorAthenaPool::nextWithSkip");
687 
688  for (;;) {
689  // Check if we're at the end of file
691  if (sc.isRecoverable()) {
692  continue; // handles empty files
693  }
694  if (sc.isFailure()) {
695  return StatusCode::FAILURE;
696  }
697 
698  // Increase event count
699  ++m_evtCount;
700 
701  if (!m_counterTool.empty() && !m_counterTool->preNext().isSuccess()) {
702  ATH_MSG_WARNING("Failed to preNext() CounterTool.");
703  }
705  && (m_skipEventRanges.empty() || m_evtCount < m_skipEventRanges.front().first))
706  {
707  return StatusCode::SUCCESS;
708  } else {
709  while( !m_skipEventRanges.empty() && m_evtCount >= m_skipEventRanges.front().second ) {
710  m_skipEventRanges.erase(m_skipEventRanges.begin());
711  }
712  if (m_isSecondary.value()) {
713  ATH_MSG_INFO("skipping secondary event " << m_evtCount);
714  } else {
715  ATH_MSG_INFO("skipping event " << m_evtCount);
716  }
717  }
718  }
719 
720  return StatusCode::SUCCESS;
721 }
722 //________________________________________________________________________________
723 StatusCode EventSelectorAthenaPool::previous(IEvtSelector::Context& /*ctxt*/) const {
724  ATH_MSG_ERROR("previous() not implemented");
725  return(StatusCode::FAILURE);
726 }
727 //________________________________________________________________________________
728 StatusCode EventSelectorAthenaPool::previous(IEvtSelector::Context& ctxt, int jump) const {
729  if (jump > 0) {
730  for (int i = 0; i < jump; i++) {
731  ATH_CHECK(previous(ctxt));
732  }
733  return(StatusCode::SUCCESS);
734  }
735  return(StatusCode::FAILURE);
736 }
737 //________________________________________________________________________________
738 StatusCode EventSelectorAthenaPool::last(IEvtSelector::Context& ctxt) const {
739  if (ctxt.identifier() == m_endIter->identifier()) {
740  ATH_MSG_DEBUG("last(): Last event in InputStream.");
741  return(StatusCode::SUCCESS);
742  }
743  return(StatusCode::FAILURE);
744 }
745 //________________________________________________________________________________
746 StatusCode EventSelectorAthenaPool::rewind(IEvtSelector::Context& ctxt) const {
747  ATH_CHECK(reinit());
748  ctxt = EventContextAthenaPool(this);
749  return(StatusCode::SUCCESS);
750 }
751 //________________________________________________________________________________
752 StatusCode EventSelectorAthenaPool::createAddress(const IEvtSelector::Context& /*ctxt*/,
753  IOpaqueAddress*& iop) const {
754  std::string tokenStr;
756  if (attrList.isValid()) {
757  try {
758  tokenStr = (*attrList)["eventRef"].data<std::string>();
759  ATH_MSG_DEBUG("found AthenaAttribute, name = eventRef = " << tokenStr);
760  } catch (std::exception &e) {
761  ATH_MSG_ERROR(e.what());
762  return(StatusCode::FAILURE);
763  }
764  } else {
765  ATH_MSG_WARNING("Cannot find AthenaAttribute, key = " << m_attrListKey.value());
766  tokenStr = m_poolCollectionConverter->retrieveToken(m_headerIterator, "");
767  }
768  auto token = std::make_unique<Token>();
769  token->fromString(tokenStr);
770  iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, std::move(token));
771  return(StatusCode::SUCCESS);
772 }
773 //________________________________________________________________________________
774 StatusCode EventSelectorAthenaPool::releaseContext(IEvtSelector::Context*& /*ctxt*/) const {
775  return(StatusCode::SUCCESS);
776 }
777 //________________________________________________________________________________
778 StatusCode EventSelectorAthenaPool::resetCriteria(const std::string& /*criteria*/,
779  IEvtSelector::Context& /*ctxt*/) const {
780  return(StatusCode::SUCCESS);
781 }
782 //__________________________________________________________________________
783 StatusCode EventSelectorAthenaPool::seek(Context& /*ctxt*/, int evtNum) const {
784 
785  if( m_inputCollectionsChanged ) {
786  StatusCode rc = reinit();
787  if( rc != StatusCode::SUCCESS ) return rc;
788  }
789 
790  long newColl = findEvent(evtNum);
791  if (newColl == -1 && evtNum >= m_firstEvt[m_curCollection] && evtNum < m_evtCount - 1) {
792  newColl = m_curCollection;
793  }
794  if (newColl == -1) {
795  m_headerIterator = nullptr;
796  ATH_MSG_INFO("seek: Reached end of Input.");
797  fireEndFileIncidents(true);
798  return(StatusCode::RECOVERABLE);
799  }
800  if (newColl != m_curCollection) {
801  if (!m_keepInputFilesOpen.value() && m_poolCollectionConverter != nullptr) {
802  m_poolCollectionConverter->disconnectDb().ignore();
803  }
804  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
805  m_curCollection = newColl;
806  try {
807  ATH_MSG_DEBUG("Seek to item: \""
809  << "\" from the collection list.");
810  // Reset input collection iterator to the right place
811  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
812  m_inputCollectionsIterator += m_curCollection;
813  m_poolCollectionConverter = new PoolCollectionConverter(m_collectionType.value() + ":" + m_collectionTree.value(),
816  m_athenaPoolCnvSvc->getPoolSvc());
817  if (!m_poolCollectionConverter->initialize().isSuccess()) {
818  m_headerIterator = nullptr;
819  ATH_MSG_ERROR("seek: Unable to initialize PoolCollectionConverter.");
820  return(StatusCode::FAILURE);
821  }
822  // Create DataHeader iterators
823  m_headerIterator = &m_poolCollectionConverter->selectAll();
824  EventContextAthenaPool* beginIter = new EventContextAthenaPool(this);
825  m_evtCount = m_firstEvt[m_curCollection];
826  next(*beginIter).ignore();
827  ATH_MSG_DEBUG("Token " << m_headerIterator->eventRef().toString());
828  } catch (std::exception &e) {
829  m_headerIterator = nullptr;
830  ATH_MSG_ERROR(e.what());
831  return(StatusCode::FAILURE);
832  }
833  }
834 
835  pool::IPositionSeek* is = dynamic_cast<pool::IPositionSeek*>(m_headerIterator);
836  if (is == nullptr) {
837  ATH_MSG_ERROR("Container does not allow seeking.");
838  return(StatusCode::FAILURE);
839  }
840  if (is->seek(evtNum - m_firstEvt[m_curCollection]) == 0) {
841  m_headerIterator = nullptr;
842  ATH_MSG_ERROR("Did not find event, evtNum = " << evtNum);
843  return(StatusCode::FAILURE);
844  } else {
845  m_evtCount = evtNum + 1;
846  }
847  return(StatusCode::SUCCESS);
848 }
849 //__________________________________________________________________________
850 int EventSelectorAthenaPool::curEvent (const Context& /*ctxt*/) const {
851  return(m_evtCount);
852 }
853 //__________________________________________________________________________
854 // Search for event number evtNum.
855 // Return the index of the collection containing it, or -1 if not found.
856 // Note: passing -1 for evtNum will always yield failure,
857 // but this can be used to force filling in the entire m_numEvt array.
858 int EventSelectorAthenaPool::findEvent(int evtNum) const {
859  for (std::size_t i = 0, imax = m_numEvt.size(); i < imax; i++) {
860  if (m_numEvt[i] == -1) {
861  PoolCollectionConverter pcc(m_collectionType.value() + ":" + m_collectionTree.value(),
862  m_inputCollectionsProp.value()[i],
864  m_athenaPoolCnvSvc->getPoolSvc());
865  if (!pcc.initialize().isSuccess()) {
866  break;
867  }
868  int collection_size = 0;
869  if (pcc.isValid()) {
870  pool::ICollectionCursor* hi = &pcc.selectAll();
871  ICollectionSize* cs = dynamic_cast<ICollectionSize*>(hi);
872  if (cs == nullptr) {
873  break;
874  }
875  collection_size = cs->size();
876  }
877  if (i > 0) {
878  m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
879  } else {
880  m_firstEvt[i] = 0;
881  }
882  m_numEvt[i] = collection_size;
883  }
884  if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
885  return(i);
886  }
887  }
888  return(-1);
889 }
890 
891 //________________________________________________________________________________
893  if (num < 0) {
894  if (m_athenaPoolCnvSvc->makeServer(num - 1).isFailure()) {
895  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
896  }
897  return(StatusCode::SUCCESS);
898  }
899  if (m_athenaPoolCnvSvc->makeServer(num + 1).isFailure()) {
900  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
901  return(StatusCode::FAILURE);
902  }
903  if (m_eventStreamingTool.empty()) {
904  return(StatusCode::SUCCESS);
905  }
906  m_processMetadata = false;
907  ATH_MSG_DEBUG("makeServer: " << m_eventStreamingTool << " = " << num);
908  return(m_eventStreamingTool->makeServer(1, ""));
909 }
910 
911 //________________________________________________________________________________
913  if (m_athenaPoolCnvSvc->makeClient(num + 1).isFailure()) {
914  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to DataStreaming client");
915  return(StatusCode::FAILURE);
916  }
917  if (m_eventStreamingTool.empty()) {
918  return(StatusCode::SUCCESS);
919  }
920  ATH_MSG_DEBUG("makeClient: " << m_eventStreamingTool << " = " << num);
921  std::string dummyStr;
922  return(m_eventStreamingTool->makeClient(0, dummyStr));
923 }
924 
925 //________________________________________________________________________________
927  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
928  StatusCode sc = m_eventStreamingTool->lockEvent(evtnum);
929  while (sc.isRecoverable()) {
930  usleep(1000);
931  sc = m_eventStreamingTool->lockEvent(evtnum);
932  }
933 // Send stop client and wait for restart
934  if (sc.isFailure()) {
935  if (m_athenaPoolCnvSvc->makeClient(0).isFailure()) {
936  return(StatusCode::FAILURE);
937  }
938  sc = m_eventStreamingTool->lockEvent(evtnum);
939  while (sc.isRecoverable() || sc.isFailure()) {
940  usleep(1000);
941  sc = m_eventStreamingTool->lockEvent(evtnum);
942  }
943 //FIXME
944  if (m_athenaPoolCnvSvc->makeClient(1).isFailure()) {
945  return(StatusCode::FAILURE);
946  }
947  }
948  return(sc);
949  }
950  return(StatusCode::FAILURE);
951 }
952 
953 //________________________________________________________________________________
955  if (m_eventStreamingTool.empty()) {
956  ATH_MSG_ERROR("No AthenaSharedMemoryTool configured for readEvent()");
957  return(StatusCode::FAILURE);
958  }
959  ATH_MSG_VERBOSE("Called read Event " << maxevt);
960  IEvtSelector::Context* ctxt = new EventContextAthenaPool(this);
961  for (int i = 0; i < maxevt || maxevt == -1; ++i) {
962  if (!next(*ctxt).isSuccess()) {
963  if (m_evtCount == -1) {
964  ATH_MSG_VERBOSE("Called read Event and read last event from input: " << i);
965  break;
966  }
967  ATH_MSG_ERROR("Cannot read Event " << m_evtCount - 1 << " into AthenaSharedMemoryTool");
968  delete ctxt; ctxt = nullptr;
969  return(StatusCode::FAILURE);
970  } else {
971  ATH_MSG_VERBOSE("Called next, read Event " << m_evtCount - 1);
972  }
973  }
974  delete ctxt; ctxt = nullptr;
975  // End of file, wait for last event to be taken
976  StatusCode sc;
977  while ( (sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
978  while (m_athenaPoolCnvSvc->readData().isSuccess()) {
979  ATH_MSG_VERBOSE("Called last readData, while marking last event in readEvent()");
980  }
981  usleep(1000);
982  }
983  if (!sc.isSuccess()) {
984  ATH_MSG_ERROR("Cannot put last Event marker to AthenaSharedMemoryTool");
985  return(StatusCode::FAILURE);
986  } else {
987  sc = m_athenaPoolCnvSvc->readData();
988  while (sc.isSuccess() || sc.isRecoverable()) {
989  sc = m_athenaPoolCnvSvc->readData();
990  }
991  ATH_MSG_DEBUG("Failed last readData -> Clients are stopped, after marking last event in readEvent()");
992  }
993  return(StatusCode::SUCCESS);
994 }
995 
996 //__________________________________________________________________________
997 int EventSelectorAthenaPool::size(Context& /*ctxt*/) const {
998  // Fetch sizes of all collections.
999  findEvent(-1);
1000  int sz = 0;
1001  for (std::size_t i = 0, imax = m_numEvt.size(); i < imax; i++) {
1002  sz += m_numEvt[i];
1003  }
1004  return(sz);
1005 }
1006 //__________________________________________________________________________
1008  while (m_inputCollectionsIterator != m_inputCollectionsProp.value().end()) {
1009  if (m_curCollection != 0) {
1010  m_numEvt[m_curCollection] = m_evtCount - m_firstEvt[m_curCollection];
1011  m_curCollection++;
1012  m_firstEvt[m_curCollection] = m_evtCount;
1013  }
1014  ATH_MSG_DEBUG("Try item: \"" << *m_inputCollectionsIterator << "\" from the collection list.");
1015  PoolCollectionConverter* pCollCnv = new PoolCollectionConverter(m_collectionType.value() + ":" + m_collectionTree.value(),
1016  *m_inputCollectionsIterator,
1018  m_athenaPoolCnvSvc->getPoolSvc());
1019  StatusCode status = pCollCnv->initialize();
1020  if (!status.isSuccess()) {
1021  // Close previous collection.
1022  delete pCollCnv; pCollCnv = nullptr;
1023  if (!status.isRecoverable()) {
1024  ATH_MSG_ERROR("Unable to initialize PoolCollectionConverter.");
1025  throw GaudiException("Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
1026  } else {
1027  ATH_MSG_ERROR("Unable to open: " << *m_inputCollectionsIterator);
1028  throw GaudiException("Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
1029  }
1030  } else {
1031  if (!pCollCnv->isValid().isSuccess()) {
1032  delete pCollCnv; pCollCnv = nullptr;
1033  ATH_MSG_DEBUG("No events found in: " << *m_inputCollectionsIterator << " skipped!!!");
1034  if (throwIncidents && m_processMetadata.value()) {
1035  FileIncident beginInputFileIncident(name(), "BeginInputFile", *m_inputCollectionsIterator);
1036  m_incidentSvc->fireIncident(beginInputFileIncident);
1037  FileIncident endInputFileIncident(name(), "EndInputFile", "eventless " + *m_inputCollectionsIterator);
1038  m_incidentSvc->fireIncident(endInputFileIncident);
1039  }
1040  m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb(*m_inputCollectionsIterator).ignore();
1041  ++m_inputCollectionsIterator;
1042  } else {
1043  return(pCollCnv);
1044  }
1045  }
1046  }
1047  return(nullptr);
1048 }
1049 //__________________________________________________________________________
1051  // Get access to AttributeList
1052  ATH_MSG_DEBUG("Get AttributeList from the collection");
1053  // MN: accessing only attribute list, ignoring token list
1054  const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
1055  ATH_MSG_DEBUG("AttributeList size " << attrList.size());
1056  std::unique_ptr<AthenaAttributeList> athAttrList(new AthenaAttributeList(attrList));
1057  // Fill the new attribute list
1058  ATH_CHECK(fillAttributeList(athAttrList.get(), "", false));
1059  // Write the AttributeList
1061  if (!wh.record(std::move(athAttrList)).isSuccess()) {
1062  ATH_MSG_ERROR("Cannot record AttributeList to StoreGate " << StoreID::storeName(eventStore()->storeID()));
1063  return(StatusCode::FAILURE);
1064  }
1065  return(StatusCode::SUCCESS);
1066 }
1067 //__________________________________________________________________________
1068 StatusCode EventSelectorAthenaPool::fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const
1069 {
1070  const pool::TokenList& tokenList = m_headerIterator->currentRow().tokenList();
1071  for (pool::TokenList::const_iterator iter = tokenList.begin(), last = tokenList.end(); iter != last; ++iter) {
1072  attrList->extend(iter.tokenName() + suffix, "string");
1073  (*attrList)[iter.tokenName() + suffix].data<std::string>() = iter->toString();
1074  ATH_MSG_DEBUG("record AthenaAttribute, name = " << iter.tokenName() + suffix << " = " << iter->toString() << ".");
1075  }
1076 
1077  std::string eventRef = "eventRef";
1078  if (m_isSecondary.value()) {
1079  eventRef.append(suffix);
1080  }
1081  attrList->extend(eventRef, "string");
1082  (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1083  ATH_MSG_DEBUG("record AthenaAttribute, name = " + eventRef + " = " << m_headerIterator->eventRef().toString() << ".");
1084 
1085  if (copySource) {
1086  const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1087  for (const auto &attr : sourceAttrList) {
1088  attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1089  (*attrList)[attr.specification().name() + suffix] = attr;
1090  }
1091  }
1092 
1093  return StatusCode::SUCCESS;
1094 }
1095 //__________________________________________________________________________
1097  ATH_MSG_INFO("I/O reinitialization...");
1098  if (m_poolCollectionConverter != nullptr) {
1099  m_poolCollectionConverter->disconnectDb().ignore();
1100  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
1101  }
1102  m_headerIterator = nullptr;
1103  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
1104  if (!iomgr.retrieve().isSuccess()) {
1105  ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
1106  return(StatusCode::FAILURE);
1107  }
1108  if (!iomgr->io_hasitem(this)) {
1109  ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
1110  return(StatusCode::FAILURE);
1111  }
1112  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
1113  m_guid = Guid::null();
1114  return(this->reinit());
1115  }
1116  std::vector<std::string> inputCollections = m_inputCollectionsProp.value();
1117  std::set<std::size_t> updatedIndexes;
1118  for (std::size_t i = 0, imax = m_inputCollectionsProp.value().size(); i < imax; i++) {
1119  if (updatedIndexes.find(i) != updatedIndexes.end()) continue;
1120  std::string savedName = inputCollections[i];
1121  std::string &fname = inputCollections[i];
1122  if (!iomgr->io_contains(this, fname)) {
1123  ATH_MSG_ERROR("IoComponentMgr does not know about [" << fname << "] !");
1124  return(StatusCode::FAILURE);
1125  }
1126  if (!iomgr->io_retrieve(this, fname).isSuccess()) {
1127  ATH_MSG_FATAL("Could not retrieve new value for [" << fname << "] !");
1128  return(StatusCode::FAILURE);
1129  }
1130  if (savedName != fname) {
1131  ATH_MSG_DEBUG("Mapping value for [" << savedName << "] to [" << fname << "]");
1132  m_athenaPoolCnvSvc->getPoolSvc()->renamePfn(savedName, fname);
1133  }
1134  updatedIndexes.insert(i);
1135  for (std::size_t j = i + 1; j < imax; j++) {
1136  if (inputCollections[j] == savedName) {
1137  inputCollections[j] = fname;
1138  updatedIndexes.insert(j);
1139  }
1140  }
1141  }
1142  // all good... copy over.
1144  m_guid = Guid::null();
1145  return reinit();
1146 }
1147 //__________________________________________________________________________
1149  ATH_MSG_INFO("I/O finalization...");
1150  if (m_poolCollectionConverter != nullptr) {
1151  m_poolCollectionConverter->disconnectDb().ignore();
1152  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
1153  }
1154  return(StatusCode::SUCCESS);
1155 }
1156 
1157 //__________________________________________________________________________
1158 /* Listen to IncidentType::BeginProcessing and EndProcessing
1159  Maintain counters of how many events from a given file are being processed.
1160  Files are identified by SG::SourceID (string GUID).
1161  When there are no more events from a file, see if it can be closed.
1162 */
1163 void EventSelectorAthenaPool::handle(const Incident& inc)
1164 {
1165  SG::SourceID fid;
1166  if (inc.type() == IncidentType::BeginProcessing) {
1167  if ( Atlas::hasExtendedEventContext(inc.context()) ) {
1168  fid = Atlas::getExtendedEventContext(inc.context()).proxy()->sourceID();
1169  }
1170  *m_sourceID.get(inc.context()) = fid;
1171  }
1172  else {
1173  fid = *m_sourceID.get(inc.context());
1174  }
1175 
1176  if( fid.empty() ) {
1177  ATH_MSG_WARNING("could not read event source ID from incident event context");
1178  return;
1179  }
1180  if( m_activeEventsPerSource.find( fid ) == m_activeEventsPerSource.end()) {
1181  ATH_MSG_DEBUG("Incident handler ignoring unknown input FID: " << fid );
1182  return;
1183  }
1184  ATH_MSG_DEBUG("** MN Incident handler " << inc.type() << " Event source ID=" << fid );
1185  if( inc.type() == IncidentType::BeginProcessing ) {
1186  // increment the events-per-file counter for FID
1187  m_activeEventsPerSource[fid]++;
1188  } else if( inc.type() == IncidentType::EndProcessing ) {
1189  m_activeEventsPerSource[fid]--;
1190  disconnectIfFinished( fid );
1191  *m_sourceID.get(inc.context()) = "";
1192  }
1193  if( msgLvl(MSG::DEBUG) ) {
1194  for( auto& source: m_activeEventsPerSource )
1195  msg(MSG::DEBUG) << "SourceID: " << source.first << " active events: " << source.second << endmsg;
1196  }
1197 }
1198 
1199 //__________________________________________________________________________
1200 /* Disconnect APR Database identifieed by a SG::SourceID when it is no longer in use:
1201  m_guid is not pointing to it and there are no events from it being processed
1202  (if the EventLoopMgr was not firing Begin/End incidents, this will just close the DB)
1203 */
1205 {
1206  if( m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1207  && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1208  // Explicitly disconnect file corresponding to old FID to release memory
1209  if( !m_keepInputFilesOpen.value() ) {
1210  // Assume that the end of collection file indicates the end of payload file.
1211  if (m_processMetadata.value()) {
1212  FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + fid, fid);
1213  m_incidentSvc->fireIncident(endInputFileIncident);
1214  }
1215  ATH_MSG_INFO("Disconnecting input sourceID: " << fid );
1216  m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb("FID:" + fid, IPoolSvc::kInputStream).ignore();
1217  m_activeEventsPerSource.erase( fid );
1218  return true;
1219  }
1220  }
1221  return false;
1222 }
EventSelectorAthenaPool::last
virtual StatusCode last(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:738
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
EventSelectorAthenaPool::createContext
virtual StatusCode createContext(IEvtSelector::Context *&ctxt) const override
create context
Definition: EventSelectorAthenaPool.cxx:455
trigbs_pickEvents.ranges
ranges
Definition: trigbs_pickEvents.py:60
ICollectionSize::size
virtual int size()=0
Return the size of the collection.
Guid::null
static const Guid & null()
NULL-Guid: static class method.
Definition: Guid.cxx:18
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
EventSelectorAthenaPool::fillAttributeList
virtual StatusCode fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const override
Fill AttributeList with specific items from the selector and a suffix.
Definition: EventSelectorAthenaPool.cxx:1068
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
EventSelectorAthenaPool::m_skipEvents
Gaudi::Property< int > m_skipEvents
SkipEvents, numbers of events to skip: default = 0.
Definition: EventSelectorAthenaPool.h:234
EventSelectorAthenaPool.h
This file contains the class definition for the EventSelectorAthenaPool class.
fitman.sz
sz
Definition: fitman.py:527
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
EventSelectorAthenaPool::releaseContext
virtual StatusCode releaseContext(IEvtSelector::Context *&ctxt) const override
Definition: EventSelectorAthenaPool.cxx:774
EventSelectorAthenaPool::io_reinit
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
Definition: EventSelectorAthenaPool.cxx:1096
EventSelectorAthenaPool::curEvent
virtual int curEvent(const Context &ctxt) const override
Return the current event number.
Definition: EventSelectorAthenaPool.cxx:850
Gaudi::Parsers::parse
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:284
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
pool::IPositionSeek::seek
virtual bool seek(long long int position)=0
Seek to a given position in the collection.
EventSelectorAthenaPool::reinit
StatusCode reinit() const
Reinitialize the service when a fork() occured/was-issued.
Definition: EventSelectorAthenaPool.cxx:247
TokenList.h
EventSelectorAthenaPool::makeClient
virtual StatusCode makeClient(int num) override
Make this a client.
Definition: EventSelectorAthenaPool.cxx:912
PoolCollectionConverter
This class provides an interface to POOL collections.
Definition: PoolCollectionConverter.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
PoolCollectionConverter.h
This file contains the class definition for the PoolCollectionConverter class.
EventSelectorAthenaPool::previous
virtual StatusCode previous(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:723
EventSelectorAthenaPool::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Definition: EventSelectorAthenaPool.h:178
initialize
void initialize()
Definition: run_EoverP.cxx:894
ICollectionCursor.h
Atlas::hasExtendedEventContext
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
Definition: ExtendedEventContext.cxx:23
EventSelectorAthenaPool::m_athenaPoolCnvSvc
ServiceHandle< IAthenaPoolCnvSvc > m_athenaPoolCnvSvc
Definition: EventSelectorAthenaPool.h:177
EventSelectorAthenaPool::start
virtual StatusCode start() override
Definition: EventSelectorAthenaPool.cxx:357
SG::SlotSpecificObj::get
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
PoolCollectionConverter::selectAll
pool::ICollectionCursor & selectAll()
Definition: PoolCollectionConverter.cxx:125
EventSelectorAthenaPool::readEvent
virtual StatusCode readEvent(int maxevt) override
Read the next maxevt events.
Definition: EventSelectorAthenaPool.cxx:954
Token::dbID
const Guid & dbID() const
Access database identifier.
Definition: Token.h:64
EventSelectorAthenaPool::m_eventStreamingTool
ToolHandle< IAthenaIPCTool > m_eventStreamingTool
Definition: EventSelectorAthenaPool.h:209
EventSelectorAthenaPool::eventStore
StoreGateSvc * eventStore() const
Return pointer to active event SG.
Definition: EventSelectorAthenaPool.cxx:85
ICollectionSize.h
Abstract interface for finding the size of an event collection.
Guid::toString
const std::string toString() const
Automatic conversion to string representation.
Definition: Guid.cxx:58
pool::TokenList::end
iterator end()
Returns a forward iterator pointing to last element in Token list.
Definition: TokenList.h:224
EventSelectorAthenaPool::m_firstLBNo
Gaudi::CheckedProperty< uint32_t > m_firstLBNo
Definition: EventSelectorAthenaPool.h:224
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
EventSelectorAthenaPool::findEvent
int findEvent(int evtNum) const
Search for event with number evtNum.
Definition: EventSelectorAthenaPool.cxx:858
EventSelectorAthenaPool::m_callLock
CallMutex m_callLock
Definition: EventSelectorAthenaPool.h:244
AthenaAttributeList.h
EventContextAthenaPool
This class provides the context to access an event from POOL persistent store.
Definition: EventContextAthenaPool.h:21
EventSelectorAthenaPool::stop
virtual StatusCode stop() override
Definition: EventSelectorAthenaPool.cxx:385
PoolCollectionConverter::isValid
StatusCode isValid() const
Check whether has valid pool::ICollection*.
Definition: PoolCollectionConverter.cxx:121
atlasStyleMacro.icol
int icol
Definition: atlasStyleMacro.py:13
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
EventSelectorAthenaPool::m_counterTool
ToolHandle< IAthenaSelectorTool > m_counterTool
Definition: EventSelectorAthenaPool.h:208
TokenAddress
This class provides a Generic Transient Address for POOL tokens.
Definition: TokenAddress.h:23
Atlas::getExtendedEventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition: ExtendedEventContext.cxx:32
pool::TokenList
Definition: TokenList.h:24
EventSelectorAthenaPool::share
virtual StatusCode share(int evtnum) override
Request to share a given event number.
Definition: EventSelectorAthenaPool.cxx:926
Token::fromString
Token & fromString(const std::string &from)
Build from the string representation of a token.
Definition: Token.cxx:148
WriteHandle.h
Handle class for recording to StoreGate.
IPoolSvc::kInputStream
@ kInputStream
Definition: IPoolSvc.h:39
EventSelectorAthenaPool::m_runNo
Gaudi::CheckedProperty< uint32_t > m_runNo
The following are included for compatibility with McEventSelector and are not really used.
Definition: EventSelectorAthenaPool.h:216
EventContextAthenaPool::identifier
virtual void * identifier() const
Definition: EventContextAthenaPool.h:56
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
TileAANtupleConfig.inputCollections
inputCollections
Definition: TileAANtupleConfig.py:133
CollectionRowBuffer.h
Token::technology
int technology() const
Access technology type.
Definition: Token.h:77
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
EventSelectorAthenaPool::m_firedIncident
std::atomic_bool m_firedIncident
Definition: EventSelectorAthenaPool.h:241
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
EventSelectorAthenaPool::m_oldRunNo
Gaudi::CheckedProperty< uint32_t > m_oldRunNo
Definition: EventSelectorAthenaPool.h:217
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EventSelectorAthenaPool::m_attrListKey
Gaudi::Property< std::string > m_attrListKey
AttributeList SG key.
Definition: EventSelectorAthenaPool.h:193
EventSelectorAthenaPool::rewind
virtual StatusCode rewind(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:746
lumiFormat.i
int i
Definition: lumiFormat.py:85
IAthenaIPCTool
Definition: IAthenaIPCTool.h:14
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
L1CaloPhase1Monitoring.propVal
propVal
Definition: L1CaloPhase1Monitoring.py:489
EventSelectorAthenaPool::resetCriteria
virtual StatusCode resetCriteria(const std::string &criteria, IEvtSelector::Context &ctxt) const override
Set a selection criteria.
Definition: EventSelectorAthenaPool.cxx:778
EventSelectorAthenaPool::m_isSecondary
Gaudi::Property< bool > m_isSecondary
IsSecondary, know if this is an instance of secondary event selector.
Definition: EventSelectorAthenaPool.h:182
StoreGateSvc::currentStoreGate
static StoreGateSvc * currentStoreGate()
get current StoreGate
Definition: StoreGateSvc.cxx:69
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
calibdata.exception
exception
Definition: calibdata.py:496
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
parseDir.wh
wh
Definition: parseDir.py:46
IPositionSeek.h
Abstract interface for seeking within an event stream.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ICollectionSize
Abstract interface for finding the size of an event collection.
Definition: ICollectionSize.h:26
EventSelectorAthenaPool::fireEndFileIncidents
void fireEndFileIncidents(bool isLastFile) const
Fires the EndInputFile incident (if there is an open file) at end of selector.
Definition: EventSelectorAthenaPool.cxx:397
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
EventSelectorAthenaPool::m_makeStreamingToolClient
IntegerProperty m_makeStreamingToolClient
Make this instance a Streaming Client during first iteration automatically.
Definition: EventSelectorAthenaPool.h:211
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
EventSelectorAthenaPool::m_eventsPerRun
Gaudi::CheckedProperty< uint64_t > m_eventsPerRun
Definition: EventSelectorAthenaPool.h:223
StoreGateSvc::clearStore
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
Definition: StoreGateSvc.cxx:450
DataHeader.h
This file contains the class definition for the DataHeader and DataHeaderElement classes.
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
checkRpcDigits.allGood
bool allGood
Loop over the SDOs & Digits.
Definition: checkRpcDigits.py:171
EventSelectorAthenaPool::m_collectionTree
Gaudi::Property< std::string > m_collectionTree
CollectionTree, prefix of the collection TTree: default = "POOLContainer".
Definition: EventSelectorAthenaPool.h:188
EventSelectorAthenaPool::inputCollectionsHandler
void inputCollectionsHandler(Gaudi::Details::PropertyBase &)
Definition: EventSelectorAthenaPool.cxx:76
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
EventSelectorAthenaPool::m_firstEventNo
Gaudi::CheckedProperty< uint64_t > m_firstEventNo
Definition: EventSelectorAthenaPool.h:221
EventSelectorAthenaPool::m_skipEventRangesProp
Gaudi::Property< std::string > m_skipEventRangesProp
Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>
Definition: EventSelectorAthenaPool.h:237
EventSelectorAthenaPool::handle
virtual void handle(const Incident &incident) override
Incident service handle listening for BeginProcessing and EndProcessing.
Definition: EventSelectorAthenaPool.cxx:1163
pool::ICollectionCursor
Definition: ICollectionCursor.h:21
pool_uuid.guid
guid
Definition: pool_uuid.py:112
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
EventSelectorAthenaPool::~EventSelectorAthenaPool
virtual ~EventSelectorAthenaPool()
Destructor.
Definition: EventSelectorAthenaPool.cxx:82
pool::TokenList::const_iterator
Constant forward iterator class for navigation of TokenList objects.
Definition: TokenList.h:164
EventSelectorAthenaPool::next
virtual StatusCode next(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:460
EventSelectorAthenaPool::m_processMetadata
Gaudi::Property< bool > m_processMetadata
ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default...
Definition: EventSelectorAthenaPool.h:184
pool::TokenList::extend
void extend(const std::string &name)
Extends the Token list by one element.
EventSelectorAthenaPool::disconnectIfFinished
virtual bool disconnectIfFinished(const SG::SourceID &fid) const override
Definition: EventSelectorAthenaPool.cxx:1204
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EventSelectorAthenaPool::m_inputCollectionsProp
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp
InputCollections, vector with names of the input collections.
Definition: EventSelectorAthenaPool.h:196
pool::READ
@ READ
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:68
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
EventSelectorAthenaPool::recordAttributeList
virtual StatusCode recordAttributeList() const override
Record AttributeList in StoreGate.
Definition: EventSelectorAthenaPool.cxx:1050
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:129
EventSelectorAthenaPool::m_sourceID
SG::SlotSpecificObj< SG::SourceID > m_sourceID
Definition: EventSelectorAthenaPool.h:246
EventSelectorAthenaPool::nextHandleFileTransition
virtual StatusCode nextHandleFileTransition(IEvtSelector::Context &ctxt) const override
Handle file transition at the next iteration.
Definition: EventSelectorAthenaPool.cxx:606
EventSelectorAthenaPool::createAddress
virtual StatusCode createAddress(const IEvtSelector::Context &ctxt, IOpaqueAddress *&iop) const override
Definition: EventSelectorAthenaPool.cxx:752
EventSelectorAthenaPool::nextWithSkip
virtual StatusCode nextWithSkip(IEvtSelector::Context &ctxt) const override
Go to next event and skip if necessary.
Definition: EventSelectorAthenaPool.cxx:685
EventSelectorAthenaPool::m_curCollection
std::atomic_long m_curCollection
Definition: EventSelectorAthenaPool.h:229
pool::TokenList::begin
iterator begin()
Returns a forward iterator pointing to first element in Token list.
Definition: TokenList.h:218
IPoolSvc.h
This file contains the class definition for the IPoolSvc interface class.
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
python.PyAthena.v
v
Definition: PyAthena.py:154
EventSelectorAthenaPool::m_eventsPerLB
Gaudi::CheckedProperty< uint32_t > m_eventsPerLB
Definition: EventSelectorAthenaPool.h:225
TokenAddress.h
This file contains the class definition for the TokenAddress class.
EventSelectorAthenaPool::m_endIter
EventContextAthenaPool * m_endIter
Definition: EventSelectorAthenaPool.h:169
PoolCollectionConverter::initialize
StatusCode initialize()
Required by all Gaudi Services.
Definition: PoolCollectionConverter.cxx:67
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
EventSelectorAthenaPool::initialize
virtual StatusCode initialize() override
Required of all Gaudi Services.
Definition: EventSelectorAthenaPool.cxx:89
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
EventSelectorAthenaPool::m_evtCount
std::atomic_int m_evtCount
Definition: EventSelectorAthenaPool.h:240
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
pool::ITransaction::READ
@ READ
Definition: ITransaction.h:29
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
DEBUG
#define DEBUG
Definition: page_access.h:11
pool::IPositionSeek
Abstract interface for seeking inside a collection.
Definition: IPositionSeek.h:26
EventSelectorAthenaPool::io_finalize
virtual StatusCode io_finalize() override
Callback method to finalize the internal state of the component for I/O purposes (e....
Definition: EventSelectorAthenaPool.cxx:1148
EventSelectorAthenaPool::m_initTimeStamp
Gaudi::CheckedProperty< uint32_t > m_initTimeStamp
Definition: EventSelectorAthenaPool.h:226
EventSelectorAthenaPool::m_skipEventSequenceProp
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp
Definition: EventSelectorAthenaPool.h:235
EventSelectorAthenaPool::makeServer
virtual StatusCode makeServer(int num) override
Make this a server.
Definition: EventSelectorAthenaPool.cxx:892
EventSelectorAthenaPool::getCollectionCnv
PoolCollectionConverter * getCollectionCnv(bool throwIncidents=false) const
Return pointer to new PoolCollectionConverter.
Definition: EventSelectorAthenaPool.cxx:1007
copySelective.source
string source
Definition: copySelective.py:32
merge.status
status
Definition: merge.py:17
EventSelectorAthenaPool::size
virtual int size(Context &ctxt) const override
Return the size of the collection.
Definition: EventSelectorAthenaPool.cxx:997
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
ReadHandle.h
Handle class for reading from StoreGate.
EventSelectorAthenaPool::finalize
virtual StatusCode finalize() override
Definition: EventSelectorAthenaPool.cxx:414
EventSelectorAthenaPool::m_keepInputFilesOpen
Gaudi::Property< bool > m_keepInputFilesOpen
KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false...
Definition: EventSelectorAthenaPool.h:204
Token.h
This file contains the class definition for the Token class (migrated from POOL).
EventSelectorAthenaPool::m_collectionType
Gaudi::Property< std::string > m_collectionType
CollectionType, type of the collection: default = "ImplicitROOT".
Definition: EventSelectorAthenaPool.h:186
StoreGateSvc.h
EventSelectorAthenaPool::EventSelectorAthenaPool
EventSelectorAthenaPool(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Definition: EventSelectorAthenaPool.cxx:58
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
StoreID::storeName
static const std::string & storeName(const StoreID::type &s)
Definition: StoreID.cxx:77
EventContextAthenaPool.h
This file contains the class definition for the EventContextAthenaPool class.
EventSelectorAthenaPool::seek
virtual StatusCode seek(Context &ctxt, int evtnum) const override
Seek to a given event number.
Definition: EventSelectorAthenaPool.cxx:783
ServiceHandle
Definition: ClusterMakerTool.h:37