CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
external::HEPTopTaggerV2 Class Reference

#include <HEPTopTaggerV2.h>

Public Member Functions

const PseudoJet & b () const
 
double delta_top () const
 
double djsum () const
 
void do_optimalR (bool optimalR)
 
void do_qjets (bool qjets)
 
double f_rec ()
 
const PseudoJet & fat_initial ()
 
const PseudoJet & fat_Ropt ()
 
void get_info () const
 
void get_setting () const
 
const std::vector< PseudoJet > & hardparts () const
 
 HEPTopTaggerV2 ()
 
 HEPTopTaggerV2 (const fastjet::PseudoJet &jet)
 
 HEPTopTaggerV2 (const fastjet::PseudoJet &jet, double mtmass, double mwmass)
 
HEPTopTaggerV2_fixed_R HEPTopTaggerV2agger (int i)
 
bool is_masscut_passed () const
 
bool is_maybe_top () const
 
bool is_minptcut_passed () const
 
bool is_tagged () const
 
const PseudoJet & j1 () const
 
const PseudoJet & j2 () const
 
const PseudoJet & j3 () const
 
double nsub_filtered (int order, fastjet::contrib::Njettiness::AxesMode axes=fastjet::contrib::Njettiness::kt_axes, double beta=1., double R0=1.)
 
double nsub_unfiltered (int order, fastjet::contrib::Njettiness::AxesMode axes=fastjet::contrib::Njettiness::kt_axes, double beta=1., double R0=1.)
 
int optimalR_type ()
 
double pruned_mass () const
 
double pt_for_Ropt_calc () const
 
double q_weight ()
 
double Ropt () const
 
double Ropt_calc () const
 
void run ()
 
void set_debug (bool debug)
 
void set_filtering_jetalgorithm (JetAlgorithm jet_algorithm)
 
void set_filtering_minpt_subjet (double x)
 
void set_filtering_n (unsigned nfilt)
 
void set_filtering_optimalR_calc_n (unsigned x)
 
void set_filtering_optimalR_calc_R (double x)
 
void set_filtering_optimalR_fail_n (unsigned x)
 
void set_filtering_optimalR_fail_R (double x)
 
void set_filtering_optimalR_pass_n (unsigned x)
 
void set_filtering_optimalR_pass_R (double x)
 
void set_filtering_R (double Rfilt)
 
void set_fw (double fw)
 
void set_mass_drop_threshold (double x)
 
void set_mass_ratio_cut (double m23cut, double m13cutmin, double m13cutmax)
 
void set_mass_ratio_range (double rmin, double rmax)
 
void set_max_subjet_mass (double x)
 
void set_mode (enum Mode mode)
 
void set_mt (double x)
 
void set_mw (double x)
 
void set_optimalR_calc_fun (double(*f)(double))
 
void set_optimalR_max (double x)
 
void set_optimalR_min (double x)
 
void set_optimalR_reject_minimum (bool x)
 
void set_optimalR_step (double x)
 
void set_optimalR_threshold (double x)
 
void set_optimalR_type_fw (double x)
 
void set_optimalR_type_max_diff (double x)
 
void set_optimalR_type_top_mass_range (double x, double y)
 
void set_pruning_rcut_factor (double rcut_factor)
 
void set_pruning_zcut (double zcut)
 
void set_qjets (double q_zcut, double q_dcut_fctr, double q_exp_min, double q_exp_max, double q_rigidity, double q_truncation_fctr)
 
void set_qjets_rng (CLHEP::HepRandomEngine *engine)
 
void set_reclustering_jetalgorithm (JetAlgorithm jet_algorithm)
 
void set_top_mass_range (double xmin, double xmax)
 
void set_top_minpt (double x)
 
const PseudoJet & t () const
 
const std::vector< PseudoJet > & top_hadrons () const
 
const std::vector< PseudoJet > & top_subjets () const
 
double unfiltered_mass () const
 
const PseudoJet & W () const
 
const PseudoJet & W1 () const
 
const PseudoJet & W2 () const
 
 ~HEPTopTaggerV2 ()
 

Private Member Functions

void UnclusterFatjets (const vector< fastjet::PseudoJet > &big_fatjets, vector< fastjet::PseudoJet > &small_fatjets, const ClusterSequence &cs, const double small_radius)
 

Private Attributes

bool _debug
 
bool _do_optimalR
 
bool _do_qjets
 
PseudoJet _fat
 
PseudoJet _filt_fat
 
map< int, HEPTopTaggerV2_fixed_R_HEPTopTaggerV2
 
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
 
PseudoJet _initial_jet
 
PseudoJet _jet
 
fastjet::JetAlgorithm _jet_algorithm_filter
 
fastjet::JetAlgorithm _jet_algorithm_recluster
 
double _m13cutmax
 
double _m13cutmin
 
double _m23cut
 
double _mass_drop_threshold
 
double _max_fatjet_R
 
double _max_subjet_mass
 
double _min_fatjet_R
 
double _minpt_subjet
 
double _minpt_tag
 
Mode _mode
 
double _mtmass
 
double _mtmax
 
double _mtmin
 
double _mwmass
 
double _N_filt_optimalR_calc
 
