ATLAS Offline Software
Functions
ElRecomFileHelpers Namespace Reference

Functions

std::string convertToOneKey (const std::string &recokey, const std::string &idkey, const std::string &isokey, const std::string &trigkey)
 
std::string getValueByKey (const std::string &mapFile, const std::string &key)
 

Function Documentation

◆ convertToOneKey()

std::string ElRecomFileHelpers::convertToOneKey ( const std::string &  recokey,
const std::string &  idkey,
const std::string &  isokey,
const std::string &  trigkey 
)

Definition at line 38 of file ElRecomFileHelpers.cxx.

42 {
43 
44  std::string key;
45  // Reconstruction Key
46  if (!recokey.empty()) {
47  key = recokey;
48  }
49  // Identification Key
50  if (!idkey.empty() &&
51  (recokey.empty() && isokey.empty() && trigkey.empty())) {
52  key = idkey;
53  }
54  // Isolation Key
55  if ((!idkey.empty() && !isokey.empty()) && recokey.empty() &&
56  trigkey.empty()) {
57  key = std::string(idkey + "_" + isokey);
58  }
59  // Trigger Key
60  if (!trigkey.empty() && !idkey.empty()) {
61  // Trigger SF file with isolation
62  if (!isokey.empty()) {
63  key = std::string(trigkey + "_" + idkey + "_" + isokey);
64  } else {
65  // Trigger SF file without isolation
66  key = std::string(trigkey + "_" + idkey);
67  }
68  }
69  return key;
70 }

◆ getValueByKey()

std::string ElRecomFileHelpers::getValueByKey ( const std::string &  mapFile,
const std::string &  key 
)

Definition at line 75 of file ElRecomFileHelpers.cxx.

77 {
78  std::map<std::string, std::string> fileTomap = read(file);
79  if (fileTomap.empty()) {
80  return {};
81  }
82 
83  auto i = fileTomap.find(key);
84  if (i != fileTomap.end()) {
85  return i->second;
86  }
87  return {};
88 }
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
lumiFormat.i
int i
Definition: lumiFormat.py:92
file
TFile * file
Definition: tile_monitor.h:29
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37