#include <DecayParser.h>
|
PyObject * | m_parseFct |
| python function to parse the input string modeling the decay pattern to look for. More...
|
|
std::vector< McUtils::Strings > | m_parents |
| List of parents : each slot of the vector is a list of candidates So one could have something like : [ ["22","23"] ] to model a decay of a gamma or a Z0. More...
|
|
std::vector< McUtils::Strings > | m_children |
| List of children : each slot of the vector is a list of candidates So one could have something like : [ ["11","13"], ["-11","-13" ] ] to model a decay into a pair of electrons or muons. More...
|
|
Definition at line 33 of file DecayParser.h.
◆ DecayParser() [1/3]
DecayParser::DecayParser |
( |
const std::string & |
cmd | ) |
|
Constructor with parameters:
Public methods:
Constructors
Definition at line 39 of file DecayParser.cxx.
◆ ~DecayParser()
DecayParser::~DecayParser |
( |
| ) |
|
|
virtual |
◆ DecayParser() [2/3]
DecayParser::DecayParser |
( |
| ) |
|
|
protected |
◆ DecayParser() [3/3]
◆ dump()
void DecayParser::dump |
( |
| ) |
const |
Const methods:
Definition at line 59 of file DecayParser.cxx.
61 std::cout <<
"--- Parents ---" << std::endl;
64 std::cout <<
"--- Children ---" << std::endl;
◆ getChildren()
◆ getParents()
◆ operator=()
Assignment operator:
Definition at line 218 of file DecayParser.cxx.
220 if (
this != &rhs ) {
◆ parse()
void DecayParser::parse |
( |
const std::string & |
cmd | ) |
|
Non-const methods:
Definition at line 80 of file DecayParser.cxx.
82 if ( inputCmd.empty() ) {
98 std::string
error =
"problem while parsing command [" + inputCmd +
"]";
99 throw std::runtime_error (
error);
102 if (!PyTuple_Check (
res)) {
104 std::string
error =
"expected a python tuple";
105 throw std::runtime_error (
error);
108 if (PyTuple_GET_SIZE (
res) != 3) {
110 std::string
error =
"expected a python tuple of size 3";
111 throw std::runtime_error (
error);
116 #if PY_MAJOR_VERSION < 3
117 if (!
sc || !PyInt_Check (
sc)) {
119 if (!
sc || !PyLong_Check (
sc)) {
123 std::string
error =
"corrupted return code";
124 throw std::runtime_error (
error);
127 #if PY_MAJOR_VERSION < 3
128 Py_ssize_t
status = PyInt_AsSsize_t (
sc);
130 Py_ssize_t
status = PyLong_AsSsize_t (
sc);
135 std::string
error =
"failed to parse command ["+inputCmd+
"]";
136 throw std::runtime_error (
error);
144 std::string
error =
"corrupted parents' list";
145 throw std::runtime_error (
error);
153 std::string
error =
"corrupted children' list";
154 throw std::runtime_error (
error);
169 std::string
error =
"could not translate parents' list";
170 throw std::runtime_error (
error);
176 std::string
error =
"could not translate children' list";
177 throw std::runtime_error (
error);
◆ pdgId()
int DecayParser::pdgId |
( |
const std::string & |
pdgIdString | ) |
const |
Definition at line 68 of file DecayParser.cxx.
72 std::stringstream( pdgIdString ) >> iPDG;
◆ printMcUtilsStrings()
Print the content of a vector of McUtils::Strings to std::cout.
Protected methods:
Definition at line 190 of file DecayParser.cxx.
192 unsigned int iSlot = 0;
193 for( std::vector<McUtils::Strings>::const_iterator itr =
list.begin();
196 std::stringstream iSlotStr;
198 const McUtils::Strings::const_iterator candEnd = itr->end();
199 std::cout <<
"slot #" << iSlotStr.str() <<
": candidates= [ ";
200 for( McUtils::Strings::const_iterator candidate = itr->begin();
201 candidate != candEnd;
203 std::cout << *candidate;
204 if ( candidate+1 != candEnd ) {
208 std::cout <<
" ]" << std::endl;
◆ m_children
List of children : each slot of the vector is a list of candidates So one could have something like : [ ["11","13"], ["-11","-13" ] ] to model a decay into a pair of electrons or muons.
Definition at line 105 of file DecayParser.h.
◆ m_parents
List of parents : each slot of the vector is a list of candidates So one could have something like : [ ["22","23"] ] to model a decay of a gamma or a Z0.
Definition at line 99 of file DecayParser.h.
◆ m_parseFct
python function to parse the input string modeling the decay pattern to look for.
Definition at line 93 of file DecayParser.h.
The documentation for this class was generated from the following files: