54 using std::next_permutation;
55 using std::stable_sort;
75 : _print_event_flag (defs.get_bool (
"print_event_flag")),
76 _do_higgs_flag (defs.get_bool (
"do_higgs_flag")),
77 _jet_mass_cut (defs.get_float (
"jet_mass_cut")),
78 _mwhad_min_cut (defs.get_float (
"mwhad_min_cut")),
79 _mwhad_max_cut (defs.get_float (
"mwhad_max_cut")),
80 _mtdiff_max_cut (defs.get_float (
"mtdiff_max_cut")),
81 _nkeep (defs.get_int (
"nkeep")),
82 _solve_nu_tmass (defs.get_bool (
"solve_nu_tmass")),
258 vector<int> classify_jetperm (
const vector<int>& jet_types,
285 assert (jet_types.size() == ev.
njets());
289 int t1 = jet_types[
i];
334 void set_jet_types (
const vector<int>& jet_types,
347 assert (ev.
njets() == jet_types.size());
348 bool saw_hadw1 =
false;
350 int t = jet_types[
i];
385 lepw_mass, hadw_mass, top_mass),
386 _lepw_mass(lepw_mass),
387 _hadw_mass (hadw_mass)
467 utmass = (umthad + umtlep) / 2;
471 cout <<
"Top_Fit::fit_one_perm() : Before fit:\n";
479 cout <<
"Top_Fit: bad mass comb.\n";
488 cout <<
"Top_Fit::fit_one_perm() : After fit:\n";
489 cout <<
"chisq: " << chisq <<
" mt: " << mt <<
" ";
514 assert (ev.
njets() >= 4);
526 stable_sort (jet_types.begin(), jet_types.end());
531 for (
int nusol = 0 ; nusol != 2 ; nusol++) {
534 bool nuz =
bool(nusol);
540 set_jet_types (jet_types, fev);
543 vector<int> list_flags = classify_jetperm (jet_types, ev);
546 double umwhad, utmass,
mt,
sigmt;
552 cout <<
"Top_Fit::fit(): Before fit: (";
555 cout << jet_types[
i];
557 cout <<
" nuz = " << nuz ;
558 cout <<
") " << std::endl;
561 chisq =
fit_one_perm (fev, nuz, umwhad, utmass, mt, sigmt, pullx, pully);
565 cout <<
"Top_Fit::fit(): After fit:\n";
567 sprintf (buf,
"chisq: %8.3f mt: %6.2f pm %5.2f %c\n",
568 chisq, mt, sigmt, (list_flags[
noperm_list] ?
'*' :
' '));
573 res.push (chisq, fev, pullx, pully, umwhad, utmass, mt, sigmt, list_flags);
578 }
while (next_permutation (jet_types.begin(), jet_types.end()));
static bool solve_nu_tmass(const Lepjets_Event &ev, double tmass, double &nuz1, double &nuz2)
Solve for the neutrino longitudinal momentum that makes the leptonic top have a certain value of mas...
bool solve_nu_tmass() const
Return the solve_nu_tmass parameter.
Hold on to parameters for the Constrained_Top class.
Define an abstract interface for getting parameter settings.
Top_Fit(const Top_Fit_Args &args, double lepw_mass, double hadw_mass, double top_mass)
Constructor.
Define three-vector and four-vector classes for the HitFit package, and supply a few additional opera...
Hold on to parameters for the Top_Fit class.
double mwhad_min_cut() const
Return the mwhad_min_cut parameter.
void adjust_e_for_mass(Fourvec &v, double mass)
Adjust the energy component of four-vector v (leaving the three-vector part unchanged) so that the fo...
CLHEP::HepVector Column_Vector
double mwhad_max_cut() const
Return the mwhad_min_cut parameter.
bool print_event_flag() const
Return the print_event_flag parameter.
Lepjets_Event_Jet & jet(std::vector< Lepjets_Event_Jet >::size_type i)
Return a reference to jet at index position i.
double fit_one_perm(Lepjets_Event &ev, bool &nuz, double &umwhad, double &utmass, double &mt, double &sigmt, Column_Vector &pullx, Column_Vector &pully)
Fit for a single jet permutation.
int & type()
Return a reference to the type code.
double jet_mass_cut() const
Return the jet_mass_cut parameter.
static bool solve_nu(const Lepjets_Event &ev, double wmass, double &nuz1, double &nuz2)
Solve for the longitudinal momentum that makes the leptonic -boson to have a certain value of mass...
Represent a simple event consisting of lepton(s) and jet(s).
std::vector< Lepjets_Event_Jet >::size_type njets() const
Return the number of jets in the event.
A class to hold functions to calculate kinematic quantities of interest in events.
Represent a simple event consisting of lepton(s) and jet(s). An instance of this class holds a list o...
const Constrained_Top_Args & constrainer_args() const
Abs< T >::type abs(const T &t)
Fit_Results fit(const Lepjets_Event &ev)
Fit all jets permutations in ev. This function returns a Fit_Results object, which is not easy to ext...
double constrain(Lepjets_Event &ev, double &mt, double &sigmt, Column_Vector &pullx, Column_Vector &pully)
Do a constrained fit of events. Returns the top mass and its error in mt and sigmt, and the pull quantities in pullx and pully. Returns the , this will be negative if the fit failed to converge.
double mtdiff_max_cut() const
Return the mwhad_max_cut parameter.
Handle and fit jet permutations of an event. This is the primary interface between user's Lepjets_Eve...
Top_Fit_Args(const Defaults &defs)
Constructor, initialize an instance of Top_Fit_Args from an instance of Defaults object.
Fourvec sum(int type) const
Return the sum of all objects' four-momentum which have a particular type.
friend std::ostream & operator<<(std::ostream &s, const Top_Fit &fitter)
Output stream operator, print the content of this Top_Fit object to an output stream.
Constrained_Top_Args _args
Fourvec & met()
Return a reference to the missing transverse energy.
static Fourvec hadt(const Lepjets_Event &ev)
Sum up the appropriate four-momenta to find the hadronic top quark.
const Top_Fit_Args & args() const
Return a constant reference to the fit arguments.
Constrained_Top _constrainer
static Fourvec lept(const Lepjets_Event &ev)
Sum up the appropriate four-momenta to find the leptonic top quark.
Hold set(s) of results from more than one kinematic fits. Each set correspond to some subset of jet p...
Define an interface for getting parameter settings.
bool do_higgs_flag() const
Return the do_higgs_flag parameter.
int nkeep() const
Return the nkeep parameter.
Handle and fit jet permutations of an event. This is the primary interface between user's Lepjets_Eve...
static Fourvec hadw(const Lepjets_Event &ev)
Sum up the appropriate four-momenta to find the hadronic boson.
Holds set(s) of results from more than one kinematic fits.
static std::ostream & dump_ev(std::ostream &s, const Lepjets_Event &ev)
Print the kinematic information for an event.