/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/OfflineValidation/plugins/StyleParser.C
31 строка
948 B
mmusich
code-format & code-checks
04 ноя 2022, 05:42
04 ноя 2022, 05:42
53832d9
Код
Авторство
О чём код?
#include <iostream> #include <map> #include "TROOT.h" #include "TColor.h" #include <cassert> #include <cstdlib> #include "TString.h" using namespace std; static const map<TString, Style_t> stylemap{{"kSolid", kSolid}, {"kDashed", kDashed}, {"kDotted", kDotted}, {"kDashDotted", kDashDotted}, {"kFullSquare", kFullSquare}, {"kFullCircle", kFullCircle}, {"kFullTriangleDown", kFullTriangleDown}}; Style_t StyleParser(TString input) { // 1) remove all space input.ReplaceAll(" ", ""); // 2) if number, then just return it if (input.IsDec()) return input.Atoi(); // 3) if the first char is not a k, then crash assert(input(0) == 'k'); return stylemap.at(input); }