CMS 3D CMS Logo

Classes | Typedefs | Functions
cand::parser Namespace Reference

Classes

struct  ConjInfo
 
class  ModeSetter
 

Typedefs

typedef rule< ScannerUsed_1Rule_1
 
typedef scanner_policies< skip_parser_iteration_policy< nothing_parser, iteration_policy >, match_policy, action_policy > ScannerPolicy
 
typedef scanner< const char *, ScannerPolicyScannerUsed_1
 

Functions

bool decayParser (const std::string &iValue, std::vector< ConjInfo > &oStrings)
 
bool decayParser (const string &iValue, vector< ConjInfo > &oStrings)
 
std::ostream & operator<< (std::ostream &out, const ConjInfo &info)
 

Typedef Documentation

◆ Rule_1

Definition at line 39 of file decayParser.cc.

◆ ScannerPolicy

typedef scanner_policies<skip_parser_iteration_policy<nothing_parser, iteration_policy>, match_policy, action_policy> cand::parser::ScannerPolicy

Definition at line 37 of file decayParser.cc.

◆ ScannerUsed_1

typedef scanner<const char*, ScannerPolicy> cand::parser::ScannerUsed_1

Definition at line 38 of file decayParser.cc.

Function Documentation

◆ decayParser() [1/2]

bool cand::parser::decayParser ( const std::string &  iValue,
std::vector< ConjInfo > &  oStrings 
)

◆ decayParser() [2/2]

bool cand::parser::decayParser ( const string &  iValue,
vector< ConjInfo > &  oStrings 
)

Definition at line 41 of file decayParser.cc.

41  {
42  using namespace boost::spirit;
43 
44  Rule_1 label = ((+alnum_p) >> *ch_p(':') >> *ch_p('_') >> *alnum_p)[push_back_a(oStrings)];
45  Rule_1 conj = (ch_p('@') >> !((ch_p('b') >> ch_p('a') >> ch_p('r')[ModeSetter(oStrings, ConjInfo::kBar)]) |
46  ch_p('+')[ModeSetter(oStrings, ConjInfo::kPlus)] |
47  ch_p('-')[ModeSetter(oStrings, ConjInfo::kMinus)]));
48 
49  return parse(iValue.c_str(), ((label >> !conj) % blank_p), nothing_p).full;
50  }

References full, reco::ParticleMasses::kPlus, label, and dumpparser::parse().

◆ operator<<()

std::ostream& cand::parser::operator<< ( std::ostream &  out,
const ConjInfo info 
)
inline

Definition at line 41 of file decayParser.h.

41  {
42  return out << info.tag_.encode() << " "
43  << (0 == info.mode_
44  ? "p"
45  : (info.mode_ == ConjInfo::kBar ? "b" : (info.mode_ == ConjInfo::kPlus ? "+" : "-")));
46  }

References info(), cand::parser::ConjInfo::kBar, cand::parser::ConjInfo::kPlus, and MillePedeFileConverter_cfg::out.

reco::ParticleMasses::kPlus
const double kPlus
Definition: ParticleMasses.h:8
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
full
Definition: GenABIO.cc:168
cand::parser::Rule_1
rule< ScannerUsed_1 > Rule_1
Definition: decayParser.cc:39
dumpparser.parse
def parse(path, config)
Definition: dumpparser.py:13
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
label
const char * label
Definition: PFTauDecayModeTools.cc:11
boost::spirit
Definition: DDPartSelection.cc:9