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

This class is the EventSelector for event data. More...

#include <DoubleEventSelectorAthenaPool.h>

Inheritance diagram for DoubleEventSelectorAthenaPool:
Collaboration diagram for DoubleEventSelectorAthenaPool:

Public Member Functions

 DoubleEventSelectorAthenaPool (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Service Constructor. More...
 
virtual ~DoubleEventSelectorAthenaPool ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Initialize function. More...
 
virtual StatusCode next (IEvtSelector::Context &ctxt) const override
 
virtual StatusCode next (IEvtSelector::Context &ctxt, int jump) const override
 
virtual StatusCode seek (Context &ctxt, int evtNum) const override
 Seek to a given event number. More...
 
virtual int size (Context &ctxt) const override
 Return the size of the collection. More...
 
virtual void handle (const Incident &incident) override
 Incident service handle listening for BeginProcessing and EndProcessing. More...
 
virtual StatusCode start () override
 
virtual StatusCode stop () override
 
virtual StatusCode finalize () override
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 Does this object satisfy a given interface? See Gaudi documentation for details. More...
 
virtual StatusCode createContext (IEvtSelector::Context *&ctxt) const override
 create context More...
 
virtual StatusCode previous (IEvtSelector::Context &ctxt) const override
 
virtual StatusCode previous (IEvtSelector::Context &ctxt, int jump) const override
 
virtual StatusCode last (IEvtSelector::Context &ctxt) const override
 
virtual StatusCode rewind (IEvtSelector::Context &ctxt) const override
 
virtual StatusCode createAddress (const IEvtSelector::Context &ctxt, IOpaqueAddress *&iop) const override
 
virtual StatusCode releaseContext (IEvtSelector::Context *&ctxt) const override
 
virtual StatusCode resetCriteria (const std::string &criteria, IEvtSelector::Context &ctxt) const override
 Set a selection criteria. More...
 
virtual int curEvent (const Context &ctxt) const override
 Return the current event number. More...
 
virtual StatusCode makeServer (int num) override
 Make this a server. More...
 
virtual StatusCode makeClient (int num) override
 Make this a client. More...
 
virtual StatusCode share (int evtnum) override
 Request to share a given event number. More...
 
virtual StatusCode readEvent (int maxevt) override
 Read the next maxevt events. More...
 
virtual StatusCode io_reinit () override
 Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2)) More...
 
virtual StatusCode io_finalize () override
 Callback method to finalize the internal state of the component for I/O purposes (e.g. before fork(2)) More...
 

Protected Member Functions

virtual StatusCode nextHandleFileTransition (IEvtSelector::Context &ctxt) const override
 Handle file transition at the next iteration. More...
 
virtual StatusCode nextWithSkip (IEvtSelector::Context &ctxt) const override
 Go to next event and skip if necessary. More...
 
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. More...
 
virtual bool disconnectIfFinished (const SG::SourceID &fid) const override
 

Private Types

typedef std::mutex CallMutex
 

Private Member Functions

virtual StatusCode recordAttributeList () const override
 Record AttributeList in StoreGate. More...
 
StoreGateSvceventStore () const
 Return pointer to active event SG. More...
 
StatusCode reinit () const
 Reinitialize the service when a fork() occured/was-issued. More...
 
PoolCollectionConvertergetCollectionCnv (bool throwIncidents=false) const
 Return pointer to new PoolCollectionConverter. More...
 
int findEvent (int evtNum) const
 Search for event with number evtNum. More...
 
void fireEndFileIncidents (bool isLastFile) const
 Fires the EndInputFile incident (if there is an open file) at end of selector. More...
 
void inputCollectionsHandler (Gaudi::Details::PropertyBase &)
 

Private Attributes

ServiceHandle< ISecondaryEventSelectorm_secondarySelector {this, "SecondaryEventSelector", "SecondaryEventSelector", ""}
 
Gaudi::Property< std::string > m_secondaryAttrListSuffix {this, "SecondaryAttrListSuffix", "secondary", ""}
 
bool m_secondaryByteStream {}
 
SG::SlotSpecificObj< SG::SourceIDm_sourceID1
 
SG::SlotSpecificObj< SG::SourceIDm_sourceID2
 
EventContextAthenaPoolm_endIter {}
 
PoolCollectionConverter *m_poolCollectionConverter ATLAS_THREAD_SAFE {}
 
pool::ICollectionCursor *m_headerIterator ATLAS_THREAD_SAFE {}
 
Guid m_guid ATLAS_THREAD_SAFE {}
 
std::map< SG::SourceID, int > m_activeEventsPerSource ATLAS_THREAD_SAFE
 
std::vector< std::string >::const_iterator m_inputCollectionsIterator ATLAS_THREAD_SAFE
 
bool m_inputCollectionsChanged ATLAS_THREAD_SAFE
 flag to notify the EvSel that the inputs were changed and reinit() needs to be called ASAP More...
 
ToolHandleArray< IAthenaSelectorTool > m_helperTools ATLAS_THREAD_SAFE {this}
 HelperTools, vector of names of AlgTools that are executed by the EventSelector. More...
 
std::vector< int > m_numEvt ATLAS_THREAD_SAFE
 
std::vector< int > m_firstEvt ATLAS_THREAD_SAFE
 
std::vector< std::pair< long, long > > m_skipEventRanges ATLAS_THREAD_SAFE
 
ServiceHandle< IAthenaPoolCnvSvcm_athenaPoolCnvSvc {this, "AthenaPoolCnvSvc", "AthenaPoolCnvSvc", ""}
 
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""}
 
Gaudi::Property< bool > m_isSecondary {this, "IsSecondary", false, ""}
 IsSecondary, know if this is an instance of secondary event selector. More...
 
Gaudi::Property< bool > m_processMetadata {this, "ProcessMetadata", true, ""}
 ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default = true. More...
 
Gaudi::Property< std::string > m_collectionType {this, "CollectionType", "ImplicitROOT", ""}
 CollectionType, type of the collection: default = "ImplicitROOT". More...
 
Gaudi::Property< std::string > m_collectionTree {this, "CollectionTree", APRDefaults::TTreeNames::DataHeader, ""}
 CollectionTree, prefix of the collection TTree: default = "POOLContainer". More...
 
Gaudi::Property< std::string > m_connection {this, "Connection", "", ""}
 Connection, connection string. More...
 
Gaudi::Property< std::string > m_refName {this, "RefName", "", ""}
 RefName, attribute name. More...
 
Gaudi::Property< std::string > m_attrListKey {this, "AttributeListKey", "Input", ""}
 AttributeList SG key. More...
 
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp {this, "InputCollections", {}, ""}
 InputCollections, vector with names of the input collections. More...
 
Gaudi::Property< std::string > m_query {this, "Query", "", ""}
 Query string passed to APR when opening DataHeader container (kind of useless). More...
 
Gaudi::Property< bool > m_keepInputFilesOpen {this, "KeepInputFilesOpen", false, ""}
 KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false. More...
 
ToolHandle< IAthenaSelectorToolm_counterTool {this, "CounterTool", "", ""}
 
ToolHandle< IAthenaIPCToolm_eventStreamingTool {this, "SharedMemoryTool", "", ""}
 
IntegerProperty m_makeStreamingToolClient {this,"MakeStreamingToolClient",0}
 Make this instance a Streaming Client during first iteration automatically. More...
 
Gaudi::CheckedProperty< int > m_runNo {this, "RunNumber", 0, ""}
 The following are included for compatibility with McEventSelector and are not really used. More...
 
Gaudi::CheckedProperty< int > m_oldRunNo {this, "OldRunNumber", 0, ""}
 
Gaudi::Property< bool > m_overrideRunNumber {this, "OverrideRunNumber", false, ""}
 
Gaudi::Property< bool > m_overrideRunNumberFromInput {this, "OverrideRunNumberFromInput", false, ""}
 
Gaudi::CheckedProperty< int > m_firstEventNo {this, "FirstEvent", 1, ""}
 
Gaudi::CheckedProperty< int > m_eventsPerRun {this, "EventsPerRun", 1000000, ""}
 
Gaudi::CheckedProperty< int > m_firstLBNo {this, "FirstLB", 0, ""}
 
Gaudi::CheckedProperty< int > m_eventsPerLB {this, "EventsPerLB", 1000, ""}
 
Gaudi::CheckedProperty< int > m_initTimeStamp {this, "InitialTimeStamp", 0, ""}
 
Gaudi::Property< int > m_timeStampInterval {this, "TimeStampInterval", 0, ""}
 
std::atomic_long m_curCollection {}
 
Gaudi::Property< int > m_skipEvents {this, "SkipEvents", 0, ""}
 SkipEvents, numbers of events to skip: default = 0. More...
 
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""}
 
Gaudi::Property< std::string > m_skipEventRangesProp {this, "SkipEventRanges", {}, ""}
 Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end> More...
 
std::atomic_int m_evtCount {}
 
std::atomic_bool m_firedIncident {}
 
CallMutex m_callLock
 
SG::SlotSpecificObj< SG::SourceIDm_sourceID
 

Detailed Description

This class is the EventSelector for event data.

Definition at line 26 of file DoubleEventSelectorAthenaPool.h.

Member Typedef Documentation

◆ CallMutex

typedef std::mutex EventSelectorAthenaPool::CallMutex
privateinherited

