 |
ATLAS Offline Software
|
Python interface to xAOD::TEvent.
More...
#include <TPyEvent.h>
|
| TPyEvent (EAuxMode mode=kUndefinedAccess) |
| Constructor with an access mode - only that one is used from the python TPyEvent. More...
|
|
::Bool_t | contains (const std::string &key, const std::string &type) |
| Function checking if an object is available from the store. More...
|
|
::Bool_t | transientContains (const std::string &key, const std::string &type) const |
| Function checking if an object is already in memory. More...
|
|
StatusCode | record (int dummy, void *obj, const std::string &key, const std::string &type, ::Int_t basketSize=32000, ::Int_t splitLevel=0) |
| Add an output object to the event. More...
|
|
EAuxMode | auxMode () const |
| Get what auxiliary access mode the object was constructed with. More...
|
|
std::string | dump () |
| Function creating a user-readable dump of the current input. More...
|
|
void | printIOStats () const |
| Function printing the I/O statistics of the current process. More...
|
|
void | setPrintEventProxyWarnings (bool) |
| Function to silence warnings associated with broken element links. More...
|
|
template<typename T > |
bool | retrieve (const T *&obj, sgkey_t key=DEFAULT_KEY, bool silent=false) |
| Function retrieving an object from the event (constant version) More...
|
|
template<typename T > |
bool | retrieve (const T *&obj, const std::string &key, bool silent=false) |
| Function retrieving an object from the event (constant version) More...
|
|
template<typename T > |
void | keys (std::vector< std::string > &vkeys, bool metadata=false) const |
| provide list of all keys associated with provided type. More...
|
|
|
::Bool_t | contains (const std::string &key, const std::type_info &ti, ::Bool_t metadata=kFALSE) |
| Internal function checking if an object is in the input. More...
|
|
::Bool_t | transientContains (const std::string &key, const std::type_info &ti, ::Bool_t metadata=kFALSE) const |
| Internal function checking if an object is already in memory. More...
|
|
StatusCode | record (TAuxStore *store, const std::string &key, ::Int_t basketSize, ::Int_t splitLevel, ::Bool_t ownsStore=kFALSE) |
| Internal function for adding an auxiliary store object to the output. More...
|
|
void * | getOutputObject (const std::string &key, const std::type_info &ti, ::Bool_t metadata=kFALSE) const |
| Function for retrieving an output object in a non-template way. More...
|
|
const void * | getInputObject (const std::string &key, const std::type_info &ti, ::Bool_t silent=kFALSE, ::Bool_t metadata=kFALSE) |
| Function for retrieving an input object in a non-template way. More...
|
|
StatusCode | initStats () |
| Function to initialise the statistics for all Tree content. More...
|
|
StatusCode | connectBranch (const std::string &key, ::Bool_t silent=kFALSE) |
| Function setting up access to a particular branch. More...
|
|
StatusCode | connectMetaBranch (const std::string &key, ::Bool_t silent=kFALSE) |
| Function setting up access to a branch in the metadata tree. More...
|
|
StatusCode | connectAux (const std::string &prefix, ::Bool_t standalone) |
| Function setting up access to a set of auxiliary branches. More...
|
|
StatusCode | connectMetaAux (const std::string &prefix, ::Bool_t standalone) |
| Function setting up access to a set of auxiliary branches for a metadata object. More...
|
|
StatusCode | setUpDynamicStore (TObjectManager &mgr, ::TTree *tree) |
| Function adding dynamic variable reading capabilities to an auxiliary store object. More...
|
|
StatusCode | setAuxStore (TObjectManager &mgr, ::Bool_t metadata=kFALSE) |
| Function connecting a DV object to its auxiliary store. More...
|
|
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. More...
|
|
|
StatusCode | record (void *obj, const std::string &typeName, const std::string &key, ::Int_t basketSize, ::Int_t splitLevel, ::Bool_t overwrite=kFALSE, ::Bool_t metadata=kFALSE, ::Bool_t isOwner=kTRUE) |
| Internal function for recording an object into the output. More...
|
|
SG::sgkey_t | getHash (const std::string &key) const override |
| Function returning the hash describing an object name. More...
|
|
SG::sgkey_t | getKey (const void *obj) const override |
| Function returning the hash describing a known object. More...
|
|
const std::string & | getName (const void *obj) const override |
| Function returning the key describing a known object. More...
|
|
const std::string & | getName (SG::sgkey_t hash) const override |
| Function returning the key describing a known object. More...
|
|
void * | getOutputObject (SG::sgkey_t key, const std::type_info &ti) override |
| Function for retrieving an output object in a non-template way. More...
|
|
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. More...
|
|
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. More...
|
|
Python interface to xAOD::TEvent.
In order to make it possible to record objects that are created in Python, into an xAOD::TEvent object (in order to record selected objects into an output file for instance), this class extends the xAOD::TEvent object with some non-template functions. Functions that are inconvenient to use from C++, but which allow for much more flexibility in PyROOT.
- Author
- Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Definition at line 29 of file TPyEvent.h.
◆ Listener_t
◆ Object_t
◆ sgkey_t
◆ upgrade_mutex_t
◆ upgrading_lock_t
◆ EAuxMode
Auxiliary store "mode".
Enumerator |
---|
kBranchAccess | Access auxiliary data branch-by-branch.
|
kClassAccess | Access auxiliary data using the aux containers.
|
kAthenaAccess | Access containers/objects like Athena does.
|
kUndefinedAccess | Undefined, to be selected by the object.
|
Definition at line 99 of file Control/xAODRootAccess/xAODRootAccess/TEvent.h.
◆ TPyEvent()
Constructor with an access mode - only that one is used from the python TPyEvent.
Definition at line 33 of file TPyEvent.h.
◆ addListener()
Register an incident listener object.
This function works pretty much like IIncidentSvc::addListener does in Athena.
It tells the TEvent object that when certain "interesting
incidents" happen, a given object should be notified about it.
- Parameters
-
listener | Pointer to the object that should be notified |
- Returns
- The usual StatusCode types
Definition at line 921 of file Control/xAODRootAccess/Root/TEvent.cxx.
925 ::Error(
"xAOD::TEvent::addListener",
926 XAOD_MESSAGE(
"Received a null pointer for the listener" ) );
927 return StatusCode::FAILURE;
931 bool listenerKnown =
false;
933 if(
l == listener ) {
934 ::Warning(
"xAOD::TEvent::addListener",
935 "Listener %p was added previously already",
936 static_cast< void*
>( listener ) );
937 listenerKnown =
true;
943 if( ! listenerKnown ) {
948 return StatusCode::SUCCESS;
◆ addNameRemap()
StatusCode xAOD::TEvent::addNameRemap |
( |
const std::string & |
onfile, |
|
|
const std::string & |
newName |
|
) |
| |
|
inherited |
Add a name re-mapping rule.
The names of containers can change during the lifetime of the experiment.
One such change happened after the DC14 exercise, when many containers got a new name. (Like "ElectronCollection" became simply "Electrons".)
This function allows us to create aliases with which certain containers should be accessible. So that the analyser would be able to access older files, while using the latest container name(s).
- Parameters
-
onfile | The name of the container as it was saved into the input file |
newName | The alias with which the object/container should be accessible |
- Returns
- The usual StatusCode types
Save the new name association:
Definition at line 1001 of file Control/xAODRootAccess/Root/TEvent.cxx.
1007 ::Error(
"xAOD::TEvent::addNameRemap",
1008 XAOD_MESSAGE(
"Can't use \"%s\" as the target name in the"
1009 "\"%s\" -> \"%s\" remapping" ),
1011 return StatusCode::FAILURE;
1017 ::Warning(
"xAOD::TEvent::addNameRemap",
1018 "Overriding existing name remapping \"%s\" -> \"%s\"",
1019 itr->second.c_str(), itr->first.c_str() );
1020 ::Warning(
"xAOD::TEvent::addNameRemap",
" with: \"%s\" -> \"%s\"",
1021 onfile.c_str(),
newName.c_str() );
1028 return StatusCode::SUCCESS;
◆ addToStore()
|
overrideprotectedinherited |
Add a new proxy to the store.
Smart pointers to objects that don't exist in the input event, can end up calling this function.
In this case warn the user that something fishy is happening, and take posession of the received proxy.
- Parameters
-
clid | The CLID of the type. Not taken into account. |
proxy | The proxy to take posession of. Not used for anything useful. |
Definition at line 385 of file TEventProxyDict.cxx.
392 ::Warning(
"xAOD::TEvent::addToStore",
393 "Function should only be called through an invalid "
401 bi.m_proxy.reset(
proxy );
403 m_branches.insert( std::make_pair(
stringToKey( uniqueKey.Data(),
408 return StatusCode::SUCCESS;
◆ auxMode()
◆ clearListeners()
void xAOD::TEvent::clearListeners |
( |
| ) |
|
|
inherited |
Remove all listeners from the object.
This function can be used to remove all the listeners from the internal list.
Should not be necessary under regular circumstances.
Definition at line 981 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ clearNameRemap()
void xAOD::TEvent::clearNameRemap |
( |
| ) |
|
|
inherited |
Clear the current name re-mapping.
This function simply clears out any existing name remapping declarations.
In case the remapping rules need to be changed in the code in some complicated way.
Definition at line 1035 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ connectAux()
StatusCode xAOD::TEvent::connectAux |
( |
const std::string & |
prefix, |
|
|
::Bool_t |
standalone |
|
) |
| |
|
protectedinherited |
Function setting up access to a set of auxiliary branches.
This function is used internally to connect an auxiliary object to the input.
Based on the configuration of the object it will either use TAuxStore, or the EDM object that was used to write the auxiliary information in Athena.
- Parameters
-
prefix | The prefix (main branch name) of the auxiliary data |
standalone | Type of the auxiliary store that should be created |
- Returns
kTRUE
if the connection was successful, or kFALSE
if it was not
Definition at line 2884 of file Control/xAODRootAccess/Root/TEvent.cxx.
2889 ::Error(
"xAOD::TEvent::connectAux",
2891 return StatusCode::FAILURE;
2899 return StatusCode::SUCCESS;
2904 return StatusCode::SUCCESS;
2917 ::Fatal(
"xAOD::TEvent::connectAux",
2920 const TObjectManager* omgr =
2921 dynamic_cast< const TObjectManager*
>( mgr_itr->second );
2923 ::Fatal(
"xAOD::TEvent::connectAux",
2925 return StatusCode::FAILURE;
2929 static const TClass*
const holderClass =
2931 if( ! omgr->holder()->getClass()->InheritsFrom( holderClass ) ) {
2933 return StatusCode::SUCCESS;
2940 if( ! storeHolder ) {
2941 ::Fatal(
"xAOD::TEvent::connectAux",
2952 ::Error(
"xAOD::TEvent::connectAux",
2954 "for: %s" ),
prefix.c_str() );
2955 ::Error(
"xAOD::TEvent::connectAux",
2956 XAOD_MESSAGE(
"standalone = %s, getStoreType() = %i" ),
2959 return StatusCode::FAILURE;
2963 return StatusCode::SUCCESS;
2970 new TAuxStore(
prefix, kTRUE,
2976 TAuxManager*
mgr =
new TAuxManager(
store );
2984 return StatusCode::SUCCESS;
2988 ::Error(
"xAOD::TEvent::connectAux",
2989 XAOD_MESSAGE(
"Unknown auxiliary access mode set (%i)" ),
2991 return StatusCode::FAILURE;
◆ connectBranch()
StatusCode xAOD::TEvent::connectBranch |
( |
const std::string & |
key, |
|
|
::Bool_t |
silent = kFALSE |
|
) |
| |
|
protectedinherited |
Function setting up access to a particular branch.
This is one of the more important functions of the class.
It connects the event object to a given branch of the input TTree.
The type that is read in to memory is not actually determined by the type written to the tree itself, but from the xAOD::EventFormat object. Which is there to make it possible to possibly use ROOT read rules in the future to read a different type than what's on disk.
Everything else is fairly basic ROOT stuff, the code just has to make sure that the memory management is set up correctly for the created object.
- Parameters
-
key | The name of the branch to connect to |
silent | Set to kTRUE to make the code fail silently in case the branch can't be connected to |
- Returns
kTRUE
if the connection was successful, or kFALSE
if it was not
Definition at line 2586 of file Control/xAODRootAccess/Root/TEvent.cxx.
2591 ::Error(
"xAOD::TEvent::connectBranch",
2592 XAOD_MESSAGE(
"Function called on un-initialised object" ) );
2593 return StatusCode::FAILURE;
2601 return StatusCode::SUCCESS;
2606 ::Warning(
"xAOD::TEvent::connectBranch",
2607 "Branch \"%s\" not available on input",
2610 return StatusCode::RECOVERABLE;
2617 ::Warning(
"xAOD::TEvent::connectBranch",
2618 "No metadata available for branch: %s",
2630 ::Warning(
"xAOD::TEvent::connectBranch",
2631 "Branch \"%s\" not available on input",
2635 return StatusCode::RECOVERABLE;
2639 br->SetMakeClass( 0 );
2650 ::Error(
"xAOD::TEvent::connectBranch",
2651 XAOD_MESSAGE(
"Couldn't find an appropriate type with a "
2652 "dictionary for branch \"%s\"" ),
2654 return StatusCode::FAILURE;
2657 ::TClass* realClass = ::TClass::GetClass(
className.c_str() );
2658 if( ( ( ! realClass ) || ( ! realClass->IsLoaded() ) ) &&
ef ) {
2663 realClass = ::TClass::GetClass(
className.c_str() );
2665 if( ( ! realClass ) || ( ! realClass->IsLoaded() ) ) {
2667 ::Error(
"xAOD::TEvent::connectBranch",
2668 XAOD_MESSAGE(
"Couldn't find an appropriate type with a "
2669 "dictionary for branch \"%s\"" ),
2671 return StatusCode::FAILURE;
2678 static const ::EDataType
dataType = kOther_t;
2688 TObjectManager*
mgr =
2689 dynamic_cast< TObjectManager*
>( out_itr->second );
2691 ::Error(
"xAOD::TEvent::connectBranch",
2692 XAOD_MESSAGE(
"Couldn't access output manager for: %s" ),
2694 return StatusCode::FAILURE;
2697 ptr =
mgr->holder()->get();
2704 ptr = realClass->New();
2708 THolder* hldr =
new THolder(
ptr, realClass );
2709 TObjectManager*
mgr =
2719 ::Error(
"xAOD::TEvent::connectBranch",
2721 "This can only be read in kAthenaAccess mode." ),
2722 key.c_str(),
br->GetSplitLevel() );
2724 *( hldr->getPtr() ) = 0;
2727 return StatusCode::FAILURE;
2737 ::Error(
"xAOD::TEvent::connectBranch",
2738 XAOD_MESSAGE(
"Couldn't connect variable of type \"%s\" to "
2739 "input branch \"%s\". Return code: %i" ),
2742 *( hldr->getPtr() ) = 0;
2745 return StatusCode::FAILURE;
◆ connectMetaAux()
StatusCode xAOD::TEvent::connectMetaAux |
( |
const std::string & |
prefix, |
|
|
::Bool_t |
standalone |
|
) |
| |
|
protectedinherited |
Function setting up access to a set of auxiliary branches for a metadata object.
This function is used internally to connect an auxiliary metadata object to the input.
Based on the configuration of the object it will either use TAuxStore, or the EDM object that was used to write the auxiliary information in Athena.
- Parameters
-
prefix | The prefix (main branch name) of the auxiliary data |
standalone | Type of the auxiliary store that should be created |
- Returns
- The usual StatusCode types
Definition at line 3003 of file Control/xAODRootAccess/Root/TEvent.cxx.
3008 return StatusCode::SUCCESS;
3013 ::Fatal(
"xAOD::TEvent::connectMetaAux",
3015 return StatusCode::FAILURE;
3029 ::Fatal(
"xAOD::TEvent::connectMetaAux",
3032 const TObjectManager* omgr =
3033 dynamic_cast< const TObjectManager*
>( mgr_itr->second );
3035 ::Fatal(
"xAOD::TEvent::connectMetaAux",
3037 return StatusCode::FAILURE;
3041 static const TClass*
const holderClass =
3043 if( ! omgr->holder()->getClass()->InheritsFrom( holderClass ) ) {
3045 return StatusCode::SUCCESS;
3052 if( ! storeHolder ) {
3053 ::Fatal(
"xAOD::TEvent::connectMetaAux",
3064 ::Error(
"xAOD::TEvent::connectMetaAux",
3065 XAOD_MESSAGE(
"Requested store types inconsistent" ) );
3066 ::Error(
"xAOD::TEvent::connectMetaAux",
3067 XAOD_MESSAGE(
"standalone = %s, getStoreType() = %i" ),
3070 return StatusCode::FAILURE;
3074 return StatusCode::SUCCESS;
3081 new TAuxStore(
prefix, kTRUE,
3087 TAuxManager*
mgr =
new TAuxManager(
store );
3095 store->getEntry( 0 );
3098 return StatusCode::SUCCESS;
3102 ::Error(
"xAOD::TEvent::connectMetaAux",
3103 XAOD_MESSAGE(
"Unknown auxiliary access mode set (%i)" ),
3105 return StatusCode::FAILURE;
◆ connectMetaBranch()
StatusCode xAOD::TEvent::connectMetaBranch |
( |
const std::string & |
key, |
|
|
::Bool_t |
silent = kFALSE |
|
) |
| |
|
protectedinherited |
Function setting up access to a branch in the metadata tree.
This is the function doing the heavy lifting with creating metadata objects in memory out of the payload of the input file.
- Parameters
-
key | The key (branch name) of the metadata object to retrieve |
silent | Set to kTRUE to make the code fail silently in case the branch can't be connected to |
- Returns
- The usual StatusCode types
Definition at line 2770 of file Control/xAODRootAccess/Root/TEvent.cxx.
2775 ::Error(
"xAOD::TEvent::connectMetaBranch",
2776 XAOD_MESSAGE(
"Function called on un-initialised object" ) );
2777 return StatusCode::FAILURE;
2782 return StatusCode::SUCCESS;
2789 ::Warning(
"xAOD::TEvent::connectMetaBranch",
2790 "Branch \"%s\" not available on input",
2793 return StatusCode::RECOVERABLE;
2797 if( !
br->GetEntries() ) {
2799 ::Warning(
"xAOD::TEvent::connectMetaBranch",
2800 "Branch \"%s\" doesn't hold any data",
2803 return StatusCode::RECOVERABLE;
2807 br->SetMakeClass( 0 );
2811 ::EDataType
dt = kOther_t;
2812 if(
br->GetExpectedType(
cl,
dt ) || ( !
cl ) ) {
2813 ::Error(
"xAOD::TEvent::connectMetaBranch",
2815 "branch %s" ),
key.c_str() );
2816 return StatusCode::FAILURE;
2820 void*
ptr =
cl->New();
2821 THolder* hldr =
new THolder(
ptr,
cl );
2822 TObjectManager*
mgr =
2833 ::Error(
"xAOD::TEvent::connectMetaBranch",
2834 XAOD_MESSAGE(
"Couldn't connect variable of type \"%s\" to "
2835 "input branch \"%s\". Return code: %i" ),
2838 *( hldr->getPtr() ) = 0;
2841 return StatusCode::FAILURE;
2845 if(
mgr->getEntry() < 0 ) {
2846 ::Error(
"xAOD::TEvent::connectMetaBranch",
2847 XAOD_MESSAGE(
"Couldn't read in metadata object with key "
2848 "\"%s\"" ),
key.c_str() );
2849 return StatusCode::FAILURE;
2871 return StatusCode::SUCCESS;
◆ contains() [1/3]
template<typename T >
::Bool_t xAOD::TEvent::contains |
( |
const std::string & |
key | ) |
|
|
inherited |
Function checking if an object is available from the store.
◆ contains() [2/3]
Bool_t xAOD::TPyEvent::contains |
( |
const std::string & |
key, |
|
|
const std::string & |
type |
|
) |
| |
Function checking if an object is available from the store.
Definition at line 13 of file TPyEvent.cxx.
17 ::TClass*
cl = ::TClass::GetClass(
type.c_str() );
19 ::Warning(
"xAOD::TPyEvent::contains",
20 "Type name \"%s\" not known",
type.c_str() );
25 const std::type_info* ti =
cl->GetTypeInfo();
27 ::Warning(
"xAOD::TPyEvent::contains",
28 "Type \"%s\" doesn't have a proper dictionary",
◆ contains() [3/3]
Bool_t xAOD::TEvent::contains |
( |
const std::string & |
key, |
|
|
const std::type_info & |
ti, |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| |
|
protectedinherited |
Internal function checking if an object is in the input.
Created a non-template version of the call internally to be able to use it from xAOD::MakeTransientTree.
- Parameters
-
key | The key to check |
ti | The type of the object to check |
metadata | Flag deciding whether we are looking for a metadata object or not |
- Returns
kTRUE
if such an object is held by the event object at the moment, kFALSE
otherwise
Definition at line 3698 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ containsMeta()
template<typename T >
::Bool_t xAOD::TEvent::containsMeta |
( |
const std::string & |
key | ) |
|
|
inherited |
Function checking if a meta-object is available from the store.
◆ copy() [1/2]
StatusCode xAOD::TEvent::copy |
( |
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 |
|
) |
| |
|
inherited |
Copy all (ROOT readable) objects directly from the input to the output.
This function is here to make it easy to write code that skims an input file into an output file without applying any modification to the events.
- Parameters
-
basketSize | Optional size for the basket associated with the output branch |
splitLevel | Optional split level of the output branch |
- Returns
StatusCode::SUCCESS
if the copy was successful, or StatusCode::FAILURE
if not
Definition at line 1257 of file Control/xAODRootAccess/Root/TEvent.cxx.
1261 ::Error(
"xAOD::TEvent::copy",
1263 return StatusCode::FAILURE;
1269 for( ; itr !=
end; ++itr ) {
1272 const EventFormatElement& efe = itr->second;
1275 if( !
m_inTree->GetBranch( efe.branchName().c_str() ) ) {
1279 if( efe.branchName().find(
"Aux." ) ==
1280 ( efe.branchName().size() - 4 ) ) {
1284 if( efe.parentName() !=
"" ) {
1288 ::TClass*
cl = ::TClass::GetClass( efe.className().c_str() );
1289 if( ( !
cl ) || ( !
cl->IsLoaded() ) ) {
1295 this->
copy( efe.branchName(), basketSize, splitLevel ) );
1299 return StatusCode::SUCCESS;
◆ copy() [2/2]
StatusCode xAOD::TEvent::copy |
( |
const std::string & |
key, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 |
|
) |
| |
|
inherited |
Copy an object directly from the input to the output.
This function can be used to easily copy a given object/container to the output, without modifying the contents of it.
It only needs to be called on the interface object/container, the copying of the auxiliary data is done automatically, and is steered by the SetAuxItemList function.
- Parameters
-
key | The key (branch name) of the object/container to copy |
basketSize | Optional size for the basket associated with the output branch |
splitLevel | Optional split level of the output branch |
Definition at line 1154 of file Control/xAODRootAccess/Root/TEvent.cxx.
1158 std::string keyToUse =
key;
1163 keyToUse = remap_itr->second;
1170 Object_t::const_iterator vobjMgr =
m_inputObjects.find( keyToUse );
1172 ::Error(
"xAOD::TEvent::copy",
1174 return StatusCode::FAILURE;
1176 TObjectManager* objMgr =
1177 dynamic_cast< TObjectManager*
>( vobjMgr->second );
1179 ::Error(
"xAOD::TEvent::copy",
1181 return StatusCode::FAILURE;
1184 *( objMgr->holder()->getClass()->GetTypeInfo() ) ) ) {
1185 ::Error(
"xAOD::TEvent::copy",
1187 return StatusCode::FAILURE;
1192 record( objMgr->object(),
1193 objMgr->holder()->getClass()->GetName(),
1194 key, basketSize, splitLevel, kTRUE ) );
1197 const std::set< std::string >*
filter = 0;
1200 filter = &( fitr->second );
1204 Object_t::const_iterator vauxMgr =
m_inputObjects.find( keyToUse +
1209 return StatusCode::SUCCESS;
1213 TObjectManager* auxMgr =
1214 dynamic_cast< TObjectManager*
>( vauxMgr->second );
1216 ::Error(
"xAOD::TEvent::copy",
1218 return StatusCode::FAILURE;
1221 record( auxMgr->object(),
1222 auxMgr->holder()->getClass()->GetName(),
1223 key +
"Aux.", basketSize, splitLevel, kTRUE ) );
1225 TAuxManager* auxMgr =
1226 dynamic_cast< TAuxManager*
>( vauxMgr->second );
1228 ::Error(
"xAOD::TEvent::copy",
1230 return StatusCode::FAILURE;
1234 auxMgr->getStore()->selectAux( *
filter );
1237 record( auxMgr->getStore(),
1238 key +
"Aux.", basketSize, splitLevel ) );
1240 ::Fatal(
"xAOD::TEvent::copy",
1245 return StatusCode::SUCCESS;
◆ dump()
std::string xAOD::TEvent::dump |
( |
| ) |
|
|
inherited |
Function creating a user-readable dump of the current input.
This function behaves exactly like StoreGateSvc::dump().
It doesn't actually print anything to the screen, it just returns a user readable dump of the contents of the current input file/chain.
It is a pretty dumb implementation for the moment. Should be made nicer later on.
- Returns
- The user-readable contents of the current input file/chain
Definition at line 295 of file Control/xAODRootAccess/Root/TEvent.cxx.
298 std::ostringstream
ost;
299 ost <<
"<<<<<<<<<<<<<<<<<<<< xAOD::TEvent Dump >>>>>>>>>>>>>>>>>>>>\n";
304 for( ; ef_itr != ef_end; ++ef_itr ) {
307 std::string
typeName = ef_itr->second.className();
312 ::TClass::GetClass( ef_itr->second.className().c_str() );
313 const std::type_info* ti = (
cl ?
cl->GetTypeInfo() : nullptr );
314 if( ( !
cl ) || ( !
cl->IsLoaded() ) || ( ! ti ) ) {
315 Warning(
"xAOD::TEvent::dump",
316 "Unknown type (%s) found in the event format",
317 ef_itr->second.className().c_str() );
322 if( !
contains( ef_itr->second.branchName(), *ti ) ) {
327 ost <<
" Hash: 0x" << std::setw( 8 ) << std::setfill(
'0' )
328 << std::hex << ef_itr->second.hash()
329 <<
" Key: \"" << ef_itr->second.branchName() <<
"\"\n";
334 ost <<
" isConst: " << ( isNonConst ?
"No" :
"Yes" ) <<
"\n";
342 ost <<
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
◆ fill()
Int_t xAOD::TEvent::fill |
( |
| ) |
|
|
inherited |
Function filling one event into the output tree.
This function needs to be called by the user at the end of processing each event that is meant to be written out.
- Returns
- The number of bytes written if successful, a negative number if not
Definition at line 1519 of file Control/xAODRootAccess/Root/TEvent.cxx.
1523 ::Error(
"xAOD::TEvent::fill",
1524 XAOD_MESSAGE(
"Object not connected to an output file!" ) );
1534 ::Error(
"xAOD::TEvent::fill",
1540 ::Error(
"xAOD::TEvent::fill",
1550 std::string unsetObjects;
1552 for(
auto& itr : outputObjectsCopy ) {
1554 if( ! itr.second->create() ) {
1557 if( unsetObjects.size() ) {
1558 unsetObjects.append(
", \"" + itr.first +
"\"" );
1560 unsetObjects.append(
"\"" + itr.first +
"\"" );
1568 ::Error(
"xAOD::TEvent::fill",
1569 XAOD_MESSAGE(
"Failed to put dynamic auxiliary variables "
1570 "in the output for object \"%s\"" ),
1571 itr.first.c_str() );
1577 if( unsetObjects.size() ) {
1578 ::Error(
"xAOD::TEvent::fill",
1579 XAOD_MESSAGE(
"The following objects were not set in the "
1580 "current event: %s" ), unsetObjects.c_str() );
1587 ::Error(
"xAOD::TEvent::fill",
1588 XAOD_MESSAGE(
"Output tree filling failed with return "
1589 "value: %i" ), ret );
1595 for( ; ncitr != ncend; ++ncitr ) {
1596 ncitr->second->reset();
◆ finishWritingTo()
StatusCode xAOD::TEvent::finishWritingTo |
( |
::TFile * |
file | ) |
|
|
inherited |
Finish writing to an output file.
This function needs to be called when the user is done writing events to a file, before (s)he would close the file itself.
- Parameters
-
file | The file that the event data is written to |
- Returns
kTRUE
if successful, kFALSE
otherwise
Definition at line 737 of file Control/xAODRootAccess/Root/TEvent.cxx.
741 ::Error(
"xAOD::TEvent::finishWritingTo",
742 XAOD_MESSAGE(
"The object doesn't seem to be connected to an "
744 return StatusCode::FAILURE;
752 const TIncident incident( IncidentType::MetaDataStop );
755 for( ; l_itr != l_end; ++l_itr ) {
756 ( *l_itr )->handle( incident );
771 return StatusCode::SUCCESS;
777 metatree->SetAutoSave( 10000 );
778 metatree->SetAutoFlush( -30000000 );
779 metatree->SetDirectory(
file );
783 metatree->Branch(
"EventFormat",
788 ::Error(
"xAOD::TEvent::finishWritingTo",
791 return StatusCode::FAILURE;
801 for(
auto&
object : outputMetaObjects ) {
804 TObjectManager*
mgr =
dynamic_cast< TObjectManager*
>(
object.second );
806 ::Error(
"xAOD::TEvent::finishWritingTo",
808 return StatusCode::FAILURE;
812 const ::Int_t splitLevel = (
object.first.find(
"Aux." ) ==
813 (
object.first.size() - 4 ) ? 1 : 0 );
815 *(
mgr->branchPtr() ) =
816 metatree->Branch(
object.first.c_str(),
817 mgr->holder()->getClass()->GetName(),
818 mgr->holder()->getPtr(), 32000, splitLevel );
819 if( !
mgr->branch() ) {
820 ::Error(
"xAOD::TEvent::finishWritingTo",
823 mgr->holder()->getClass()->GetName(),
824 object.first.c_str() );
825 return StatusCode::FAILURE;
835 if( metatree->Fill() <= 0 ) {
836 ::Error(
"xAOD::TEvent::finishWritingTo",
837 XAOD_MESSAGE(
"Failed to write event format metadata into "
839 metatree->SetDirectory( 0 );
841 return StatusCode::FAILURE;
846 metatree->SetDirectory( 0 );
851 for( ; obj_itr != obj_end; ++obj_itr ) {
852 delete obj_itr->second;
857 for( ; obj_itr != obj_end; ++obj_itr ) {
858 delete obj_itr->second;
863 return StatusCode::SUCCESS;
◆ getBranchInfo()
Get the object describing one object/branch.
Definition at line 268 of file TEventProxyDict.cxx.
277 auto it = m_branches.find(
sgkey );
278 if(
it != m_branches.end() ) {
279 return &(
it->second );
292 static const bool SILENT =
true;
293 static const bool METADATA =
false;
305 static const std::type_info&
dummy =
typeid(
TEvent );
306 nc_this->getInputObject(
name,
dummy, SILENT, METADATA );
315 const TObjectManager*
mgr =
316 dynamic_cast< const TObjectManager*
>( itr->second );
318 ::Error(
"xAOD::TEvent::getBranchInfo",
322 bi.m_class =
mgr->holder()->getClass();
327 #ifndef XAOD_STANDALONE
331 new GenericAddress() );
336 *bi.m_class->GetTypeInfo());
338 loader->
setProxy (*bi.m_proxy.get());
339 #endif // not XAOD_STANDALONE
344 auto ret = m_branches.insert( std::make_pair(
sgkey, std::move( bi ) ) );
347 return &( ret.first->second );
◆ getEntries()
Long64_t xAOD::TEvent::getEntries |
( |
| ) |
const |
|
inherited |
Get how many entries are available from the current input file(s)
- Returns
- The number of events in the input file(s)
Definition at line 1304 of file Control/xAODRootAccess/Root/TEvent.cxx.
1314 ::Error(
"xAOD::TEvent::getEntries",
◆ getEntry()
Int_t xAOD::TEvent::getEntry |
( |
::Long64_t |
entry, |
|
|
::Int_t |
getall = 0 |
|
) |
| |
|
inherited |
Function loading a given entry of the input TTree.
This function is used to move to looking at a new entry from the input tree.
It doesn't do any I/O operation at this point, it just remembers which entry the objects should be loaded from later on.
Unless one calls the function with getall==1
. In that case all input is force-read. This is necessary when writing out an event that was processed in a load-on-request manner.
- Parameters
-
entry | The entry from the input tree to load |
getall | Parameter deciding if partial reading should be used or not. |
- Returns
- The number of bytes read, or a negative number in case of an error
Definition at line 1335 of file Control/xAODRootAccess/Root/TEvent.cxx.
1339 ::Error(
"xAOD::TEvent::getEntry",
1349 if( fileEntry < 0 ) {
1350 ::Error(
"xAOD::TEvent::getEntry",
1353 static_cast< int >(
entry ) );
1368 ::Error(
"xAOD::TEvent::getEntry",
1391 ::Error(
"xAOD::TEvent::getEntry",
1392 XAOD_MESSAGE(
"Failure in loading entry %i from the input "
1393 "file" ),
static_cast< int >(
m_entry ) );
1404 const TIncident incident( IncidentType::BeginEvent );
1407 for( ; l_itr != l_end; ++l_itr ) {
1408 ( *l_itr )->handle( incident );
1422 static const std::string dynStorePostfix =
"Aux.Dynamic";
1423 if( inObj.first.find( dynStorePostfix ) ==
1424 ( inObj.first.size() - dynStorePostfix.size() ) ) {
1438 result += inObj.second->getEntry( getall );
1443 const TIncident incident( IncidentType::BeginEvent );
1446 for( ; l_itr != l_end; ++l_itr ) {
1447 ( *l_itr )->handle( incident );
◆ getEventFormatElement()
Get the metadata object for a given "SG key".
Definition at line 351 of file TEventProxyDict.cxx.
354 static const bool QUIET =
true;
363 static mutex_t
mutex;
365 if( missingSGKeys.emplace(
sgkey ).second ) {
367 ::Warning(
"xAOD::TEvent::getEventFormatElement",
368 "Can't find EventFormatElement for hashed "
369 "SG key %d",
sgkey );
◆ getFile()
Int_t xAOD::TEvent::getFile |
( |
::Long64_t |
file, |
|
|
::Int_t |
getall = 0 |
|
) |
| |
|
inherited |
Load the first event for a given file from the input TChain.
This function can be used to iterate over the input files specified for the object.
It should be most useful for collecting metadata about a set of input files, if there's no regular event loop done to process them.
- Parameters
-
file | The file number to load |
getall | If set to 1, all connected branches are loaded |
- Returns
- The number of read bytes on success, or a negative number on failure
Definition at line 1483 of file Control/xAODRootAccess/Root/TEvent.cxx.
1487 ::Error(
"xAOD::TEvent::getFile",
1488 XAOD_MESSAGE(
"Function called with invalid file number "
1489 "(%i)" ),
static_cast< int >(
file ) );
1504 ::Long64_t
entry = 0;
1505 for( ::Long64_t
i = 0;
i <
file; ++
i ) {
◆ getFiles()
Long64_t xAOD::TEvent::getFiles |
( |
| ) |
const |
|
inherited |
Get how many files are available on the currently defined input.
This function can be used to get the number of input files that the object currently knows about.
This is meant to be used to collect the metadata from each of the input files, or to access the metadata using a transient tree. (xAOD::TMetaTree)
- Returns
- The number of input files when reading from a TChain, 1 when reading from a TFile, and 0 if the object is not connected to any input
Definition at line 1463 of file Control/xAODRootAccess/Root/TEvent.cxx.
1466 return m_inChain->GetListOfFiles()->GetEntries();
◆ getHash()
Function returning the hash describing an object name.
This helper function is mostly needed by the smart pointers of the xAOD EDM.
Right now it very simply just calculates the hash just based on the key given to the function. But later on it might be good to do some tests here, checking if the event format knows about the specified key or not. This is why it's not made to be a static function
- Parameters
-
key | String key to turn into a hash |
- Returns
- A hash corresponding to the specified string key
Implements xAOD::TVirtualEvent.
Definition at line 1660 of file Control/xAODRootAccess/Root/TEvent.cxx.
1663 if(
key ==
"" )
return 0;
◆ getInputObject() [1/2]
const void * xAOD::TEvent::getInputObject |
( |
const std::string & |
key, |
|
|
const std::type_info & |
ti, |
|
|
::Bool_t |
silent = kFALSE , |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| |
|
protectedinherited |
Function for retrieving an input object in a non-template way.
This is the function doing the heavy lifting to retrieve objects from the input file.
- Parameters
-
key | The key (branch name) of the object to retrieve |
ti | The type as which the object is to be retrieved |
silent | Set to kTRUE to make the code fail silently in case the object can't be retrieved |
metadata | Flag deciding whether we're looking for a metadata or event data object |
- Returns
- A pointer to the input object if successful, or a null pointer if not
Definition at line 2208 of file Control/xAODRootAccess/Root/TEvent.cxx.
2214 std::string keyToUse =
key;
2219 keyToUse = remap_itr->second;
2225 if(
store &&
store->contains( keyToUse, ti ) &&
2226 store->isConst( keyToUse, ti ) ) {
2227 const void*
result =
store->getConstObject( keyToUse, ti );
2258 ::Fatal(
"xAOD::TEvent::getInputObject",
2259 XAOD_MESSAGE(
"There is an internal logic error in the "
2265 TObjectManager*
mgr =
2266 dynamic_cast< TObjectManager*
>( itr->second );
2268 if(
key == keyToUse ) {
2269 ::Error(
"xAOD::TEvent::getInputObject",
2274 ::Error(
"xAOD::TEvent::getInputObject",
2276 "\"%s\"/\"%s\"" ),
key.c_str(),
2284 if(
mgr->getEntry() ) {
2289 ::Error(
"xAOD::TEvent::getInputObject",
2292 mgr->holder()->getClass()->GetName(),
2303 ::Warning(
"xAOD::TEvent::getInputObject",
2304 "Could not retrieve object with key \"%s\" "
2305 "as \"%s\"", keyToUse.c_str(),
◆ getInputObject() [2/2]
|
overrideprotectedvirtualinherited |
Function for retrieving an input object in a non-template way.
This function is used by the TVirtualEvent interface to access an input object with a given hashed key.
The function looks up the string key belonging to the hash, and then calls the other GetInputObject(...) function in the class with that parameter.
- Parameters
-
key | The hashed key of the input object |
ti | The type description of the object requested |
silent | Switch for being silent about failures or not |
- Returns
- A pointer to the requested object, or a null pointer in case of failure
Implements xAOD::TVirtualEvent.
Definition at line 1951 of file Control/xAODRootAccess/Root/TEvent.cxx.
1958 Warning(
"xAOD::TEvent::getInputObject",
1959 "Key 0x%08x unknown",
key );
◆ getKey()
Function returning the hash describing a known object.
This function is used by the smart pointer code to find the identifier of an object that's already in the event in some way.
- Parameters
-
obj | Pointer to the object that we want to look up |
- Returns
- The hashed identifier of the object, or 0 if the object was not found in the event
Implements xAOD::TVirtualEvent.
Definition at line 1682 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ getName() [1/2]
const std::string & xAOD::TEvent::getName |
( |
const void * |
obj | ) |
const |
|
overridevirtualinherited |
Function returning the key describing a known object.
This function is used by the smart pointer code to find the identifier of an object that's already in the event in some way.
- Parameters
-
obj | Pointer to the object that we want to look up |
- Returns
- The name of the object, or an empty string if the object was not found in the event
Implements xAOD::TVirtualEvent.
Definition at line 1695 of file Control/xAODRootAccess/Root/TEvent.cxx.
1700 for( ; obj_itr != obj_end; ++obj_itr ) {
1703 if( obj_itr->second->object() !=
obj )
continue;
1706 return obj_itr->first;
1712 for( ; obj_itr != obj_end; ++obj_itr ) {
1715 if( obj_itr->second->object() !=
obj )
continue;
1718 return obj_itr->first;
1729 ::Warning(
"xAOD::TEvent::getName",
1730 "Didn't find object with pointer %p in the event",
1732 static const std::string
dummy;
◆ getName() [2/2]
Function returning the key describing a known object.
This function is used primarily when getting the string key of a smart pointer that we read in from a file, or access it in memory.
- Parameters
-
hash | The hashed key for the container/object |
- Returns
- The name of the object, or an empty string if the object was not found in the event
Implements xAOD::TVirtualEvent.
Definition at line 1893 of file Control/xAODRootAccess/Root/TEvent.cxx.
1913 static const std::string
dummy;
◆ getNames()
void xAOD::TEvent::getNames |
( |
const std::string & |
targetClassName, |
|
|
std::vector< std::string > & |
vkeys, |
|
|
bool |
metadata = false |
|
) |
| const |
|
overrideprotectedvirtualinherited |
Function determining the list keys associated with a type name.
Implements xAOD::TVirtualEvent.
Definition at line 1736 of file Control/xAODRootAccess/Root/TEvent.cxx.
1740 std::set<std::string>
keys;
1744 std::vector<TObjArray*> fullListOfBranches = {};
1749 ::Info(
"xAOD::TEvent::getNames",
"scanning input objects");
1750 fullListOfBranches.push_back(
m_inMetaTree->GetListOfBranches());
1755 ::Info(
"xAOD::TEvent::getNames",
"scanning input objects");
1757 fullListOfBranches.push_back(
m_inTree->GetListOfBranches());
1762 TList *fList =
m_inTree->GetListOfFriends();
1764 for (TObject * feObj : *fList){
1767 auto * pElement =
dynamic_cast<TFriendElement*
>(feObj);
1768 if (not pElement)
continue;
1769 TTree *friendTree = pElement->GetTree();
1771 fullListOfBranches.push_back(friendTree->GetListOfBranches());
1779 for (
const TObjArray * in : fullListOfBranches){
1782 const TObject *
obj = in->At(
index);
1783 if ( !
obj )
continue;
1784 const TBranch * element =
dynamic_cast<const TBranch*
>(
obj);
1786 ::Error(
"xAOD::TEvent::getNames",
"Failure inspecting input objects");
1789 std::string objClassName = element->GetClassName();
1790 std::string
key =
obj->GetName();
1791 ::Info(
"xAOD::TEvent::getNames",
1792 "Inspecting %s / %s",
1793 objClassName.c_str(),
key.c_str());
1794 if (objClassName == targetClassName) {
1795 ::Info(
"xAOD::TEvent::getNames",
1796 "Matched %s to key %s",
1797 targetClassName.c_str(),
key.c_str());
1806 ::Info(
"xAOD::TEvent::getNames",
1807 "scanning input Aux objects for %s", targetClassName.c_str());
1808 for(
const auto&
object : inAux ) {
1811 TObjectManager*
mgr =
dynamic_cast< TObjectManager*
>(
object.second );
1812 if ( !
mgr )
continue;
1813 const std::string& objClassName =
mgr->holder()->getClass()->GetName();
1814 const std::string&
key =
object.first;
1815 ::Info(
"xAOD::TEvent::getNames",
1816 "Inspecting %s / %s",
1817 objClassName.c_str(),
key.c_str());
1818 if (objClassName == targetClassName) {
1819 ::Info(
"xAOD::TEvent::getNames",
1820 "Matched %s to key %s",
1821 targetClassName.c_str(),
key.c_str());
1830 const TObjArray *
out =
tree->GetListOfBranches();
1831 ::Info(
"xAOD::TEvent::getNames",
"scanning output objects");
1835 if ( !
obj )
continue;
1836 const TBranch * element =
dynamic_cast<const TBranch*
>(
obj);
1838 ::Error(
"xAOD::TEvent::getNames",
"Failure inspecting input objects");
1841 std::string objClassName = element->GetClassName();
1842 std::string
key =
obj->GetName();
1843 ::Info(
"xAOD::TEvent::getNames",
1844 "Inspecting %s / %s",
1845 objClassName.c_str(),
key.c_str());
1846 if (objClassName == targetClassName) {
1847 ::Info(
"xAOD::TEvent::getNames",
1848 "Matched %s to key %s",
1849 targetClassName.c_str(),
key.c_str());
1854 ::Info(
"xAOD::TEvent::getNames",
"no output tree connected");
1863 ::Info(
"xAOD::TEvent::getNames",
1864 "scanning output Aux objects for %s", targetClassName.c_str());
1865 for(
const auto&
object : outAux ) {
1868 TObjectManager*
mgr =
dynamic_cast< TObjectManager*
>(
object.second );
1869 if ( !
mgr )
continue;
1870 const std::string& objClassName =
mgr->holder()->getClass()->GetName();
1871 const std::string&
key =
object.first;
1872 ::Info(
"xAOD::TEvent::getNames",
1873 "Inspecting %s / %s",
1874 objClassName.c_str(),
key.c_str());
1875 if (objClassName == targetClassName) {
1876 ::Info(
"xAOD::TEvent::getNames",
1877 "Matched %s to key %s",
1878 targetClassName.c_str(),
key.c_str());
1883 vkeys.insert(vkeys.end(),
keys.begin(),
keys.end());
◆ getOutputObject() [1/2]
void * xAOD::TEvent::getOutputObject |
( |
const std::string & |
key, |
|
|
const std::type_info & |
ti, |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| const |
|
protectedinherited |
Function for retrieving an output object in a non-template way.
This function does the heavy lifting of retrieving object from the list of output objects.
While it returns a typeless pointer, that pointer can be cast directly to the type described by the second parameter in the caller code.
- Parameters
-
key | The key (branch name) of the object to retrieve |
ti | The type as which the object is to be retrieved |
metadata | Flag deciding whether we're looking for a metadata or event data object |
- Returns
- A pointer to the output object if successful, or a null pointer if not
Definition at line 2138 of file Control/xAODRootAccess/Root/TEvent.cxx.
2147 Object_t::const_iterator itr =
objects.find(
key );
2169 if( ! itr->second->isSet() ) {
2174 TObjectManager*
mgr =
2175 dynamic_cast< TObjectManager*
>( itr->second );
2177 ::Error(
"xAOD::TEvent::getOutputObject",
2178 XAOD_MESSAGE(
"Object of wrong type found for key \"%s\"" ),
2184 void*
result =
mgr->holder()->getAs( ti );
2186 ::Warning(
"xAOD::TEvent::getOutputObject",
2187 "Couldn't retrieve object as \"%s\"",
◆ getOutputObject() [2/2]
void * xAOD::TEvent::getOutputObject |
( |
SG::sgkey_t |
key, |
|
|
const std::type_info & |
ti |
|
) |
| |
|
overrideprotectedvirtualinherited |
Function for retrieving an output object in a non-template way.
This function is used by the TVirtualEvent interface to access an output object with a given hashed key.
The function looks up the string key belonging to the hash, and then calls the other GetOutputObject(...) function in the class with that parameter.
- Parameters
-
key | The hashed key of the output object |
ti | The type description of the object requested |
- Returns
- A pointer to the requested object, or a null pointer in case of failure
Implements xAOD::TVirtualEvent.
Definition at line 1927 of file Control/xAODRootAccess/Root/TEvent.cxx.
1932 if( !
name.length() ) {
◆ hasAuxStore()
Function checking if a given object may have an auxiliary store.
Since the code needs to check in a few places whether a given object has an auxiliary store, and as this check may change slightly over time, it seemed to be a good idea to outsource this check into this function.
- Parameters
-
mgr | The manager of the object that should be checked |
- Returns
kTRUE
if the object can have an auxiliary store, kFALSE
otherwise
Definition at line 3620 of file Control/xAODRootAccess/Root/TEvent.cxx.
3624 static const TClass*
const dvClass =
3626 static const TClass*
const aeClass =
3630 return (
mgr.holder()->getClass()->InheritsFrom( dvClass ) ||
3631 mgr.holder()->getClass()->InheritsFrom( aeClass ) );
◆ initStats()
StatusCode xAOD::TEvent::initStats |
( |
| ) |
|
|
protectedinherited |
Function to initialise the statistics for all Tree content.
This function is used internally to initialise the reading of an input file.
It prepares the "monitoring information" in memory that gets filled while the code is running, with information about xAOD I/O.
- Returns
StatusCode::SUCCESS
if the function is successful, or StatusCode::kFaulure
if not
Definition at line 1974 of file Control/xAODRootAccess/Root/TEvent.cxx.
1978 return StatusCode::SUCCESS;
1983 ::Error(
"xAOD::TEvent::initStats",
1986 return StatusCode::FAILURE;
1995 for( ; itr !=
end; ++itr ) {
1998 const std::string& branchName = itr->second.branchName();
2001 if( branchName.find(
"Aux." ) != std::string::npos ) {
2010 const std::string intName =
2011 branchName.substr( 0, branchName.size() - 4 );
2019 ::Bool_t auxFound = kFALSE;
2022 std::vector<TObjArray*> fullListOfBranches = {};
2024 fullListOfBranches.push_back(
m_inTree->GetListOfBranches());
2029 TList *fList =
m_inTree->GetListOfFriends();
2031 for (TObject * feObj : *fList){
2034 auto * pElement =
dynamic_cast<TFriendElement*
>(feObj);
2035 if (not pElement)
continue;
2036 TTree *friendTree = pElement->GetTree();
2038 fullListOfBranches.push_back(friendTree->GetListOfBranches());
2043 for (TObjArray*
branches : fullListOfBranches){
2044 for( Int_t
i = 0;
i <
branches->GetEntriesFast(); ++
i ){
2048 if(
name.BeginsWith( branchName ) ||
2049 name.BeginsWith( dynName ) ) {
2056 ::Warning(
"xAOD::TEvent::initStats",
2057 "Couldn't find interface object/container "
2058 "\"%s\" belonging to branch \"%s\"",
2059 intName.c_str(), branchName.c_str() );
2066 ::TClass*
cl = ::TClass::GetClass(
el->className().c_str() );
2067 if( ( !
cl ) || ( !
cl->IsLoaded() ) ) {
2068 ::Warning(
"xAOD::TEvent::initStats",
2069 "Couldn't find dictionary for type \"%s\"",
2070 el->className().c_str() );
2076 static const std::string baseName =
2078 static ::TClass*
const baseCl = ::TClass::GetClass( baseName.c_str() );
2080 ::Error(
"xAOD::TEvent::initStats",
2082 "\"%s\"" ), baseName.c_str() );
2083 return StatusCode::FAILURE;
2093 static constexpr
bool TOP_STORE =
true;
2094 TAuxStore temp( branchName, TOP_STORE,
mode );
2095 static constexpr
bool PRINT_WARNINGS =
false;
2097 temp.readFrom( *
m_inTree, PRINT_WARNINGS ) );
2104 stats.branch(branchName,
id);
2108 stats.setBranchNum(
stats.branchNum() + temp.getAuxIDs().size());
2113 const ::TBranch* container =
2114 m_inTree->GetBranch( branchName.c_str() );
2123 return StatusCode::SUCCESS;
◆ inputEventFormat()
Get information about the input objects.
This function makes it possible for the user to investigate the contents of the input file that the object is currently connected to.
Notice that this doesn't necessarily mean that all the objects for which metadata is stored, would necessarily be part of the input TTree that this object is connected to.
- Returns
- The event format object if a file is being read, or a null pointer if no input file is connected at the moment.
Definition at line 1614 of file Control/xAODRootAccess/Root/TEvent.cxx.
1622 ::Warning(
"xAOD::TEvent::inputEventFormat",
1623 "No input file is connected at the moment" );
◆ isAuxStore()
Function checking if a given object may be an auxiliary store.
This function is used to decide if a given object is an auxiliary store type or not.
- Parameters
-
mgr | The manager of the object that should be checked |
- Returns
kTRUE
if the object is an auxiliary store, kFALSE
if it is not
Definition at line 3641 of file Control/xAODRootAccess/Root/TEvent.cxx.
3644 static const TClass*
const storeClass =
3646 static const TClass*
const storeHolderClass =
3650 return (
mgr.holder()->getClass()->InheritsFrom( storeClass ) ||
3651 mgr.holder()->getClass()->InheritsFrom( storeHolderClass ) );
◆ isStandalone()
Function checking if an object is standalone (not a container)
This function is used to figure out while setting up the reading of the TTree in kBranchAccess mode, what to tell the underlying TAuxStore object, what kind of store it needs to be.
It's done in pretty much the same way in which hasAuxStore(...) decides if the object in question can have an auxiliary store.
- Parameters
-
mgr | The manager of the object that should be checked |
- Returns
kTRUE
if the object is a standalone one, kFALSE
if it is a container
Definition at line 3664 of file Control/xAODRootAccess/Root/TEvent.cxx.
3668 static const TClass*
const dvClass =
3670 static const TClass*
const aeClass =
3674 if(
mgr.holder()->getClass()->InheritsFrom( aeClass ) ) {
3676 }
else if(
mgr.holder()->getClass()->InheritsFrom( dvClass ) ) {
3681 ::Error(
"xAOD::TEvent::isStandalone",
3683 "auxiliary store" ),
3684 mgr.holder()->getClass()->GetName() );
◆ keys()
template<typename T >
void xAOD::TVirtualEvent::keys |
( |
std::vector< std::string > & |
vkeys, |
|
|
bool |
metadata = false |
|
) |
| const |
|
inherited |
provide list of all keys associated with provided type.
usage: event->keys( vec_to_fill, metadata )
- Parameters
-
vkeys | will be filled with the list of keys (may be empty) |
metadata | (default false) look in metadata content if true |
◆ keyToString() [1/2]
|
overrideprotectedinherited |
◆ keyToString() [2/2]
|
overrideprotectedinherited |
◆ name()
const std::string & xAOD::TEvent::name |
( |
| ) |
const |
|
overrideprotectedinherited |
Get the name of the instance.
Definition at line 452 of file TEventProxyDict.cxx.
454 static const std::string NAME =
"xAOD::TEvent";
◆ outputEventFormat()
Get information about the output objects.
This function makes it possible for the user to investigate the content that is being written to the output file.
Notice that this doesn't necessarily mean that all the objects for which metadata is stored, would necessarily be part of the output TTree that this object is connected to.
- Returns
- The event format object if a file is being written, or a null pointer if not.
Definition at line 1637 of file Control/xAODRootAccess/Root/TEvent.cxx.
1645 ::Warning(
"xAOD::TEvent::outputEventFormat",
1646 "No output file is connected at the moment" );
◆ printIOStats()
void xAOD::TEvent::printIOStats |
( |
| ) |
const |
|
inherited |
Function printing the I/O statistics of the current process.
This is a convenience function for printing basic I/O information about the current job.
It can be called at the end of a job to get an overview of what the job did exactly I/O-wise.
Definition at line 350 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ printNameRemap()
void xAOD::TEvent::printNameRemap |
( |
| ) |
const |
|
inherited |
Print the current name re-mapping rules.
This function can be used for debugging, to check what container/object name remapping rules are in place for the current TEvent object.
Definition at line 1044 of file Control/xAODRootAccess/Root/TEvent.cxx.
1047 ::Info(
"xAOD::TEvent::printNameRemap",
"Name remapping rules:" );
1051 ::Info(
"xAOD::TEvent::printNameRemap",
" NONE" );
1058 ::Info(
"xAOD::TEvent::printNameRemap",
" \"%s\" -> \"%s\"",
1059 itr->second.c_str(), itr->first.c_str() );
◆ proxies()
|
overrideprotectedinherited |
return the list of all current proxies in store
Definition at line 411 of file TEventProxyDict.cxx.
415 std::vector< const SG::DataProxy* > ret;
416 for(
const auto&
p : m_branches ) {
419 ret.push_back(
proxy );
◆ proxy() [1/2]
|
overrideprotectedinherited |
get proxy with given id and key. Returns 0 to flag failure
Definition at line 234 of file TEventProxyDict.cxx.
◆ proxy() [2/2]
|
overrideprotectedinherited |
get proxy for a given data object address in memory
Definition at line 206 of file TEventProxyDict.cxx.
217 static const bool QUIET =
true;
231 return bi->m_proxy.get();
◆ proxy_exact()
|
overrideprotectedinherited |
Get proxy given a hashed key+clid.
Definition at line 244 of file TEventProxyDict.cxx.
250 static mutex_t
mutex;
252 if( missingSGKeys.emplace(
sgkey ).second &&
254 ::Warning(
"xAOD::TEvent::proxy_exact",
255 "Can't find BranchInfo for %d.",
◆ putAux()
StatusCode xAOD::TEvent::putAux |
( |
::TTree & |
outTree, |
|
|
TVirtualManager & |
vmgr, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 , |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| |
|
protectedinherited |
Function saving the dynamically created auxiliary properties.
This function is used internally to set up the writing of the auxiliary store variables that were dynamically created on an object.
(And not statically defined to be part of that object.)
- Parameters
-
outTree | The TTree to put the auxiliary branches into |
mgr | The object manager of the output object |
basketSize | Size of the buffer associated with the branches |
splitLevel | The split level to use for the created branches |
metadata | Flag specifying whether the info written is metadata or not |
- Returns
kTRUE
if the setup was successful, or kFALSE
if it was not
Definition at line 3377 of file Control/xAODRootAccess/Root/TEvent.cxx.
3385 TObjectManager*
mgr =
dynamic_cast< TObjectManager*
>( &vmgr );
3388 return StatusCode::SUCCESS;
3392 if( !
mgr->holder()->getClass()->InheritsFrom(
"SG::IAuxStoreIO" ) ) {
3393 return StatusCode::SUCCESS;
3401 ::Fatal(
"xAOD::TEvent::putAux",
3402 XAOD_MESSAGE(
"There is a logic error in the code!" ) );
3411 sel.selectAux( item_itr->second );
3421 if( auxids.
empty() ) {
3422 return StatusCode::SUCCESS;
3426 const std::string dynNamePrefix =
3435 typedef std::pair< std::string, SG::auxid_t > AuxVarSort_t;
3436 std::vector< AuxVarSort_t > varsort;
3437 varsort.reserve( auxids.
size() );
3439 varsort.emplace_back(
r.getName(
id ),
id );
3441 std::sort( varsort.begin(), varsort.end() );
3444 for(
const auto&
p : varsort ) {
3450 const std::string
brName = dynNamePrefix +
p.first;
3459 const std::type_info* brType = aux->
getIOType(
id );
3461 ::Error(
"xAOD::TEvent::putAux",
3464 return StatusCode::FAILURE;
3466 const std::string brTypeName =
3468 std::string brProperTypeName =
"<unknown>";
3474 if( strlen( brType->name() ) == 1 ) {
3477 brProperTypeName = brTypeName;
3482 ::Error(
"xAOD::TEvent::putAux",
3485 brName.c_str(), brTypeName.c_str() );
3486 return StatusCode::FAILURE;
3490 std::ostringstream leaflist;
3494 THolder* hldr =
new THolder( aux->
getIOData(
id ),
3496 TPrimitiveAuxBranchManager* auxmgr =
3497 new TPrimitiveAuxBranchManager(
id, 0, hldr );
3501 *( auxmgr->branchPtr() ) =
3502 outTree.Branch(
brName.c_str(), hldr->get(),
3503 leaflist.str().c_str(),
3505 if( ! auxmgr->branch() ) {
3506 ::Error(
"xAOD::TEvent::putAux",
3509 brName.c_str(), brProperTypeName.c_str() );
3511 *( auxmgr->holder()->getPtr() ) = 0;
3514 return StatusCode::FAILURE;
3516 br = auxmgr->branch();
3521 TClass*
cl = TClass::GetClass( *brType, kTRUE, kTRUE );
3525 cl = TClass::GetClass( brTypeName.c_str() );
3528 ::Error(
"xAOD::TEvent::putAux",
3530 "variable \"%s\" of type \"%s\"" ),
3531 brName.c_str(), brTypeName.c_str() );
3532 return StatusCode::FAILURE;
3537 brProperTypeName =
cl->GetName();
3540 THolder* hldr =
new THolder( aux->
getIOData(
id ),
3542 TAuxBranchManager* auxmgr =
3543 new TAuxBranchManager(
id, 0, hldr );
3546 if (!
cl->CanSplit() && strncmp (
cl->GetName(),
"SG::PackedContainer<", 20) == 0)
3550 *( auxmgr->branchPtr() ) =
3551 outTree.Branch(
brName.c_str(),
3553 hldr->getPtr(), basketSize, splitLevel );
3554 if( ! auxmgr->branch() ) {
3555 ::Error(
"xAOD::TEvent::putAux",
3558 brName.c_str(), brProperTypeName.c_str() );
3560 *( auxmgr->holder()->getPtr() ) = 0;
3563 return StatusCode::FAILURE;
3565 br = auxmgr->branch();
3571 if( outTree.GetEntries() ) {
3572 void*
ptr =
br->GetAddress();
3573 br->SetAddress( 0 );
3574 for( ::Long64_t
i = 0;
i < outTree.GetEntries(); ++
i ) {
3577 br->SetAddress(
ptr );
3584 EventFormatElement(
brName,
3586 mgr->branch()->GetName(),
3597 ::Fatal(
"xAOD::TEvent::putAux",
3598 XAOD_MESSAGE(
"There is an internal logic error in the "
3604 const_cast< void*
>(
static_cast< const void*
>( aux->
getIOData(
id ) ) );
3605 bmgr->second->setObject( nc_data );
3609 return StatusCode::SUCCESS;
◆ readFrom() [1/2]
StatusCode xAOD::TEvent::readFrom |
( |
::TFile * |
file, |
|
|
Bool_t |
useTreeCache = kTRUE , |
|
|
const char * |
treeName = EVENT_TREE_NAME |
|
) |
| |
|
inherited |
Connect the object to a new input file.
This function takes care of connecting the event object to a new input file.
It reads in the metadata of the input file needed for reading the file.
- Parameters
-
file | Pointer to the file being read |
useTreeCache | Flag for turning on/off the usage of TTreeCache |
treeName | Name of the input tree |
- Returns
kTRUE
if successful, kFALSE
otherwise
Definition at line 367 of file Control/xAODRootAccess/Root/TEvent.cxx.
371 if( !
file )
return StatusCode::SUCCESS;
376 for( ; itr !=
end; ++itr ) {
390 for( ; itr !=
end; ++itr ) {
410 ::Error(
"xAOD::TEvent::readFrom",
411 XAOD_MESSAGE(
"Couldn't find metadata tree on input. Object "
413 return StatusCode::FAILURE;
419 ::Error(
"xAOD::TEvent::readFrom",
420 XAOD_MESSAGE(
"Failed to load entry for metadata tree=%s" ),
422 return StatusCode::FAILURE;
427 ::Info(
"xAOD::TEvent::readFrom",
428 "Was expecting a metadata tree with size 1, instead of %i.",
430 ::Info(
"xAOD::TEvent::readFrom",
431 "File most probably produced by hadd..." );
437 static const std::string eventFormatTypeName =
439 ::TClass*
cl = ::TClass::GetClass( eventFormatTypeName.c_str() );
441 ::Warning(
"xAOD::TEvent::readFrom",
442 "Couldn't load the EventFormat dictionary" );
446 const std::string eventFormatBranchName =
448 if( !
m_inMetaTree->GetBranch( eventFormatBranchName.c_str() ) ) {
452 ::Info(
"xAOD::TEvent::readFrom",
"Input file provides no event or "
456 return StatusCode::SUCCESS;
462 m_inMetaTree->SetBranchAddress( eventFormatBranchName.c_str(),
465 ::Error(
"xAOD::TEvent::readFrom",
466 XAOD_MESSAGE(
"Failed to connect to EventFormat object" ) );
467 return StatusCode::FAILURE;
484 std::set<std::string> lOtherMetaTreeNames = {};
485 TList *lKeys =
file->GetListOfKeys();
488 for (
int iKey = 0; iKey < lKeys->GetEntries() ; iKey++){
490 std::string
keyName = lKeys->At(iKey)->GetName();
495 && (
keyName.find(
"MetaData") != std::string::npos)
496 && !(
keyName.find(
"MetaDataHdr") != std::string::npos)){
498 const char *
className = ((::TKey*)lKeys->At(iKey))->GetClassName();
499 static constexpr Bool_t LOAD = kFALSE;
500 static constexpr Bool_t
SILENT = kTRUE;
501 ::TClass*
cl = ::TClass::GetClass(
className, LOAD, SILENT);
502 if ((
cl !=
nullptr) &&
cl->InheritsFrom(::TTree::Class())){
504 lOtherMetaTreeNames.insert(std::move(
keyName));
511 for (
const std::string & metaTreeName : lOtherMetaTreeNames){
512 TTree *tmpMetaTree =
dynamic_cast< ::TTree*
>(
file->Get( metaTreeName.c_str() ) );
516 ::Warning(
"xAOD::TEvent::readFrom",
"Could not read metadata tree=%s",metaTreeName.c_str());
522 if ( tmpMetaTree->LoadTree(0) < 0 ){
523 ::Error(
"xAOD::TEvent::readFrom",
524 XAOD_MESSAGE(
"Failed to load entry for metadata tree=%s" ),
525 tmpMetaTree->GetName() );
526 return StatusCode::FAILURE;
530 const std::string tmpEventFormatBranchName =
532 if( ! tmpMetaTree->GetBranch( tmpEventFormatBranchName.c_str() ) ) {
534 ::Warning(
"xAOD::TEvent::readFrom",
"No EventFormat branch found in metadata tree=%s",tmpMetaTree->GetName() );
540 tmpMetaTree->SetBranchAddress( tmpEventFormatBranchName.c_str(),
541 &tmpFormat, &tmpBr );
543 ::Error(
"xAOD::TEvent::readFrom",
544 XAOD_MESSAGE(
"Failed to connect to EventFormat object for metadata tree = %s"), tmpMetaTree->GetName() );
545 return StatusCode::FAILURE;
548 tmpBr->GetEntry( 0 );
550 for (
const std::pair<const std::string, xAOD::EventFormatElement> &evtElem : *tmpFormat){
572 m_inTree->SetCacheLearnEntries( 10 );
584 const TIncident beginIncident( IncidentType::BeginInputFile );
585 for( TVirtualIncidentListener* listener :
m_listeners ) {
586 listener->handle( beginIncident );
593 const TIncident endIncident( IncidentType::EndInputFile );
594 for( TVirtualIncidentListener* listener :
m_listeners ) {
595 listener->handle( endIncident );
599 return StatusCode::SUCCESS;
◆ readFrom() [2/2]
StatusCode xAOD::TEvent::readFrom |
( |
::TTree * |
tree, |
|
|
Bool_t |
useTreeCache = kTRUE |
|
) |
| |
|
inherited |
Connect the object to a new input tree/chain.
This version of the function sets up the object to read information from a tree/chain.
Using it with a TTree pointer makes not much sense, but using it with a TChain pointer could be a very valid usage mode.
- Parameters
-
tree | The pointer to a TTree or a TChain |
useTreeCache | Flag for switching TTreeCache usage on/off |
- Returns
kTRUE
if successful, kFALSE
when not
Definition at line 610 of file Control/xAODRootAccess/Root/TEvent.cxx.
622 if( useTreeCache && ( !
m_inChain->GetCacheSize() ) ) {
632 ::Error(
"xAOD::TEvent::readFrom",
633 XAOD_MESSAGE(
"Couldn't get the list of files from the "
635 return StatusCode::FAILURE;
637 if( !
files->GetEntries() ) {
638 ::Error(
"xAOD::TEvent::readFrom",
641 return StatusCode::FAILURE;
643 const ::TChainElement* chEl =
644 dynamic_cast< const ::TChainElement*
>(
files->At( 0 ) );
646 ::Error(
"xAOD::TEvent::readFrom",
647 XAOD_MESSAGE(
"Couldn't cast object to TChainElement" ) );
648 return StatusCode::FAILURE;
650 ::TFile* dummyFile = ::TFile::Open( chEl->GetTitle() );
652 ::Error(
"xAOD::TEvent::readFrom",
655 return StatusCode::FAILURE;
670 return StatusCode::SUCCESS;
681 ::TFile*
file =
tree->GetCurrentFile();
◆ record() [1/5]
StatusCode xAOD::TPyEvent::record |
( |
int |
dummy, |
|
|
void * |
obj, |
|
|
const std::string & |
key, |
|
|
const std::string & |
type, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 |
|
) |
| |
Add an output object to the event.
This function is designed to be callable from PyROOT in order to record hand-made containers into an output file.
Notice that unline TEvent::record(...), this function doesn't take ownership of the object that's given to it. That's because all objects created by the Python interpreter are garbage collected by the Python interpreter. And we don't want to run into double-deletes.
- Parameters
-
dummy | Necessary to make sure that this function's signature is distinct from xAOD::TEvent::record . So that PyROOT would not mistake them for each other. |
obj | Typeless pointer to the object that is to be recorded |
key | The key with which the object is to be recorded |
type | The type name of the object being recorded |
basketSize | The size of the baskets used to write the payload |
splitLevel | The split level of the branch created |
- Returns
- The usual StatusCode types
Definition at line 79 of file TPyEvent.cxx.
87 kFALSE, kFALSE, kFALSE ) );
89 return StatusCode::SUCCESS;
◆ record() [2/5]
template<typename T >
StatusCode xAOD::TEvent::record |
( |
std::unique_ptr< T > |
obj, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 |
|
) |
| |
|
inherited |
Add an output object to the event, explicitly taking ownership of it.
◆ record() [3/5]
template<typename T >
StatusCode xAOD::TEvent::record |
( |
T * |
obj, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 0 |
|
) |
| |
|
inherited |
Add an output object to the event.
◆ record() [4/5]
StatusCode xAOD::TEvent::record |
( |
TAuxStore * |
store, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize, |
|
|
::Int_t |
splitLevel, |
|
|
::Bool_t |
ownsStore = kFALSE |
|
) |
| |
|
protectedinherited |
Internal function for adding an auxiliary store object to the output.
This function is used internally when copying an object with its auxiliary store from the input file, and branch access mode is activated for the event object.
The assumption is that the store object already knows what prefix it should be using. The key parameter only specifies under what ID the object should be handled in the output object list.
- Parameters
-
store | The store object to connect to the output |
key | The "key" with which to record the object |
basketSize | The basket size of the output branches |
splitLevel | The split level of the output branches |
- Returns
kTRUE
if the operation was successful, or kFALSE
if it was not
Definition at line 2496 of file Control/xAODRootAccess/Root/TEvent.cxx.
2502 ::Error(
"xAOD::TEvent::record",
2503 XAOD_MESSAGE(
"No output tree defined. Did you forget to "
2504 "call writeTo(...)?" ) );
2505 return StatusCode::FAILURE;
2509 const std::set< std::string >*
filter = 0;
2512 filter = &( filter_itr->second );
2526 TAuxManager*
mgr =
new TAuxManager(
store, ownsStore );
2530 return StatusCode::SUCCESS;
2534 if( vitr->second->object() ==
store ) {
2536 return StatusCode::SUCCESS;
2544 TAuxManager*
mgr =
dynamic_cast< TAuxManager*
>( vitr->second );
2546 ::Error(
"xAOD::TEvent::record",
2547 XAOD_MESSAGE(
"Output object with key %s already exists, "
2548 "and is not of type TAuxStore" ),
2550 return StatusCode::FAILURE;
2565 return StatusCode::SUCCESS;
◆ record() [5/5]
StatusCode xAOD::TEvent::record |
( |
void * |
obj, |
|
|
const std::string & |
typeName, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize, |
|
|
::Int_t |
splitLevel, |
|
|
::Bool_t |
overwrite = kFALSE , |
|
|
::Bool_t |
metadata = kFALSE , |
|
|
::Bool_t |
isOwner = kTRUE |
|
) |
| |
|
inherited |
Internal function for recording an object into the output.
This is the function doing the heavy lifting when recording a new object into the output tree/file.
It makes sure that the object is saved together with all of its dynamic auxiliary data if it has any.
- Parameters
-
obj | A typeless pointer to the object that we want to record |
typeName | The type name of the output object |
key | The key (branch name) of the object to record |
basketSize | The basket size of the output branch |
splitLevel | The split level of the output branch |
overwrite | Flag selecting if it is allowed to overwrite an already existing object (used internally) |
metadata | Flag selecting if we are writing an event or a metadata object |
isOwner | Flag selecting if we should take ownership of the object or not |
- Returns
kTRUE
if the operation was successful, or kFALSE
if it was not
Definition at line 2333 of file Control/xAODRootAccess/Root/TEvent.cxx.
2341 ::Error(
"xAOD::TEvent::record",
2342 XAOD_MESSAGE(
"No output tree defined. Did you forget to "
2343 "call writeTo(...)?" ) );
2344 return StatusCode::FAILURE;
2352 if( ( ! overwrite ) &&
2355 ::Error(
"xAOD::TEvent::record",
2358 return StatusCode::FAILURE;
2361 TClass*
cl = TClass::GetClass(
typeName.c_str() );
2363 ::Error(
"xAOD::TEvent::record",
2366 return StatusCode::FAILURE;
2369 THolder* hldr =
new THolder(
obj,
cl, isOwner );
2370 TObjectManager*
mgr =
2374 return StatusCode::SUCCESS;
2379 if( ( ! overwrite ) &&
2381 ::Error(
"xAOD::TEvent::record",
2382 XAOD_MESSAGE(
"Object %s/%s already accessed from the input, "
2383 "can't be overwritten in memory" ),
2385 return StatusCode::FAILURE;
2390 if( ( splitLevel == 0 ) &&
2391 (
key.find(
"Aux." ) == (
key.size() - 4 ) ) ) {
2400 TClass*
cl = TClass::GetClass(
typeName.c_str() );
2402 ::Error(
"xAOD::TEvent::record",
2405 return StatusCode::FAILURE;
2415 THolder* hldr =
new THolder(
obj,
cl, isOwner );
2416 TObjectManager*
mgr =
2421 *(
mgr->branchPtr() ) =
2423 hldr->getPtr(), basketSize, splitLevel );
2424 if( !
mgr->branch() ) {
2425 ::Error(
"xAOD::TEvent::record",
2428 key.c_str(),
cl->GetName() );
2430 hldr->setOwner( kFALSE );
2432 return StatusCode::FAILURE;
2443 return StatusCode::SUCCESS;
2447 TObjectManager* omgr =
dynamic_cast< TObjectManager*
>( vitr->second );
2449 ::Error(
"xAOD::TEvent::record",
2452 return StatusCode::FAILURE;
2457 if(
typeName != omgr->holder()->getClass()->GetName() ) {
2461 TClass*
cl = TClass::GetClass(
typeName.c_str() );
2462 if( ( !
cl ) || ::strcmp(
cl->GetName(),
2463 omgr->holder()->getClass()->GetName() ) ) {
2464 ::Error(
"xAOD::TEvent::record",
2465 XAOD_MESSAGE(
"For output key \"%s\" the previous type "
2466 "was \"%s\", the newly requested type is "
2468 key.c_str(), omgr->holder()->getClass()->GetName(),
2470 return StatusCode::FAILURE;
2475 omgr->setObject(
obj );
◆ recordAux()
Add an auxiliary store object to the output.
This function can be used to create/retrieve a ROOT-specific auxiliary object container that can be used to write information in the output file.
Any auxiliary information written this way will however only be readable in ROOT, using the kBranchAccess
option.
- Parameters
-
key | The name/prefix of the auxiliary store object/branches |
type | The type of the auxiliary store (object/container) |
basketSize | Size of the baskets created by the store object |
splitLevel | The split level of the branches created by the store |
- Returns
- An auxiliary store object that will write to the output
Definition at line 1077 of file Control/xAODRootAccess/Root/TEvent.cxx.
1083 ::Error(
"xAOD::TEvent::recordAux",
1084 XAOD_MESSAGE(
"No output tree given to the object" ) );
1102 ::Error(
"xAOD::TEvent::recordAux",
1104 static_cast< int >(
type ) );
1109 basketSize, splitLevel );
1110 if(
record(
store,
key, basketSize, splitLevel, kTRUE ).isFailure() ) {
1111 ::Error(
"xAOD::TEvent::recordAux",
1112 XAOD_MESSAGE(
"Couldn't connect TAuxStore object to the "
1123 ::Error(
"xAOD::TEvent::recordAux",
1129 TAuxManager*
mgr =
dynamic_cast< TAuxManager*
>( itr->second );
1131 ::Error(
"xAOD::TEvent::recordAux",
1132 XAOD_MESSAGE(
"Object of non-TAuxStore type registered "
1133 "with key \"%s\"" ),
key.c_str() );
1138 TAuxStore*
store =
mgr->getStore();
◆ recordMeta() [1/2]
template<typename T >
StatusCode xAOD::TEvent::recordMeta |
( |
std::unique_ptr< T > |
obj, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 1 |
|
) |
| |
|
inherited |
Add an object to the output file's metadata, explicitly taking ownership of it.
◆ recordMeta() [2/2]
template<typename T >
StatusCode xAOD::TEvent::recordMeta |
( |
T * |
obj, |
|
|
const std::string & |
key, |
|
|
::Int_t |
basketSize = 32000 , |
|
|
::Int_t |
splitLevel = 1 |
|
) |
| |
|
inherited |
Add an object to the output file's metadata.
◆ recordObject()
|
overrideprotectedinherited |
Record an object in the store.
Definition at line 445 of file TEventProxyDict.cxx.
448 throw std::runtime_error(
"xAOD::TEvent::recordObject is not "
◆ registerKey()
|
overrideprotectedinherited |
◆ removeListener()
Remove an incident listener object.
This function allows us to remove a listener when for instance a metadata tool is deleted during a job.
- Parameters
-
listener | Pointer to the listener that should be removed |
- Returns
- The usual StatusCode types
Definition at line 957 of file Control/xAODRootAccess/Root/TEvent.cxx.
965 ::Error(
"xAOD::TEvent::removeListener",
967 static_cast< void*
>( listener ) );
968 return StatusCode::FAILURE;
975 return StatusCode::SUCCESS;
◆ retrieve() [1/4]
template<typename T >
StatusCode xAOD::TEvent::retrieve |
( |
const T *& |
obj, |
|
|
const std::string & |
key |
|
) |
| |
|
inherited |
Retrieve either an input or an output object from the event.
◆ retrieve() [2/4]
template<typename T >
bool xAOD::TVirtualEvent::retrieve |
( |
const T *& |
obj, |
|
|
const std::string & |
key, |
|
|
bool |
silent = false |
|
) |
| |
|
inherited |
Function retrieving an object from the event (constant version)
◆ retrieve() [3/4]
Function retrieving an object from the event (constant version)
◆ retrieve() [4/4]
template<typename T >
StatusCode xAOD::TEvent::retrieve |
( |
T *& |
obj, |
|
|
const std::string & |
key |
|
) |
| |
|
inherited |
Retrieve an output object from the event.
◆ retrieveMetaInput()
template<typename T >
StatusCode xAOD::TEvent::retrieveMetaInput |
( |
const T *& |
obj, |
|
|
const std::string & |
key |
|
) |
| |
|
inherited |
Retrieve an input metadata object.
◆ retrieveMetaOutput() [1/2]
template<typename T >
StatusCode xAOD::TEvent::retrieveMetaOutput |
( |
const T *& |
obj, |
|
|
const std::string & |
key |
|
) |
| |
|
inherited |
Retrieve an output metadata object.
◆ retrieveMetaOutput() [2/2]
template<typename T >
StatusCode xAOD::TEvent::retrieveMetaOutput |
( |
T *& |
obj, |
|
|
const std::string & |
key |
|
) |
| |
|
inherited |
Retrieve an output metadata object.
◆ setActive()
void xAOD::TEvent::setActive |
( |
| ) |
const |
|
inherited |
Set this event object as the currently active one.
Setting TEvent objects happens automatically when reading a file, but when writing a file from scratch, the code doesn't necessarily know which TEvent object a given smart pointer should "belong to".
This function helps the user with setting this up.
Definition at line 871 of file Control/xAODRootAccess/Root/TEvent.cxx.
878 #ifndef XAOD_STANDALONE
880 #endif // not XAOD_STANDALONE
◆ setAuxItemList()
void xAOD::TEvent::setAuxItemList |
( |
const std::string & |
containerKey, |
|
|
const std::string & |
itemList |
|
) |
| |
|
inherited |
Configure which dynamic variables to write out for a given store.
This function receives the rules for selecting which dynamic auxiliary branches should be written for a given container, in the exact same format in which we need to set it in the Athena output ItemList.
- Parameters
-
containerKey | The name of the auxiliary container in question |
itemList | The variable list according to the ... formatting rules |
Definition at line 893 of file Control/xAODRootAccess/Root/TEvent.cxx.
903 while( std::getline(
ss, attr,
'.' ) ) {
◆ setAuxStore()
StatusCode xAOD::TEvent::setAuxStore |
( |
TObjectManager & |
mgr, |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| |
|
protectedinherited |
Function connecting a DV object to its auxiliary store.
Every time a DataVector is read in from the input for a new TTree entry, one needs to re-connect it with its auxiliary store.
This function takes care of this.
- Parameters
-
mgr | The manager object of the DV container |
metadata | Flag specifying whether we're dealing with a metadata or event data object |
- Returns
kTRUE
if the setup was successful, or kFALSE
if it was not
Definition at line 3200 of file Control/xAODRootAccess/Root/TEvent.cxx.
3205 return StatusCode::SUCCESS;
3209 const std::string
key =
mgr.branch()->GetName();
3217 TVirtualManager* auxMgr =
nullptr;
3221 auxKey = std::move(
key);
3227 return StatusCode::SUCCESS;
3229 auxMgr = itr->second;
3230 auxKey =
key +
"Aux.";
3235 ::Int_t readBytes = auxMgr->getEntry();
3239 const std::string dynAuxKey = auxKey +
"Dynamic";
3240 auto dynAuxMgr =
objects.find( dynAuxKey );
3242 if( ( dynAuxMgr !=
objects.end() ) &&
3244 ( auxMgr == &
mgr ) ) ) {
3249 dynAuxMgr->second->getEntry();
3263 auto dynAuxMgr =
objects.find( dynAuxKey );
3264 if( dynAuxMgr ==
objects.end() ) {
3265 ::Error(
"xAOD::TEvent::setAuxStore",
3267 return StatusCode::FAILURE;
3269 dynAuxMgr->second->getEntry();
3275 if( auxMgr == &
mgr ) {
3276 return StatusCode::SUCCESS;
3282 switch(
mgr.holder()->typeKind() ) {
3301 if(
vec && ( !
vec->trackIndices() ) ) {
3302 forceTrackIndices( *
vec );
3306 if( ( !
vec ) && ( ! aux ) ) {
3307 ::Fatal(
"xAOD::TEvent::setAuxStore",
3309 "SG::AuxVectorBase or SG::AuxElement" ),
3310 mgr.holder()->getClass()->GetName() );
3317 TAuxManager* amgr =
dynamic_cast< TAuxManager*
>( auxMgr );
3319 ::Fatal(
"xAOD::TEvent::setAuxStore",
3320 XAOD_MESSAGE(
"Auxiliary manager for \"%s\" is not of the "
3321 "right type" ), auxKey.c_str() );
3322 return StatusCode::FAILURE;
3324 store = amgr->getConstStore();
3330 amgr->getStore()->setStructMode(
mode );
3334 TObjectManager* omgr =
3335 dynamic_cast< TObjectManager*
>( auxMgr );
3337 ::Fatal(
"xAOD::TEvent::setAuxStore",
3338 XAOD_MESSAGE(
"Auxiliary manager for \"%s\" is not of the "
3339 "right type" ), auxKey.c_str() );
3340 return StatusCode::FAILURE;
3346 ::Fatal(
"xAOD::TEvent::setAuxStore",
3356 ::Fatal(
"xAOD::TEvent::setAuxStore",
3361 return StatusCode::SUCCESS;
◆ setPrintEventProxyWarnings()
void xAOD::TEvent::setPrintEventProxyWarnings |
( |
bool |
print | ) |
|
|
inherited |
Function to silence warnings associated with broken element links.
These appear harmless so long as you don't actually try to access the links (which will cause other errors).
Definition at line 3724 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ setUpDynamicStore()
StatusCode xAOD::TEvent::setUpDynamicStore |
( |
TObjectManager & |
mgr, |
|
|
::TTree * |
tree |
|
) |
| |
|
protectedinherited |
Function adding dynamic variable reading capabilities to an auxiliary store object.
This function is used by connectBranch(...) and connectMetaBranch(...) to set up auxiliary store type objects correctly for accessing dynamic variables from the input file.
- Parameters
-
mgr | The object manager of the auxiliary store object |
tree | The tree to read dynamic variables from |
- Returns
- The usual
StatusCode
types
Definition at line 3116 of file Control/xAODRootAccess/Root/TEvent.cxx.
3119 ::TMethodCall setNameCall;
3123 setNameCall.InitWithPrototype(
mgr.holder()->getClass(),
3124 "setName",
"const char*" );
3125 if( setNameCall.IsValid() ) {
3130 const char* charParams =
params.Data();
3131 setNameCall.Execute(
mgr.holder()->get(), charParams );
3134 ::Warning(
"xAOD::TEvent::setUpDynamicStore",
3135 "Couldn't find setName(...) function for container %s "
3137 mgr.branch()->GetName(),
3138 mgr.holder()->getClass()->GetName() );
3143 static const TClass*
const holderClass =
3145 if( !
mgr.holder()->getClass()->InheritsFrom( holderClass ) ) {
3147 return StatusCode::SUCCESS;
3154 if( ! storeHolder ) {
3155 ::Fatal(
"xAOD::TEvent::setUpDynamicStore",
3157 return StatusCode::FAILURE;
3165 new TAuxStore(
mgr.branch()->GetName(), kFALSE,
3173 TAuxManager* amgr =
new TAuxManager(
store, kFALSE );
3181 store->getEntry( 0 );
3187 return StatusCode::SUCCESS;
◆ stringToKey()
|
overrideprotectedinherited |
◆ transientContains() [1/3]
template<typename T >
::Bool_t xAOD::TEvent::transientContains |
( |
const std::string & |
key | ) |
const |
|
inherited |
Function checking if an object is already in memory.
◆ transientContains() [2/3]
Bool_t xAOD::TPyEvent::transientContains |
( |
const std::string & |
key, |
|
|
const std::string & |
type |
|
) |
| const |
Function checking if an object is already in memory.
Definition at line 37 of file TPyEvent.cxx.
41 ::TClass*
cl = ::TClass::GetClass(
type.c_str() );
43 ::Warning(
"xAOD::TPyEvent::transientContains",
44 "Type name \"%s\" not known",
type.c_str() );
49 const std::type_info* ti =
cl->GetTypeInfo();
51 ::Warning(
"xAOD::TPyEvent::transientContains",
52 "Type \"%s\" doesn't have a proper dictionary",
◆ transientContains() [3/3]
Bool_t xAOD::TEvent::transientContains |
( |
const std::string & |
key, |
|
|
const std::type_info & |
ti, |
|
|
::Bool_t |
metadata = kFALSE |
|
) |
| const |
|
protectedinherited |
Internal function checking if an object is already in memory.
Internal function checking if an object of a given type, with a given key is held in memory by the event object.
It's this function doing the heavy lifting for the public template function.
- Parameters
-
key | The key/branch name of the object |
ti | The type description of the object |
metadata | Flag deciding whether we are looking for a metadata object or not |
- Returns
kTRUE
if such a modifiable object is held by the event object at the moment, kFALSE
otherwise
Definition at line 3717 of file Control/xAODRootAccess/Root/TEvent.cxx.
◆ transientContainsMeta()
template<typename T >
::Bool_t xAOD::TEvent::transientContainsMeta |
( |
const std::string & |
key | ) |
const |
|
inherited |
Function checking if a meta-object is already in memory.
◆ writeTo()
Connect the object to an output file.
This function should be called on a file opened be the user, before any event processing would occur.
It sets up the output event tree.
- Parameters
-
file | The file that the event data should be written to |
autoFlush | The auto-flush setting to use on the output TTree |
treeName | Name of the output event tree |
- Returns
kTRUE
if successful, kFALSE
otherwise
Definition at line 695 of file Control/xAODRootAccess/Root/TEvent.cxx.
700 ::Error(
"xAOD::TEvent::writeTo",
701 XAOD_MESSAGE(
"Null pointer given to the function!" ) );
702 return StatusCode::FAILURE;
707 ::Error(
"xAOD::TEvent::writeTo",
708 XAOD_MESSAGE(
"Object already writing to a file. Close that "
710 return StatusCode::FAILURE;
728 return StatusCode::SUCCESS;
◆ ATLAS_THREAD_SAFE
|
mutableprotectedinherited |
◆ CACHE_SIZE
const ::Int_t xAOD::TEvent::CACHE_SIZE = -1 |
|
staticprotectedinherited |
◆ DEFAULT_KEY
constexpr sgkey_t xAOD::TVirtualEvent::DEFAULT_KEY = ~static_cast<sgkey_t>(0) |
|
staticconstexprinherited |
Key for retrieving the "default" object of a given type.
Definition at line 41 of file TVirtualEvent.h.
◆ EVENT_TREE_NAME
◆ KEY_MASK
Mask for the keys, used mostly internally.
Definition at line 43 of file TVirtualEvent.h.
◆ m_auxItemList
std::unordered_map< std::string, std::set< std::string > > xAOD::TEvent::m_auxItemList |
|
protectedinherited |
◆ m_auxMode
◆ m_branchesMutex
|
mutableprotectedinherited |
◆ m_entry
::Long64_t xAOD::TEvent::m_entry |
|
protectedinherited |
◆ m_inChain
::TChain* xAOD::TEvent::m_inChain |
|
protectedinherited |
◆ m_inChainTracker
◆ m_inMetaTree
::TTree* xAOD::TEvent::m_inMetaTree |
|
protectedinherited |
◆ m_inputEventFormat
◆ m_inputMetaObjects
Object_t xAOD::TEvent::m_inputMetaObjects |
|
protectedinherited |
◆ m_inputMissingObjects
std::set< std::string > xAOD::TEvent::m_inputMissingObjects |
|
protectedinherited |
◆ m_inputObjects
◆ m_inTree
::TTree* xAOD::TEvent::m_inTree |
|
protectedinherited |
◆ m_inTreeMissing
::Bool_t xAOD::TEvent::m_inTreeMissing |
|
protectedinherited |
◆ m_inTreeNumber
::Int_t xAOD::TEvent::m_inTreeNumber |
|
protectedinherited |
◆ m_listeners
◆ m_nameRemapping
std::unordered_map< std::string, std::string > xAOD::TEvent::m_nameRemapping |
|
protectedinherited |
◆ m_outputEventFormat
◆ m_outputMetaObjects
Object_t xAOD::TEvent::m_outputMetaObjects |
|
protectedinherited |
◆ m_outputObjects
◆ m_outTree
::TTree* xAOD::TEvent::m_outTree |
|
protectedinherited |
◆ m_printEventProxyWarnings
Bool_t xAOD::TEvent::m_printEventProxyWarnings = true |
|
protectedinherited |
◆ METADATA_TREE_NAME
The documentation for this class was generated from the following files:
::Int_t m_inTreeNumber
The number of the currently open tree in the input chain.
JetConstituentVector::iterator iterator
std::unordered_map< std::string, std::string > m_nameRemapping
Container name re-mapping rules.
@ AUXELEMENT
A type inheriting from SG::AuxElement.
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
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.
virtual AuxStoreType getStoreType() const =0
Return the type of the store 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.
std::string find(const std::string &s)
return a remapped string
ReadStats & stats()
Access the object belonging to the current thread.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
@ SILENT
don't print anything and return success
static void setEvent(TVirtualEvent *ptr)
Set the active event pointer.
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Base class for elements of a container that can have aux data.
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
@ DATAVECTOR
A DataVector container.
@ kAthenaAccess
Access containers/objects like Athena does.
::TTree * m_outTree
The tree that we are writing to.
::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.
void Print(::Option_t *option="") const
Print information about the collected statistics.
EStructMode
"Structural" modes of the object
Object_t m_inputObjects
Collection of all the managed input objects.
static IProxyDict * setStore(IProxyDict *store)
Set the current store.
static TStore * store()
Access the currently active TStore object.
BranchStats * container(const std::string &name)
Access the description of a container. Creating it if necessary.
StatusCode copy(const std::string &key, ::Int_t basketSize=32000, ::Int_t splitLevel=0)
Copy an object directly from the input to the output.
std::vector< size_t > vec
@ 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.
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.
@ kObjectStore
The object describes a single object.
@ kContainerStore
The object describes an entire container.
Manage index tracking and synchronization of auxiliary data.
::TTree * m_inMetaTree
Pointer to the metadata tree in the input file.
Interface providing I/O for a generic auxiliary store.
std::string dynBranchPrefix(const std::string &key)
This function is used to figure out what to name dynamic auxiliary branches coming from a container c...
void nextEvent()
Function incrementing the processed event counter.
Handle mappings between names and auxid_t.
size_t auxid_t
Identifier for a particular aux data item.
Bool_t m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
bit_t size() const
Count the number of 1 bits in the set.
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.
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
::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.
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
::Bool_t isStandalone(const TObjectManager &mgr)
Function checking if an object is standalone (not a container)
virtual SG::auxid_set_t getSelectedAuxIDs() const
Get a list of dynamic variables that need to be written out.
void reset()
Reset the object.
void setBranchNum(::Int_t num)
Set the total number of branches on the input.
EventFormat m_inputEventFormat
Format of the current input file.
bool empty() const
Return true if there are no 1 bits in the set.
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.
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
static IOStats & instance()
Singleton object accessor.
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.
Object_t m_outputObjects
Collection of all the managed output object.
Object_t m_inputMetaObjects
Collection of all the managed input meta-objects.
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.
void setProxy(SG::DataProxy &proxy)
void print(char *figname, TCanvas *c1)
void keys(std::vector< std::string > &vkeys, bool metadata=false) const
provide list of all keys associated with provided type.
upgrade_mutex_t m_branchesMutex
Class helping in dealing with dynamic branch selection.
static const char *const METADATA_TREE_NAME
Name of the metadata tree.
::Bool_t internalStateChanged() const
Check whether there was an internal state change without us knowing.
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
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.
::Bool_t m_inTreeMissing
Internal status flag showing that an input file is open, but it doesn't contain an event tree.
void readContainer(const std::string &name)
Function incrementing the read counter on a specific container.
StatusCode initStats()
Function to initialise the statistics for all Tree content.
Manager for EDM objects created by ROOT.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
::Bool_t transientContains(const std::string &key) const
Function checking if an object is already in memory.
::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.
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.
::Long64_t getFiles() const
Get how many files are available on the currently defined input.
Exception to signal a malformed class name.
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.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
::Bool_t hasAuxStore(const TObjectManager &mgr)
Function checking if a given object may have an auxiliary store.
std::string getFirstBranchMatch(TTree *tree, const std::string &pre)
This function is used to search for a branch in a TTree that contains a given substring.
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.
EventFormat_v1 EventFormat
Definition of the current event format version.
void setSGKey(sgkey_t sgkey)
check if it is a transient ID (primary or symLinked):
::Long64_t m_entry
The entry to look at from the input tree.
TChainStateTracker * m_inChainTracker
Optional object for tracking the state changes of an input TChain.
@ kUndefinedStore
The structure mode is not defined.
StatusCode readFrom(::TFile *file, Bool_t useTreeCache=kTRUE, const char *treeName=EVENT_TREE_NAME)
Connect the object to a new input file.
A set of aux data identifiers.
std::unordered_map< std::string, TVirtualManager * > Object_t
Definition of the internal data structure type.
@ kBranchAccess
Access auxiliary data branch-by-branch.
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
Class describing the access statistics of a collection of branches.
Interface for const operations on an auxiliary store.
void setActive() const
Set this event object as the currently active one.
@ AST_ObjectStore
The store describes a single object.
Interface for objects taking part in direct ROOT I/O.
SG::sgkey_t hash(const std::string &name)
This function provides a hashed version of the key (branch) names used in the xAOD file,...
StatusCode connectMetaBranch(const std::string &key, ::Bool_t silent=kFALSE)
Function setting up access to a branch in the metadata tree.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
char rootType(char typeidType)
This function is used internally in the code when creating primitive dynamic auxiliary branches.
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.