![]() |
ATLAS Offline Software
|
Class implementing the GAUDI IEvtSelector interface using ROOT TTree as a backend.
More...
#include <RootNtupleEventSelector.h>
Public Member Functions | |
| RootNtupleEventSelector (const std::string &name, ISvcLocator *svcLoc) | |
| Constructor with parameters: | |
| virtual | ~RootNtupleEventSelector () |
| Destructor: | |
| virtual StatusCode | initialize () override |
| virtual StatusCode | stop () override |
| virtual StatusCode | finalize () override |
| virtual void | handle (const Incident &incident) override |
| virtual StatusCode | io_reinit () override |
| Callback method to reinitialize the internal state of the component for I/O purposes (e.g. | |
| virtual int | size (Context &refCtxt) const override |
ICollectionSize interface | |
| virtual StatusCode | createContext (Context *&refpCtxt) const override |
| virtual StatusCode | last (Context &refContext) const override |
| virtual StatusCode | next (Context &refCtxt) const override |
| virtual StatusCode | next (Context &refCtxt, int jump) const override |
| virtual StatusCode | previous (Context &refCtxt) const override |
| virtual StatusCode | previous (Context &refCtxt, int jump) const override |
| virtual StatusCode | rewind (Context &refCtxt) const override |
| virtual StatusCode | createAddress (const Context &refCtxt, IOpaqueAddress *&) const override |
| virtual StatusCode | releaseContext (Context *&refCtxt) const override |
| virtual StatusCode | resetCriteria (const std::string &cr, Context &ctx) const override |
| virtual StatusCode | seek (Context &refCtxt, int evtnum) const override |
| Seek to a given event number. | |
| virtual int | curEvent (const Context &refCtxt) const override |
| return the current event number. | |
| virtual StatusCode | preLoadAddresses (StoreID::type storeID, tadList &list) override |
| virtual StatusCode | loadAddresses (StoreID::type storeID, tadList &list) override |
| get all new addresses from Provider for this Event. | |
| virtual StatusCode | updateAddress (StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override |
| update a transient Address | |
Private Member Functions | |
| StatusCode | endInputFile (RootNtupleEventContext *rctx) const |
| void | setupInputCollection (Gaudi::Details::PropertyBase &inputCollectionsName) |
| callback to synchronize the list of input files | |
| StatusCode | createRootBranchAddresses (StoreID::type storeID, tadList &tads) |
| helper method to create proxies | |
| TTree * | fetchNtuple (const std::string &fname, const std::string &tupleName) const |
| helper method to retrieve the correct tuple | |
| void | addMetadataFromDirectoryName (const std::string &metadirname, TFile *fileObj, const std::string &prefix="") const |
| void | addMetadataFromDirectory (TDirectoryFile *metadir, const std::string &prefix="") const |
| void | addMetadata (TTree *metatree, const std::string &path="") const |
| void | addMetadata (TObjString *metastring, const std::string &path="") const |
| StatusCode | createMetaDataRootBranchAddresses (StoreGateSvc *store, TTree *tree, const std::string &prefix) const |
| helper method to create proxies for the metadata store | |
| StatusCode | do_init_io () |
| helper method to init the i/o components | |
Private Attributes | |
| std::vector< std::vector< CollMetaData > > | m_collEvts |
| helper method to get the collection index (into m_inputCollectionsName) and tuple index (into m_tupleNames')
for a given event index evtidx`. | |
| TTree * | m_tuple |
| current tree being read | |
| bool | m_needReload |
The (python) selection function to apply on the TChain we are reading. | |
| std::optional< InputFileIncidentGuard > | m_inputFileGuard |
| RAII guard: guarantees a matching EndInputFile for every BeginInputFile. | |
| bool | m_fireBIF {true} |
| Flag to fire BeginInputFile on the next BeginEvent incident. | |
| std::vector< TFile * > | m_files |
Friends | |
| class | Athena::RootNtupleEventContext |
Class implementing the GAUDI IEvtSelector interface using ROOT TTree as a backend.
Definition at line 48 of file RootNtupleEventSelector.h.
| Athena::RootNtupleEventSelector::RootNtupleEventSelector | ( | const std::string & | name, |
| ISvcLocator * | svcLoc ) |
Constructor with parameters:
Definition at line 222 of file RootNtupleEventSelector.cxx.
|
virtual |
|
private |
Definition at line 1171 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1159 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1117 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1110 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 637 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
IEvtSelector interface
Definition at line 629 of file RootNtupleEventSelector.cxx.
|
private |
helper method to create proxies for the metadata store
Definition at line 944 of file RootNtupleEventSelector.cxx.
|
private |
helper method to create proxies
Definition at line 837 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
return the current event number.
Definition at line 720 of file RootNtupleEventSelector.cxx.
|
private |
helper method to init the i/o components
Definition at line 1180 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 433 of file RootNtupleEventSelector.cxx.
|
private |
helper method to retrieve the correct tuple
Definition at line 1060 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 412 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 1270 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 274 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Callback method to reinitialize the internal state of the component for I/O purposes (e.g.
upon fork(2))
Definition at line 728 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 615 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
get all new addresses from Provider for this Event.
Definition at line 799 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
|
overridevirtual |
Definition at line 592 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
IAddressProvider interface get all addresses from Provider : Called before Begin Event
Definition at line 788 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
|
overridevirtual |
Definition at line 609 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 645 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 657 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 623 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Seek to a given event number.
IEvtSelectorSeek interface
| evtnum | The event number to which to seek. |
| evtnum | The event number to which to seek. |
Definition at line 672 of file RootNtupleEventSelector.cxx.
|
private |
callback to synchronize the list of input files
Definition at line 830 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
ICollectionSize interface
|
overridevirtual |
Definition at line 403 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
update a transient Address
Definition at line 810 of file RootNtupleEventSelector.cxx.
|
friend |
Definition at line 53 of file RootNtupleEventSelector.h.
|
mutableprivate |
helper method to get the collection index (into m_inputCollectionsName) and tuple index (into m_tupleNames') for a given event index evtidx`.
returns -1 if not found. */ void find_coll_idx(int evtidx, long& coll_idx, long& tuple_idx) const;
/ non-const access to self (b/c ::next() is const) RootNtupleEventSelector self() const { return const_cast<RootNtupleEventSelector>(this); }
///////////////////////////////////////////////////////////////// Private data: ///////////////////////////////////////////////////////////////// private:
typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; / Pointer to the StoreGateSvc event store StoreGateSvc_t m_dataStore;
/ Pointer to the StoreGateSvc input metadata store StoreGateSvc_t m_imetaStore;
/ Pointer to the StoreGateSvc output metadata store StoreGateSvc_t m_ometaStore;
typedef ServiceHandle<IClassIDSvc> ICLIDSvc_t; / Pointer to the IClassIDSvc ICLIDSvc_t m_clidsvc;
typedef ServiceHandle<IDictLoaderSvc> IDictSvc_t; / Pointer to the IDictLoaderSvc IDictSvc_t m_dictsvc;
typedef ServiceHandle<IIncidentSvc> IIncSvc_t; / Handle to the incident service IIncSvc_t m_incsvc;
/ List of input files containing TTree StringArrayProperty m_inputCollectionsName;
/ Name of TTree to load from collection of input files StringProperty m_tupleName;
/ List of branches to activate in the TTree StringArrayProperty m_activeBranchNames;
/ Number of events to skip at the beginning long m_skipEvts;
/ Names of all trees over which to iterate. std::vector<std::string> m_tupleNames;
/ Number of Events read so far. mutable long m_nbrEvts;
/ current event index mutable long m_curEvt;
struct CollMetaData { / number of entries up to this collection long min_entries; / number of entries after this collection long max_entries; / number of entries in this collection. long entries; }; /** cache of the number of entries for each collection Indexed like [tuple][collection]
Definition at line 242 of file RootNtupleEventSelector.h.
|
mutableprivate |
Definition at line 268 of file RootNtupleEventSelector.h.
|
mutableprivate |
Flag to fire BeginInputFile on the next BeginEvent incident.
Definition at line 259 of file RootNtupleEventSelector.h.
|
mutableprivate |
RAII guard: guarantees a matching EndInputFile for every BeginInputFile.
BeginInputFile is deferred to the next BeginEvent (data must be loaded in the store first), so the guard is created in handle(), not immediately.
Definition at line 257 of file RootNtupleEventSelector.h.
|
mutableprivate |
The (python) selection function to apply on the TChain we are reading.
Definition at line 252 of file RootNtupleEventSelector.h.
|
mutableprivate |
current tree being read
Definition at line 245 of file RootNtupleEventSelector.h.