Definition at line 249 of file EventSelectorAthenaPool.h.

Constructor & Destructor Documentation

◆ DoubleEventSelectorAthenaPool()

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

Standard Service Constructor.

Definition at line 28 of file DoubleEventSelectorAthenaPool.cxx.

29  : EventSelectorAthenaPool(name, pSvcLocator)
30 {
31 }

◆ ~DoubleEventSelectorAthenaPool()

DoubleEventSelectorAthenaPool::~DoubleEventSelectorAthenaPool ( )
virtual

Destructor.

Definition at line 34 of file DoubleEventSelectorAthenaPool.cxx.

34 {}

Member Function Documentation

◆ createAddress()

StatusCode EventSelectorAthenaPool::createAddress ( const IEvtSelector::Context &  ctxt,
IOpaqueAddress *&  iop 
) const
overridevirtualinherited
Parameters
ctxt[IN] current event context.
iop[OUT] pointer to IOpaqueAddress reference of selection context.

Definition at line 788 of file EventSelectorAthenaPool.cxx.

789  {
790  std::string tokenStr;
792  if (attrList.isValid()) {
793  try {
794  if (m_refName.value().empty()) {
795  tokenStr = (*attrList)["eventRef"].data<std::string>();
796  ATH_MSG_DEBUG("found AthenaAttribute, name = eventRef = " << tokenStr);
797  } else {
798  tokenStr = (*attrList)[m_refName.value() + "_ref"].data<std::string>();
799  ATH_MSG_DEBUG("found AthenaAttribute, name = " << m_refName.value() << "_ref = " << tokenStr);
800  }
801  } catch (std::exception &e) {
802  ATH_MSG_ERROR(e.what());
803  return(StatusCode::FAILURE);
804  }
805  } else {
806  ATH_MSG_WARNING("Cannot find AthenaAttribute, key = " << m_attrListKey.value());
807  tokenStr = m_poolCollectionConverter->retrieveToken(m_headerIterator, m_refName.value());
808  }
809  Token* token = new Token;
810  token->fromString(tokenStr);
811  iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, token);
812  return(StatusCode::SUCCESS);
813 }

◆ createContext()

StatusCode EventSelectorAthenaPool::createContext ( IEvtSelector::Context *&  ctxt) const
overridevirtualinherited

create context

Definition at line 488 of file EventSelectorAthenaPool.cxx.

488  {
489  ctxt = new EventContextAthenaPool(this);
490  return(StatusCode::SUCCESS);
491 }

◆ curEvent()

int EventSelectorAthenaPool::curEvent ( const Context &  ctxt) const
overridevirtualinherited

Return the current event number.

Parameters
ctxt[IN/OUT] current event context.

Definition at line 892 of file EventSelectorAthenaPool.cxx.

892  {
893  return(m_evtCount);
894 }

◆ disconnectIfFinished()

bool EventSelectorAthenaPool::disconnectIfFinished ( const SG::SourceID fid) const
overrideprotectedvirtualinherited

Definition at line 1248 of file EventSelectorAthenaPool.cxx.

1249 {
1250  if( m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1251  && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1252  // Explicitly disconnect file corresponding to old FID to release memory
1253  if( !m_keepInputFilesOpen.value() ) {
1254  // Assume that the end of collection file indicates the end of payload file.
1255  if (m_processMetadata.value()) {
1256  FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + fid, fid);
1257  m_incidentSvc->fireIncident(endInputFileIncident);
1258  }
1259  ATH_MSG_INFO("Disconnecting input sourceID: " << fid );
1260  m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb("FID:" + fid, IPoolSvc::kInputStream).ignore();
1261  m_activeEventsPerSource.erase( fid );
1262  return true;
1263  }
1264  }
1265  return false;
1266 }

◆ eventStore()

StoreGateSvc * EventSelectorAthenaPool::eventStore ( ) const
privateinherited

Return pointer to active event SG.

Definition at line 85 of file EventSelectorAthenaPool.cxx.

85  {
87 }

◆ fillAttributeList()

StatusCode EventSelectorAthenaPool::fillAttributeList ( coral::AttributeList *  attrList,
const std::string &  suffix,
bool  copySource 
) const
overrideprotectedvirtualinherited

Fill AttributeList with specific items from the selector and a suffix.

Definition at line 1112 of file EventSelectorAthenaPool.cxx.

1113 {
1114  const pool::TokenList& tokenList = m_headerIterator->currentRow().tokenList();
1115  for (pool::TokenList::const_iterator iter = tokenList.begin(), last = tokenList.end(); iter != last; ++iter) {
1116  attrList->extend(iter.tokenName() + suffix, "string");
1117  (*attrList)[iter.tokenName() + suffix].data<std::string>() = iter->toString();
1118  ATH_MSG_DEBUG("record AthenaAttribute, name = " << iter.tokenName() + suffix << " = " << iter->toString() << ".");
1119  }
1120 
1121  std::string eventRef = "eventRef";
1122  if (m_isSecondary.value()) {
1123  eventRef.append(suffix);
1124  }
1125  attrList->extend(eventRef, "string");
1126  (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1127  ATH_MSG_DEBUG("record AthenaAttribute, name = " + eventRef + " = " << m_headerIterator->eventRef().toString() << ".");
1128 
1129  if (copySource) {
1130  const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1131  for (const auto &attr : sourceAttrList) {
1132  attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1133  (*attrList)[attr.specification().name() + suffix] = attr;
1134  }
1135  }
1136 
1137  return StatusCode::SUCCESS;
1138 }

◆ finalize()

StatusCode EventSelectorAthenaPool::finalize ( )
overridevirtualinherited

Definition at line 427 of file EventSelectorAthenaPool.cxx.

427  {
428  if (m_eventStreamingTool.empty() || !m_eventStreamingTool->isClient()) {
429  if (!m_counterTool.empty() && !m_counterTool->preFinalize().isSuccess()) {
430  ATH_MSG_WARNING("Failed to preFinalize() CounterTool");
431  }
432  for (auto& tool : m_helperTools) {
433  if (!tool->preFinalize().isSuccess()) {
434  ATH_MSG_WARNING("Failed to preFinalize() " << tool->name());
435  }
436  }
437  }
438  delete m_endIter; m_endIter = nullptr;
439  m_headerIterator = nullptr;
440  if (m_poolCollectionConverter != nullptr) {
441  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
442  }
443  // Release AthenaSharedMemoryTool
444  if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.release().isSuccess()) {
445  ATH_MSG_WARNING("Cannot release AthenaSharedMemoryTool");
446  }
447  // Release CounterTool
448  if (!m_counterTool.empty() && !m_counterTool.release().isSuccess()) {
449  ATH_MSG_WARNING("Cannot release CounterTool.");
450  }
451  // Release HelperTools
452  if (!m_helperTools.release().isSuccess()) {
453  ATH_MSG_WARNING("Cannot release " << m_helperTools);
454  }
455  // Release AthenaPoolCnvSvc
456  if (!m_athenaPoolCnvSvc.release().isSuccess()) {
457  ATH_MSG_WARNING("Cannot release " << m_athenaPoolCnvSvc.typeAndName() << ".");
458  }
459  // Release IncidentSvc
460  if (!m_incidentSvc.release().isSuccess()) {
461  ATH_MSG_WARNING("Cannot release " << m_incidentSvc.typeAndName() << ".");
462  }
463  // Finalize the Service base class.
464  return(::AthService::finalize());
465 }

◆ findEvent()

int EventSelectorAthenaPool::findEvent ( int  evtNum) const
privateinherited

Search for event with number evtNum.

Definition at line 900 of file EventSelectorAthenaPool.cxx.

900  {
901  for (std::size_t i = 0, imax = m_numEvt.size(); i < imax; i++) {
902  if (m_numEvt[i] == -1) {
903  PoolCollectionConverter pcc(m_collectionType.value() + ":" + m_collectionTree.value(),
904  m_inputCollectionsProp.value()[i],
906  m_query.value(),
907  m_athenaPoolCnvSvc->getPoolSvc());
908  if (!pcc.initialize().isSuccess()) {
909  break;
910  }
911  int collection_size = 0;
912  if (pcc.isValid()) {
913  pool::ICollectionCursor* hi = &pcc.executeQuery();
914  ICollectionSize* cs = dynamic_cast<ICollectionSize*>(hi);
915  if (cs == nullptr) {
916  break;
917  }
918  collection_size = cs->size();
919  }
920  if (i > 0) {
921  m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
922  } else {
923  m_firstEvt[i] = 0;
924  }
925  m_numEvt[i] = collection_size;
926  }
927  if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
928  return(i);
929  }
930  }
931  return(-1);
932 }

◆ fireEndFileIncidents()

void EventSelectorAthenaPool::fireEndFileIncidents ( bool  isLastFile) const
privateinherited

Fires the EndInputFile incident (if there is an open file) at end of selector.

Definition at line 410 of file EventSelectorAthenaPool.cxx.

410  {
411  if (m_processMetadata.value()) {
412  if (m_evtCount >= 0) {
413  // Assume that the end of collection file indicates the end of payload file.
414  if (m_guid != Guid::null()) {
415  // Fire EndInputFile incident
416  FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_guid.toString(), m_guid.toString());
417  m_incidentSvc->fireIncident(endInputFileIncident);
418  }
419  }
420  if (isLastFile && m_firedIncident) {
421  m_firedIncident = false;
422  }
423  }
424 }

