ATLAS Offline Software
Functions
egammaLayerRecalibTool.cxx File Reference
#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.

Functions

std::map< std::string, std::string > parse (const std::string &list)
 

Function Documentation

◆ parse()

std::map<std::string, std::string> parse ( const std::string &  list)

Definition at line 1082 of file egammaLayerRecalibTool.cxx.

1083 {
1084  std::cout << "list: '" << list << "'" << std::endl;
1085  std::map<std::string, std::string> result;
1086  TIter next(TString(list).Tokenize(","));
1087  while (TObjString* sObj = (TObjString*) next())
1088  {
1089  const TString& item(sObj->GetString());
1090  std::cout << "item: '" << item << "'" << std::endl;
1091  TObjArray* item_list = TString(item).Tokenize(":");
1092  std::string key;
1093  std::string value;
1094  if (item_list->GetEntries() == 1) {
1095  key = "amount";
1096  value = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1097  }
1098  else if (item_list->GetEntries() == 2) {
1099  key = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1100  value = static_cast<TObjString*>(item_list->At(1))->GetString().Data();
1101  }
1102  else {
1103  std::cerr << "invalid string " << item << std::endl;
1104  }
1105  if (result.find(key) != result.end()) {
1106  std::cerr << "trying to insert two times key " << key << std::endl;
1107  assert(false);
1108  }
1109  result.insert(std::make_pair(key, value));
1110  }
1111  return result;
1112 }
get_generator_info.result
result
Definition: get_generator_info.py:21
athena.value
value
Definition: athena.py:124
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
pool::Tokenize
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
item
Definition: ItemListSvc.h:43
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37