![]() |
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 223 of file RootNtupleEventSelector.cxx.
|
virtual |
|
private |
Definition at line 1212 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1200 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1158 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 1151 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 669 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
IEvtSelector interface
Definition at line 661 of file RootNtupleEventSelector.cxx.
|
private |
helper method to create proxies for the metadata store
Definition at line 976 of file RootNtupleEventSelector.cxx.
|
private |
helper method to create proxies
Definition at line 869 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
return the current event number.
Definition at line 752 of file RootNtupleEventSelector.cxx.
|
private |
helper method to init the i/o components
Definition at line 1221 of file RootNtupleEventSelector.cxx.
|
private |
Definition at line 431 of file RootNtupleEventSelector.cxx.
|
private |
helper method to retrieve the correct tuple
Definition at line 1092 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 410 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 1311 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 275 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 760 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 647 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
get all new addresses from Provider for this Event.
Definition at line 831 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
|
overridevirtual |
Definition at line 624 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
IAddressProvider interface get all addresses from Provider : Called before Begin Event
Definition at line 820 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
|
overridevirtual |
Definition at line 641 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 677 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 689 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
Definition at line 655 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 704 of file RootNtupleEventSelector.cxx.
|
private |
callback to synchronize the list of input files
Definition at line 862 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
ICollectionSize interface
|
overridevirtual |
Definition at line 401 of file RootNtupleEventSelector.cxx.
|
overridevirtual |
update a transient Address
Definition at line 842 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;
/ optional event number variable to propagate to EventInfo. StringProperty m_eventNumberVar { this, "EventNumberVar", "", "Optional event number variable to propagate to EventInfo" }; / optional run number variable to propagate to EventInfo. StringProperty m_runNumberVar { this, "RunNumberVar", "", "Optional run number variable to propagate to EventInfo" }; / optional LBN variable to propagate to EventInfo. StringProperty m_lbnVar { this, "LBNVar", "", "Optional LBN variable to propagate to EventInfo" };
/ 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 252 of file RootNtupleEventSelector.h.
|
mutableprivate |
Definition at line 278 of file RootNtupleEventSelector.h.
|
mutableprivate |
Flag to fire BeginInputFile on the next BeginEvent incident.
Definition at line 269 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 267 of file RootNtupleEventSelector.h.
|
mutableprivate |
The (python) selection function to apply on the TChain we are reading.
Definition at line 262 of file RootNtupleEventSelector.h.
|
mutableprivate |
current tree being read
Definition at line 255 of file RootNtupleEventSelector.h.