◆ getCollectionCnv()

PoolCollectionConverter * EventSelectorAthenaPool::getCollectionCnv ( bool  throwIncidents = false) const
privateinherited

Return pointer to new PoolCollectionConverter.

Definition at line 1050 of file EventSelectorAthenaPool.cxx.

1050  {
1051  while (m_inputCollectionsIterator != m_inputCollectionsProp.value().end()) {
1052  if (m_curCollection != 0) {
1053  m_numEvt[m_curCollection] = m_evtCount - m_firstEvt[m_curCollection];
1054  m_curCollection++;
1055  m_firstEvt[m_curCollection] = m_evtCount;
1056  }
1057  ATH_MSG_DEBUG("Try item: \"" << *m_inputCollectionsIterator << "\" from the collection list.");
1058  PoolCollectionConverter* pCollCnv = new PoolCollectionConverter(m_collectionType.value() + ":" + m_collectionTree.value(),
1059  *m_inputCollectionsIterator,
1061  m_query.value(),
1062  m_athenaPoolCnvSvc->getPoolSvc());
1063  StatusCode status = pCollCnv->initialize();
1064  if (!status.isSuccess()) {
1065  // Close previous collection.
1066  delete pCollCnv; pCollCnv = nullptr;
1067  if (!status.isRecoverable()) {
1068  ATH_MSG_ERROR("Unable to initialize PoolCollectionConverter.");
1069  throw GaudiException("Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
1070  } else {
1071  ATH_MSG_ERROR("Unable to open: " << *m_inputCollectionsIterator);
1072  throw GaudiException("Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
1073  }
1074  } else {
1075  if (!pCollCnv->isValid().isSuccess()) {
1076  delete pCollCnv; pCollCnv = nullptr;
1077  ATH_MSG_DEBUG("No events found in: " << *m_inputCollectionsIterator << " skipped!!!");
1078  if (throwIncidents && m_processMetadata.value()) {
1079  FileIncident beginInputFileIncident(name(), "BeginInputFile", *m_inputCollectionsIterator);
1080  m_incidentSvc->fireIncident(beginInputFileIncident);
1081  FileIncident endInputFileIncident(name(), "EndInputFile", "eventless " + *m_inputCollectionsIterator);
1082  m_incidentSvc->fireIncident(endInputFileIncident);
1083  }
1084  m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb(*m_inputCollectionsIterator).ignore();
1085  ++m_inputCollectionsIterator;
1086  } else {
1087  return(pCollCnv);
1088  }
1089  }
1090  }
1091  return(nullptr);
1092 }

◆ handle()

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

Incident service handle listening for BeginProcessing and EndProcessing.

Reimplemented from EventSelectorAthenaPool.

Definition at line 199 of file DoubleEventSelectorAthenaPool.cxx.

200 {
201  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::handle");
202 
203  if (not Atlas::hasExtendedEventContext(inc.context()) ) {
204  ATH_MSG_WARNING("No extended event context available.");
205  return;
206  }
207 
208  SG::SourceID fid1;
209  if (inc.type() == IncidentType::BeginProcessing) {
210  if ( Atlas::hasExtendedEventContext(inc.context()) ) {
211  fid1 = Atlas::getExtendedEventContext(inc.context()).proxy()->sourceID();
212  }
213  *m_sourceID1.get(inc.context()) = fid1;
214  }
215  else {
216  fid1 = *m_sourceID1.get(inc.context());
217  }
218 
219  if( fid1.empty() ) {
220  ATH_MSG_WARNING("could not read event source ID from incident event context with key EventSelector");
221  return;
222  }
223 
224  ATH_MSG_DEBUG("** MN Incident handler " << inc.type() << " Event source ID=" << fid1 );
225  if( inc.type() == IncidentType::BeginProcessing ) {
226  // increment the events-per-file counter for FID
227  m_activeEventsPerSource[fid1]++;
228  } else if( inc.type() == IncidentType::EndProcessing ) {
229  m_activeEventsPerSource[fid1]--;
230  disconnectIfFinished( fid1 );
231  *m_sourceID1.get(inc.context()) = "";
232  }
233  if( msgLvl(MSG::DEBUG) ) {
234  for( auto& source: m_activeEventsPerSource )
235  msg(MSG::DEBUG) << "SourceID: " << source.first << " active events: " << source.second << endmsg;
236  }
237 
238  // Nothing to do if secondary event selector is ByteStream
239  if (m_secondaryByteStream) {
240  return;
241  }
242 
243  // Secondary guid
244  SG::SourceID fid2;
245  if (inc.type() == IncidentType::BeginProcessing) {
246  if ( Atlas::hasExtendedEventContext(inc.context()) ) {
247  fid2 = Atlas::getExtendedEventContext(inc.context()).proxy()->sourceID("SecondaryEventSelector");
248  }
249  *m_sourceID2.get(inc.context()) = fid2;
250  }
251  else {
252  fid2 = *m_sourceID2.get(inc.context());
253  }
254 
255  if( fid2.empty() ) {
256  ATH_MSG_WARNING("could not read event source ID from incident event context with key SecondaryEventSelector");
257  return;
258  }
259 
260  ATH_MSG_DEBUG("** MN Incident handler " << inc.type() << " Event source ID=" << fid2 );
261  if( inc.type() == IncidentType::BeginProcessing ) {
262  // increment the events-per-file counter for FID
263  m_activeEventsPerSource[fid2]++;
264  } else if( inc.type() == IncidentType::EndProcessing ) {
265  m_activeEventsPerSource[fid2]--;
266  m_secondarySelector->disconnectIfFinished( fid2 );
267  *m_sourceID2.get(inc.context()) = "";
268  }
269  if( msgLvl(MSG::DEBUG) ) {
270  for( auto& source: m_activeEventsPerSource )
271  msg(MSG::DEBUG) << "SourceID: " << source.first << " active events: " << source.second << endmsg;
272  }
273 }

◆ initialize()

StatusCode DoubleEventSelectorAthenaPool::initialize ( )
overridevirtual

Initialize function.

Reimplemented from EventSelectorAthenaPool.

Definition at line 37 of file DoubleEventSelectorAthenaPool.cxx.

38 {
40 
41  ATH_CHECK(m_secondarySelector.retrieve());
42  if (dynamic_cast<EventSelectorAthenaPool *>(&*(m_secondarySelector)) == nullptr) {
43  m_secondaryByteStream = true;
44  }
45 
46  return StatusCode::SUCCESS;
47 }

◆ inputCollectionsHandler()

void EventSelectorAthenaPool::inputCollectionsHandler ( Gaudi::Details::PropertyBase &  )
privateinherited

Definition at line 76 of file EventSelectorAthenaPool.cxx.

76  {
77  if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
78  m_inputCollectionsChanged = true;
79  }
80 }

◆ io_finalize()

StatusCode EventSelectorAthenaPool::io_finalize ( )
overridevirtualinherited

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

Definition at line 1192 of file EventSelectorAthenaPool.cxx.

1192  {
1193  ATH_MSG_INFO("I/O finalization...");
1194  if (m_poolCollectionConverter != nullptr) {
1195  m_poolCollectionConverter->disconnectDb().ignore();
1196  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
1197  }
1198  return(StatusCode::SUCCESS);
1199 }

◆ io_reinit()

StatusCode EventSelectorAthenaPool::io_reinit ( )
overridevirtualinherited

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

Definition at line 1140 of file EventSelectorAthenaPool.cxx.

1140  {
1141  ATH_MSG_INFO("I/O reinitialization...");
1142  if (m_poolCollectionConverter != nullptr) {
1143  m_poolCollectionConverter->disconnectDb().ignore();
1144  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
1145  }
1146  m_headerIterator = nullptr;
1147  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
1148  if (!iomgr.retrieve().isSuccess()) {
1149  ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
1150  return(StatusCode::FAILURE);
1151  }
1152  if (!iomgr->io_hasitem(this)) {
1153  ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
1154  return(StatusCode::FAILURE);
1155  }
1156  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
1157  m_guid = Guid::null();
1158  return(this->reinit());
1159  }
1160  std::vector<std::string> inputCollections = m_inputCollectionsProp.value();
1161  std::set<std::size_t> updatedIndexes;
1162  for (std::size_t i = 0, imax = m_inputCollectionsProp.value().size(); i < imax; i++) {
1163  if (updatedIndexes.find(i) != updatedIndexes.end()) continue;
1164  std::string savedName = inputCollections[i];
1165  std::string &fname = inputCollections[i];
1166  if (!iomgr->io_contains(this, fname)) {
1167  ATH_MSG_ERROR("IoComponentMgr does not know about [" << fname << "] !");
1168  return(StatusCode::FAILURE);
1169  }
1170  if (!iomgr->io_retrieve(this, fname).isSuccess()) {
1171  ATH_MSG_FATAL("Could not retrieve new value for [" << fname << "] !");
1172  return(StatusCode::FAILURE);
1173  }
1174  if (savedName != fname) {
1175  ATH_MSG_DEBUG("Mapping value for [" << savedName << "] to [" << fname << "]");
1176  m_athenaPoolCnvSvc->getPoolSvc()->renamePfn(savedName, fname);
1177  }
1178  updatedIndexes.insert(i);
1179  for (std::size_t j = i + 1; j < imax; j++) {
1180  if (inputCollections[j] == savedName) {
1181  inputCollections[j] = fname;
1182  updatedIndexes.insert(j);
1183  }
1184  }
1185  }
1186  // all good... copy over.
1188  m_guid = Guid::null();
1189  return reinit();
1190 }

