CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Fit_Result.cc
Go to the documentation of this file.
1 //
2 // $Id: Fit_Result.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
3 //
4 // File: src/Fit_Result.cc
5 // Purpose: Hold the result from a single kinematic fit.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // CMSSW File : src/Fit_Result.cc
9 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
10 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
11 //
12 
36 #include <ostream>
37 #include <cmath>
38 
39 
40 using std::ostream;
41 using std::abs;
42 
43 
44 namespace hitfit {
45 
46 
47 Fit_Result::Fit_Result (double chisq,
48  const Lepjets_Event& ev,
49  const Column_Vector& pullx,
50  const Column_Vector& pully,
51  double umwhad,
52  double utmass,
53  double mt,
54  double sigmt)
55 //
56 // Purpose: Constructor.
57 //
58 // Inputs:
59 // chisq - The fit chisq.
60 // ev - The event kinematics.
61 // pullx - The pull quantities for the well-measured variables.
62 // pully - The pull quantities for the poorly-measured variables.
63 // umwhad - The hadronic W mass before the fit.
64 // utmass - The top quark mass before the fit.
65 // mt - The top quark mass after the fit.
66 // sigmt - The top quark mass uncertainty after the fit.
67 //
68  : _chisq (chisq),
69  _umwhad (umwhad),
70  _utmass (utmass),
71  _mt (mt),
72  _sigmt (sigmt),
73  _pullx (pullx),
74  _pully (pully),
75  _ev (ev)
76 {
77 }
78 
79 
81 //
82 // Purpose: Return the fit chisq.
83 //
84 // Returns:
85 // Return the fit chisq.
86 //
87 {
88  return _chisq;
89 }
90 
91 
93 //
94 // Purpose: Return the hadronic W mass before the fit.
95 //
96 // Returns:
97 // The hadronic W mass before the fit.
98 //
99 {
100  return _umwhad;
101 }
102 
103 
105 //
106 // Purpose: Return the top mass before the fit.
107 //
108 // Returns:
109 // The top mass before the fit.
110 //
111 {
112  return _utmass;
113 }
114 
115 
117 //
118 // Purpose: Return the top mass after the fit.
119 //
120 // Returns:
121 // The top mass after the fit.
122 //
123 {
124  return _mt;
125 }
126 
127 
129 //
130 // Purpose: Return the top mass uncertainty after the fit.
131 //
132 // Returns:
133 // The top mass uncertainty after the fit.
134 //
135 {
136  return _sigmt;
137 }
138 
139 
141 //
142 // Purpose: Return the pull quantities for the well-measured variables.
143 //
144 // Returns:
145 // The pull quantities for the well-measured variables.
146 //
147 {
148  return _pullx;
149 }
150 
151 
153 //
154 // Purpose: Return the pull quantities for the poorly-measured variables.
155 //
156 // Returns:
157 // The pull quantities for the poorly-measured variables.
158 //
159 {
160  return _pully;
161 }
162 
163 
164 std::vector<int> Fit_Result::jet_types ()
165 //
166 // Purpose: Returns the jet types of the fit
167 //
168 {
169  return _ev.jet_types();
170 }
171 
173 //
174 // Purpose: Return the event kinematic quantities after the fit.
175 //
176 // Returns:
177 // The event kinematic quantities after the fit.
178 //
179 {
180  return _ev;
181 }
182 
183 
196 bool operator< (const Fit_Result& a, const Fit_Result& b)
197 //
198 // Purpose: Compare two objects by chisq.
199 // The use of abs() is to make sure that the -1000 flags
200 // go to the end.
201 //
202 // Inputs:
203 // a - The first object to compare.
204 // b - The second object to compare.
205 //
206 // Returns:
207 // The result of the comparison.
208 //
209 {
210  return abs (a._chisq) < abs (b._chisq);
211 }
212 
213 
222 std::ostream& operator<< (std::ostream& s, const Fit_Result& res)
223 //
224 // Purpose: Print the object to S.
225 //
226 // Inputs:
227 // s - The stream to which to write.
228 // res - The object to write.
229 //
230 // Returns:
231 // The stream S.
232 //
233 {
234  s << "chisq: " << res._chisq << "\n";
235  s << "umwhad: " << res._umwhad << "\n";
236  s << "utmass: " << res._utmass << "\n";
237  s << "mt: " << res._mt << "\n";
238  s << "sigmt: " << res._sigmt << "\n";
239  s << res._ev;
240  s << "pullx: " << res._pullx.T();
241  s << "pully: " << res._pully.T();
242  return s;
243 }
244 
245 
246 
247 } // namespace hitfit
Hold the result of one kinematic fit.
Definition: Fit_Result.h:54
Column_Vector _pully
Definition: Fit_Result.h:174
const Column_Vector & pullx() const
Return the pull quantities for the well-measured variables.
Definition: Fit_Result.cc:140
Fit_Result(double chisq, const Lepjets_Event &ev, const Column_Vector &pullx, const Column_Vector &pully, double umwhad, double utmass, double mt, double sigmt)
Constructor, provide the results of the fit.
Definition: Fit_Result.cc:47
const Lepjets_Event & ev() const
Return the event kinematics quantities after the fit.
Definition: Fit_Result.cc:172
double sigmt() const
Return the top quark mass uncertainty after the fit.
Definition: Fit_Result.cc:128
Hold the result of one kinematic fit.
CLHEP::HepVector Column_Vector
Definition: matutil.h:67
#define abs(x)
Definition: mlp_lapack.h:159
double umwhad() const
Return the hadronic boson mass before the fit.
Definition: Fit_Result.cc:92
std::vector< int > jet_types()
Return the list of jet types for this event.
Definition: Fit_Result.cc:164
bool operator<(const EtaDepResElement &a, const EtaDepResElement &b)
Comparison operator, compare two EtaDepResElement instances based on their respective valid ranges...
double utmass() const
Return the top quark mass before the fit.
Definition: Fit_Result.cc:104
const Column_Vector & pully() const
Return the pull quantities for the poorly-measured variables.
Definition: Fit_Result.cc:152
Represent a simple event consisting of lepton(s) and jet(s). An instance of this class holds a list o...
Definition: Lepjets_Event.h:67
std::vector< int > jet_types() const
Return the jet types in the event.
Lepjets_Event _ev
Definition: Fit_Result.h:179
Column_Vector _pullx
Definition: Fit_Result.h:169
double b
Definition: hdecay.h:120
double mt() const
Return the top quark mass after the fit.
Definition: Fit_Result.cc:116
string const
Definition: compareJSON.py:14
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
double chisq() const
Return the of the fit.
Definition: Fit_Result.cc:80