53 using std::next_permutation;
55 using std::stable_sort;
71 : _print_event_flag(defs.get_bool(
"print_event_flag")),
72 _do_higgs_flag(defs.get_bool(
"do_higgs_flag")),
73 _jet_mass_cut(defs.get_float(
"jet_mass_cut")),
74 _mwhad_min_cut(defs.get_float(
"mwhad_min_cut")),
75 _mwhad_max_cut(defs.get_float(
"mwhad_max_cut")),
76 _mtdiff_max_cut(defs.get_float(
"mtdiff_max_cut")),
77 _nkeep(defs.get_int(
"nkeep")),
78 _solve_nu_tmass(defs.get_bool(
"solve_nu_tmass")),
181 bool test_for_bad_masses(
232 vector<int> classify_jetperm(
const vector<int>& jet_types,
const Lepjets_Event& ev)
258 assert(jet_types.size() == ev.njets());
261 int t1 = jet_types[
i];
262 int t2 = ev.jet(
i).type();
293 if ((ev.jet(
i).svx_tag() || ev.jet(
i).slt_tag()) &&
308 void set_jet_types(
const vector<int>& jet_types, Lepjets_Event& ev)
320 assert(ev.njets() == jet_types.size());
321 bool saw_hadw1 =
false;
323 int t = jet_types[
i];
329 ev.jet(
i).type() =
t;
351 _constrainer(args.constrainer_args(), lepw_mass, hadw_mass, top_mass),
352 _lepw_mass(lepw_mass),
353 _hadw_mass(hadw_mass) {}
428 utmass = (umthad + umtlep) / 2;
432 cout <<
"Top_Fit::fit_one_perm() : Before fit:\n";
437 if (
_hadw_mass > 0 && test_for_bad_masses(ev,
_args, umwhad, umthad, umtlep)) {
438 cout <<
"Top_Fit: bad mass comb.\n";
447 cout <<
"Top_Fit::fit_one_perm() : After fit:\n";
448 cout <<
"chisq: " << chisq <<
" mt: " << mt <<
" ";
484 stable_sort(jet_types.begin(), jet_types.end());
488 for (
int nusol = 0; nusol != 2; nusol++) {
490 bool nuz = bool(nusol);
496 set_jet_types(jet_types, fev);
499 vector<int> list_flags = classify_jetperm(jet_types, ev);
502 double umwhad, utmass, mt, sigmt;
508 cout <<
"Top_Fit::fit(): Before fit: (";
512 cout << jet_types[
i];
514 cout <<
" nuz = " << nuz;
515 cout <<
") " << std::endl;
518 chisq =
fit_one_perm(fev, nuz, umwhad, utmass, mt, sigmt, pullx, pully);
522 cout <<
"Top_Fit::fit(): After fit:\n";
525 buf,
"chisq: %8.3f mt: %6.2f pm %5.2f %c\n", chisq, mt, sigmt, (list_flags[
noperm_list] ?
'*' :
' '));
530 res.push(chisq, fev, pullx, pully, umwhad, utmass, mt, sigmt, list_flags);
535 }
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.
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.
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.
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.
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
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.