◆ last()

StatusCode EventSelectorAthenaPool::last ( IEvtSelector::Context &  ctxt) const
overridevirtualinherited
Parameters
ctxt[IN/OUT] current event context is interated to last event.

Definition at line 774 of file EventSelectorAthenaPool.cxx.

774  {
775  if (ctxt.identifier() == m_endIter->identifier()) {
776  ATH_MSG_DEBUG("last(): Last event in InputStream.");
777  return(StatusCode::SUCCESS);
778  }
779  return(StatusCode::FAILURE);
780 }

◆ makeClient()

StatusCode EventSelectorAthenaPool::makeClient ( int  num)
overridevirtualinherited

Make this a client.

Definition at line 955 of file EventSelectorAthenaPool.cxx.

955  {
956  if (m_athenaPoolCnvSvc->makeClient(num + 1).isFailure()) {
957  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to DataStreaming client");
958  return(StatusCode::FAILURE);
959  }
960  if (m_eventStreamingTool.empty()) {
961  return(StatusCode::SUCCESS);
962  }
963  ATH_MSG_DEBUG("makeClient: " << m_eventStreamingTool << " = " << num);
964  std::string dummyStr;
965  return(m_eventStreamingTool->makeClient(0, dummyStr));
966 }

◆ makeServer()

StatusCode EventSelectorAthenaPool::makeServer ( int  num)
overridevirtualinherited

Make this a server.

Definition at line 935 of file EventSelectorAthenaPool.cxx.

935  {
936  if (num < 0) {
937  if (m_athenaPoolCnvSvc->makeServer(num - 1).isFailure()) {
938  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
939  }
940  return(StatusCode::SUCCESS);
941  }
942  if (m_athenaPoolCnvSvc->makeServer(num + 1).isFailure()) {
943  ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
944  return(StatusCode::FAILURE);
945  }
946  if (m_eventStreamingTool.empty()) {
947  return(StatusCode::SUCCESS);
948  }
949  m_processMetadata = false;
950  ATH_MSG_DEBUG("makeServer: " << m_eventStreamingTool << " = " << num);
951  return(m_eventStreamingTool->makeServer(1, ""));
952 }

◆ next() [1/2]

StatusCode DoubleEventSelectorAthenaPool::next ( IEvtSelector::Context &  ctxt) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to next event.

Reimplemented from EventSelectorAthenaPool.

Definition at line 50 of file DoubleEventSelectorAthenaPool.cxx.

51 {
52  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::next");
53 
54  std::lock_guard<CallMutex> lockGuard(m_callLock);
55  if (!eventStore()->clearStore().isSuccess()) {
56  ATH_MSG_WARNING("Cannot clear Store");
57  }
58  for (const auto& tool : m_helperTools) {
59  if (!tool->preNext().isSuccess()) {
60  ATH_MSG_WARNING("Failed to preNext() " << tool->name());
61  }
62  }
63 
64  for (;;) {
65  // Move in the primary file (with skipping)
66  if (nextWithSkip(ctxt).isFailure()) {
67  return StatusCode::FAILURE;
68  }
69 
70  // Check if we're at the end of secondary file
71  if (m_secondarySelector->nextWithSkip(ctxt).isFailure()) {
72  return StatusCode::FAILURE;
73  }
74 
75  // Record the attribute list
76  if (!recordAttributeList().isSuccess()) {
77  ATH_MSG_ERROR("Failed to record AttributeList.");
78  return StatusCode::FAILURE;
79  }
80 
81  StatusCode status = StatusCode::SUCCESS;
82  for (const auto& tool : m_helperTools) {
83  StatusCode toolStatus = tool->postNext();
84  if (toolStatus.isRecoverable()) {
85  ATH_MSG_INFO("Request skipping event from: " << tool->name());
86  if (status.isSuccess()) {
87  status = StatusCode::RECOVERABLE;
88  }
89  } else if (toolStatus.isFailure()) {
90  ATH_MSG_WARNING("Failed to postNext() " << tool->name());
91  status = StatusCode::FAILURE;
92  }
93  }
94  if (status.isRecoverable()) {
95  ATH_MSG_INFO("skipping event " << m_evtCount);
96  } else if (status.isFailure()) {
97  ATH_MSG_WARNING("Failed to postNext() HelperTool.");
98  } else {
99  if (!m_counterTool.empty() && !m_counterTool->postNext().isSuccess()) {
100  ATH_MSG_WARNING("Failed to postNext() CounterTool.");
101  }
102  break;
103  }
104  }
105 
106  return StatusCode::SUCCESS;
107 }

◆ next() [2/2]

StatusCode DoubleEventSelectorAthenaPool::next ( IEvtSelector::Context &  ctxt,
int  jump 
) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to next event.
jump[IN] number of events to jump (currently not supported).

Reimplemented from EventSelectorAthenaPool.

Definition at line 110 of file DoubleEventSelectorAthenaPool.cxx.

111 {
112  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::next(jump)");
113 
114  if (jump > 0) {
115  for (int i = 0; i < jump; i++) {
116  if (!next(ctxt).isSuccess()) {
117  return StatusCode::FAILURE;
118  }
119  }
120  return StatusCode::SUCCESS;
121  }
122 
123  return StatusCode::FAILURE;
124 }

◆ nextHandleFileTransition()

StatusCode EventSelectorAthenaPool::nextHandleFileTransition ( IEvtSelector::Context &  ctxt) const
overrideprotectedvirtualinherited

Handle file transition at the next iteration.

Definition at line 639 of file EventSelectorAthenaPool.cxx.

640 {
641  if( m_inputCollectionsChanged ) {
642  StatusCode rc = reinit();
643  if( rc != StatusCode::SUCCESS ) return rc;
644  }
645  else { // advance to the next (not needed after reinit)
646  // Check if we're at the end of file
647  if (m_headerIterator == nullptr || m_headerIterator->next() == 0) {
648  m_headerIterator = nullptr;
649  // Close previous collection.
650  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
651 
652  // zero the current DB ID (m_guid) before disconnect() to indicate it is no longer in use
653  const SG::SourceID old_guid = m_guid.toString();
654  m_guid = Guid::null();
655  disconnectIfFinished( old_guid );
656 
657  // check if somebody updated Inputs in the EOF incident (like VP1 does)
658  if( m_inputCollectionsChanged ) {
659  StatusCode rc = reinit();
660  if( rc != StatusCode::SUCCESS ) return rc;
661  } else {
662  // Open next file from inputCollections list.
663  ++m_inputCollectionsIterator;
664  // Create PoolCollectionConverter for input file
665  m_poolCollectionConverter = getCollectionCnv(true);
666  if (m_poolCollectionConverter == nullptr) {
667  // Return end iterator
668  ctxt = *m_endIter;
669  // This is not a real failure but a Gaudi way of handling "end of job"
670  return StatusCode::FAILURE;
671  }
672  // Get DataHeader iterator
673  m_headerIterator = &m_poolCollectionConverter->executeQuery();
674 
675  // Return RECOVERABLE to mark we should still continue
676  return StatusCode::RECOVERABLE;
677  }
678  }
679  }
680 
681  const Token& headRef = m_refName.value().empty()?
682  m_headerIterator->eventRef()
683  : m_headerIterator->currentRow().tokenList()[m_refName.value() + "_ref"];
684  const Guid guid = headRef.dbID();
685  const int tech = headRef.technology();
686  ATH_MSG_VERBOSE("next(): DataHeder Token=" << headRef.toString() );
687 
688  if (guid != m_guid) {
689  // we are starting reading from a new DB. Check if the old one needs to be retired
690  if (m_guid != Guid::null()) {
691  // zero the current DB ID (m_guid) before trying disconnect() to indicate it is no longer in use
692  const SG::SourceID old_guid = m_guid.toString();
693  m_guid = Guid::null();
694  disconnectIfFinished( old_guid );
695  }
696  m_guid = guid;
697  m_activeEventsPerSource[guid.toString()] = 0;
698  // Fire BeginInputFile incident if current InputCollection is a payload file;
699  // otherwise, ascertain whether the pointed-to file is reachable before firing any incidents and/or proceeding
700  if (m_collectionType.value() == "ImplicitROOT") {
701  // For now, we can only deal with input metadata from POOL files, but we know we have a POOL file here
702  if (!m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
703  ATH_MSG_ERROR("Failed to set input attributes.");
704  return(StatusCode::FAILURE);
705  }
706  if (m_processMetadata.value()) {
707  FileIncident beginInputFileIncident(name(), "BeginInputFile", *m_inputCollectionsIterator, m_guid.toString());
708  m_incidentSvc->fireIncident(beginInputFileIncident);
709  }
710  } else {
711  // Check if File is BS
712  if (tech != 0x00001000 && m_processMetadata.value()) {
713  FileIncident beginInputFileIncident(name(), "BeginInputFile", "FID:" + m_guid.toString(), m_guid.toString());
714  m_incidentSvc->fireIncident(beginInputFileIncident);
715  }
716  }
717  } // end if (guid != m_guid)
718  return StatusCode::SUCCESS;
719 }

