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-2025 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
26namespace xAOD {
27
28 namespace Utils {
29
31 SG::sgkey_t hash( const std::string& key );
32
35 std::string dynBranchPrefix( const std::string& key );
36
39 std::string dynFieldPrefix( const std::string& key );
40
42 const std::type_info& getTypeInfo( EDataType type );
43
45 const std::type_info& getTypeInfo( std::string_view typeName );
46
48 bool isPrimitiveType( std::string_view typeName );
49
51 char rootType( char typeidType );
52
54 std::string getTypeName( const std::type_info& ti );
55
57 std::string getFirstBranchMatch( TTree* tree, const std::string& pre );
58
59 } // namespace Utils
60
61} // namespace xAOD
62
63#endif // XAODROOTACCESS_TOOLS_UTILS_H
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 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