diff --git a/Event/DFStreamEventSelector/CMakeLists.txt b/Event/DFStreamEventSelector/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..574b9434c00749b76171331d98de82d4498f5377 --- /dev/null +++ b/Event/DFStreamEventSelector/CMakeLists.txt @@ -0,0 +1,44 @@ +################################################################################ +# Package: DFStreamEventSelector +################################################################################ + +# Declare the package name: +atlas_subdir( DFStreamEventSelector ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( + PUBLIC + Control/AthenaBaseComps + Event/ByteStreamCnvSvcBase + Event/ByteStreamData + GaudiKernel + PRIVATE + Control/AthenaKernel + Control/SGTools + Control/StoreGate + Event/EventInfo + ) + +# External dependencies: +#find_package( Boost COMPONENTS system ) +#find_package( CORAL COMPONENTS CoralBase ) +find_package( tdaq-common COMPONENTS hltinterface ) + +# Libraries in the package: +atlas_add_library( DFStreamEventSelectorLib + src/*.h src/*.cxx + PUBLIC_HEADERS DFStreamEventSelector + PRIVATE_INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} + LINK_LIBRARIES AthenaBaseComps GaudiKernel + StoreGateLib rt + PRIVATE_LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} + AthenaKernel StorageSvc EventInfo) + +atlas_add_component( DFStreamEventSelector + src/components/*.cxx + LINK_LIBRARIES DFStreamEventSelectorLib ) + + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_joboptions( share/*.py ) diff --git a/Event/DFStreamEventSelector/src/DFStreamEventSelector.cxx b/Event/DFStreamEventSelector/src/DFStreamEventSelector.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7110d1b263a78b6d04c3203c4f636c29ee015080 --- /dev/null +++ b/Event/DFStreamEventSelector/src/DFStreamEventSelector.cxx @@ -0,0 +1,37 @@ +#include "DFStreamEventSelector.h" + +DFStreamEventSelector::DFStreamEventSelector(const std::string &name, ISvcLocator* pSvcLocator):AthService(name,pSvcLocator){} + +DFStreamEventSelector::~DFStreamEventSelector(){} + +StatusCode DFStreamEventSelector::createContext(EvtContext*& c) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::next(EvtContext& c) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::next(EvtContext& c,int jump) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::previous(EvtContext& c) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::previous(EvtContext& c,int jump) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::last(EvtContext& refContext) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::rewind(EvtContext& c) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::createAddress(const EvtContext& c,IOpaqueAddress*& iop) const{ + return StatusCode::SUCCESS; +} +StatusCode DFStreamEventSelector::releaseContext(EvtContext*&)const{ + return StatusCode::SUCCESS; +} + +StatusCode DFStreamEventSelector::resetCriteria(const std::string& cr,Context& c)const{ + return StatusCode::SUCCESS; +} diff --git a/Event/DFStreamEventSelector/src/DFStreamEventSelector.h b/Event/DFStreamEventSelector/src/DFStreamEventSelector.h new file mode 100644 index 0000000000000000000000000000000000000000..aaea1b5fbb2eef7808a55802335b7ab15c5e7693 --- /dev/null +++ b/Event/DFStreamEventSelector/src/DFStreamEventSelector.h @@ -0,0 +1,107 @@ +/* --+- C++ -+-- */ +/* A simple class to use DFDataSource implementations to read data + * + */ +#ifndef __DFSTREAMEVENTSELECTOR_H +#define __DFSTREAMEVENTSELECTOR_H + +#ifndef GAUDIKERNEL_IEVTSELECTOR_H +# include "GaudiKernel/IEvtSelector.h" +#endif + +#ifndef GAUDIKERNEL_PROPERTY_H +# include "GaudiKernel/Property.h" +#endif + +#ifndef GAUDIKERNEL_SERVICEHANDLE_H +# include "GaudiKernel/ServiceHandle.h" +#endif + +#ifndef GAUDIKERNEL_TOOLHANDLE_H +#include "GaudiKernel/ToolHandle.h" +#endif +#ifndef EVENTINFO_EVENTID_H +# include "EventInfo/EventID.h" /* number_type */ +#endif + +#include "AthenaBaseComps/AthService.h" +class DFStreamEventSelector:public AthService, + public IEvtSelector{ +public: + DFStreamEventSelector(const std::string &name, ISvcLocator* pSvcLocator); + virtual ~DFStreamEventSelector(); + typedef IEvtSelector::Context EvtContext; + /**Create and return a context object that will + keep track of the state of selection. + + @param c Reference of a pointer to a Context object. + */ + virtual StatusCode createContext(EvtContext*& c) const override; + + /**Fetch the next event or the first event if it will be use soon + after the creation of the context. + It will return StatusCode::FAILURE if there have been problem in the fetching or it + has been reached the end of the list of events. + + @param c Reference to the Context object. + */ + virtual StatusCode next(EvtContext& c) const override; + + /**Same of next(const Context&) plus the possibility to jump the next n-1 events. + + @param c Reference to the Context object. + @param jump The event to jump to from the current event. + */ + virtual StatusCode next(EvtContext& c,int jump) const override; + + /**Fetch the previous event. + It will return StatusCode::FAILURE if there have been problem in the fetching or it + has been reached the begin of the list of events. + + @param c Reference to the Context object. + */ + virtual StatusCode previous(EvtContext& c) const override; + + /**Same of previous(Context& c) the possibility to jump the previous n-1 events. + + @param c Reference to the Context object. + @param jump The event to jump to from the current event. + */ + virtual StatusCode previous(EvtContext& c,int jump) const override; + + /** Access last item in the iteration + * @param refContext [IN/OUT] Reference to the Context object. + */ + virtual StatusCode last(EvtContext& refContext) const override; + + /** Will set the state of the context in a way that the next event read + * is the first of the list. + * + * @param c Reference to the Context object. + */ + virtual StatusCode rewind(EvtContext& c) const override; + + /** Create an IOpaqueAddress object from the event fetched. + * + * @param c Reference to the Context object. + * @param iop Refernce pointer to a IOpaqueAddress object + * + */ + virtual StatusCode createAddress(const EvtContext& c,IOpaqueAddress*& iop) const override; + + /** Release the Context object. + * + * @param c Reference pointer to the Context object. + */ + virtual StatusCode releaseContext(EvtContext*&)const override; + + /** Will set a new criteria for the selection of the next list of events and will change + * the state of the context in a way to point to the new list. + * + * @param cr The new criteria string. + * @param c Reference pointer to the Context object. + */ + virtual StatusCode resetCriteria(const std::string& cr,Context& c)const override; + +}; +#endif diff --git a/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_entries.cxx b/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6c2212c7e4ed4431e92821f08be63290a20ce0ec --- /dev/null +++ b/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_entries.cxx @@ -0,0 +1,10 @@ +//==================================================================== + +#include "GaudiKernel/DeclareFactoryEntries.h" +#include "../DFStreamEventSelector.h" + +DECLARE_SERVICE_FACTORY( DFStreamEventSelector ) + +DECLARE_FACTORY_ENTRIES( DFStreamEventSelector ) { + DECLARE_SERVICE ( DFStreamEventSelector ) +} diff --git a/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_load.cxx b/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_load.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0cfb35af2aedfb2587c088c31b1d4621325344e6 --- /dev/null +++ b/Event/DFStreamEventSelector/src/components/DFStreamEventSelector_load.cxx @@ -0,0 +1,5 @@ +//==================================================================== + +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( DFStreamEventSelector )