◆ nextWithSkip()

StatusCode EventSelectorAthenaPool::nextWithSkip ( IEvtSelector::Context &  ctxt) const
overrideprotectedvirtualinherited

Go to next event and skip if necessary.

Definition at line 721 of file EventSelectorAthenaPool.cxx.

721  {
722  ATH_MSG_DEBUG("EventSelectorAthenaPool::nextWithSkip");
723 
724  for (;;) {
725  // Check if we're at the end of file
727  if (sc.isRecoverable()) {
728  continue; // handles empty files
729  }
730  if (sc.isFailure()) {
731  return StatusCode::FAILURE;
732  }
733 
734  // Increase event count
735  ++m_evtCount;
736 
737  if (!m_counterTool.empty() && !m_counterTool->preNext().isSuccess()) {
738  ATH_MSG_WARNING("Failed to preNext() CounterTool.");
739  }
741  && (m_skipEventRanges.empty() || m_evtCount < m_skipEventRanges.front().first))
742  {
743  return StatusCode::SUCCESS;
744  } else {
745  while( !m_skipEventRanges.empty() && m_evtCount >= m_skipEventRanges.front().second ) {
746  m_skipEventRanges.erase(m_skipEventRanges.begin());
747  }
748  if (m_isSecondary.value()) {
749  ATH_MSG_INFO("skipping secondary event " << m_evtCount);
750  } else {
751  ATH_MSG_INFO("skipping event " << m_evtCount);
752  }
753  }
754  }
755 
756  return StatusCode::SUCCESS;
757 }

◆ previous() [1/2]

StatusCode EventSelectorAthenaPool::previous ( IEvtSelector::Context &  ctxt) const
overridevirtualinherited
Parameters
ctxt[IN/OUT] current event context is interated to previous event.

Definition at line 759 of file EventSelectorAthenaPool.cxx.

759  {
760  ATH_MSG_ERROR("previous() not implemented");
761  return(StatusCode::FAILURE);
762 }

◆ previous() [2/2]

StatusCode EventSelectorAthenaPool::previous ( IEvtSelector::Context &  ctxt,
int  jump 
) const
overridevirtualinherited
Parameters
ctxt[IN/OUT] current event context is interated to previous event.
jump[IN] number of events to jump (currently not supported).

Definition at line 764 of file EventSelectorAthenaPool.cxx.

764  {
765  if (jump > 0) {
766  for (int i = 0; i < jump; i++) {
767  ATH_CHECK(previous(ctxt));
768  }
769  return(StatusCode::SUCCESS);
770  }
771  return(StatusCode::FAILURE);
772 }

◆ queryInterface()

StatusCode EventSelectorAthenaPool::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
overridevirtualinherited

Does this object satisfy a given interface? See Gaudi documentation for details.

Definition at line 468 of file EventSelectorAthenaPool.cxx.

468  {
469  if (riid == IEvtSelector::interfaceID()) {
470  *ppvInterface = dynamic_cast<IEvtSelector*>(this);
471  } else if (riid == IIoComponent::interfaceID()) {
472  *ppvInterface = dynamic_cast<IIoComponent*>(this);
473  } else if (riid == IProperty::interfaceID()) {
474  *ppvInterface = dynamic_cast<IProperty*>(this);
475  } else if (riid == IEvtSelectorSeek::interfaceID()) {
476  *ppvInterface = dynamic_cast<IEvtSelectorSeek*>(this);
477  } else if (riid == IEventShare::interfaceID()) {
478  *ppvInterface = dynamic_cast<IEventShare*>(this);
479  } else if (riid == ISecondaryEventSelector::interfaceID()) {
480  *ppvInterface = dynamic_cast<ISecondaryEventSelector*>(this);
481  } else {
482  return(::AthService::queryInterface(riid, ppvInterface));
483  }
484  addRef();
485  return(StatusCode::SUCCESS);
486 }

◆ readEvent()

StatusCode EventSelectorAthenaPool::readEvent ( int  maxevt)
overridevirtualinherited

Read the next maxevt events.

Parameters
evtnum[IN] The number of events to read.

Definition at line 997 of file EventSelectorAthenaPool.cxx.

997  {
998  if (m_eventStreamingTool.empty()) {
999  ATH_MSG_ERROR("No AthenaSharedMemoryTool configured for readEvent()");
1000  return(StatusCode::FAILURE);
1001  }
1002  ATH_MSG_VERBOSE("Called read Event " << maxevt);
1003  IEvtSelector::Context* ctxt = new EventContextAthenaPool(this);
1004  for (int i = 0; i < maxevt || maxevt == -1; ++i) {
1005  if (!next(*ctxt).isSuccess()) {
1006  if (m_evtCount == -1) {
1007  ATH_MSG_VERBOSE("Called read Event and read last event from input: " << i);
1008  break;
1009  }
1010  ATH_MSG_ERROR("Cannot read Event " << m_evtCount - 1 << " into AthenaSharedMemoryTool");
1011  delete ctxt; ctxt = nullptr;
1012  return(StatusCode::FAILURE);
1013  } else {
1014  ATH_MSG_VERBOSE("Called next, read Event " << m_evtCount - 1);
1015  }
1016  }
1017  delete ctxt; ctxt = nullptr;
1018  // End of file, wait for last event to be taken
1019  StatusCode sc;
1020  while ( (sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
1021  while (m_athenaPoolCnvSvc->readData().isSuccess()) {
1022  ATH_MSG_VERBOSE("Called last readData, while marking last event in readEvent()");
1023  }
1024  usleep(1000);
1025  }
1026  if (!sc.isSuccess()) {
1027  ATH_MSG_ERROR("Cannot put last Event marker to AthenaSharedMemoryTool");
1028  return(StatusCode::FAILURE);
1029  } else {
1030  sc = m_athenaPoolCnvSvc->readData();
1031  while (sc.isSuccess() || sc.isRecoverable()) {
1032  sc = m_athenaPoolCnvSvc->readData();
1033  }
1034  ATH_MSG_DEBUG("Failed last readData -> Clients are stopped, after marking last event in readEvent()");
1035  }
1036  return(StatusCode::SUCCESS);
1037 }

◆ recordAttributeList()

StatusCode DoubleEventSelectorAthenaPool::recordAttributeList ( ) const
overrideprivatevirtual

Record AttributeList in StoreGate.

Reimplemented from EventSelectorAthenaPool.

Definition at line 153 of file DoubleEventSelectorAthenaPool.cxx.

154 {
155  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::recordAttributeList");
156 
157  // Get access to AttributeList
158  ATH_MSG_DEBUG("Get AttributeList from the collection");
159  // MN: accessing only attribute list, ignoring token list
160  const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
161  ATH_MSG_DEBUG("AttributeList size " << attrList.size());
162  std::unique_ptr<AthenaAttributeList> athAttrList{};
163 
164  // Decide what to do based on the type of secondary file
165  if (m_secondaryByteStream) {
166  // Create empty attribute list
167  athAttrList = std::make_unique<AthenaAttributeList>();
168  // Always add ByteStream as primary input
169  ATH_CHECK(m_secondarySelector->fillAttributeList(athAttrList.get(), "", false));
170 
171  // Then fill the new attribute list from the primary file
172  ATH_MSG_DEBUG("Append primary attribute list properties to the secondary one with a suffix: " << m_secondaryAttrListSuffix.value());
173  ATH_CHECK(fillAttributeList(athAttrList.get(), "_" + m_secondaryAttrListSuffix.value(), true));
174  } else {
175  // Create a new attribute list from the primary input one
176  athAttrList = std::make_unique<AthenaAttributeList>(attrList);
177  // Fill the new attribute list from the primary file
178  ATH_CHECK(fillAttributeList(athAttrList.get(), "", false));
179 
180  // Fill the new attribute list from the secondary file
181  ATH_MSG_DEBUG("Append secondary attribute list properties to the primary one with a suffix: " << m_secondaryAttrListSuffix.value());
182  ATH_CHECK(m_secondarySelector->fillAttributeList(athAttrList.get(), "_" + m_secondaryAttrListSuffix.value(), true));
183  }
184 
185  // Add info about secondary input
186  athAttrList->extend("hasSecondaryInput", "bool");
187  (*athAttrList)["hasSecondaryInput"].data<bool>() = true;
188 
190  if (!wh.record(std::move(athAttrList)).isSuccess()) {
191  ATH_MSG_ERROR("Cannot record AttributeList to StoreGate " << StoreID::storeName(eventStore()->storeID()));
192  return StatusCode::FAILURE;
193  }
194 
195  return StatusCode::SUCCESS;
196 }

◆ reinit()

StatusCode EventSelectorAthenaPool::reinit ( ) const
privateinherited

Reinitialize the service when a fork() occured/was-issued.

Definition at line 247 of file EventSelectorAthenaPool.cxx.

247  {
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  ATH_MSG_INFO("EventSelection with query " << m_query.value());
282  // Create an m_poolCollectionConverter to read the objects in
283  m_poolCollectionConverter = getCollectionCnv();
284  if (m_poolCollectionConverter == nullptr) {
285  ATH_MSG_INFO("No Events found in any Input Collections");
286  if (m_processMetadata.value()) {
287  m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
288  if (!m_inputCollectionsProp.value().empty()) --m_inputCollectionsIterator;
289  //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
290  if (m_collectionType.value() == "ImplicitROOT" && !m_firedIncident && !m_inputCollectionsProp.value().empty()) {
291  FileIncident firstInputFileIncident(name(), "FirstInputFile", *m_inputCollectionsIterator);
292  m_incidentSvc->fireIncident(firstInputFileIncident);
293  m_firedIncident = true;
294  }
295  }
296  return(StatusCode::SUCCESS);
297  }
298  // Check for valid header name
299  if (!m_refName.value().empty()) {
300  if (m_collectionType.value() == "ExplicitROOT") {
301  ATH_MSG_INFO("Using collection ref name: " << m_refName.value());
302  } else {
303  ATH_MSG_INFO("Using implicit collection, ignore ref name: " << m_refName.value());
304  }
305  } else if (m_collectionType.value() == "ExplicitROOT") {
306  ATH_MSG_INFO("Using standard collection ref ");
307  }
308  // Get DataHeader iterator
309  try {
310  m_headerIterator = &m_poolCollectionConverter->executeQuery();
311  } catch (std::exception &e) {
312  ATH_MSG_FATAL("Cannot open implicit collection - check data/software version.");
313  ATH_MSG_ERROR(e.what());
314  return(StatusCode::FAILURE);
315  }
316  while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // no selected events
317  if (m_poolCollectionConverter != nullptr) {
318  m_poolCollectionConverter->disconnectDb().ignore();
319  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
320  }
321  ++m_inputCollectionsIterator;
322  m_poolCollectionConverter = getCollectionCnv();
323  if (m_poolCollectionConverter != nullptr) {
324  m_headerIterator = &m_poolCollectionConverter->executeQuery();
325  } else {
326  break;
327  }
328  }
329  if (m_poolCollectionConverter == nullptr || m_headerIterator == nullptr) { // no event selected in any collection
330  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
331  m_curCollection = 0;
332  m_poolCollectionConverter = getCollectionCnv();
333  if (m_poolCollectionConverter == nullptr) {
334  return(StatusCode::SUCCESS);
335  }
336  m_headerIterator = &m_poolCollectionConverter->selectAll();
337  while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // empty collection
338  if (m_poolCollectionConverter != nullptr) {
339  m_poolCollectionConverter->disconnectDb().ignore();
340  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
341  }
342  ++m_inputCollectionsIterator;
343  m_poolCollectionConverter = getCollectionCnv();
344  if (m_poolCollectionConverter != nullptr) {
345  m_headerIterator = &m_poolCollectionConverter->selectAll();
346  } else {
347  break;
348  }
349  }
350  }
351  if (m_poolCollectionConverter == nullptr || m_headerIterator == nullptr) {
352  return(StatusCode::SUCCESS);
353  }
354  const Token& headRef = m_refName.value().empty()?
355  m_headerIterator->eventRef()
356  : m_headerIterator->currentRow().tokenList()[m_refName.value() + "_ref"];
357  const std::string fid = headRef.dbID().toString();
358  const int tech = headRef.technology();
359  ATH_MSG_VERBOSE("reinit(): First DataHeder Token=" << headRef.toString() );
360 
361  // Check if File is BS, for which Incident is thrown by SingleEventInputSvc
362  if (tech != 0x00001000 && m_processMetadata.value() && !m_firedIncident) {
363  FileIncident firstInputFileIncident(name(), "FirstInputFile", "FID:" + fid, fid);
364  m_incidentSvc->fireIncident(firstInputFileIncident);
365  m_firedIncident = true;
366  }
367  return(StatusCode::SUCCESS);
368 }

