11#ifndef ATHENAROOTCOMPS_ATHENA_XAODEVENTSELECTOR_H
12#define ATHENAROOTCOMPS_ATHENA_XAODEVENTSELECTOR_H 1
17#include "GaudiKernel/IEvtSelector.h"
18#include "GaudiKernel/IIoComponent.h"
19#include "GaudiKernel/IIncidentSvc.h"
20#include "GaudiKernel/MsgStream.h"
21#include "Gaudi/Property.h"
22#include "GaudiKernel/ServiceHandle.h"
34#include <unordered_map>
50 public extends<::AthService,
74 virtual StatusCode
stop()
override;
75 virtual StatusCode
finalize()
override;
77 virtual void handle(
const Incident& incident)
override;
81 virtual StatusCode
createContext( Context*& refpCtxt )
const override;
83 virtual StatusCode
last( Context& refContext )
const override;
84 virtual StatusCode
next( Context& refCtxt )
const override;
85 virtual StatusCode
next( Context& refCtxt,
int jump )
const override;
86 virtual StatusCode
previous( Context& refCtxt )
const override;
87 virtual StatusCode
previous( Context& refCtxt,
int jump )
const override;
88 virtual StatusCode
rewind( Context& refCtxt )
const override;
91 IOpaqueAddress*& )
const override;
92 virtual StatusCode
releaseContext( Context*& refCtxt )
const override;
94 Context& ctx )
const override;
103 virtual StatusCode
seek (Context& refCtxt,
int evtnum)
const override;
109 virtual int curEvent (
const Context& refCtxt)
const override;
129 const EventContext& ctx)
override;
133 virtual int size (Context& refCtxt)
const override;
153 StatusCode
setFile(
const std::string& fname);
Extension to IEvtSelector to allow for seeking.
This file contains the class definition for the IPoolSvc interface class.
size_t size() const
Number of registered mappings.
Define macros for attributes used to control the static checker.
event selector context ... just holds reference back to the selector
ServiceHandle< StoreGateSvc > m_ometaStore
Pointer to the StoreGateSvc output metadata store.
std::optional< InputFileIncidentGuard > m_inputFileGuard
RAII guard: guarantees a matching EndInputFile for every BeginInputFile.
virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override
update a transient Address
StringProperty m_tupleName
Name of TTree to load from collection of input files.
virtual StatusCode next(Context &refCtxt) const override
xAODEventSelector(const std::string &name, ISvcLocator *svcLoc)
Constructor with parameters:
long m_nbrEvts
Number of Events read so far.
ServiceHandle< IDictLoaderSvc > m_dictsvc
Pointer to the IDictLoaderSvc.
TFile * m_tfile
current TFile being read
virtual StatusCode resetCriteria(const std::string &cr, Context &ctx) const override
StringArrayProperty m_inputCollectionsName
List of input files containing TTree.
StatusCode createRootBranchAddresses(StoreID::type storeID, tadList &tads)
helper method to create proxies
StatusCode createMetaDataRootBranchAddresses() const
helper method to create proxies for the metadata store
bool m_readMetadataWithPool
StringProperty m_collectionType
virtual StatusCode releaseContext(Context *&refCtxt) const override
StringProperty m_metadataName
Name of TTree to load from metadata of input files.
xAOD::xAODTEvent * m_tevent
current TEvent being read
xAODEventSelector * self() const
non-const access to self (b/c next() is const)
std::vector< CollMetaData > m_collEvts
cache of the number of entries for each collection
StatusCode do_init_io()
helper method to init the i/o components
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
ServiceHandle< IProxyProviderSvc > m_ppSvc
Handle to the proxy provider svc.
virtual StatusCode loadAddresses(StoreID::type storeID, tadList &list) override
get all new addresses from Provider for this Event.
ServiceHandle< StoreGateSvc > m_dataStore
Pointer to the StoreGateSvc event store.
bool m_printEventProxyWarnings
StatusCode setFile(const std::string &fname)
switch to given file, loading metadata and triggering a beginInputFile incident
virtual StatusCode previous(Context &refCtxt) const override
std::unordered_map< SG::TransientAddress *, bool > m_rootAddresses
virtual int curEvent(const Context &refCtxt) const override
return the current event number.
ServiceHandle< IIncidentSvc > m_incsvc
Handle to the incident service.
virtual StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&) const override
virtual StatusCode finalize() override
ServiceHandle< IClassIDSvc > m_clidsvc
Pointer to the IClassIDSvc.
virtual StatusCode last(Context &refContext) const override
virtual StatusCode seek(Context &refCtxt, int evtnum) const override
Seek to a given event number.
TFile * fetchNtupleFile(const std::string &fname) const
helper method to retrieve the correct tuple
long m_curEvt
current event index
ServiceHandle< IPoolSvc > m_poolSvc
Handle to the PoolSvc (used in Hybrid mode when user is reading metadata with pool).
virtual StatusCode createContext(Context *&refpCtxt) const override
long m_skipEvts
Number of events to skip at the beginning.
virtual StatusCode rewind(Context &refCtxt) const override
long m_collIdx
current collection index (into m_inputCollectionsName)
virtual void handle(const Incident &incident) override
virtual StatusCode stop() override
virtual StatusCode preLoadAddresses(StoreID::type storeID, tadList &list) override
ServiceHandle< StoreGateSvc > m_imetaStore
Pointer to the StoreGateSvc input metadata store.
a simple interface to interact with the Reflex dictionaries and abstract/workaround a few ROOT bugs.
The Athena Transient Store API.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
find_coll_idx(-1, coll_idx, tuple_idx)
StatusCode ROOTMessageFilterSvc::initialize ATLAS_NOT_THREAD_SAFE()
Return the file descriptor fataldump() uses for output.