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 // $Id: Constraint.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/private/Constraint.h
5 // Purpose: Represent a mass constraint equation.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // This class represents a mass constraint equation.
9 // Mass constraints come in two varieties, either saying that the sum
10 // of a set of labels should equal a constant:
11 //
12 // (1 + 2) = 80
13 //
14 // or that two such sums should equal each other:
15 //
16 // (1 + 2) = (3 + 4)
17 //
18 // We represent such a constraint equation by two Constraint_Intermed
19 // instances, each of which represents one side of the equation.
20 //
21 // CMSSW File : interface/Constraint.h
22 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
23 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
24 
25 
48 #ifndef HITFIT_CONSTRAINT_H
49 #define HITFIT_CONSTRAINT_H
50 
51 
52 #include <memory>
53 #include <string>
55 
56 
57 namespace hitfit {
58 
59 
60 class Fourvec_Event;
61 
62 
81 //
82 // Purpose: Represent a mass constraint equation.
83 //
84 {
85 public:
86  // Constructor, destructor. S is the string to parse describing
87  // the constraint.
88 
95 
101  Constraint (const Constraint& c);
102 
103 
108 
109  // Assignment.
115  Constraint& operator= (const Constraint& c);
116 
117  // See if this guy references both labels ILABEL and JLABEL
118  // on a single side of the constraint equation.
119 
132  int has_labels (int ilabel, int jlabel) const;
133 
134  // Evaluate the mass constraint, using the data in EV.
135  // Return m(lhs)^2/2 - m(rhs)^2/2.
144  double sum_mass_terms (const Fourvec_Event& ev) const;
145 
146  // Print this object.
147  friend std::ostream& operator<< (std::ostream& s, const Constraint& c);
148 
149 
150 private:
151  // The two sides of the constraint.
152 
156  std::auto_ptr<Constraint_Intermed> _lhs;
157 
161  std::auto_ptr<Constraint_Intermed> _rhs;
162 };
163 
164 
165 } // namespace hitfit
166 
167 
168 #endif // not HITFIT_CONSTRAINT_H
169 
std::auto_ptr< Constraint_Intermed > _rhs
Definition: Constraint.h:161
Represent a mass constraint equation. Mass constraints come in two varieties, either saying that the ...
Definition: Constraint.h:80
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:156
double sum_mass_terms(const Fourvec_Event &ev) const
Definition: Constraint.cc:137
Constraint(std::string s)
Definition: Constraint.cc:86
Constraint & operator=(const Constraint &c)
Definition: Constraint.cc:62
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:163
int has_labels(int ilabel, int jlabel) const
Definition: Constraint.cc:113
Represent one side of a mass constraint equation. Contains the abstract base class Constraint_Interme...