◆ releaseContext()

StatusCode EventSelectorAthenaPool::releaseContext ( IEvtSelector::Context *&  ctxt) const
overridevirtualinherited
Parameters
ctxt[IN] current event context is released.

Definition at line 815 of file EventSelectorAthenaPool.cxx.

815  {
816  return(StatusCode::SUCCESS);
817 }

◆ resetCriteria()

StatusCode EventSelectorAthenaPool::resetCriteria ( const std::string &  criteria,
IEvtSelector::Context &  ctxt 
) const
overridevirtualinherited

Set a selection criteria.

Parameters
criteriafilter predicate (SQL-style WHERE clause)
ctxt[IN] current event context.

Definition at line 819 of file EventSelectorAthenaPool.cxx.

820  {
821  return(StatusCode::SUCCESS);
822 }

◆ rewind()

StatusCode EventSelectorAthenaPool::rewind ( IEvtSelector::Context &  ctxt) const
overridevirtualinherited
Parameters
ctxt[IN/OUT] current event context is rewound to first event.

Definition at line 782 of file EventSelectorAthenaPool.cxx.

782  {
783  ATH_CHECK(reinit());
784  ctxt = EventContextAthenaPool(this);
785  return(StatusCode::SUCCESS);
786 }

◆ seek()

StatusCode DoubleEventSelectorAthenaPool::seek ( Context &  ctxt,
int  evtNum 
) const
overridevirtual

Seek to a given event number.

Parameters
ctxt[IN/OUT] current event context.
evtNum[IN] The event number to which to seek.

Reimplemented from EventSelectorAthenaPool.

Definition at line 127 of file DoubleEventSelectorAthenaPool.cxx.

128 {
129  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::seek");
130 
132  ATH_CHECK(m_secondarySelector->seek(ctxt, evtNum));
133 
134  return StatusCode::SUCCESS;
135 }

◆ share()

StatusCode EventSelectorAthenaPool::share ( int  evtnum)
overridevirtualinherited

Request to share a given event number.

Parameters
evtnum[IN] The event number to share.

Definition at line 969 of file EventSelectorAthenaPool.cxx.

969  {
970  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
971  StatusCode sc = m_eventStreamingTool->lockEvent(evtnum);
972  while (sc.isRecoverable()) {
973  usleep(1000);
974  sc = m_eventStreamingTool->lockEvent(evtnum);
975  }
976 // Send stop client and wait for restart
977  if (sc.isFailure()) {
978  if (m_athenaPoolCnvSvc->makeClient(0).isFailure()) {
979  return(StatusCode::FAILURE);
980  }
981  sc = m_eventStreamingTool->lockEvent(evtnum);
982  while (sc.isRecoverable() || sc.isFailure()) {
983  usleep(1000);
984  sc = m_eventStreamingTool->lockEvent(evtnum);
985  }
986 //FIXME
987  if (m_athenaPoolCnvSvc->makeClient(1).isFailure()) {
988  return(StatusCode::FAILURE);
989  }
990  }
991  return(sc);
992  }
993  return(StatusCode::FAILURE);
994 }

◆ size()

int DoubleEventSelectorAthenaPool::size ( Context &  ctxt) const
overridevirtual

Return the size of the collection.

Parameters
ctxt[IN/OUT] current event context.

Reimplemented from EventSelectorAthenaPool.

Definition at line 138 of file DoubleEventSelectorAthenaPool.cxx.

139 {
140  ATH_MSG_DEBUG("DoubleEventSelectorAthenaPool::size");
141 
142  int sz1 = EventSelectorAthenaPool::size(ctxt);
143  int sz2 = m_secondarySelector->size(ctxt);
144 
145  if (sz2 < sz1) {
146  ATH_MSG_WARNING("Fewer secondary input events than primary input events. Expect trouble!");
147  }
148 
149  return sz1;
150 }

◆ start()

StatusCode EventSelectorAthenaPool::start ( )
overridevirtualinherited

Definition at line 370 of file EventSelectorAthenaPool.cxx.

370  {
371  if (m_poolCollectionConverter != nullptr) {
372  // Reset iterators and apply new query
373  m_poolCollectionConverter->disconnectDb().ignore();
374  delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr;
375  }
376  m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
377  m_curCollection = 0;
378  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
379  return(StatusCode::SUCCESS);
380  }
381  m_poolCollectionConverter = getCollectionCnv(true);
382  if (m_poolCollectionConverter == nullptr) {
383  ATH_MSG_INFO("No Events found in any Input Collections");
384  m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
385  if (!m_inputCollectionsProp.value().empty()) {
386  --m_inputCollectionsIterator; //leave iterator in state of last input file
387  }
388  } else {
389  m_headerIterator = &m_poolCollectionConverter->executeQuery(/*m_query.value()*/);
390  }
391  m_evtCount = 0;
392  delete m_endIter;
393  m_endIter = nullptr;
394  m_endIter = new EventContextAthenaPool(nullptr);
395  return(StatusCode::SUCCESS);
396 }

◆ stop()

StatusCode EventSelectorAthenaPool::stop ( )
overridevirtualinherited

Definition at line 398 of file EventSelectorAthenaPool.cxx.

398  {
399  if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
400  return(StatusCode::SUCCESS);
401  }
402  IEvtSelector::Context* ctxt(nullptr);
403  if (!releaseContext(ctxt).isSuccess()) {
404  ATH_MSG_WARNING("Cannot release context");
405  }
406  return(StatusCode::SUCCESS);
407 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/10]

PoolCollectionConverter* m_poolCollectionConverter EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivateinherited

Definition at line 173 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [2/10]

pool::ICollectionCursor* m_headerIterator EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivateinherited

Definition at line 174 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [3/10]

