 |
ATLAS Offline Software
|
Go to the documentation of this file.
30 void removeDefaultTemplateParameters( std::string&
name,
31 const std::string& vectorName ) {
34 while( ( vecPos =
name.find( vectorName +
"<", vecPos ) ) !=
38 vecPos += ( vectorName.size() + 1 );
43 size_t commaPos = std::string::npos;
60 if( commaPos != std::string::npos ) {
66 if( commaPos == std::string::npos ) {
72 size_t closingPos = std::string::npos;
88 if( closingPos != std::string::npos ) {
94 if( closingPos == std::string::npos ) {
95 ::Error(
"removeDefaultTemplateParameters",
102 name.erase( commaPos, closingPos - commaPos );
127 static constexpr
SG::sgkey_t MASK = (~static_cast<SG::sgkey_t>(0)) >> 2;
130 static const std::hash< std::string >
helper;
200 return typeid( Char_t );
202 return typeid( UChar_t );
204 return typeid( Short_t );
206 return typeid( UShort_t );
209 return typeid( Int_t );
212 case kDataTypeAliasUnsigned_t:
213 return typeid( UInt_t );
215 return typeid( Long_t );
217 return typeid( ULong_t );
219 return typeid( Float_t );
221 return typeid( Double_t );
223 return typeid( Double32_t );
225 return typeid( Bool_t );
227 return typeid( Long64_t );
229 return typeid( ULong64_t );
231 return typeid( Float16_t );
233 return typeid(
char* );
235 return typeid( void );
237 ::Error(
"xAOD::Utils::getTypeInfo",
239 static_cast< int >(
type ) );
240 return typeid( void );
245 #define TYPE_CHECK_INSTANTIATE(MACRO) \
247 MACRO(std::uint8_t) \
248 MACRO(std::int16_t) \
249 MACRO(std::uint16_t) \
250 MACRO(std::int32_t) \
251 MACRO(std::uint32_t) \
252 MACRO(std::int64_t) \
253 MACRO(std::uint64_t) \
260 #define GETTYPEINFO_SPECIALIZE(TYPE) \
261 if(typeName == #TYPE) { \
262 return typeid(TYPE); \
267 ::Error(
"xAOD::Utils::getTypeInfo",
273 #undef GETTYPEINFO_SPECIALIZE
275 #define ISPRIMITIVETYPE_SPECIALIZE(TYPE) \
276 if(typeName == #TYPE) { \
285 #undef ISPRIMITIVETYPE_SPECIALIZE
286 #undef TYPE_CHECK_INSTANTIATE
298 switch( typeidType ) {
337 Error(
"xAOD::Utils::rootType",
338 XAOD_MESSAGE(
"Received an unknown type: %c" ), typeidType );
361 if( (
result.find(
"DataVector<" ) == std::string::npos ) &&
362 (
result.find(
"std::vector<" ) == std::string::npos ) &&
363 (
result.find(
"std::__1::vector<") == std::string::npos ) ) {
368 removeDefaultTemplateParameters(
result,
"DataVector" );
369 removeDefaultTemplateParameters(
result,
"std::vector" );
370 removeDefaultTemplateParameters(
result,
"std::__1::vector" );
374 while( (
pos =
result.find(
">>" ) ) != std::string::npos ) {
379 while( (
pos =
result.find(
"__1::" ) ) != std::string::npos ) {
395 const std::string& pre ) {
396 const TObjArray * pBranches =
tree->GetListOfBranches();
399 for(
int i = 0, nLast = pBranches->GetLast();
i <= nLast; ++
i ) {
400 const std::string
name = pBranches->At(
i)->GetName();
#define GETTYPEINFO_SPECIALIZE(TYPE)
Macro returning the type info for a given type name.
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.
bool isPrimitiveType(std::string_view typeName)
Check if the type name describes a primitive type.
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...
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
Helper for emitting error messages.
#define ISPRIMITIVETYPE_SPECIALIZE(TYPE)
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
const std::type_info & getTypeInfo(EDataType type)
This function is used when reading a primitive branch from an input file without the user explicitly ...
#define TYPE_CHECK_INSTANTIATE(MACRO)
Macro instantiating another macro for all usual "primitive" types.
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.
Error
The different types of error that can be flagged in the L1TopoRDO.
SG::sgkey_t hash(const std::string &name)
This function provides a hashed version of the key (branch) names used in the xAOD file,...
char rootType(char typeidType)
This function is used internally in the code when creating primitive dynamic auxiliary branches.