double _N_filt_optimalR_fail
 
double _N_filt_optimalR_pass
 
map< int, int > _n_small_fatjets
 
unsigned _nfilt
 
double _optimalR_fw
 
double _optimalR_mmax
 
double _optimalR_mmin
 
double _optimalR_threshold
 
double _pt_for_R_opt_calc
 
double _q_dcut_fctr
 
double _q_exp_max
 
double _q_exp_min
 
double _q_rigidity
 
double _q_truncation_fctr
 
double _q_zcut
 
JetDefinition _qjet_def
 
double _qweight
 
double _R_filt_optimalR_calc
 
double _R_filt_optimalR_fail
 
double _R_filt_optimalR_pass
 
double(* _r_min_exp_function )(double)
 
double _R_opt_calc
 
double _R_opt_diff
 
bool _R_opt_reject_min
 
double _rcut_factor
 
double _Rfilt
 
double _rmax
 
double _rmin
 
CLHEP::HepRandomEngine * _rnEngine
 
int _Ropt
 
double _step_R
 
double _zcut
 

Detailed Description

Definition at line 181 of file HEPTopTaggerV2.h.

Constructor & Destructor Documentation

HEPTopTaggerV2::HEPTopTaggerV2 ( )

Definition at line 437 of file HEPTopTaggerV2.cc.

437  : _do_optimalR(false), _do_qjets(false),
439  _mode(Mode(0)), _mtmass(172.3), _mwmass(80.4), _mtmin(150.), _mtmax(200.), _rmin(0.85*80.4/172.3), _rmax(1.15*80.4/172.3),
440  _m23cut(0.35), _m13cutmin(0.2), _m13cutmax(1.3), _minpt_tag(200.),
441  _nfilt(5), _Rfilt(0.3), _jet_algorithm_filter(fastjet::cambridge_algorithm), _minpt_subjet(0.),
442  _jet_algorithm_recluster(fastjet::cambridge_algorithm),
443  _zcut(0.1), _rcut_factor(0.5),
446  _optimalR_mmin(150.), _optimalR_mmax(200.), _optimalR_fw(0.175), _R_opt_diff(0.3), _R_opt_reject_min(false),
448  _q_zcut(0.1), _q_dcut_fctr(0.5), _q_exp_min(0.), _q_exp_max(0.), _q_rigidity(0.1), _q_truncation_fctr(0.0), _rnEngine(nullptr),
449  _debug(false)
450 {}
fastjet::JetAlgorithm _jet_algorithm_filter
double R_opt_calc_funct(double pt_filt)
fastjet::JetAlgorithm _jet_algorithm_recluster
double(* _r_min_exp_function)(double)
CLHEP::HepRandomEngine * _rnEngine
HEPTopTaggerV2::HEPTopTaggerV2 ( const fastjet::PseudoJet &  jet)

Definition at line 452 of file HEPTopTaggerV2.cc.

453  : _do_optimalR(false), _do_qjets(false),
456  _mode(Mode(0)), _mtmass(172.3), _mwmass(80.4), _mtmin(150.), _mtmax(200.), _rmin(0.85*80.4/172.3), _rmax(1.15*80.4/172.3),
457  _m23cut(0.35), _m13cutmin(0.2), _m13cutmax(1.3), _minpt_tag(200.),
458  _nfilt(5), _Rfilt(0.3), _jet_algorithm_filter(fastjet::cambridge_algorithm), _minpt_subjet(0.),
459  _jet_algorithm_recluster(fastjet::cambridge_algorithm),
460  _zcut(0.1), _rcut_factor(0.5),
461  _max_fatjet_R(jet.validated_cluster_sequence()->jet_def().R()), _min_fatjet_R(0.5), _step_R(0.1), _optimalR_threshold(0.2),
463  _optimalR_mmin(150.), _optimalR_mmax(200.), _optimalR_fw(0.175), _R_opt_diff(0.3), _R_opt_reject_min(false),
465  _q_zcut(0.1), _q_dcut_fctr(0.5), _q_exp_min(0.), _q_exp_max(0.), _q_rigidity(0.1), _q_truncation_fctr(0.0),
466  _fat(jet),_rnEngine(nullptr),
467  _debug(false)
468 {}
fastjet::JetAlgorithm _jet_algorithm_filter
double R_opt_calc_funct(double pt_filt)
fastjet::JetAlgorithm _jet_algorithm_recluster
double(* _r_min_exp_function)(double)
CLHEP::HepRandomEngine * _rnEngine
HEPTopTaggerV2::HEPTopTaggerV2 ( const fastjet::PseudoJet &  jet,
double  mtmass,
double  mwmass 
)

Definition at line 470 of file HEPTopTaggerV2.cc.

