FastJet 3.0beta1
TopTaggerBase.hh
00001 #ifndef __FASTJET_TOP_TAGGER_BASE_HH__
00002 #define __FASTJET_TOP_TAGGER_BASE_HH__
00003 
00004 //STARTHEADER
00005 // $Id: TopTaggerBase.hh 2512 2011-08-08 06:38:07Z salam $
00006 //
00007 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
00008 //
00009 //----------------------------------------------------------------------
00010 // This file is part of FastJet.
00011 //
00012 //  FastJet is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU General Public License as published by
00014 //  the Free Software Foundation; either version 2 of the License, or
00015 //  (at your option) any later version.
00016 //
00017 //  The algorithms that underlie FastJet have required considerable
00018 //  development and are described in hep-ph/0512210. If you use
00019 //  FastJet as part of work towards a scientific publication, please
00020 //  include a citation to the FastJet paper.
00021 //
00022 //  FastJet is distributed in the hope that it will be useful,
00023 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 //  GNU General Public License for more details.
00026 //
00027 //  You should have received a copy of the GNU General Public License
00028 //  along with FastJet; if not, write to the Free Software
00029 //  Foundation, Inc.:
00030 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00031 //----------------------------------------------------------------------
00032 //ENDHEADER
00033 
00034 #include <fastjet/tools/Transformer.hh>
00035 
00036 FASTJET_BEGIN_NAMESPACE
00037 
00038 class TopTaggerBaseStructure;
00039 
00040 //----------------------------------------------------------------------
00041 /// A base class that provides a common interface for top taggers
00042 /// that are able to return a W (in addition to the top itself).
00043 ///
00044 /// Top taggers that derive from this should satisfy the following 
00045 /// criteria:
00046 ///
00047 /// - their underlying structure should derive from TopTaggerBaseStructure
00048 /// - tagged tops should have two pieces, the first of which is the W candidate
00049 /// - they should apply the top and W selectors to decide if the top has been
00050 ///   tagged
00051 class TopTaggerBase : public Transformer {
00052 public:
00053   TopTaggerBase() : _top_selector(SelectorIdentity()),
00054                     _W_selector(SelectorIdentity()),
00055                     _top_selector_set(false),
00056                     _W_selector_set(false)              {}
00057 
00058   /// the type of the associated structure
00059   typedef TopTaggerBaseStructure StructureType;
00060 
00061   /// sets the selector that is applied to the top candidate
00062   void set_top_selector(const Selector & sel) {_top_selector = sel; _top_selector_set = true;}
00063   /// sets  the selector that is applied to the W candidate
00064   void set_W_selector  (const Selector & sel) {_W_selector   = sel; _W_selector_set = true;}
00065   
00066   /// returns a description of the top and W selectors
00067   virtual std::string description_of_selectors() const {
00068     std::string result;
00069     if (_top_selector_set) result = ", top selector: "+_top_selector.description();
00070     if (_W_selector_set) result += ", W selector: "+_W_selector.description();
00071     return result;
00072   }
00073 
00074 protected:
00075   Selector _top_selector, _W_selector;
00076   bool _top_selector_set, _W_selector_set;
00077 };
00078 
00079 
00080 //----------------------------------------------------------------------
00081 /// class that specifies the structure common to all top taggers
00082 ///
00083 /// Note that this specifies only the W, non_W part of the
00084 /// interface. An actual top tagger structure class will also need to
00085 /// derive from a PseudoJetStructureBase type class
00086 /// (e.g. CompositeJetStructure)
00087 class TopTaggerBaseStructure {
00088 public:
00089   virtual const PseudoJet & W() const = 0;
00090   virtual const PseudoJet & non_W() const = 0;
00091   virtual ~TopTaggerBaseStructure() {}
00092 };
00093 
00094 
00095 FASTJET_END_NAMESPACE
00096 
00097 #endif  //  __FASTJET_TOP_TAGGER_BASE_HH__
00098 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends