 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef XAODROOTACCESS_REVENT_H
6 #define XAODROOTACCESS_REVENT_H
9 #include <unordered_map>
14 #include <unordered_map>
18 #include <ROOT/REntry.hxx>
19 #include <ROOT/RNTupleModel.hxx>
20 #include <ROOT/RNTupleReader.hxx>
21 #include <ROOT/RNTupleWriter.hxx>
22 #include <ROOT/RError.hxx>
42 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 35, 1)
44 using Experimental::RNTupleReader;
45 using Experimental::RNTupleWriter;
46 using Experimental::REntry;
47 using Experimental::RException;
48 using Experimental::kInvalidDescriptorId;
50 #endif // ROOT_VERSION_CODE < ROOT_VERSION(6, 36, 0)
76 class TVirtualManager;
77 class TVirtualIncidentListener;
83 namespace Experimental {
102 #ifdef XAOD_STANDALONE
103 class REvent :
public TVirtualEvent,
IProxyDict {
196 template<
typename T >
199 template<
typename T >
203 template<
typename T >
206 template<
typename T >
237 template<
typename T >
240 template<
typename T >
244 template<
typename T >
248 template<
typename T >
255 template<
typename T >
257 ::Int_t basketSize = 32000,
258 ::Int_t splitLevel = 1 );
261 template<
typename T >
263 ::Int_t basketSize = 32000,
264 ::Int_t splitLevel = 1 );
301 const std::string&
getName(
const void*
obj )
const override;
308 const std::string&
key);
328 const std::type_info& ti )
override;
331 const std::type_info& ti,
332 bool silent =
false )
override;
335 void getNames(
const std::string& targetClassName,
336 std::vector<std::string>& vkeys,
337 bool metadata =
false)
const override;
349 const std::string&
key )
const override;
358 std::vector< const SG::DataProxy* >
proxies()
const override;
368 CLID& clid )
const override;
372 CLID clid )
override;
377 const std::string&
key,
379 bool returnExisting )
override;
382 const std::string&
name()
const override;
390 const std::type_info& ti,
394 const std::type_info& ti,
403 ::Bool_t
silent = kFALSE );
406 ::Bool_t
silent = kFALSE );
449 const std::type_info& ti,
453 const std::type_info& ti,
457 typedef std::unordered_map< std::string,
526 const ::TClass* m_class = 0;
560 #endif // XAODROOTACCESS_REVENT_H
std::set< std::string > m_inputMissingObjects
Objects that have been asked for, but were found to be missing in the current input.
::Bool_t transientContains(const std::string &key) const
Function checking if an object is already in memory.
Base interface for getting objects out of the input file.
@ kBranchAccess
Access auxiliary data branch-by-branch.
Object_t m_outputObjects
Collection of all the managed output object.
Tool for accessing xAOD files outside of Athena, version RNTuple.
StatusCode retrieve(const T *&obj, const std::string &key)
Retrieve either an input or an output object from the event.
::Bool_t contains(const std::string &key)
Function checking if an object is available from the store.
upgrade_mutex_t m_branchesMutex
StatusCode removeListener(TVirtualIncidentListener *listener)
Remove an incident listener object.
std::unordered_map< std::string, TVirtualManager * > Object_t
Definition of the internal data structure type.
std::string dump()
Function creating a user-readable dump of the current input.
::Long64_t getEntries() const
Get how many entries are available from the current input file(s)
StatusCode recordMeta(T *obj, const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=1)
Add an object to the output file's metadata.
EAuxMode
Auxiliary store "mode".
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
This function is used by the TVirtualEvent interface to access an output object with a given hashed k...
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
Manager for EDM objects created by ROOT.
REvent & operator=(const REvent &rhs)=delete
Do not allow copying this object.
This class takes care of holding EDM objects in memory.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Class providing an interface for classes listening to xAOD incidents.
Interface class for the "manager classes".
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
void setPrintEventProxyWarnings(bool)
Function to silence warnings associated with broken element links.
StatusCode addNameRemap(const std::string &onfile, const std::string &newName)
Add a name re-mapping rule.
static const char *const METADATA_TREE_NAME
Name of the metadata tree.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
Helper struct used by the IProxyDict code.
std::unordered_map< std::string, std::string > m_nameRemapping
Container name re-mapping rules.
std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
StatusCode connectMetaBranch(const std::string &key, ::Bool_t silent=kFALSE)
Function setting up access to a branch in the metadata tree.
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent=false) override
Function for retrieving an input object in a non-template way.
StatusCode retrieveMetaOutput(const T *&obj, const std::string &key)
Retrieve an output metadata object.
::Bool_t hasAuxStore(const THolder &holder)
RDS: for the three following methods, moving to directly take THolder rather than have one for TObjec...
@ kAthenaAccess
Access containers/objects like Athena does.
void printIOStats() const
Function printing the I/O statistics of the current process.
::StatusCode StatusCode
StatusCode definition for legacy code.
const std::string * keyToString(SG::sgkey_t key) const override
Find the string corresponding to a given key.
AthContainers_detail::upgrade_mutex upgrade_mutex_t
Mutex and lock for multithread synchronization.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
Object_t m_inputObjects
Collection of all the managed input objects.
StatusCode record(void *obj, const std::string &typeName, const std::string &key)
Internal function for recording an object into the output.
::Bool_t isStandalone(const THolder &holder)
Function checking if an object is standalone (not a container)
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
void printNameRemap() const
Print the current name re-mapping rules.
@ kUndefinedAccess
Undefined, to be selected by the object.
::TTree * m_outTree
The tree that we are writing to.
StatusCode connectBranch(const std::string &key, ::Bool_t silent=kFALSE)
Function setting up access to a particular branch.
StatusCode setAuxStore(RObjectManager &mgr, ::Bool_t metadata=kFALSE)
Function connecting a DV object to its auxiliary store.
std::unique_ptr< ROOT::RNTupleReader > m_inNtupleReader
The main event reader: RNTupleReader.
uint32_t CLID
The Class ID type.
EventFormat m_inputEventFormat
Format of the current input file.
static const ::Int_t CACHE_SIZE
Size of a possible TTreeCache (30 MB)
virtual ~REvent()
Destructor.
StatusCode recordMeta(std::unique_ptr< T > obj, const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=1)
Add an object to the output file's metadata, explicitly taking ownership of it.
void setActive() const
Set this event object as the currently active one.
StatusCode connectMetaAux(const std::string &prefix, ::Bool_t standalone)
Function setting up access to a set of auxiliary branches for a metadata object.
Listener_t m_listeners
Listeners who should be notified when certain incidents happen.
EAuxMode m_auxMode
The auxiliary access mode.
void setAuxItemList(const std::string &containerKey, const std::string &itemList)
Configure which dynamic variables to write out for a given store.
REvent(EAuxMode mode=kUndefinedAccess)
Default constructor.
StatusCode setUpDynamicStore(TObjectManager &mgr, ::TTree *tree)
Function adding dynamic variable reading capabilities to an auxiliary store object metadata still use...
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
Manager for EDM objects created by ROOT.
StatusCode readFrom(const std::string &fileName)
This function takes care of connecting the event object to a new input file.
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
StatusCode retrieveMetaInput(const T *&obj, const std::string &key)
Retrieve an input metadata object.
::Bool_t containsMeta(const std::string &key)
Function checking if a meta-object is available from the store.
std::vector< TVirtualIncidentListener * > Listener_t
Definition of the structure type holding on to listeners.
REvent(const REvent &parent)=delete
Do not allow copy-constructing this object:
StatusCode retrieve(T *&obj, const std::string &key)
Retrieve an output object from the event.
StatusCode addListener(TVirtualIncidentListener *listener)
Register an incident listener object.
::Long64_t m_entry
The entry to look at from the input tree.
Define the type used for hashed StoreGate key+CLID pairs.
void registerKey(SG::sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
std::unordered_map< std::string, std::set< std::string > > m_auxItemList
Rules for selecting which auxiliary branches to write.
Bool_t m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
Helper object for holding something through a THolder.
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
::Bool_t m_inMetaTreeIsTTree
Boolean indicating the technology of the metadata tree, i.e. TTree of RNTuple.
void clearNameRemap()
Clear the current name re-mapping.
static const char *const EVENT_RNTUPLE_NAME
Name of the event tree.
@ kClassAccess
Access auxiliary data using the aux containers.
::Bool_t isAuxStore(const THolder &holder)
Function checking if a given object may be an auxiliary store.
::Bool_t transientContainsMeta(const std::string &key) const
Function checking if a meta-object is already in memory.
std::unique_ptr< SG::DataProxy > m_proxy
Data proxy describing this branch/object.
Lock object for taking out upgradable locks.
SG::sgkey_t getKey(const void *obj) const override
Function returning the hash describing a known object.
StatusCode initStats()
Function to initialise the statistics for all Tree content.
const EventFormat * inputEventFormat() const
RDS: Only valid for TChains, i.e.
Smart pointer to manage DataObject reference counts.
EventFormat * m_outputEventFormat
Format of the current output file.
Object_t m_inputMetaObjects
Collection of all the managed input meta-objects.
AthContainers_detail::upgrading_lock< upgrade_mutex_t > upgrading_lock_t
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
Define macros for attributes used to control the static checker.
void clearListeners()
Remove all listeners from the object.
const std::string & name() const override
Get the name of the instance.
Selection rules: declare transient members.
::TTree * m_inMetaTree
Pointer to the metadata tree in the input file.
Object_t m_outputMetaObjects
Collection of all the managed output meta-objects.
EAuxMode auxMode() const
Get what auxiliary access mode the object was constructed with.
void getNames(const std::string &targetClassName, std::vector< std::string > &vkeys, bool metadata=false) const override
Function determining the list keys associated with a type name.
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Add a new proxy to the store.
StatusCode connectAux(const std::string &prefix, ::Bool_t standalone)
Function setting up access to a set of auxiliary branches.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.