ATLAS Offline Software
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-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: Utils.h 601421 2014-06-12 11:44:08Z krasznaa $
8 #ifndef XAODROOTACCESS_TOOLS_UTILS_H
9 #define XAODROOTACCESS_TOOLS_UTILS_H
10 
11 // System include(s):
12 #include <string>
13 #include <typeinfo>
14 #include <stdexcept>
15 extern "C" {
16 #include <stdint.h>
17 }
18 
19 // ROOT include(s):
20 #include <TDataType.h>
21 #include <TTree.h>
22 // #include <xAODMetaData/FileMetaDataAuxInfo.h>
23 // #include "AthContainers/AuxElement.h"
24 
25 
26 #include <ROOT/RNTupleReader.hxx>
27 
28 #include "CxxUtils/sgkey_t.h"
29 
30 namespace xAOD {
31 
32  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  char rootType( char typeidType );
51 
53  std::string getTypeName( const std::type_info& ti );
54 
56  std::string getFirstBranchMatch( TTree* tree, const std::string& pre );
57 
59  std::string getFirstFieldMatch(
60  RNTupleReader& nupleReader,
61  const std::string& pre );
62 
64  ::Bool_t fieldExists(
65  std::string fieldName,
66  RNTupleReader& ntupleReader );
67 
68  } // namespace Utils
69 
70 } // namespace xAOD
71 
72 #endif // XAODROOTACCESS_TOOLS_UTILS_H
tree
TChain * tree
Definition: tile_monitor.h:30
xAOD::Utils::dynFieldPrefix
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...
Definition: Control/xAODRootAccess/Root/Utils.cxx:170
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::Utils::dynBranchPrefix
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...
Definition: Control/xAODRootAccess/Root/Utils.cxx:144
xAOD::Utils::getFirstFieldMatch
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.
Definition: Control/xAODRootAccess/Root/Utils.cxx:375
xAOD::Utils::getTypeName
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
Definition: Control/xAODRootAccess/Root/Utils.cxx:310
taskman.fieldName
fieldName
Definition: taskman.py:492
xAOD::Utils::fieldExists
::Bool_t fieldExists(std::string fieldName, RNTupleReader &ntupleReader)
This function is used to check if a field exists in an RNTupleReader.
Definition: Control/xAODRootAccess/Root/Utils.cxx:403
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
xAOD::Utils::getTypeInfo
const std::type_info & getTypeInfo(EDataType type)
This function is used when reading a primitive branch from an input file without the user explicitly ...
Definition: Control/xAODRootAccess/Root/Utils.cxx:194
sgkey_t.h
Define the type used for hashed StoreGate key+CLID pairs.
xAOD::Utils::getFirstBranchMatch
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.
Definition: Control/xAODRootAccess/Root/Utils.cxx:350
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Utils
Definition: CaloCellSelectorUtils.cxx:10
xAOD::Utils::hash
SG::sgkey_t hash(const std::string &name)
This function provides a hashed version of the key (branch) names used in the xAOD file,...
Definition: Control/xAODRootAccess/Root/Utils.cxx:125
xAOD::Utils::rootType
char rootType(char typeidType)
This function is used internally in the code when creating primitive dynamic auxiliary branches.
Definition: Control/xAODRootAccess/Root/Utils.cxx:251
xAOD::Utils::RNTupleReader
ROOT::Experimental::RNTupleReader RNTupleReader
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Utils.h:33
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37