CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
24 
47 #ifndef HITFIT_CONSTRAINT_H
48 #define HITFIT_CONSTRAINT_H
49 
50 
51 #include <memory>
52 #include <string>
54 
55 
56 namespace hitfit {
57 
58 
59 class Fourvec_Event;
60 
61 
80 //
81 // Purpose: Represent a mass constraint equation.
82 //
83 {
84 public:
85  // Constructor, destructor. S is the string to parse describing
86  // the constraint.
87 
94 
100  Constraint (const Constraint& c);
101 
102 
107 
108  // Assignment.
114  Constraint& operator= (const Constraint& c);
115 
116  // See if this guy references both labels ILABEL and JLABEL
117  // on a single side of the constraint equation.
118 
131  int has_labels (int ilabel, int jlabel) const;
132 
133  // Evaluate the mass constraint, using the data in EV.
134  // Return m(lhs)^2/2 - m(rhs)^2/2.
143  double sum_mass_terms (const Fourvec_Event& ev) const;
144 
145  // Print this object.
146  friend std::ostream& operator<< (std::ostream& s, const Constraint& c);
147 
148 
149 private:
150  // The two sides of the constraint.
151 
155  std::auto_ptr<Constraint_Intermed> _lhs;
156 
160  std::auto_ptr<Constraint_Intermed> _rhs;
161 };
162 
163 
164 } // namespace hitfit
165 
166 
167 #endif // not HITFIT_CONSTRAINT_H
168 
std::auto_ptr< Constraint_Intermed > _rhs
Definition: Constraint.h:160
Represent a mass constraint equation. Mass constraints come in two varieties, either saying that the ...
Definition: Constraint.h:79
Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented ...
std::auto_ptr< Constraint_Intermed > _lhs
Definition: Constraint.h:155
bool ev
double sum_mass_terms(const Fourvec_Event &ev) const
Definition: Constraint.cc:136
Constraint(std::string s)
Definition: Constraint.cc:85
Constraint & operator=(const Constraint &c)
Definition: Constraint.cc:61
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:162
int has_labels(int ilabel, int jlabel) const
Definition: Constraint.cc:112
Represent one side of a mass constraint equation. Contains the abstract base class Constraint_Interme...