472  : _do_optimalR(false), _do_qjets(false),
475  _mode(Mode(0)), _mtmass(mtmass), _mwmass(mwmass), _mtmin(150.), _mtmax(200.), _rmin(0.85*80.4/172.3), _rmax(1.15*80.4/172.3),
476  _m23cut(0.35), _m13cutmin(0.2), _m13cutmax(1.3), _minpt_tag(200.),
477  _nfilt(5), _Rfilt(0.3), _jet_algorithm_filter(fastjet::cambridge_algorithm), _minpt_subjet(0.),
478  _jet_algorithm_recluster(fastjet::cambridge_algorithm),
479  _zcut(0.1), _rcut_factor(0.5),
480  _max_fatjet_R(jet.validated_cluster_sequence()->jet_def().R()), _min_fatjet_R(0.5), _step_R(0.1), _optimalR_threshold(0.2),
482  _optimalR_mmin(150.), _optimalR_mmax(200.), _optimalR_fw(0.175), _R_opt_diff(0.3), _R_opt_reject_min(false),
484  _q_zcut(0.1), _q_dcut_fctr(0.5), _q_exp_min(0.), _q_exp_max(0.), _q_rigidity(0.1), _q_truncation_fctr(0.0),
485  _fat(jet), _rnEngine(nullptr),
486  _debug(false)
487 {}
fastjet::JetAlgorithm _jet_algorithm_filter
double R_opt_calc_funct(double pt_filt)
fastjet::JetAlgorithm _jet_algorithm_recluster
double(* _r_min_exp_function)(double)
CLHEP::HepRandomEngine * _rnEngine
HEPTopTaggerV2::~HEPTopTaggerV2 ( )

Definition at line 654 of file HEPTopTaggerV2.cc.

654 {}

Member Function Documentation

const PseudoJet& external::HEPTopTaggerV2::b ( ) const
inline

Definition at line 210 of file HEPTopTaggerV2.h.

210 {return _HEPTopTaggerV2_opt.b();}
const PseudoJet & b() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
double external::HEPTopTaggerV2::delta_top ( ) const
inline

Definition at line 203 of file HEPTopTaggerV2.h.

203 {return _HEPTopTaggerV2_opt.delta_top();}
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
double external::HEPTopTaggerV2::djsum ( ) const
inline

Definition at line 204 of file HEPTopTaggerV2.h.

204 {return _HEPTopTaggerV2_opt.djsum();}
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
void external::HEPTopTaggerV2::do_optimalR ( bool  optimalR)
inline
void external::HEPTopTaggerV2::do_qjets ( bool  qjets)
inline

Definition at line 284 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

284 {_do_qjets = qjets;}
double external::HEPTopTaggerV2::f_rec ( )
inline

Definition at line 208 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

208 {return _HEPTopTaggerV2_opt.f_rec();}
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::fat_initial ( )
inline

Definition at line 220 of file HEPTopTaggerV2.h.

220 {return _fat;}
const PseudoJet& external::HEPTopTaggerV2::fat_Ropt ( )
inline

Definition at line 221 of file HEPTopTaggerV2.h.

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
void external::HEPTopTaggerV2::get_info ( ) const
inline

Definition at line 234 of file HEPTopTaggerV2.h.

234 {return _HEPTopTaggerV2_opt.get_info();};
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
void external::HEPTopTaggerV2::get_setting ( ) const
inline

Definition at line 233 of file HEPTopTaggerV2.h.

233 {return _HEPTopTaggerV2_opt.get_setting();};
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const std::vector<PseudoJet>& external::HEPTopTaggerV2::hardparts ( ) const
inline

Definition at line 219 of file HEPTopTaggerV2.h.

219 {return _HEPTopTaggerV2_opt.hardparts();}
const std::vector< PseudoJet > & hardparts() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
HEPTopTaggerV2_fixed_R external::HEPTopTaggerV2::HEPTopTaggerV2agger ( int  i)
inline

Definition at line 223 of file HEPTopTaggerV2.h.

References mps_fire::i.

223 {return _HEPTopTaggerV2[i];}
map< int, HEPTopTaggerV2_fixed_R > _HEPTopTaggerV2
bool external::HEPTopTaggerV2::is_masscut_passed ( ) const
inline

Definition at line 199 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
bool external::HEPTopTaggerV2::is_maybe_top ( ) const
inline

Definition at line 198 of file HEPTopTaggerV2.h.

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
bool external::HEPTopTaggerV2::is_minptcut_passed ( ) const
inline

Definition at line 200 of file HEPTopTaggerV2.h.

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
bool external::HEPTopTaggerV2::is_tagged ( ) const
inline

Definition at line 201 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

201 {return _HEPTopTaggerV2_opt.is_tagged();}
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::j1 ( ) const
inline

Definition at line 215 of file HEPTopTaggerV2.h.

215 {return _HEPTopTaggerV2_opt.j1();}
const PseudoJet & j1() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::j2 ( ) const
inline

Definition at line 216 of file HEPTopTaggerV2.h.

216 {return _HEPTopTaggerV2_opt.j2();}
const PseudoJet & j2() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::j3 ( ) const
inline

Definition at line 217 of file HEPTopTaggerV2.h.

217 {return _HEPTopTaggerV2_opt.j3();}
const PseudoJet & j3() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
double HEPTopTaggerV2::nsub_filtered ( int  order,
fastjet::contrib::Njettiness::AxesMode  axes = fastjet::contrib::Njettiness::kt_axes,
double  beta = 1.,
double  R0 = 1. 
)

Definition at line 649 of file HEPTopTaggerV2.cc.

References _filt_fat.

