Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 1080 of file egammaLayerRecalibTool.cxx.

1081 {
1082  std::cout << "list: '" << list << "'" << std::endl;
1083  std::map<std::string, std::string> result;
1084  TIter next(TString(list).Tokenize(","));
1085  while (TObjString* sObj = (TObjString*) next())
1086  {
1087  const TString& item(sObj->GetString());
1088  std::cout << "item: '" << item << "'" << std::endl;
1089  TObjArray* item_list = TString(item).Tokenize(":");
1090  std::string key;
1091  std::string value;
1092  if (item_list->GetEntries() == 1) {
1093  key = "amount";
1094  value = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1095  }
1096  else if (item_list->GetEntries() == 2) {
1097  key = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1098  value = static_cast<TObjString*>(item_list->At(1))->GetString().Data();
1099  }
1100  else {
1101  std::cerr << "invalid string " << item << std::endl;
1102  }
1103  if (result.find(key) != result.end()) {
1104  std::cerr << "trying to insert two times key " << key << std::endl;
1105  assert(false);
1106  }
1107  result.insert(std::make_pair(key, value));
1108  }
1109  return result;
1110 }
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