![]() |
ATLAS Offline Software
|
Typedefs | |
using | RNTupleReader = ROOT::Experimental::RNTupleReader |
Functions | |
SG::sgkey_t | hash (const std::string &name) |
This function provides a hashed version of the key (branch) names used in the xAOD file, similar to how Athena saves hashed numbers in persistent ElementLinks. More... | |
std::string | dynBranchPrefix (const std::string &key) |
This function is used to figure out what to name dynamic auxiliary branches coming from a container called key . More... | |
std::string | dynFieldPrefix (const std::string &key) |
This function is used to figure out what to name dynamic auxiliary field coming from a container called key . More... | |
const std::type_info & | getTypeInfo (EDataType type) |
This function is used when reading a primitive branch from an input file without the user explicitly asking for it. More... | |
char | rootType (char typeidType) |
This function is used internally in the code when creating primitive dynamic auxiliary branches. More... | |
std::string | getTypeName (const std::type_info &ti) |
This function is necessary in order to create type names that ROOT can understand. More... | |
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. More... | |
std::string | getFirstFieldMatch (RNTupleReader &ntupleReader, const std::string &pre) |
This function is used to search for a field in an RNTupleReader that contains a given substring. More... | |
::Bool_t | fieldExists (std::string fieldName, RNTupleReader &ntupleReader) |
This function is used to check if a field exists in an RNTupleReader. More... | |
std::string | timeToString (::Double_t secs) |
Function creating a human-readable elapsed time printout. More... | |
std::string | sizeToString (::Long64_t bytes) |
Function for printing data sizes in human-readable format. More... | |
std::string | speedToString (::Double_t bytespersec) |
Function for printing data processing speeds in a human-readable format. More... | |
using xAOD::Utils::RNTupleReader = typedef ROOT::Experimental::RNTupleReader |
Definition at line 33 of file Control/xAODRootAccess/xAODRootAccess/tools/Utils.h.
std::string xAOD::Utils::dynBranchPrefix | ( | const std::string & | key | ) |
This function is used to figure out what to name dynamic auxiliary branches coming from a container called key
.
Get the dynamic auxiliary variable prefix based on a container name (for TTree)
It needs to work in sync with how it is done in the offline code, so will eventually probably end up in another package.
key | The key/branch name of the auxiliary container |
Definition at line 144 of file Control/xAODRootAccess/Root/Utils.cxx.
std::string xAOD::Utils::dynFieldPrefix | ( | const std::string & | key | ) |
This function is used to figure out what to name dynamic auxiliary field coming from a container called key
.
Get the dynamic auxiliary variable prefix based on a container name (for RNTuple)
key | The key/field name of the auxiliary container |
Definition at line 170 of file Control/xAODRootAccess/Root/Utils.cxx.
Bool_t xAOD::Utils::fieldExists | ( | std::string | fieldName, |
RNTupleReader & | ntupleReader | ||
) |
This function is used to check if a field exists in an RNTupleReader.
Checks if a given field exists in the ntuple.
fieldName | The name of the field to check |
ntupleReader | The RNTupleReader to check in |
Definition at line 403 of file Control/xAODRootAccess/Root/Utils.cxx.
std::string xAOD::Utils::getFirstBranchMatch | ( | TTree * | tree, |
const std::string & | pre | ||
) |
This function is used to search for a branch in a TTree that contains a given substring.
Search for branches, returns search term on no result.
It returns the name of the first branch that contains the search term. If no branch is found, the function returns the search term itself.
tree | The TTree to search in |
pre | The search term |
Definition at line 350 of file Control/xAODRootAccess/Root/Utils.cxx.
std::string xAOD::Utils::getFirstFieldMatch | ( | RNTupleReader & | ntupleReader, |
const std::string & | pre | ||
) |
This function is used to search for a field in an RNTupleReader that contains a given substring.
Search for fields, returns search term on no result.
It returns the name of the first field that contains the search term. If no field is found, the function returns the search term itself.
ntupleReader | The RNTupleReader to search in |
pre | The search term |
Definition at line 375 of file Control/xAODRootAccess/Root/Utils.cxx.
const std::type_info & xAOD::Utils::getTypeInfo | ( | EDataType | type | ) |
This function is used when reading a primitive branch from an input file without the user explicitly asking for it.
Get the type info of a primitive variable, as declared by ROOT.
type | The type taken from ROOT |
Definition at line 194 of file Control/xAODRootAccess/Root/Utils.cxx.
std::string xAOD::Utils::getTypeName | ( | const std::type_info & | ti | ) |
This function is necessary in order to create type names that ROOT can understand.
Get the type name as it is known to ROOT, based on std::type_info.
For instance, a type name like std::vector<ElementLink<DataVector<xAOD::IParticle, DataModel_detail::NoBase> >, std::allocator<ElementLink<DataVector<xAOD::IParticle, DataModel_detail::NoBase> > > >
as seen by the compiler, needs to become std::vector<ElementLink<DataVector<xAOD::IParticle> > >
for ROOT to find a dictionary for it.
This function executes the string manipulation necessary to do this.
ti | The type for which we want to find a string type name |
Definition at line 310 of file Control/xAODRootAccess/Root/Utils.cxx.
SG::sgkey_t xAOD::Utils::hash | ( | const std::string & | name | ) |
This function provides a hashed version of the key (branch) names used in the xAOD file, similar to how Athena saves hashed numbers in persistent ElementLinks.
Function creating a hash out of a "key name".
Since Athena uses the top 2 bits in a hashed key to save additional state information about the link, the top 2 bits of the hash are always set to 0.
name | The name that we want to create a unique hash for |
Definition at line 125 of file Control/xAODRootAccess/Root/Utils.cxx.
This function is used internally in the code when creating primitive dynamic auxiliary branches.
Get the character describing a given primitive type for ROOT.
I just took the code from SFrame to be honest...
typeidType | The type name coming from typeid(...).name() |
Definition at line 251 of file Control/xAODRootAccess/Root/Utils.cxx.
std::string xAOD::Utils::sizeToString | ( | ::Long64_t | bytes | ) |
Function for printing data sizes in human-readable format.
This function is used to produce nicely readable printouts for amounts of data.
bytes | The amount of data expressed in bytes |
Definition at line 129 of file Event/xAOD/xAODCore/Root/Utils.cxx.
std::string xAOD::Utils::speedToString | ( | ::Double_t | bytespersec | ) |
Function for printing data processing speeds in a human-readable format.
bytespersec | The speed expressed in bytes / seconds |
Definition at line 151 of file Event/xAOD/xAODCore/Root/Utils.cxx.
std::string xAOD::Utils::timeToString | ( | ::Double_t | secs | ) |
Function creating a human-readable elapsed time printout.
Since I wasn't able to find a nice function printing elapsed times in a human-readable format, I ended up writing one.
This function is used in printing the statistics about an analysis.
secs | An amount of time passed, expressed in seconds |
Definition at line 99 of file Event/xAOD/xAODCore/Root/Utils.cxx.