Referenced by HEPTopTaggerV2::result().

649  {
650  fastjet::contrib::Nsubjettiness nsub(order, axes, beta, R0);
651  return nsub.result(_filt_fat);
652 }
double HEPTopTaggerV2::nsub_unfiltered ( int  order,
fastjet::contrib::Njettiness::AxesMode  axes = fastjet::contrib::Njettiness::kt_axes,
double  beta = 1.,
double  R0 = 1. 
)

Definition at line 644 of file HEPTopTaggerV2.cc.

References _fat.

Referenced by HEPTopTaggerV2::result().

644  {
645  fastjet::contrib::Nsubjettiness nsub(order, axes, beta, R0);
646  return nsub.result(_fat);
647 }
int HEPTopTaggerV2::optimalR_type ( )

Definition at line 631 of file HEPTopTaggerV2.cc.

References _HEPTopTaggerV2_opt, _optimalR_fw, _optimalR_mmax, _optimalR_mmin, _R_opt_calc, _R_opt_diff, _Ropt, external::HEPTopTaggerV2_fixed_R::f_rec(), and external::HEPTopTaggerV2_fixed_R::t().

Referenced by run().

631  {
633  return 0;
634  }
636  return 0;
637  }
638  if(_Ropt/10. - _R_opt_calc > _R_opt_diff) {
639  return 0;
640  }
641  return 1;
642 }
const PseudoJet & t() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
double external::HEPTopTaggerV2::pruned_mass ( ) const
inline

Definition at line 205 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
double external::HEPTopTaggerV2::pt_for_Ropt_calc ( ) const
inline
double external::HEPTopTaggerV2::q_weight ( )
inline

Definition at line 236 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

236 {return _qweight;}
double external::HEPTopTaggerV2::Ropt ( ) const
inline

Definition at line 225 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

225 {return _Ropt/10.;}
double external::HEPTopTaggerV2::Ropt_calc ( ) const
inline

Definition at line 226 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

226 {return _R_opt_calc;}
void HEPTopTaggerV2::run ( )

Definition at line 489 of file HEPTopTaggerV2.cc.

References _debug, _do_optimalR, _do_qjets, _fat, _filt_fat, _HEPTopTaggerV2, _HEPTopTaggerV2_opt, _initial_jet, _jet, _jet_algorithm_filter, _jet_algorithm_recluster, _m13cutmax, _m13cutmin, _m23cut, _mass_drop_threshold, _max_fatjet_R, _max_subjet_mass, _min_fatjet_R, _minpt_subjet, _minpt_tag, _mode, _mtmass, _mtmax, _mtmin, _mwmass, _N_filt_optimalR_calc, _N_filt_optimalR_fail, _N_filt_optimalR_pass, _n_small_fatjets, _nfilt, _optimalR_threshold, _pt_for_R_opt_calc, _q_dcut_fctr, _q_exp_max, _q_exp_min, _q_rigidity, _q_truncation_fctr, _q_zcut, _qjet_def, _qweight, _R_filt_optimalR_calc, _R_filt_optimalR_fail, _R_filt_optimalR_pass, _r_min_exp_function, _R_opt_calc, _R_opt_reject_min, _rcut_factor, _Rfilt, _rmax, _rmin, _rnEngine, _Ropt, circuitry::_seq, _step_R, _zcut, mps_fire::i, createfilelist::int, funct::m, optimalR_type(), EnergyCorrector::pt, external::HEPTopTaggerV2_fixed_R::q_weight(), dttmaxenums::R, external::HEPTopTaggerV2_fixed_R::run(), external::HEPTopTaggerV2_fixed_R::set_debug(), external::HEPTopTaggerV2_fixed_R::set_filtering_jetalgorithm(), external::HEPTopTaggerV2_fixed_R::set_filtering_minpt_subjet(), external::HEPTopTaggerV2_fixed_R::set_filtering_n(), external::HEPTopTaggerV2_fixed_R::set_filtering_R(), external::HEPTopTaggerV2_fixed_R::set_mass_drop_threshold(), external::HEPTopTaggerV2_fixed_R::set_mass_ratio_cut(), external::HEPTopTaggerV2_fixed_R::set_mass_ratio_range(), external::HEPTopTaggerV2_fixed_R::set_max_subjet_mass(), external::HEPTopTaggerV2_fixed_R::set_mode(), external::HEPTopTaggerV2_fixed_R::set_mt(), external::HEPTopTaggerV2_fixed_R::set_mw(), external::HEPTopTaggerV2_fixed_R::set_pruning_rcut_factor(), external::HEPTopTaggerV2_fixed_R::set_pruning_zcut(), external::HEPTopTaggerV2_fixed_R::set_qjets(), external::HEPTopTaggerV2_fixed_R::set_reclustering_jetalgorithm(), external::HEPTopTaggerV2_fixed_R::set_top_mass_range(), external::HEPTopTaggerV2_fixed_R::set_top_minpt(), QjetsPlugin::SetRNEngine(), external::HEPTopTaggerV2_fixed_R::t(), t(), UnclusterFatjets(), and QjetsBaseExtras::weight().

Referenced by HEPTopTaggerV2::result().