Guid m_guid EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivateinherited

Definition at line 175 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [4/10]

std::map<SG::SourceID, int> m_activeEventsPerSource EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 176 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [5/10]

std::vector<std::string>::const_iterator m_inputCollectionsIterator EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 200 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [6/10]

bool m_inputCollectionsChanged EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

flag to notify the EvSel that the inputs were changed and reinit() needs to be called ASAP

Definition at line 203 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [7/10]

ToolHandleArray<IAthenaSelectorTool> m_helperTools EventSelectorAthenaPool::ATLAS_THREAD_SAFE {this}
mutableprivateinherited

HelperTools, vector of names of AlgTools that are executed by the EventSelector.

Definition at line 213 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [8/10]

std::vector<int> m_numEvt EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 236 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [9/10]

std::vector<int> m_firstEvt EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 237 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [10/10]

std::vector<std::pair<long,long> > m_skipEventRanges EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 244 of file EventSelectorAthenaPool.h.

◆ m_athenaPoolCnvSvc

ServiceHandle<IAthenaPoolCnvSvc> EventSelectorAthenaPool::m_athenaPoolCnvSvc {this, "AthenaPoolCnvSvc", "AthenaPoolCnvSvc", ""}
privateinherited

Definition at line 178 of file EventSelectorAthenaPool.h.

◆ m_attrListKey

Gaudi::Property<std::string> EventSelectorAthenaPool::m_attrListKey {this, "AttributeListKey", "Input", ""}
privateinherited

AttributeList SG key.

Definition at line 196 of file EventSelectorAthenaPool.h.

◆ m_callLock

CallMutex EventSelectorAthenaPool::m_callLock
mutableprivateinherited

Definition at line 250 of file EventSelectorAthenaPool.h.

◆ m_collectionTree

Gaudi::Property<std::string> EventSelectorAthenaPool::m_collectionTree {this, "CollectionTree", APRDefaults::TTreeNames::DataHeader, ""}
privateinherited

CollectionTree, prefix of the collection TTree: default = "POOLContainer".

Definition at line 189 of file EventSelectorAthenaPool.h.

◆ m_collectionType

Gaudi::Property<std::string> EventSelectorAthenaPool::m_collectionType {this, "CollectionType", "ImplicitROOT", ""}
privateinherited

CollectionType, type of the collection: default = "ImplicitROOT".

Definition at line 187 of file EventSelectorAthenaPool.h.

◆ m_connection

Gaudi::Property<std::string> EventSelectorAthenaPool::m_connection {this, "Connection", "", ""}
privateinherited

Connection, connection string.

Definition at line 192 of file EventSelectorAthenaPool.h.

◆ m_counterTool

ToolHandle<IAthenaSelectorTool> EventSelectorAthenaPool::m_counterTool {this, "CounterTool", "", ""}
privateinherited

Definition at line 214 of file EventSelectorAthenaPool.h.

◆ m_curCollection

std::atomic_long EventSelectorAthenaPool::m_curCollection {}
mutableprivateinherited

Definition at line 235 of file EventSelectorAthenaPool.h.

◆ m_endIter

EventContextAthenaPool* EventSelectorAthenaPool::m_endIter {}
privateinherited

Definition at line 170 of file EventSelectorAthenaPool.h.

◆ m_eventsPerLB

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_eventsPerLB {this, "EventsPerLB", 1000, ""}
privateinherited

Definition at line 231 of file EventSelectorAthenaPool.h.

◆ m_eventsPerRun

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_eventsPerRun {this, "EventsPerRun", 1000000, ""}
privateinherited

Definition at line 229 of file EventSelectorAthenaPool.h.

◆ m_eventStreamingTool

ToolHandle<IAthenaIPCTool> EventSelectorAthenaPool::m_eventStreamingTool {this, "SharedMemoryTool", "", ""}
privateinherited

Definition at line 215 of file EventSelectorAthenaPool.h.

◆ m_evtCount

std::atomic_int EventSelectorAthenaPool::m_evtCount {}
mutableprivateinherited

Definition at line 246 of file EventSelectorAthenaPool.h.

◆ m_firedIncident

std::atomic_bool EventSelectorAthenaPool::m_firedIncident {}
mutableprivateinherited

Definition at line 247 of file EventSelectorAthenaPool.h.

◆ m_firstEventNo

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_firstEventNo {this, "FirstEvent", 1, ""}
privateinherited

Definition at line 227 of file EventSelectorAthenaPool.h.

◆ m_firstLBNo

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_firstLBNo {this, "FirstLB", 0, ""}
privateinherited

Definition at line 230 of file EventSelectorAthenaPool.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> EventSelectorAthenaPool::m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""}
privateinherited

Definition at line 179 of file EventSelectorAthenaPool.h.

◆ m_initTimeStamp

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_initTimeStamp {this, "InitialTimeStamp", 0, ""}
privateinherited

Definition at line 232 of file EventSelectorAthenaPool.h.

◆ m_inputCollectionsProp

Gaudi::Property<std::vector<std::string> > EventSelectorAthenaPool::m_inputCollectionsProp {this, "InputCollections", {}, ""}
privateinherited

InputCollections, vector with names of the input collections.

Definition at line 199 of file EventSelectorAthenaPool.h.

◆ m_isSecondary

Gaudi::Property<bool> EventSelectorAthenaPool::m_isSecondary {this, "IsSecondary", false, ""}
privateinherited

IsSecondary, know if this is an instance of secondary event selector.

Definition at line 183 of file EventSelectorAthenaPool.h.

◆ m_keepInputFilesOpen

Gaudi::Property<bool> EventSelectorAthenaPool::m_keepInputFilesOpen {this, "KeepInputFilesOpen", false, ""}
privateinherited

KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false.

Needed for PilUp to run without PoolFileCatalog. Relies on POOL to close files when reaching DB_AGE_LIMIT.

Definition at line 210 of file EventSelectorAthenaPool.h.

◆ m_makeStreamingToolClient

IntegerProperty EventSelectorAthenaPool::m_makeStreamingToolClient {this,"MakeStreamingToolClient",0}
privateinherited

Make this instance a Streaming Client during first iteration automatically.

Definition at line 217 of file EventSelectorAthenaPool.h.

◆ m_oldRunNo

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_oldRunNo {this, "OldRunNumber", 0, ""}
privateinherited

Definition at line 223 of file EventSelectorAthenaPool.h.

◆ m_overrideRunNumber

Gaudi::Property<bool> EventSelectorAthenaPool::m_overrideRunNumber {this, "OverrideRunNumber", false, ""}
privateinherited

Definition at line 224 of file EventSelectorAthenaPool.h.

◆ m_overrideRunNumberFromInput

Gaudi::Property<bool> EventSelectorAthenaPool::m_overrideRunNumberFromInput {this, "OverrideRunNumberFromInput", false, ""}
privateinherited

Definition at line 225 of file EventSelectorAthenaPool.h.

◆ m_processMetadata

Gaudi::Property<bool> EventSelectorAthenaPool::m_processMetadata {this, "ProcessMetadata", true, ""}
privateinherited

ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default = true.

Definition at line 185 of file EventSelectorAthenaPool.h.

◆ m_query

Gaudi::Property<std::string> EventSelectorAthenaPool::m_query {this, "Query", "", ""}
privateinherited

Query string passed to APR when opening DataHeader container (kind of useless).

Definition at line 206 of file EventSelectorAthenaPool.h.

◆ m_refName

Gaudi::Property<std::string> EventSelectorAthenaPool::m_refName {this, "RefName", "", ""}
privateinherited

RefName, attribute name.

Definition at line 194 of file EventSelectorAthenaPool.h.

◆ m_runNo

Gaudi::CheckedProperty<int> EventSelectorAthenaPool::m_runNo {this, "RunNumber", 0, ""}
privateinherited

The following are included for compatibility with McEventSelector and are not really used.

However runNo, oldRunNo and overrideRunNumberFromInput are used to reset run number for simulated events, needed to use condition

Definition at line 222 of file EventSelectorAthenaPool.h.

◆ m_secondaryAttrListSuffix

Gaudi::Property<std::string> DoubleEventSelectorAthenaPool::m_secondaryAttrListSuffix {this, "SecondaryAttrListSuffix", "secondary", ""}
private

Definition at line 67 of file DoubleEventSelectorAthenaPool.h.

◆ m_secondaryByteStream

bool DoubleEventSelectorAthenaPool::m_secondaryByteStream {}
private

Definition at line 70 of file DoubleEventSelectorAthenaPool.h.

◆ m_secondarySelector

ServiceHandle<ISecondaryEventSelector> DoubleEventSelectorAthenaPool::m_secondarySelector {this, "SecondaryEventSelector", "SecondaryEventSelector", ""}
private

Definition at line 65 of file DoubleEventSelectorAthenaPool.h.

◆ m_skipEventRangesProp

Gaudi::Property<std::string> EventSelectorAthenaPool::m_skipEventRangesProp {this, "SkipEventRanges", {}, ""}
privateinherited

Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>

Definition at line 243 of file EventSelectorAthenaPool.h.

◆ m_skipEvents

Gaudi::Property<int> EventSelectorAthenaPool::m_skipEvents {this, "SkipEvents", 0, ""}
privateinherited

SkipEvents, numbers of events to skip: default = 0.

