CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/TopQuarkAnalysis/TopHitFit/interface/Constraint.h

Go to the documentation of this file.
00001 //
00002 // $Id: Constraint.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
00003 //
00004 // File: hitfit/private/Constraint.h
00005 // Purpose: Represent a mass constraint equation.
00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
00007 //
00008 // This class represents a mass constraint equation.
00009 // Mass constraints come in two varieties, either saying that the sum
00010 // of a set of labels should equal a constant:
00011 //
00012 //     (1 + 2) = 80
00013 //
00014 // or that two such sums should equal each other:
00015 //
00016 //     (1 + 2) = (3 + 4)
00017 //
00018 // We represent such a constraint equation by two Constraint_Intermed
00019 // instances, each of which represents one side of the equation.
00020 //
00021 // CMSSW File      : interface/Constraint.h
00022 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
00023 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
00024 
00025 
00048 #ifndef HITFIT_CONSTRAINT_H
00049 #define HITFIT_CONSTRAINT_H
00050 
00051 
00052 #include <memory>
00053 #include <string>
00054 #include "TopQuarkAnalysis/TopHitFit/interface/Constraint_Intermed.h"
00055 
00056 
00057 namespace hitfit {
00058 
00059 
00060 class Fourvec_Event;
00061 
00062 
00080 class Constraint
00081 //
00082 // Purpose: Represent a mass constraint equation.
00083 //
00084 {
00085 public:
00086   // Constructor, destructor.  S is the string to parse describing
00087   // the constraint.
00088 
00094   Constraint (std::string s);
00095 
00101   Constraint (const Constraint& c);
00102 
00103 
00107   ~Constraint () {}
00108 
00109   // Assignment.
00115   Constraint& operator= (const Constraint& c);
00116 
00117   // See if this guy references both labels ILABEL and JLABEL
00118   // on a single side of the constraint equation.
00119 
00132   int has_labels (int ilabel, int jlabel) const;
00133 
00134   // Evaluate the mass constraint, using the data in EV.
00135   // Return m(lhs)^2/2 - m(rhs)^2/2.
00144   double sum_mass_terms (const Fourvec_Event& ev) const;
00145 
00146   // Print this object.
00147   friend std::ostream& operator<< (std::ostream& s, const Constraint& c);
00148 
00149 
00150 private:
00151   // The two sides of the constraint.
00152 
00156   std::auto_ptr<Constraint_Intermed> _lhs;
00157 
00161   std::auto_ptr<Constraint_Intermed> _rhs;
00162 };
00163 
00164 
00165 } // namespace hitfit
00166 
00167 
00168 #endif // not HITFIT_CONSTRAINT_H
00169