489  {
490 
492  int maxR = int(_max_fatjet_R * 10);
493  int minR = int(_min_fatjet_R * 10);
494  int stepR = int(_step_R * 10);
495  _qweight=-1;
496  _qjet_plugin.SetRNEngine(_rnEngine);
497 
498  if (!_do_optimalR) {
499  HEPTopTaggerV2_fixed_R htt(_jet);
500  htt.set_mass_drop_threshold(_mass_drop_threshold);
501  htt.set_max_subjet_mass(_max_subjet_mass);
502  htt.set_filtering_n(_nfilt);
503  htt.set_filtering_R(_Rfilt);
504  htt.set_filtering_minpt_subjet(_minpt_subjet);
505  htt.set_filtering_jetalgorithm(_jet_algorithm_filter);
506  htt.set_reclustering_jetalgorithm(_jet_algorithm_recluster);
507  htt.set_mode(_mode );
508  htt.set_mt(_mtmass);
509  htt.set_mw(_mwmass);
510  htt.set_top_mass_range(_mtmin, _mtmax);
511  htt.set_mass_ratio_range(_rmin, _rmax);
512  htt.set_mass_ratio_cut(_m23cut, _m13cutmin, _m13cutmax);
513  htt.set_top_minpt(_minpt_tag);
514  htt.set_pruning_zcut(_zcut);
515  htt.set_pruning_rcut_factor(_rcut_factor);
516  htt.set_debug(_debug);
518  htt.run();
519 
520  _HEPTopTaggerV2[maxR] = htt;
521  _Ropt = maxR;
522  _qweight = htt.q_weight();
524  } else {
525  _qjet_def = fastjet::JetDefinition(&_qjet_plugin);
526  vector<fastjet::PseudoJet> _q_constits;
527  ClusterSequence* _qjet_seq;
528  PseudoJet _qjet;
529  const ClusterSequence* _seq;
530  _seq = _initial_jet.validated_cluster_sequence();
531  if (_do_qjets){
532  _q_constits = _initial_jet.associated_cluster_sequence()->constituents(_initial_jet);
533  _qjet_seq = new ClusterSequence(_q_constits, _qjet_def);
534  _qjet = sorted_by_pt(_qjet_seq->inclusive_jets())[0];
535  _qjet_seq->delete_self_when_unused();
536  const QjetsBaseExtras* ext =
537  dynamic_cast<const QjetsBaseExtras*>(_qjet_seq->extras());
538  _qweight=ext->weight();
539  _jet = _qjet;
540  _seq = _qjet_seq;
541  _fat = _qjet;
542  }
543 
544  // Do MultiR procedure
545  vector<fastjet::PseudoJet> big_fatjets;
546  vector<fastjet::PseudoJet> small_fatjets;
547 
548  big_fatjets.push_back(_jet);
549  _Ropt = 0;
550 
551  for (int R = maxR; R >= minR; R -= stepR) {
552  UnclusterFatjets(big_fatjets, small_fatjets, *_seq, R / 10.);
553 
554  if (_debug) {edm::LogInfo("HEPTopTaggerV2") << "R = " << R << " -> n_small_fatjets = " << small_fatjets.size() << endl;}
555 
556  _n_small_fatjets[R] = small_fatjets.size();
557 
558  // We are sorting by pt - so start with a negative dummy
559  double dummy = -99999;
560 
561  for (unsigned i = 0; i < small_fatjets.size(); i++) {
562  HEPTopTaggerV2_fixed_R htt(small_fatjets[i]);
563  htt.set_mass_drop_threshold(_mass_drop_threshold);
564  htt.set_max_subjet_mass(_max_subjet_mass);
565  htt.set_filtering_n(_nfilt);
566  htt.set_filtering_R(_Rfilt);
567  htt.set_filtering_minpt_subjet(_minpt_subjet);
568  htt.set_filtering_jetalgorithm(_jet_algorithm_filter);
569  htt.set_reclustering_jetalgorithm(_jet_algorithm_recluster);
570  htt.set_mode(_mode );
571  htt.set_mt(_mtmass);
572  htt.set_mw(_mwmass);
573  htt.set_top_mass_range(_mtmin, _mtmax);
574  htt.set_mass_ratio_range(_rmin, _rmax);
575  htt.set_mass_ratio_cut(_m23cut, _m13cutmin, _m13cutmax);
576  htt.set_top_minpt(_minpt_tag);
577  htt.set_pruning_zcut(_zcut);
578  htt.set_pruning_rcut_factor(_rcut_factor);
579  htt.set_debug(_debug);
581 
582  htt.run();
583 
584  if (htt.t().perp() > dummy) {
585  dummy = htt.t().perp();
586  _HEPTopTaggerV2[R] = htt;
587  }
588  } //End of loop over small_fatjets
589 
590  // Only check if we have not found Ropt yet
591  if (_Ropt == 0 && R < maxR) {
592  // If the new mass is OUTSIDE the window ..
593  if (_HEPTopTaggerV2[R].t().m() < (1-_optimalR_threshold)*_HEPTopTaggerV2[maxR].t().m())
594  // .. set _Ropt to the previous mass
595  _Ropt = R + stepR;
596  }
597 
598  big_fatjets = small_fatjets;
599  small_fatjets.clear();
600  }//End of loop over R
601 
602  // if we did not find Ropt in the loop:
603  if (_Ropt == 0 && _HEPTopTaggerV2[maxR].t().m() > 0){
604  // either pick the last value (_R_opt_reject_min=false)
605  // or leace Ropt at zero (_R_opt_reject_min=true)
606  if (_R_opt_reject_min==false)
607  _Ropt = minR;
608  }
609 
610  //for the case that there is no tag at all (< 3 hard substructures)
611  if (_Ropt == 0 && _HEPTopTaggerV2[maxR].t().m() == 0)
612  _Ropt = maxR;
613 
615 
616  Filter filter_optimalR_calc(_R_filt_optimalR_calc, SelectorNHardest(_N_filt_optimalR_calc));
617  _R_opt_calc = _r_min_exp_function(filter_optimalR_calc(_fat).pt());
618  _pt_for_R_opt_calc = filter_optimalR_calc(_fat).pt();
619 
620  Filter filter_optimalR_pass(_R_filt_optimalR_pass, SelectorNHardest(_N_filt_optimalR_pass));
621  Filter filter_optimalR_fail(_R_filt_optimalR_fail, SelectorNHardest(_N_filt_optimalR_fail));
622  if(optimalR_type() == 1) {
623  _filt_fat = filter_optimalR_pass(_fat);
624  } else {
625  _filt_fat = filter_optimalR_fail(_fat);
626  }
627  }
628 }
fastjet::JetAlgorithm _jet_algorithm_filter
const PseudoJet & t() const
map< int, int > _n_small_fatjets
void UnclusterFatjets(const vector< fastjet::PseudoJet > &big_fatjets, vector< fastjet::PseudoJet > &small_fatjets, const ClusterSequence &cs, const double small_radius)
map< int, HEPTopTaggerV2_fixed_R > _HEPTopTaggerV2
fastjet::JetAlgorithm _jet_algorithm_recluster
Definition: Filter.py:1
Definition: memstream.h:15
double(* _r_min_exp_function)(double)
virtual double weight() const
Definition: Qjets.h:73
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
CLHEP::HepRandomEngine * _rnEngine
void external::HEPTopTaggerV2::set_debug ( bool  debug)
inline

