#include <iostream>
#include <exception>
#include <cassert>
#include <string>
#include <map>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <TFile.h>
#include <TObjString.h>
#include "PathResolver/PathResolver.h"
#include "egammaLayerRecalibTool/egammaLayerRecalibTool.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
Go to the source code of this file.
|
| std::map< std::string, std::string > | parse (const std::string &list) |
◆ parse()
| std::map< std::string, std::string > parse |
( |
const std::string & | list | ) |
|
Definition at line 1113 of file egammaLayerRecalibTool.cxx.
1114{
1115 std::cout <<
"list: '" <<
list <<
"'" << std::endl;
1116 std::map<std::string, std::string>
result;
1117 TIter
next(TString(list).Tokenize(
","));
1118 while (TObjString* sObj = (TObjString*)
next())
1119 {
1120 const TString&
item(sObj->GetString());
1121 std::cout <<
"item: '" <<
item <<
"'" << std::endl;
1122 TObjArray* item_list = TString(item).Tokenize(":");
1125 if (item_list->GetEntries() == 1) {
1127 value =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1128 }
1129 else if (item_list->GetEntries() == 2) {
1130 key =
static_cast<TObjString*
>(item_list->At(0))->GetString().Data();
1131 value =
static_cast<TObjString*
>(item_list->At(1))->GetString().Data();
1132 }
1133 else {
1134 std::cerr <<
"invalid string " <<
item << std::endl;
1135 }
1137 std::cerr <<
"trying to insert two times key " <<
key << std::endl;
1138 assert(false);
1139 }
1140 result.insert(std::make_pair(key, value));
1141 }
1143}