Represent a mass constraint equation. Mass constraints come in two varieties, either saying that the sum of a set of labels should equal a constant:
More...
#include <Constraint.h>
Public Member Functions | |
Constraint (std::string s) | |
Constraint (const Constraint &c) | |
int | has_labels (int ilabel, int jlabel) const |
Constraint & | operator= (const Constraint &c) |
double | sum_mass_terms (const Fourvec_Event &ev) const |
~Constraint () | |
Private Attributes | |
std::auto_ptr < Constraint_Intermed > | _lhs |
std::auto_ptr < Constraint_Intermed > | _rhs |
Friends | |
std::ostream & | operator<< (std::ostream &s, const Constraint &c) |
Output stream operator, print the content of this Constraint to an output stream. |
Represent a mass constraint equation. Mass constraints come in two varieties, either saying that the sum of a set of labels should equal a constant:
.
or that two such sums should be equal to each other:
.
We represent such a constraint equation by two Constraint_Intermed instances, each of which represents one side of the equation.
Definition at line 80 of file Constraint.h.
hitfit::Constraint::Constraint | ( | std::string | s | ) |
Constructor.
s | The string to parse describing the constraint. |
Definition at line 86 of file Constraint.cc.
References _lhs, _rhs, i, and hitfit::make_constraint_intermed().
{ // Split it at the equals sign. string::size_type i = s.find ('='); assert (i != string::npos); // And then build the two halves. { auto_ptr<Constraint_Intermed> ci = make_constraint_intermed (s.substr (0, i)); _lhs = ci; } { auto_ptr<Constraint_Intermed> ci = make_constraint_intermed (s.substr (i+1)); _rhs = ci; } }
hitfit::Constraint::Constraint | ( | const Constraint & | c | ) |
hitfit::Constraint::~Constraint | ( | ) | [inline] |
int hitfit::Constraint::has_labels | ( | int | ilabel, |
int | jlabel | ||
) | const |
See if this guy references both labels ilabel and jlabel on a single single side of the constraint equation.
ilabel | The first label to test. |
jlabel | The second label to test. |
Definition at line 113 of file Constraint.cc.
Constraint & hitfit::Constraint::operator= | ( | const Constraint & | c | ) |
double hitfit::Constraint::sum_mass_terms | ( | const Fourvec_Event & | ev | ) | const |
Evaluate the mass constraint, using the data in ev.
ev | The event for which the constraint should be evaluated. |
Definition at line 137 of file Constraint.cc.
std::ostream& operator<< | ( | std::ostream & | s, |
const Constraint & | c | ||
) | [friend] |
Output stream operator, print the content of this Constraint to an output stream.
s | The stream to which to write. |
c | The instance of Constraint to be printed. |
Definition at line 163 of file Constraint.cc.
std::auto_ptr<Constraint_Intermed> hitfit::Constraint::_lhs [private] |
Left hand side of the constraint.
Definition at line 156 of file Constraint.h.
Referenced by Constraint(), hitfit::operator<<(), and operator=().
std::auto_ptr<Constraint_Intermed> hitfit::Constraint::_rhs [private] |
Right hand side of the constraint.
Definition at line 161 of file Constraint.h.
Referenced by Constraint(), hitfit::operator<<(), and operator=().