Do a kinematic fit for a set of four-momenta, given a set of mass constraints. More...
#include <Fourvec_Constrainer.h>
Public Member Functions | |
void | add_constraint (std::string s) |
Specify an additional constraint s for the problem. The format for s is described in the class description. More... | |
double | constrain (Fourvec_Event &ev, double &m, double &sigm, Column_Vector &pullx, Column_Vector &pully) |
Do a constrained fit for event ev. Returns the requested mass and its uncertainty in m and sigm, and the pull quantities in pullx and pully. Returns the , the value will be negative if the fit failed to converge. More... | |
Fourvec_Constrainer (const Fourvec_Constrainer_Args &args) | |
Constructor. More... | |
void | mass_constraint (std::string s) |
Specify a combination of objects that will be returned by the constrain() method as mass. The format of s is the same as for normal constraints. The left-hand side specifies the mass to calculate, the right-hand side should be zero. This combination of objects will be called only once. More... | |
Private Attributes | |
const Fourvec_Constrainer_Args | _args |
std::vector< Constraint > | _constraints |
std::vector< Constraint > | _mass_constraint |
Friends | |
std::ostream & | operator<< (std::ostream &s, const Fourvec_Constrainer &c) |
Output stream operator, print the content of this Fourvec_Constrainer to an output stream. More... | |
Do a kinematic fit for a set of four-momenta, given a set of mass constraints.
The input is in a Fourvec_Event instance. This consists of a collection of objects, each of which has a four-momentum, an uncertainty on the four-momentum, and an integer label.
There are also a set of mass constraints, based on sums of objects with specified labels. A constraint can either require that the invariant mass of a set of objects is constant, or that the mass of two sets of objects be equal to each other. For example, the constraint
says that the sum of all objects with labels 1 and 2 should have a mass of 80, where the unit of mass is always in GeV. And the constraint
says that the sum of all objects with labels 1 and 2 should have an invariant mass equal as the invariant mass of the sum of all objects with label 3 and 4.
All the objects are fixed to constant masses for the fit. These masses are attributes of the objects in the Fourvec_Event. This is done by scaling either the four-momentum's three-momentum or energy, depending on the setting of the use_e parameter.
If there is no neutrino present in the event, two additional constraints are automatically added for total balance, unless the parameter ignore_met has been set to TRUE.
When the fit completes, this object can compute an invariant mass out of some combination of the objects, including and uncertainty. The particular combination is specified through the method mass_constraint((); it gets a constraint string like normal with the LHS of the constraint i s the mass which will be calculater, and the RHS of the oncstrant should be zero.
Definition at line 220 of file Fourvec_Constrainer.h.
hitfit::Fourvec_Constrainer::Fourvec_Constrainer | ( | const Fourvec_Constrainer_Args & | args | ) |
Constructor.
args | Parameter settings for this instance. |
Definition at line 174 of file Fourvec_Constrainer.cc.
void hitfit::Fourvec_Constrainer::add_constraint | ( | std::string | s | ) |
Specify an additional constraint s for the problem. The format for s is described in the class description.
s | The constraint to add. |
Definition at line 183 of file Fourvec_Constrainer.cc.
References _constraints, and alignCSCRings::s.
Referenced by hitfit::Constrained_Top::Constrained_Top(), and hitfit::Constrained_Z::Constrained_Z().
double hitfit::Fourvec_Constrainer::constrain | ( | Fourvec_Event & | ev, |
double & | m, | ||
double & | sigm, | ||
Column_Vector & | pullx, | ||
Column_Vector & | pully | ||
) |
Do a constrained fit for event ev. Returns the requested mass and its uncertainty in m and sigm, and the pull quantities in pullx and pully. Returns the , the value will be negative if the fit failed to converge.
ev | The event to be fitted (input), and later after fitting (output). |
m | The requested invariant mass to calculate. |
sigm | The uncertainty in the requested invariant mass. |
pullx | Pull quantities for well-measured variables. |
pully | Pull quantities for poorly-measured variables. |
Definition at line 1612 of file Fourvec_Constrainer.cc.
References _args, _constraints, _mass_constraint, hitfit::Fourvec_Constrainer_Args::chisq_constrainer_args(), ev, hitfit::Fourvec_Constrainer_Args::ignore_met(), visualization-live-secondInstance_cfg::m, class-composition::Q, dttmaxenums::R, S(), hitfit::Fourvec_Constrainer_Args::use_e(), and DOFs::Y.
Referenced by hitfit::Constrained_Z::constrain(), and hitfit::Constrained_Top::constrain().
void hitfit::Fourvec_Constrainer::mass_constraint | ( | std::string | s | ) |
Specify a combination of objects that will be returned by the constrain() method as mass. The format of s is the same as for normal constraints. The left-hand side specifies the mass to calculate, the right-hand side should be zero. This combination of objects will be called only once.
s | The constraint defining the mass. |
Definition at line 195 of file Fourvec_Constrainer.cc.
References _mass_constraint, cms::cuda::assert(), and alignCSCRings::s.
Referenced by hitfit::Constrained_Top::Constrained_Top().
|
friend |
Output stream operator, print the content of this Fourvec_Constrainer to an output stream.
s | The output stream to which to write. |
c | The instance of Fourvec_Constrainer to be printed. |
Definition at line 220 of file Fourvec_Constrainer.cc.
|
private |
Parameter settings for this instance.
Definition at line 306 of file Fourvec_Constrainer.h.
Referenced by constrain().
|
private |
The constraints for this problem.
Definition at line 312 of file Fourvec_Constrainer.h.
Referenced by add_constraint(), and constrain().
|
private |
The constraint giving the mass to be calculated. This should have no more than one entry.
Definition at line 320 of file Fourvec_Constrainer.h.
Referenced by constrain(), and mass_constraint().