Definition at line 283 of file HEPTopTaggerV2.h.

References debug.

283 {_debug = debug;}
#define debug
Definition: HDRShower.cc:19
void external::HEPTopTaggerV2::set_filtering_jetalgorithm ( JetAlgorithm  jet_algorithm)
inline

Definition at line 247 of file HEPTopTaggerV2.h.

247 {_jet_algorithm_filter = jet_algorithm;}
fastjet::JetAlgorithm _jet_algorithm_filter
void external::HEPTopTaggerV2::set_filtering_minpt_subjet ( double  x)
inline

Definition at line 246 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

void external::HEPTopTaggerV2::set_filtering_n ( unsigned  nfilt)
inline

Definition at line 244 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

244 {_nfilt = nfilt;}
void external::HEPTopTaggerV2::set_filtering_optimalR_calc_n ( unsigned  x)
inline

Definition at line 266 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_optimalR_calc_R ( double  x)
inline

Definition at line 265 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_optimalR_fail_n ( unsigned  x)
inline

Definition at line 278 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_optimalR_fail_R ( double  x)
inline

Definition at line 277 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_optimalR_pass_n ( unsigned  x)
inline

Definition at line 276 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_optimalR_pass_R ( double  x)
inline

Definition at line 275 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_filtering_R ( double  Rfilt)
inline

Definition at line 245 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

245 {_Rfilt = Rfilt;}
void external::HEPTopTaggerV2::set_fw ( double  fw)
inline
void external::HEPTopTaggerV2::set_mass_drop_threshold ( double  x)
inline

Definition at line 241 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

void external::HEPTopTaggerV2::set_mass_ratio_cut ( double  m23cut,
double  m13cutmin,
double  m13cutmax 
)
inline

Definition at line 257 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

257 {_m23cut = m23cut; _m13cutmin = m13cutmin; _m13cutmax = m13cutmax;}
void external::HEPTopTaggerV2::set_mass_ratio_range ( double  rmin,
double  rmax 
)
inline

Definition at line 256 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

256 {_rmin = rmin; _rmax = rmax;}
void external::HEPTopTaggerV2::set_max_subjet_mass ( double  x)
inline

Definition at line 242 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

void external::HEPTopTaggerV2::set_mode ( enum Mode  mode)
inline
void external::HEPTopTaggerV2::set_mt ( double  x)
inline

Definition at line 252 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_mw ( double  x)
inline

Definition at line 253 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_calc_fun ( double(*)(double)  f)
inline

Definition at line 267 of file HEPTopTaggerV2.h.

References f.

Referenced by HEPTopTaggerV2::result().

double f[11][100]
double(* _r_min_exp_function)(double)
void external::HEPTopTaggerV2::set_optimalR_max ( double  x)
inline

Definition at line 260 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_min ( double  x)
inline

Definition at line 261 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_reject_minimum ( bool  x)
inline

Definition at line 273 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

