CMS 3D CMS Logo

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

Do a constrained kinematic fitting for a $t\bar{t}\to\ell + \rm{jets}$ event. More...

#include <Constrained_Top.h>

Public Member Functions

double constrain (Lepjets_Event &ev, double &mt, double &sigmt, Column_Vector &pullx, Column_Vector &pully)
 Do a constrained fit of $t\bar{t}\to\ell + \rm{jets}$ events. Returns the top mass and its error in mt and sigmt, and the pull quantities in pullx and pully. Returns the $\chi^{2}$, this will be negative if the fit failed to converge. More...
 
 Constrained_Top (const Constrained_Top_Args &args, double lepw_mass, double hadw_mass, double top_mass)
 Constructor, create an instance of the Constrained_Top object from the arguments object and the mass constraints. More...
 

Private Attributes

const Constrained_Top_Args _args
 
Fourvec_Constrainer _constrainer
 

Friends

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

Detailed Description

Do a constrained kinematic fitting for a $t\bar{t}\to\ell + \rm{jets}$ event.

Definition at line 120 of file Constrained_Top.h.

Constructor & Destructor Documentation

◆ Constrained_Top()

hitfit::Constrained_Top::Constrained_Top ( const Constrained_Top_Args args,
double  lepw_mass,
double  hadw_mass,
double  top_mass 
)

Constructor, create an instance of the Constrained_Top object from the arguments object and the mass constraints.

Parameters
argsArgument for this instance of Constrained_Top object.
lepw_massThe mass to which the leptonic W should be constrained. If this parameter is set to 0, the constraint is skied.
hadw_massThe mass to which the hadronic W should be constrained. If this parameter is set to 0, the constraint is skied.
top_massThe mass to which the top quarks should be constrained. If this parameter is set to 0, the constraints is skied.

Definition at line 94 of file Constrained_Top.cc.

References _constrainer, hitfit::Fourvec_Constrainer::add_constraint(), writedatasetfile::args, visDQMUpload::buf, hitfit::hadb_label, hitfit::hadw1_label, hitfit::hadw2_label, hitfit::lepb_label, hitfit::lepton_label, hitfit::Fourvec_Constrainer::mass_constraint(), and hitfit::nu_label.

107  : _args(args), _constrainer(args.fourvec_constrainer_args()) {
108  char buf[256];
109  if (lepw_mass > 0) {
110  sprintf(buf, "(%d %d) = %f", nu_label, lepton_label, lepw_mass);
112  }
113 
114  if (hadw_mass > 0) {
115  sprintf(buf, "(%d %d) = %f", hadw1_label, hadw2_label, hadw_mass);
117  }
118 
119  if (args.equal_side()) {
120  sprintf(buf, "(%d %d %d) = (%d %d %d)", nu_label, lepton_label, lepb_label, hadw1_label, hadw2_label, hadb_label);
122  }
123 
124  if (top_mass > 0) {
125  sprintf(buf, "(%d %d %d) = %f", hadw1_label, hadw2_label, hadb_label, top_mass);
127  } else {
128  sprintf(buf, "(%d %d %d) = 0", hadw1_label, hadw2_label, hadb_label);
130  }
131  }
const int nu_label
Fourvec_Constrainer _constrainer
const Constrained_Top_Args _args
void mass_constraint(std::string s)
Specify a combination of objects that will be returned by the constrain() method as mass...
void add_constraint(std::string s)
Specify an additional constraint s for the problem. The format for s is described in the class descri...

Member Function Documentation

◆ constrain()

double hitfit::Constrained_Top::constrain ( Lepjets_Event ev,
double &  mt,
double &  sigmt,
Column_Vector pullx,
Column_Vector pully 
)

Do a constrained fit of $t\bar{t}\to\ell + \rm{jets}$ events. Returns the top mass and its error in mt and sigmt, and the pull quantities in pullx and pully. Returns the $\chi^{2}$, this will be negative if the fit failed to converge.

Parameters
evThe event to be fitted (input), and the event after fitting (output).
mtThe fitted top mass.
sigmtThe uncertainty on the fitted top mass.
pullxPull quantities for the well-measured variables.
pullyPull quantities for the poorly-measured variables.
Input:
Output:
  • Lepjets_Event ev.
  • double mt.
  • double sigmt.
  • Column_Vector pullx.
  • Column_Vector pully.
Return:
The $\chi^{2}$ of the fit. Return a negative value if the fit didn't converge.

Definition at line 259 of file Constrained_Top.cc.

References _args, _constrainer, hitfit::Constrained_Top_Args::bmass(), hitfit::Fourvec_Constrainer::constrain(), makeMEIFBenchmarkPlots::ev, TtSemiLepEvtBuilder_cfi::mt, and TtSemiLepEvtBuilder_cfi::sigmt.

Referenced by hitfit::Top_Fit::fit_one_perm().

280  {
281  Fourvec_Event fe;
282  do_import(ev, _args.bmass(), fe);
283  double chisq = _constrainer.constrain(fe, mt, sigmt, pullx, pully);
284  do_export(fe, ev);
285 
286  return chisq;
287  }
Fourvec_Constrainer _constrainer
double constrain(Fourvec_Event &ev, double &m, double &sigm, Column_Vector &pullx, Column_Vector &pully)
Do a constrained fit for event ev. Returns the requested mass and its uncertainty in m and sigm...
const Constrained_Top_Args _args

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Constrained_Top ct 
)
friend

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

Parameters
sThe output stream to which to write.
ctThe instance of Constrained_Top to be printed.

Definition at line 298 of file Constrained_Top.cc.

309  {
310  return s << ct._constrainer;
311  }

Member Data Documentation

◆ _args

const Constrained_Top_Args hitfit::Constrained_Top::_args
private

Parameter settings for the $\chi^{2}$ constrainer.

Definition at line 192 of file Constrained_Top.h.

Referenced by constrain().

◆ _constrainer

Fourvec_Constrainer hitfit::Constrained_Top::_constrainer
private

The guy that actually does the work.

Definition at line 198 of file Constrained_Top.h.

Referenced by constrain(), and Constrained_Top().