ATLAS Offline Software
Loading...
Searching...
No Matches
Control/xAODRootAccess/xAODRootAccess/tools/Utils.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODROOTACCESS_TOOLS_UTILS_H
8#define XAODROOTACCESS_TOOLS_UTILS_H
9
10// Framework include(s).
11#include "SGCore/sgkey_t.h"
12
13// ROOT include(s):
14#include <TDataType.h>
15#include <TTree.h>
16
17// System include(s):
18#include <string>
19#include <string_view>
20#include <typeinfo>
21#include <stdexcept>
22extern "C" {
23#include <stdint.h>
24}
25
26// Forward declaration(s):
27namespace ROOT {
28 class RNTupleDescriptor;
29}
30
31namespace xAOD {
32
33 namespace Utils {
34
36 SG::sgkey_t hash( const std::string& key );
37
40 std::string dynBranchPrefix( const std::string& key );
41
44 std::string dynFieldPrefix( const std::string& key );
45
47 const std::type_info& getTypeInfo( EDataType type );
48
50 const std::type_info& getTypeInfo( std::string_view typeName );
51
53 bool isPrimitiveType( std::string_view typeName );
54
56 char rootType( char typeidType );
57
59 std::string getTypeName( const std::type_info& ti );
60
62 std::string getFirstBranchMatch( TTree* tree, const std::string& pre );
63
65 std::string getFieldName( const ROOT::RNTupleDescriptor& descriptor,
66 const std::string& key );
67
68 } // namespace Utils
69
70} // namespace xAOD
71
72#endif // XAODROOTACCESS_TOOLS_UTILS_H
Selection rules: declare transient members.
Definition DataVector.h:583
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
const std::type_info & getTypeInfo(EDataType type)
This function is used when reading a primitive branch from an input file without the user explicitly ...
SG::sgkey_t hash(const std::string &name)
This function provides a hashed version of the key (branch) names used in the xAOD file,...
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...
char rootType(char typeidType)
This function is used internally in the code when creating primitive dynamic auxiliary branches.
std::string getFieldName(const ROOT::RNTupleDescriptor &descriptor, const std::string &key)
This function is used to find the name of the field in an RNTuple that stores the object with a given...
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.
bool isPrimitiveType(std::string_view typeName)
Check if the type name describes a primitive type.
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
std::string dynFieldPrefix(const std::string &key)
This function is used to figure out what to name dynamic auxiliary field coming from a container call...
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TChain * tree