|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef XAODROOTACCESS_TEVENT_H
6 #define XAODROOTACCESS_TEVENT_H
9 #include <unordered_map>
14 #include <unordered_map>
57 class TVirtualManager;
58 class TVirtualIncidentListener;
61 class TChainStateTracker;
81 #ifdef XAOD_STANDALONE
82 class TEvent :
public TVirtualEvent,
IProxyDict {
88 friend class ::xAODTEventBranch;
89 friend class ::xAODTMetaBranch;
153 const std::string& itemList );
176 template<
typename T >
179 template<
typename T >
183 template<
typename T >
186 template<
typename T >
190 template<
typename T >
192 ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
194 template<
typename T >
196 ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
202 Int_t basketSize = 32000,
203 Int_t splitLevel = 0 );
207 ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
209 StatusCode copy( ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
217 template<
typename T >
220 template<
typename T >
224 template<
typename T >
228 template<
typename T >
231 template<
typename T >
235 template<
typename T >
237 ::Int_t basketSize = 32000,
238 ::Int_t splitLevel = 1 );
241 template<
typename T >
243 ::Int_t basketSize = 32000,
244 ::Int_t splitLevel = 1 );
259 ::Int_t
getFile( ::Long64_t
file, ::Int_t getall = 0 );
279 const std::string&
getName(
const void*
obj )
const override;
286 const std::string&
key,
287 ::Int_t basketSize, ::Int_t splitLevel,
288 ::Bool_t overwrite = kFALSE,
290 ::Bool_t isOwner = kTRUE );
295 const std::type_info& ti )
override;
298 const std::type_info& ti,
299 bool silent =
false )
override;
302 void getNames(
const std::string& targetClassName,
303 std::vector<std::string>& vkeys,
304 bool metadata =
false)
const override;
316 const std::string&
key )
const override;
325 std::vector< const SG::DataProxy* >
proxies()
const override;
335 CLID& clid )
const override;
339 CLID clid )
override;
344 const std::string&
key,
346 bool returnExisting )
override;
349 const std::string&
name()
const override;
357 const std::type_info& ti,
361 const std::type_info& ti,
366 ::Int_t basketSize, ::Int_t splitLevel,
367 ::Bool_t ownsStore = kFALSE );
370 ::Bool_t
silent = kFALSE );
373 ::Bool_t
silent = kFALSE );
388 ::Int_t basketSize = 32000, ::Int_t splitLevel = 0,
398 const std::type_info& ti,
402 const std::type_info& ti,
406 typedef std::unordered_map< std::string,
478 const ::TClass* m_class = 0;
510 #endif // XAODROOTACCESS_TEVENT_H
::Int_t m_inTreeNumber
The number of the currently open tree in the input chain.
std::unordered_map< std::string, std::string > m_nameRemapping
Container name re-mapping rules.
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.
StatusCode addListener(TVirtualIncidentListener *listener)
Register an incident listener object.
Base interface for getting objects out of the input file.
TEvent & operator=(const TEvent &rhs)=delete
Do not allow copying this object.
StatusCode finishWritingTo(::TFile *file)
Finish writing to an output file.
Class creating (a) transient tree(s) from xAOD files.
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
const std::string & name() const override
Get the name of the instance.
EAuxMode m_auxMode
The auxiliary access mode.
@ kUndefinedAccess
Undefined, to be selected by the object.
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.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
@ kAthenaAccess
Access containers/objects like Athena does.
::TTree * m_outTree
The tree that we are writing to.
::Int_t getFile(::Long64_t file, ::Int_t getall=0)
Load the first event for a given file from the input TChain.
::TChain * m_inChain
The (optional) chain provided as input.
StatusCode putAux(::TTree &outTree, TVirtualManager &mgr, ::Int_t basketSize=32000, ::Int_t splitLevel=0, ::Bool_t metadata=kFALSE)
Function saving the dynamically created auxiliary properties.
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.
const std::string * keyToString(SG::sgkey_t key) const override
Find the string corresponding to a given key.
Object_t m_inputObjects
Collection of all the managed input objects.
void printNameRemap() const
Print the current name re-mapping rules.
"ROOT implementation" of IAuxStore
SG::IAuxStore * recordAux(const std::string &key, SG::IAuxStoreHolder::AuxStoreType type=SG::IAuxStoreHolder::AST_ContainerStore, Int_t basketSize=32000, Int_t splitLevel=0)
Add an auxiliary store object to the output.
StatusCode record(std::unique_ptr< T > obj, const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=0)
Add an output object to the event, explicitly taking ownership of it.
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.
StatusCode copy(const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=0)
Copy an object directly from the input to the output.
virtual ~TEvent()
Destructor.
Interface class for the "manager classes".
SG::sgkey_t getKey(const void *obj) const override
Function returning the hash describing a known object.
@ kClassAccess
Access auxiliary data using the aux containers.
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.
std::string dump()
Function creating a user-readable dump of the current input.
const EventFormat * outputEventFormat() const
Get information about the output objects.
void registerKey(SG::sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
Select isolated Photons, Electrons and Muons.
::TTree * m_inMetaTree
Pointer to the metadata tree in the input file.
Helper struct used by the IProxyDict code.
void clearNameRemap()
Clear the current name re-mapping.
EAuxMode auxMode() const
Get what auxiliary access mode the object was constructed with.
StatusCode retrieveMetaOutput(T *&obj, const std::string &key)
Retrieve an output metadata object.
AuxStoreType
Type of the auxiliary store.
void ErrorHandler ATLAS_NOT_THREAD_SAFE(Int_t level, Bool_t abort, const char *location, const char *message)
Function filtering the warnings coming from ROOT.
Bool_t m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
::TTree * m_inTree
The main tree that we are reading from.
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.
::Long64_t getEntries() const
Get how many entries are available from the current input file(s)
std::unordered_map< std::string, std::set< std::string > > m_auxItemList
Rules for selecting which auxiliary branches to write.
::StatusCode StatusCode
StatusCode definition for legacy code.
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
Class helping with tracking the state of TChain objects.
::Bool_t isStandalone(const TObjectManager &mgr)
Function checking if an object is standalone (not a container)
EventFormat m_inputEventFormat
Format of the current input file.
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
::Bool_t contains(const std::string &key)
Function checking if an object is available from the store.
Algorithm writing an xAOD output file.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
uint32_t CLID
The Class ID type.
void setPrintEventProxyWarnings(bool)
Function to silence warnings associated with broken element links.
AthContainers_detail::upgrade_mutex upgrade_mutex_t
Mutex and lock for multithread synchronization.
Listener_t m_listeners
Listeners who should be notified when certain incidents happen.
static const ::Int_t CACHE_SIZE
Size of a possible TTreeCache (30 MB)
Object_t m_outputMetaObjects
Collection of all the managed output meta-objects.
static const char *const EVENT_TREE_NAME
Name of the event tree.
Object_t m_outputObjects
Collection of all the managed output object.
Object_t m_inputMetaObjects
Collection of all the managed input meta-objects.
friend ::TTree * MakeTransientTree(TEvent &, const char *)
upgrade_mutex_t m_branchesMutex
Helper object for holding something through a THolder.
static const char *const METADATA_TREE_NAME
Name of the metadata tree.
TEvent(const TEvent &parent)=delete
Do not allow copy-constructing this object:
StatusCode record(T *obj, const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=0)
Add an output object to the event.
AthContainers_detail::upgrading_lock< upgrade_mutex_t > upgrading_lock_t
TEvent(EAuxMode mode=kUndefinedAccess)
Default constructor.
StatusCode retrieveMetaInput(const T *&obj, const std::string &key)
Retrieve an input metadata object.
::Bool_t m_inTreeMissing
Internal status flag showing that an input file is open, but it doesn't contain an event tree.
StatusCode initStats()
Function to initialise the statistics for all Tree content.
Manager for EDM objects created by ROOT.
Specialised class for browsing xAOD event interface objects in ROOT.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
::Int_t fill()
Function filling one event into the output tree.
::Bool_t transientContains(const std::string &key) const
Function checking if an object is already in memory.
StatusCode removeListener(TVirtualIncidentListener *listener)
Remove an incident listener object.
Helper class for merging xAOD files.
::Bool_t isAuxStore(const TObjectManager &mgr)
Function checking if a given object may be an auxiliary store.
StatusCode connectAux(const std::string &prefix, ::Bool_t standalone)
Function setting up access to a set of auxiliary branches.
Interface for non-const operations on an auxiliary store.
EventFormat * m_outputEventFormat
Format of the current output file.
StatusCode setUpDynamicStore(TObjectManager &mgr, ::TTree *tree)
Function adding dynamic variable reading capabilities to an auxiliary store object.
EAuxMode
Auxiliary store "mode".
::Long64_t getFiles() const
Get how many files are available on the currently defined input.
Define the type used for hashed StoreGate key+CLID pairs.
StatusCode addNameRemap(const std::string &onfile, const std::string &newName)
Add a name re-mapping rule.
StatusCode retrieveMetaOutput(const T *&obj, const std::string &key)
Retrieve an output metadata object.
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
::Bool_t hasAuxStore(const TObjectManager &mgr)
Function checking if a given object may have an auxiliary store.
StatusCode retrieve(T *&obj, const std::string &key)
Retrieve an output object from the event.
SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
StatusCode connectBranch(const std::string &key, ::Bool_t silent=kFALSE)
Function setting up access to a particular branch.
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
StatusCode retrieve(const T *&obj, const std::string &key)
Retrieve either an input or an output object from the event.
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
::Long64_t m_entry
The entry to look at from the input tree.
const EventFormat * inputEventFormat() const
Get information about the input objects.
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Add a new proxy to the store.
TChainStateTracker * m_inChainTracker
Optional object for tracking the state changes of an input TChain.
StatusCode writeTo(::TFile *file, Int_t autoFlush=200, const char *treeName=EVENT_TREE_NAME)
Connect the object to an output file.
::Bool_t containsMeta(const std::string &key)
Function checking if a meta-object is available from the store.
StatusCode readFrom(::TFile *file, Bool_t useTreeCache=kTRUE, const char *treeName=EVENT_TREE_NAME)
Connect the object to a new input file.
Lock object for taking out upgradable locks.
std::unordered_map< std::string, TVirtualManager * > Object_t
Definition of the internal data structure type.
std::vector< TVirtualIncidentListener * > Listener_t
Definition of the structure type holding on to listeners.
@ kBranchAccess
Access auxiliary data branch-by-branch.
Smart pointer to manage DataObject reference counts.
void setAuxItemList(const std::string &containerKey, const std::string &itemList)
Configure which dynamic variables to write out for a given store.
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 setActive() const
Set this event object as the currently active one.
::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.
StatusCode connectMetaBranch(const std::string &key, ::Bool_t silent=kFALSE)
Function setting up access to a branch in the metadata tree.
void printIOStats() const
Function printing the I/O statistics of the current process.
Tool for accessing xAOD files outside of Athena.
std::set< std::string > m_inputMissingObjects
Objects that have been asked for, but were found to be missing in the current input.
@ AST_ContainerStore
The store describes a container.
StatusCode connectMetaAux(const std::string &prefix, ::Bool_t standalone)
Function setting up access to a set of auxiliary branches for a metadata object.
StatusCode setAuxStore(TObjectManager &mgr, ::Bool_t metadata=kFALSE)
Function connecting a DV object to its auxiliary store.
void clearListeners()
Remove all listeners from the object.