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