#include <TFile.h>
#include <TObjString.h>
#include "PathResolver/PathResolver.h"
#include "egammaLayerRecalibTool/egammaLayerRecalibTool.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include <iostream>
#include <stdexcept>
#include <cassert>
#include <map>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <limits>
Go to the source code of this file.
|
| std::map< std::string, std::string, std::less<> > | parse (const std::string &list) |
◆ parse()
| std::map< std::string, std::string, std::less<> > parse |
( |
const std::string & | list | ) |
|
Definition at line 1180 of file egammaLayerRecalibTool.cxx.
1181{
1182 std::cout <<
"list: '" <<
list <<
"'" << std::endl;
1183 std::map<std::string, std::string, std::less<>>
result;
1184 TIter
next(TString(list).Tokenize(
","));
1185 while (TObjString* sObj = (TObjString*)
next())
1186 {
1187 const TString& item(sObj->GetString());
1188 std::cout << "item: '" << item << "'" << std::endl;
1189 TObjArray* item_list = TString(item).Tokenize(":");
1192 if (item_list->GetEntries() == 1) {
1194 value =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1195 }
1196 else if (item_list->GetEntries() == 2) {
1197 key =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1198 value =
static_cast<TObjString*
>(item_list->At(1))->GetString().Data();
1199 }
1200 else {
1201 std::cerr << "invalid string " << item << std::endl;
1202 }
1204 std::cerr <<
"trying to insert two times key " <<
key << std::endl;
1205 assert(false);
1206 }
1207 result.insert(std::make_pair(key, value));
1208 }
1210}