void external::HEPTopTaggerV2::set_optimalR_step ( double  x)
inline

Definition at line 262 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_threshold ( double  x)
inline

Definition at line 263 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_type_fw ( double  x)
inline

Definition at line 270 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_type_max_diff ( double  x)
inline

Definition at line 271 of file HEPTopTaggerV2.h.

void external::HEPTopTaggerV2::set_optimalR_type_top_mass_range ( double  x,
double  y 
)
inline
void external::HEPTopTaggerV2::set_pruning_rcut_factor ( double  rcut_factor)
inline
void external::HEPTopTaggerV2::set_pruning_zcut ( double  zcut)
inline

Definition at line 280 of file HEPTopTaggerV2.h.

References ak8GenJets_cfi::zcut.

void external::HEPTopTaggerV2::set_qjets ( double  q_zcut,
double  q_dcut_fctr,
double  q_exp_min,
double  q_exp_max,
double  q_rigidity,
double  q_truncation_fctr 
)
inline

Definition at line 285 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

285  {
286  _q_zcut = q_zcut; _q_dcut_fctr = q_dcut_fctr; _q_exp_min = q_exp_min; _q_exp_max = q_exp_max; _q_rigidity = q_rigidity; _q_truncation_fctr = q_truncation_fctr;
287  }
void external::HEPTopTaggerV2::set_qjets_rng ( CLHEP::HepRandomEngine *  engine)
inline

Definition at line 288 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

288 { _rnEngine = engine;}
CLHEP::HepRandomEngine * _rnEngine
void external::HEPTopTaggerV2::set_reclustering_jetalgorithm ( JetAlgorithm  jet_algorithm)
inline

Definition at line 249 of file HEPTopTaggerV2.h.

249 {_jet_algorithm_recluster = jet_algorithm;}
fastjet::JetAlgorithm _jet_algorithm_recluster
void external::HEPTopTaggerV2::set_top_mass_range ( double  xmin,
double  xmax 
)
inline
void external::HEPTopTaggerV2::set_top_minpt ( double  x)
inline

Definition at line 258 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

const PseudoJet& external::HEPTopTaggerV2::t ( ) const
inline

Definition at line 209 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result(), and run().

209 {return _HEPTopTaggerV2_opt.t();}
const PseudoJet & t() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const std::vector<PseudoJet>& external::HEPTopTaggerV2::top_hadrons ( ) const
inline

Definition at line 218 of file HEPTopTaggerV2.h.

const std::vector< PseudoJet > & top_hadrons() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const std::vector<PseudoJet>& external::HEPTopTaggerV2::top_subjets ( ) const
inline

Definition at line 214 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

const std::vector< PseudoJet > & top_subjets() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
void HEPTopTaggerV2::UnclusterFatjets ( const vector< fastjet::PseudoJet > &  big_fatjets,
vector< fastjet::PseudoJet > &  small_fatjets,
const ClusterSequence &  cs,
const double  small_radius 
)
private

Definition at line 414 of file HEPTopTaggerV2.cc.

References mps_fire::i, parents, and mathSSE::sqrt().

Referenced by run().

417  {
418  for (unsigned i=0; i < big_fatjets.size(); i++) {
419  PseudoJet this_jet = big_fatjets[i];
420  PseudoJet parent1(0, 0, 0, 0), parent2(0, 0, 0, 0);
421  bool test = cseq.has_parents(this_jet, parent1, parent2);
422  double dR = 100;
423 
424  if(test) dR = sqrt(parent1.squared_distance(parent2));
425 
426  if (!test || dR<small_radius) {
427  small_fatjets.push_back(this_jet);
428  } else {
429  vector<fastjet::PseudoJet> parents;
430  parents.push_back(parent1);
431  parents.push_back(parent2);
432  UnclusterFatjets(parents, small_fatjets, cseq, small_radius);
433  }
434  }
435 }
TPRegexp parents
Definition: eve_filter.cc:21
T sqrt(T t)
Definition: SSEVec.h:18
void UnclusterFatjets(const vector< fastjet::PseudoJet > &big_fatjets, vector< fastjet::PseudoJet > &small_fatjets, const ClusterSequence &cs, const double small_radius)
double external::HEPTopTaggerV2::unfiltered_mass ( ) const
inline

Definition at line 206 of file HEPTopTaggerV2.h.

Referenced by HEPTopTaggerV2::result().

HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::W ( ) const
inline

Definition at line 211 of file HEPTopTaggerV2.h.

211 {return _HEPTopTaggerV2_opt.W();}
const PseudoJet & W() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::W1 ( ) const
inline

Definition at line 212 of file HEPTopTaggerV2.h.

212 {return _HEPTopTaggerV2_opt.W1();}
const PseudoJet & W1() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt
const PseudoJet& external::HEPTopTaggerV2::W2 ( ) const
inline

Definition at line 213 of file HEPTopTaggerV2.h.

213 {return _HEPTopTaggerV2_opt.W2();}
const PseudoJet & W2() const
HEPTopTaggerV2_fixed_R _HEPTopTaggerV2_opt

Member Data Documentation

bool external::HEPTopTaggerV2::_debug
private
bool external::HEPTopTaggerV2::_do_optimalR
private