Definition at line 240 of file EventSelectorAthenaPool.h.

◆ m_skipEventSequenceProp

Gaudi::Property<std::vector<long> > EventSelectorAthenaPool::m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""}
privateinherited

Definition at line 241 of file EventSelectorAthenaPool.h.

◆ m_sourceID

SG::SlotSpecificObj<SG::SourceID> EventSelectorAthenaPool::m_sourceID
privateinherited

Definition at line 252 of file EventSelectorAthenaPool.h.

◆ m_sourceID1

SG::SlotSpecificObj<SG::SourceID> DoubleEventSelectorAthenaPool::m_sourceID1
private

Definition at line 72 of file DoubleEventSelectorAthenaPool.h.

◆ m_sourceID2

SG::SlotSpecificObj<SG::SourceID> DoubleEventSelectorAthenaPool::m_sourceID2
private

Definition at line 73 of file DoubleEventSelectorAthenaPool.h.

◆ m_timeStampInterval

Gaudi::Property<int> EventSelectorAthenaPool::m_timeStampInterval {this, "TimeStampInterval", 0, ""}
privateinherited

Definition at line 233 of file EventSelectorAthenaPool.h.


The documentation for this class was generated from the following files:
EventSelectorAthenaPool::last
virtual StatusCode last(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:774
DoubleEventSelectorAthenaPool::m_secondarySelector
ServiceHandle< ISecondaryEventSelector > m_secondarySelector
Definition: DoubleEventSelectorAthenaPool.h:65
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:53
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:1112
DoubleEventSelectorAthenaPool::m_sourceID2
SG::SlotSpecificObj< SG::SourceID > m_sourceID2
Definition: DoubleEventSelectorAthenaPool.h:73
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:240
fitman.sz2
sz2
Definition: fitman.py:543
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
EventSelectorAthenaPool::releaseContext
virtual StatusCode releaseContext(IEvtSelector::Context *&ctxt) const override
Definition: EventSelectorAthenaPool.cxx:815
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:247
PoolCollectionConverter
This class provides an interface to POOL collections.
Definition: PoolCollectionConverter.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
EventSelectorAthenaPool::previous
virtual StatusCode previous(IEvtSelector::Context &ctxt) const override
Definition: EventSelectorAthenaPool.cxx:759
EventSelectorAthenaPool::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Definition: EventSelectorAthenaPool.h:179
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:178
SG::SlotSpecificObj::get
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
Token::dbID
const Guid & dbID() const
Access database identifier.
Definition: Token.h:62
EventSelectorAthenaPool::m_eventStreamingTool
ToolHandle< IAthenaIPCTool > m_eventStreamingTool
Definition: EventSelectorAthenaPool.h:215
EventSelectorAthenaPool::m_query
Gaudi::Property< std::string > m_query
Query string passed to APR when opening DataHeader container (kind of useless).
Definition: EventSelectorAthenaPool.h:206
EventSelectorAthenaPool::eventStore
StoreGateSvc * eventStore() const
Return pointer to active event SG.
Definition: EventSelectorAthenaPool.cxx:85
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
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
EventSelectorAthenaPool::m_callLock
CallMutex m_callLock
Definition: EventSelectorAthenaPool.h:250
DoubleEventSelectorAthenaPool::next
virtual StatusCode next(IEvtSelector::Context &ctxt) const override
Definition: DoubleEventSelectorAthenaPool.cxx:50
EventSelectorAthenaPool
This class is the EventSelector for event data.
Definition: EventSelectorAthenaPool.h:49
DoubleEventSelectorAthenaPool::m_sourceID1
SG::SlotSpecificObj< SG::SourceID > m_sourceID1
Definition: DoubleEventSelectorAthenaPool.h:72
EventContextAthenaPool
This class provides the context to access an event from POOL persistent store.
Definition: EventContextAthenaPool.h:21
PoolCollectionConverter::isValid
StatusCode isValid() const
Check whether has valid pool::ICollection*.
Definition: PoolCollectionConverter.cxx:123
DoubleEventSelectorAthenaPool::m_secondaryAttrListSuffix
Gaudi::Property< std::string > m_secondaryAttrListSuffix
Definition: DoubleEventSelectorAthenaPool.h:67
DoubleEventSelectorAthenaPool::m_secondaryByteStream
bool m_secondaryByteStream
Definition: DoubleEventSelectorAthenaPool.h:70
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
EventSelectorAthenaPool::m_refName
Gaudi::Property< std::string > m_refName
RefName, attribute name.
Definition: EventSelectorAthenaPool.h:194
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:214
TokenAddress
This class provides a Generic Transient Address for POOL tokens.
Definition: TokenAddress.h:21
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
Token::fromString
Token & fromString(const std::string &from)
Build from the string representation of a token.
Definition: Token.cxx:133
IPoolSvc::kInputStream
@ kInputStream
Definition: IPoolSvc.h:40
EventContextAthenaPool::identifier
virtual void * identifier() const
Definition: EventContextAthenaPool.h:56
TileAANtupleConfig.inputCollections
inputCollections
Definition: TileAANtupleConfig.py:133
IEventShare
Abstract interface for sharing within an event stream.
Definition: IEventShare.h:28
Token::technology
int technology() const
Access technology type.
Definition: Token.h:75
EventSelectorAthenaPool::m_firedIncident
std::atomic_bool m_firedIncident
Definition: EventSelectorAthenaPool.h:247
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:196
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
IEventShare::interfaceID
static const InterfaceID & interfaceID()
Definition: IEventShare.h:35
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ISecondaryEventSelector
Abstract interface for secondary event selectors.
Definition: ISecondaryEventSelector.h:28
EventSelectorAthenaPool::m_isSecondary
Gaudi::Property< bool > m_isSecondary
IsSecondary, know if this is an instance of secondary event selector.
Definition: EventSelectorAthenaPool.h:183
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:40
calibdata.exception
exception
Definition: calibdata.py:496
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
parseDir.wh
wh
Definition: parseDir.py:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ICollectionSize
Abstract interface for finding the size of an event collection.
Definition: ICollectionSize.h:31
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
EventSelectorAthenaPool::m_collectionTree
Gaudi::Property< std::string > m_collectionTree
CollectionTree, prefix of the collection TTree: default = "POOLContainer".
Definition: EventSelectorAthenaPool.h:189
pool::ICollectionCursor
Definition: ICollectionCursor.h:21
pool_uuid.guid
guid
Definition: pool_uuid.py:112
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
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:493
EventSelectorAthenaPool::m_processMetadata
Gaudi::Property< bool > m_processMetadata
ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default...
Definition: EventSelectorAthenaPool.h:185
DoubleEventSelectorAthenaPool::recordAttributeList
virtual StatusCode recordAttributeList() const override
Record AttributeList in StoreGate.
Definition: DoubleEventSelectorAthenaPool.cxx:153
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:1248
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EventSelectorAthenaPool::m_inputCollectionsProp
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp
InputCollections, vector with names of the input collections.
Definition: EventSelectorAthenaPool.h:199
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:114
EventSelectorAthenaPool::nextHandleFileTransition
virtual StatusCode nextHandleFileTransition(IEvtSelector::Context &ctxt) const override
Handle file transition at the next iteration.
Definition: EventSelectorAthenaPool.cxx:639
EventSelectorAthenaPool::nextWithSkip
virtual StatusCode nextWithSkip(IEvtSelector::Context &ctxt) const override
Go to next event and skip if necessary.
Definition: EventSelectorAthenaPool.cxx:721
EventSelectorAthenaPool::m_curCollection
std::atomic_long m_curCollection
Definition: EventSelectorAthenaPool.h:235
pool::TokenList::begin
iterator begin()
Returns a forward iterator pointing to first element in Token list.
Definition: TokenList.h:218
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
EventSelectorAthenaPool::m_endIter
EventContextAthenaPool * m_endIter
Definition: EventSelectorAthenaPool.h:170
PoolCollectionConverter::initialize
StatusCode initialize()
Required by all Gaudi Services.
Definition: PoolCollectionConverter.cxx:69
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
EventSelectorAthenaPool::initialize
virtual StatusCode initialize() override
Required of all Gaudi Services.
Definition: EventSelectorAthenaPool.cxx:89
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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:246
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:23
DEBUG
#define DEBUG
Definition: page_access.h:11
EventSelectorAthenaPool::getCollectionCnv
PoolCollectionConverter * getCollectionCnv(bool throwIncidents=false) const
Return pointer to new PoolCollectionConverter.
Definition: EventSelectorAthenaPool.cxx:1050
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:1040
EventSelectorAthenaPool::m_keepInputFilesOpen
Gaudi::Property< bool > m_keepInputFilesOpen
KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false...
Definition: EventSelectorAthenaPool.h:210
EventSelectorAthenaPool::m_collectionType
Gaudi::Property< std::string > m_collectionType
CollectionType, type of the collection: default = "ImplicitROOT".
Definition: EventSelectorAthenaPool.h:187
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
EventSelectorAthenaPool::seek
virtual StatusCode seek(Context &ctxt, int evtnum) const override
Seek to a given event number.
Definition: EventSelectorAthenaPool.cxx:824
IEvtSelectorSeek
Abstract interface for seeking for an event selector.
Definition: IEvtSelectorSeek.h:28
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:350
ServiceHandle< IIoComponentMgr >