File indexing completed on 2024-04-06 12:02:17
0001 #include "CondFormats/HLTObjects/interface/AlCaRecoTriggerBits.h"
0002
0003 AlCaRecoTriggerBits::AlCaRecoTriggerBits() {}
0004 AlCaRecoTriggerBits::~AlCaRecoTriggerBits() {}
0005
0006 const std::string::value_type AlCaRecoTriggerBits::delimeter_ = ';';
0007
0008
0009 std::string AlCaRecoTriggerBits::compose(const std::vector<std::string> &paths) const {
0010 std::string mergedPaths;
0011 for (std::vector<std::string>::const_iterator iPath = paths.begin(); iPath != paths.end(); ++iPath) {
0012 if (iPath != paths.begin())
0013 mergedPaths += delimeter_;
0014 if (iPath->find(delimeter_) != std::string::npos) {
0015
0016
0017 }
0018 mergedPaths += *iPath;
0019 }
0020
0021
0022
0023
0024 if (mergedPaths.empty())
0025 mergedPaths = delimeter_;
0026
0027 return mergedPaths;
0028 }
0029
0030
0031 std::vector<std::string> AlCaRecoTriggerBits::decompose(const std::string &s) const {
0032
0033
0034
0035
0036 std::vector<std::string> result;
0037 if (!(s.size() == 1 && s[0] == delimeter_)) {
0038
0039 std::string::size_type previousPos = 0;
0040 while (true) {
0041 const std::string::size_type delimiterPos = s.find(delimeter_, previousPos);
0042 if (delimiterPos == std::string::npos) {
0043 result.push_back(s.substr(previousPos));
0044 break;
0045 }
0046 result.push_back(s.substr(previousPos, delimiterPos - previousPos));
0047 previousPos = delimiterPos + 1;
0048 }
0049 }
0050
0051 return result;
0052 }