Definition at line 292 of file HEPTopTaggerV2.h.

Referenced by run().

bool external::HEPTopTaggerV2::_do_qjets
private

Definition at line 292 of file HEPTopTaggerV2.h.

Referenced by run().

PseudoJet external::HEPTopTaggerV2::_fat
private

Definition at line 329 of file HEPTopTaggerV2.h.

Referenced by nsub_unfiltered(), and run().

PseudoJet external::HEPTopTaggerV2::_filt_fat
private

Definition at line 329 of file HEPTopTaggerV2.h.

Referenced by nsub_filtered(), and run().

map<int,HEPTopTaggerV2_fixed_R> external::HEPTopTaggerV2::_HEPTopTaggerV2
private

Definition at line 331 of file HEPTopTaggerV2.h.

Referenced by run().

HEPTopTaggerV2_fixed_R external::HEPTopTaggerV2::_HEPTopTaggerV2_opt
private

Definition at line 332 of file HEPTopTaggerV2.h.

Referenced by optimalR_type(), and run().

PseudoJet external::HEPTopTaggerV2::_initial_jet
private

Definition at line 295 of file HEPTopTaggerV2.h.

Referenced by run().

PseudoJet external::HEPTopTaggerV2::_jet
private

Definition at line 294 of file HEPTopTaggerV2.h.

Referenced by run().

fastjet::JetAlgorithm external::HEPTopTaggerV2::_jet_algorithm_filter
private

Definition at line 309 of file HEPTopTaggerV2.h.

Referenced by run().

fastjet::JetAlgorithm external::HEPTopTaggerV2::_jet_algorithm_recluster
private

Definition at line 312 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_m13cutmax
private

Definition at line 304 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_m13cutmin
private

Definition at line 304 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_m23cut
private

Definition at line 304 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_mass_drop_threshold
private

Definition at line 297 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_max_fatjet_R
private

Definition at line 317 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_max_subjet_mass
private

Definition at line 298 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_min_fatjet_R
private

Definition at line 317 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_minpt_subjet
private

Definition at line 310 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_minpt_tag
private

Definition at line 305 of file HEPTopTaggerV2.h.

Referenced by run().

Mode external::HEPTopTaggerV2::_mode
private

Definition at line 300 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_mtmass
private

Definition at line 301 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_mtmax
private

Definition at line 302 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_mtmin
private

Definition at line 302 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_mwmass
private

Definition at line 301 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_N_filt_optimalR_calc
private

Definition at line 319 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_N_filt_optimalR_fail
private

Definition at line 324 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_N_filt_optimalR_pass
private

Definition at line 324 of file HEPTopTaggerV2.h.

Referenced by run().

map<int,int> external::HEPTopTaggerV2::_n_small_fatjets
private

Definition at line 330 of file HEPTopTaggerV2.h.

Referenced by run().

unsigned external::HEPTopTaggerV2::_nfilt
private

Definition at line 307 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_optimalR_fw
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by optimalR_type().

double external::HEPTopTaggerV2::_optimalR_mmax
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by optimalR_type().

double external::HEPTopTaggerV2::_optimalR_mmin
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by optimalR_type().

double external::HEPTopTaggerV2::_optimalR_threshold
private

Definition at line 317 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_pt_for_R_opt_calc
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_dcut_fctr
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_exp_max
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_exp_min
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_rigidity
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_truncation_fctr
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_q_zcut
private

Definition at line 326 of file HEPTopTaggerV2.h.

Referenced by run().

JetDefinition external::HEPTopTaggerV2::_qjet_def
private

Definition at line 327 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_qweight
private

Definition at line 339 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_R_filt_optimalR_calc
private

Definition at line 319 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_R_filt_optimalR_fail
private

Definition at line 324 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_R_filt_optimalR_pass
private

Definition at line 324 of file HEPTopTaggerV2.h.

Referenced by run().

double(* external::HEPTopTaggerV2::_r_min_exp_function) (double)
private

Definition at line 320 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_R_opt_calc
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by optimalR_type(), and run().

double external::HEPTopTaggerV2::_R_opt_diff
private

Definition at line 322 of file HEPTopTaggerV2.h.

Referenced by optimalR_type().

bool external::HEPTopTaggerV2::_R_opt_reject_min
private

Definition at line 323 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_rcut_factor
private

Definition at line 315 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_Rfilt
private

Definition at line 308 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_rmax
private

Definition at line 303 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_rmin
private

Definition at line 303 of file HEPTopTaggerV2.h.

Referenced by run().

CLHEP::HepRandomEngine* external::HEPTopTaggerV2::_rnEngine
private

Definition at line 336 of file HEPTopTaggerV2.h.

Referenced by run().

int external::HEPTopTaggerV2::_Ropt
private

Definition at line 334 of file HEPTopTaggerV2.h.

Referenced by optimalR_type(), and run().

double external::HEPTopTaggerV2::_step_R
private

Definition at line 317 of file HEPTopTaggerV2.h.

Referenced by run().

double external::HEPTopTaggerV2::_zcut
private

Definition at line 314 of file HEPTopTaggerV2.h.

Referenced by run().