ATLAS Offline Software
transientKey.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
4  */
27 #include <string>
28 
29 
30 #ifndef SGTOOLS_TRANSIENTKEY_H
31 #define SGTOOLS_TRANSIENTKEY_H
32 
33 
34 namespace SG {
35 
36 
41 bool isTransientKey (const std::string& key)
42 {
43  return !key.empty() && key[0] == '_';
44 }
45 
46 
51 std::string transientKey (const std::string& key)
52 {
53  if (isTransientKey (key)) {
54  return key;
55  }
56  return "_" + key;
57 }
58 
59 
60 
61 } // namespace SG
62 
63 
64 #endif // not SGTOOLS_TRANSIENTKEY_H
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::isTransientKey
bool isTransientKey(const std::string &key)
Test to see if a key is transoent.
Definition: transientKey.h:41
SG::transientKey
std::string transientKey(const std::string &key)
Make a key transient.
Definition: transientKey.h:51
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37