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 1054 of file egammaLayerRecalibTool.cxx.

1055 {
1056  std::cout << "list: '" << list << "'" << std::endl;
1057  std::map<std::string, std::string> result;
1058  TIter next(TString(list).Tokenize(","));
1059  while (TObjString* sObj = (TObjString*) next())
1060  {
1061  const TString& item(sObj->GetString());
1062  std::cout << "item: '" << item << "'" << std::endl;
1063  TObjArray* item_list = TString(item).Tokenize(":");
1064  std::string key;
1065  std::string value;
1066  if (item_list->GetEntries() == 1) {
1067  key = "amount";
1068  value = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1069  }
1070  else if (item_list->GetEntries() == 2) {
1071  key = static_cast<TObjString*>(item_list->At(0))->GetString().Data();
1072  value = static_cast<TObjString*>(item_list->At(1))->GetString().Data();
1073  }
1074  else {
1075  std::cerr << "invalid string " << item << std::endl;
1076  }
1077  if (result.find(key) != result.end()) {
1078  std::cerr << "trying to insert two times key " << key << std::endl;
1079  assert(false);
1080  }
1081  result.insert(std::make_pair(key, value));
1082  }
1083  return result;
1084 }
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