CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
hitfit::Fit_Results Class Reference

Holds set(s) of results from more than one kinematic fits. More...

#include <Fit_Results.h>

Public Member Functions

 Fit_Results (int max_len, int n_lists)
 Constructor, make n_list of lists, each of maximum length max_len. More...
 
const Fit_Result_Vecoperator[] (std::vector< Fit_Result_Vec >::size_type i) const
 Access the i-th list. More...
 
void push (double chisq, const Lepjets_Event &ev, const Column_Vector &pullx, const Column_Vector &pully, double umwhad, double utmass, double mt, double sigmt, const std::vector< int > &list_flags)
 Add a new fit result. More...
 

Private Attributes

std::vector< Fit_Result_Vec_v
 

Friends

std::ostream & operator<< (std::ostream &s, const Fit_Results &res)
 Output stream operator, print the content of this Fit_Results to an output stream. More...
 

Detailed Description

Holds set(s) of results from more than one kinematic fits.

Definition at line 55 of file Fit_Results.h.

Constructor & Destructor Documentation

◆ Fit_Results()

hitfit::Fit_Results::Fit_Results ( int  max_len,
int  n_lists 
)

Constructor, make n_list of lists, each of maximum length max_len.

Parameters
max_lenThe maximum length of each list.
n_listsThe number of lists.

Definition at line 43 of file Fit_Results.cc.

51  : _v(n_lists, Fit_Result_Vec(max_len)) {}

Member Function Documentation

◆ operator[]()

const Fit_Result_Vec & hitfit::Fit_Results::operator[] ( std::vector< Fit_Result_Vec >::size_type  i) const

Access the i-th list.

Parameters
iThe index of the list.

Definition at line 53 of file Fit_Results.cc.

53  {
54  assert(i < _v.size());
55  return _v[i];
56  }

References _v, cms::cuda::assert(), and mps_fire::i.

◆ push()

void hitfit::Fit_Results::push ( double  chisq,
const Lepjets_Event ev,
const Column_Vector pullx,
const Column_Vector pully,
double  umwhad,
double  utmass,
double  mt,
double  sigmt,
const std::vector< int > &  list_flags 
)

Add a new fit result.

Parameters
chisqThe fit $\chi^{2}$.
evThe event kinematics.
pullxThe pull quantities for the well-measured variables.
pullyThe pull quantities for the poorly-measured variables.
umwhadThe hadronic W mass before fit.
utmassThe top quark mass before the fit.
mtThe top quark mass after the fit.
sigmtThe top quark mass uncertainty after the fit.
list_flagsVector indicating to which lists the result should be added. This vector should have a same length as the internal object _v.

Definition at line 58 of file Fit_Results.cc.

86  {
87  assert(list_flags.size() == _v.size());
88 
89  auto res = std::make_shared<Fit_Result>(chisq, ev, pullx, pully, umwhad, utmass, mt, sigmt);
90  for (std::vector<Fit_Result_Vec>::size_type i = 0; i < _v.size(); i++) {
91  if (list_flags[i])
92  _v[i].push(res);
93  }
94  }

References _v, cms::cuda::assert(), ev, mps_fire::i, TtSemiLepEvtBuilder_cfi::mt, and TtSemiLepEvtBuilder_cfi::sigmt.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Fit_Results res 
)
friend

Output stream operator, print the content of this Fit_Results to an output stream.

Parameters
sThe output stream to which to write.
resThe instance Fit_Results to be printed.

Definition at line 104 of file Fit_Results.cc.

115  {
116  for (std::vector<Fit_Result_Vec>::size_type i = 0; i < res._v.size(); i++)
117  s << "List " << i << "\n" << res._v[i];
118  return s;
119  }

Member Data Documentation

◆ _v

std::vector<Fit_Result_Vec> hitfit::Fit_Results::_v
private

Definition at line 119 of file Fit_Results.h.

Referenced by operator[](), and push().

mps_fire.i
i
Definition: mps_fire.py:355
hitfit::Fit_Results::_v
std::vector< Fit_Result_Vec > _v
Definition: Fit_Results.h:119
cms::cuda::assert
assert(be >=bs)
alignCSCRings.s
s
Definition: alignCSCRings.py:92
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
hitfit::n_lists
Definition: Top_Fit.h:61
TtSemiLepEvtBuilder_cfi.sigmt
sigmt
Definition: TtSemiLepEvtBuilder_cfi.py:48
res
Definition: Electron.h:6
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TtSemiLepEvtBuilder_cfi.mt
mt
Definition: TtSemiLepEvtBuilder_cfi.py:47