CMS 3D CMS Logo

Constraint.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/private/Constraint.h
4 // Purpose: Represent a mass constraint equation.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // This class represents a mass constraint equation.
8 // Mass constraints come in two varieties, either saying that the sum
9 // of a set of labels should equal a constant:
10 //
11 // (1 + 2) = 80
12 //
13 // or that two such sums should equal each other:
14 //
15 // (1 + 2) = (3 + 4)
16 //
17 // We represent such a constraint equation by two Constraint_Intermed
18 // instances, each of which represents one side of the equation.
19 //
20 // CMSSW File : interface/Constraint.h
21 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
22 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
23 
45 #ifndef HITFIT_CONSTRAINT_H
46 #define HITFIT_CONSTRAINT_H
47 
48 #include <memory>
49 #include <string>
51 
52 namespace hitfit {
53 
54  class Fourvec_Event;
55 
73  class Constraint
74  //
75  // Purpose: Represent a mass constraint equation.
76  //
77  {
78  public:
79  // Constructor, destructor. S is the string to parse describing
80  // the constraint.
81 
88 
94  Constraint(const Constraint& c);
95 
100 
101  // Assignment.
107  Constraint& operator=(const Constraint& c);
108 
109  // See if this guy references both labels ILABEL and JLABEL
110  // on a single side of the constraint equation.
111 
124  int has_labels(int ilabel, int jlabel) const;
125 
126  // Evaluate the mass constraint, using the data in EV.
127  // Return m(lhs)^2/2 - m(rhs)^2/2.
136  double sum_mass_terms(const Fourvec_Event& ev) const;
137 
138  // Print this object.
139  friend std::ostream& operator<<(std::ostream& s, const Constraint& c);
140 
141  private:
142  // The two sides of the constraint.
143 
147  std::unique_ptr<Constraint_Intermed> _lhs;
148 
152  std::unique_ptr<Constraint_Intermed> _rhs;
153  };
154 
155 } // namespace hitfit
156 
157 #endif // not HITFIT_CONSTRAINT_H
Represent a mass constraint equation. Mass constraints come in two varieties, either saying that the ...
Definition: Constraint.h:73
Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented ...
bool ev
double sum_mass_terms(const Fourvec_Event &ev) const
Definition: Constraint.cc:124
std::unique_ptr< Constraint_Intermed > _rhs
Definition: Constraint.h:152
Constraint(std::string s)
Definition: Constraint.cc:77
Constraint & operator=(const Constraint &c)
Definition: Constraint.cc:54
friend std::ostream & operator<<(std::ostream &s, const Constraint &c)
Output stream operator, print the content of this Constraint to an output stream. ...
Definition: Constraint.cc:149
std::unique_ptr< Constraint_Intermed > _lhs
Definition: Constraint.h:147
int has_labels(int ilabel, int jlabel) const
Definition: Constraint.cc:101
Represent one side of a mass constraint equation. Contains the abstract base class Constraint_Interme...