CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HEPTopTaggerWrapper.h
Go to the documentation of this file.
1 // 2011 Christopher Vermilion
2 //
3 //----------------------------------------------------------------------
4 // This file is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This file is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // The GNU General Public License is available at
15 // http://www.gnu.org/licenses/gpl.html or you can write to the Free Software
16 // Foundation, Inc.:
17 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 //----------------------------------------------------------------------
19 
20 #ifndef __HEPTOPTAGGER_WRAPPER_HH__
21 #define __HEPTOPTAGGER_WRAPPER_HH__
22 
23 #include <fastjet/tools/TopTaggerBase.hh>
24 #include <fastjet/CompositeJetStructure.hh>
25 #include <sstream>
26 
27 FASTJET_BEGIN_NAMESPACE
28 
43 
44 
45 class HEPTopTagger : public TopTaggerBase {
46 public:
56  HEPTopTagger(double mass_drop_threshold=0.8, double max_subjet_mass=30.,
57  bool use_subjet_mass_cuts=false)
58  : _mass_drop_threshold(mass_drop_threshold),
59  _max_subjet_mass(max_subjet_mass),
60  _use_subjet_mass_cuts(use_subjet_mass_cuts)
61  {}
62 
64  virtual std::string description() const;
65 
70  virtual PseudoJet result(const PseudoJet & jet) const;
71 
72  // the type of the associated structure
74 
75 private:
76  double _mass_drop_threshold;
77  double _max_subjet_mass;
79 };
80 
81 
84 
85 //BEGIN COMMENTING OUT BY CHRISTOPHER SILKWORTH
86 /*
87 class HEPTopTaggerStructure : public JHTopTaggerStructure {
88 public:
89  HEPTopTaggerStructure(std::vector<PseudoJet> pieces,
90  const JetDefinition::Recombiner *recombiner = 0)
91  : JHTopTaggerStructure(pieces, recombiner) {}
92 
93 protected:
94  friend class HEPTopTagger;
95 };
96 */
97 //END COMMENTING OUT
98 
99 //BEGIN ADDED BY CHRISTOPHER SILKWORTH
100 
101 
102 class HEPTopTaggerStructure : public CompositeJetStructure, public TopTaggerBaseStructure {
103  public:
105  HEPTopTaggerStructure(const std::vector<PseudoJet>& pieces_in,
106  const JetDefinition::Recombiner *recombiner = 0) :
107  CompositeJetStructure(pieces_in, recombiner), _cos_theta_w(0.0),W_rec(recombiner),
108  rW_()
109  {}
110 
112  inline PseudoJet const & W() const{
113  rW_ = join(_pieces[0], _pieces[1], *W_rec);
114  return rW_;
115  }
116 
117 
118  inline PseudoJet W1() const{
119  assert(W().pieces().size()>0);
120  return W().pieces()[0];
121  }
122 
124  inline PseudoJet W2() const{
125  assert(W().pieces().size()>1);
126  return W().pieces()[1];
127  }
128 
129 
133  inline const PseudoJet & non_W() const{
134  return _pieces[2];
135  }
136 
138  inline double cos_theta_W() const {return _cos_theta_w;}
139 
140  // /// returns the original jet (before tagging)
141  // const PseudoJet & original() const {return _original_jet;}
142 
143 
144 
145  protected:
146  double _cos_theta_w;
147  const JetDefinition::Recombiner * W_rec;
148  //PseudoJet _W; ///< the tagged W
149  //PseudoJet _non_W; ///< the remaining pieces
150  // PseudoJet _original_jet; ///< the original jet (before tagging)
151 
152  mutable PseudoJet rW_;
153 
154  // allow the tagger to set these
155  friend class HEPTopTagger;
156  };
157 
158 
159 //END ADDED BY CHRISTOPHER SILKWORTH
160 
161 
162 //------------------------------------------------------------------------
163 // description of the tagger
165  std::ostringstream oss;
166  oss << "HEPTopTagger with {max. subjet mass = " << _max_subjet_mass
167  << ", mass-drop threshold = " << _mass_drop_threshold
168  << ", and " << (_use_subjet_mass_cuts ? "using" : "not using") << " subjet mass cuts" << std::endl;
169  oss << description_of_selectors();
170  return oss.str();
171 }
172 
173 
174 FASTJET_END_NAMESPACE
175 
176 #endif // __HEPTOPTAGGER_HH__
tuple pieces
Definition: csv2json.py:31
assert(m_qm.get())
double _max_subjet_mass
Definition: HEPTopTagger.h:51
virtual PseudoJet result(const PseudoJet &jet) const
PseudoJet const & W() const
returns the W subjet
fastjet::PseudoJet PseudoJet
Definition: HEPTopTagger.h:10
HEPTopTagger(double mass_drop_threshold=0.8, double max_subjet_mass=30., bool use_subjet_mass_cuts=false)
virtual std::string description() const
returns a textual description of the tagger
const PseudoJet & non_W() const
HEPTopTaggerStructure StructureType
const JetDefinition::Recombiner * W_rec
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
PseudoJet W2() const
returns the second W subjet
double _mass_drop_threshold
Definition: HEPTopTagger.h:50
double cos_theta_W() const
returns the W helicity angle
double _cos_theta_w
the W helicity angle
tuple size
Write out results.
bool _use_subjet_mass_cuts
whether to include the is_masscut_passed() test
HEPTopTaggerStructure(const std::vector< PseudoJet > &pieces_in, const JetDefinition::Recombiner *recombiner=0)
ctor with pieces initialisation