CMS 3D CMS Logo

Fit_Result.cc
Go to the documentation of this file.
1 //
2 //
3 // File: src/Fit_Result.cc
4 // Purpose: Hold the result from a single kinematic fit.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // CMSSW File : src/Fit_Result.cc
8 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
9 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
10 //
11 
35 #include <ostream>
36 #include <cmath>
37 
38 using std::abs;
39 using std::ostream;
40 
41 namespace hitfit {
42 
43  Fit_Result::Fit_Result(double chisq,
44  const Lepjets_Event& ev,
45  const Column_Vector& pullx,
46  const Column_Vector& pully,
47  double umwhad,
48  double utmass,
49  double mt,
50  double sigmt)
51  //
52  // Purpose: Constructor.
53  //
54  // Inputs:
55  // chisq - The fit chisq.
56  // ev - The event kinematics.
57  // pullx - The pull quantities for the well-measured variables.
58  // pully - The pull quantities for the poorly-measured variables.
59  // umwhad - The hadronic W mass before the fit.
60  // utmass - The top quark mass before the fit.
61  // mt - The top quark mass after the fit.
62  // sigmt - The top quark mass uncertainty after the fit.
63  //
64  : _chisq(chisq), _umwhad(umwhad), _utmass(utmass), _mt(mt), _sigmt(sigmt), _pullx(pullx), _pully(pully), _ev(ev) {}
65 
67  //
68  // Purpose: Return the fit chisq.
69  //
70  // Returns:
71  // Return the fit chisq.
72  //
73  {
74  return _chisq;
75  }
76 
78  //
79  // Purpose: Return the hadronic W mass before the fit.
80  //
81  // Returns:
82  // The hadronic W mass before the fit.
83  //
84  {
85  return _umwhad;
86  }
87 
89  //
90  // Purpose: Return the top mass before the fit.
91  //
92  // Returns:
93  // The top mass before the fit.
94  //
95  {
96  return _utmass;
97  }
98 
100  //
101  // Purpose: Return the top mass after the fit.
102  //
103  // Returns:
104  // The top mass after the fit.
105  //
106  {
107  return _mt;
108  }
109 
111  //
112  // Purpose: Return the top mass uncertainty after the fit.
113  //
114  // Returns:
115  // The top mass uncertainty after the fit.
116  //
117  {
118  return _sigmt;
119  }
120 
122  //
123  // Purpose: Return the pull quantities for the well-measured variables.
124  //
125  // Returns:
126  // The pull quantities for the well-measured variables.
127  //
128  {
129  return _pullx;
130  }
131 
133  //
134  // Purpose: Return the pull quantities for the poorly-measured variables.
135  //
136  // Returns:
137  // The pull quantities for the poorly-measured variables.
138  //
139  {
140  return _pully;
141  }
142 
143  std::vector<int> Fit_Result::jet_types()
144  //
145  // Purpose: Returns the jet types of the fit
146  //
147  {
148  return _ev.jet_types();
149  }
150 
152  //
153  // Purpose: Return the event kinematic quantities after the fit.
154  //
155  // Returns:
156  // The event kinematic quantities after the fit.
157  //
158  {
159  return _ev;
160  }
161 
174  bool operator<(const Fit_Result& a, const Fit_Result& b)
175  //
176  // Purpose: Compare two objects by chisq.
177  // The use of abs() is to make sure that the -1000 flags
178  // go to the end.
179  //
180  // Inputs:
181  // a - The first object to compare.
182  // b - The second object to compare.
183  //
184  // Returns:
185  // The result of the comparison.
186  //
187  {
188  return abs(a._chisq) < abs(b._chisq);
189  }
190 
199  std::ostream& operator<<(std::ostream& s, const Fit_Result& res)
200  //
201  // Purpose: Print the object to S.
202  //
203  // Inputs:
204  // s - The stream to which to write.
205  // res - The object to write.
206  //
207  // Returns:
208  // The stream S.
209  //
210  {
211  s << "chisq: " << res._chisq << "\n";
212  s << "umwhad: " << res._umwhad << "\n";
213  s << "utmass: " << res._utmass << "\n";
214  s << "mt: " << res._mt << "\n";
215  s << "sigmt: " << res._sigmt << "\n";
216  s << res._ev;
217  s << "pullx: " << res._pullx.T();
218  s << "pully: " << res._pully.T();
219  return s;
220  }
221 
222 } // namespace hitfit
Hold the result of one kinematic fit.
Definition: Fit_Result.h:50
Column_Vector _pully
Definition: Fit_Result.h:169
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:43
Hold the result of one kinematic fit.
CLHEP::HepVector Column_Vector
Definition: matutil.h:63
const Column_Vector & pully() const
Return the pull quantities for the poorly-measured variables.
Definition: Fit_Result.cc:132
const Column_Vector & pullx() const
Return the pull quantities for the well-measured variables.
Definition: Fit_Result.cc:121
Definition: Electron.h:6
double utmass() const
Return the top quark mass before the fit.
Definition: Fit_Result.cc:88
std::vector< int > jet_types()
Return the list of jet types for this event.
Definition: Fit_Result.cc:143
bool operator<(const EtaDepResElement &a, const EtaDepResElement &b)
Comparison operator, compare two EtaDepResElement instances based on their respective valid ranges...
Represent a simple event consisting of lepton(s) and jet(s). An instance of this class holds a list o...
Definition: Lepjets_Event.h:62
Lepjets_Event _ev
Definition: Fit_Result.h:174
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double mt() const
Return the top quark mass after the fit.
Definition: Fit_Result.cc:99
Column_Vector _pullx
Definition: Fit_Result.h:164
double chisq() const
Return the of the fit.
Definition: Fit_Result.cc:66
double sigmt() const
Return the top quark mass uncertainty after the fit.
Definition: Fit_Result.cc:110
double b
Definition: hdecay.h:120
const Lepjets_Event & ev() const
Return the event kinematics quantities after the fit.
Definition: Fit_Result.cc:151
std::vector< int > jet_types() const
Return the jet types in the event.
double umwhad() const
Return the hadronic boson mass before the fit.
Definition: Fit_Result.cc:77
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...