File indexing completed on 2024-04-06 12:01:02
0001 #ifndef CANDCOMBINER_DECAYPARSER_H
0002 #define CANDCOMBINER_DECAYPARSER_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include <vector>
0026 #include <iostream>
0027 #include <string>
0028 #include "FWCore/Utilities/interface/InputTag.h"
0029
0030
0031
0032 namespace cand {
0033 namespace parser {
0034 struct ConjInfo {
0035 enum Mode { kPrimary, kBar, kPlus, kMinus } mode_;
0036 edm::InputTag tag_;
0037 ConjInfo(const std::string& tag) : mode_(kPrimary), tag_(tag) {}
0038 ConjInfo(const char* begin, const char* end) : mode_(kPrimary), tag_(std::string(begin, end)) {}
0039 };
0040
0041 inline std::ostream& operator<<(std::ostream& out, const ConjInfo& info) {
0042 return out << info.tag_.encode() << " "
0043 << (0 == info.mode_
0044 ? "p"
0045 : (info.mode_ == ConjInfo::kBar ? "b" : (info.mode_ == ConjInfo::kPlus ? "+" : "-")));
0046 }
0047
0048 bool decayParser(const std::string& iValue, std::vector<ConjInfo>& oStrings);
0049 }
0050 }
0051
0052 #endif