FastJet 3.0alpha3
CASubJetTagger.hh
00001 //STARTHEADER
00002 // $Id: CASubJetTagger.hh 2211 2011-06-02 19:55:59Z salam $
00003 //
00004 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet; if not, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 #ifndef __CASUBJET_TAGGER_HH__
00032 #define __CASUBJET_TAGGER_HH__
00033 
00034 #include <fastjet/PseudoJet.hh>
00035 #include <fastjet/WrappedStructure.hh>
00036 #include <fastjet/tools/Transformer.hh>
00037 #include "fastjet/internal/LimitedWarning.hh"
00038 
00039 FASTJET_BEGIN_NAMESPACE
00040 
00041 class CASubJetTagger;
00042 class CASubJetStructure;
00043 
00044 //----------------------------------------------------------------------
00045 /// @ingroup tools
00046 /// \class CASubJetTagger
00047 /// clean (almost parameter-free) tagger searching for the element in
00048 /// the clustering history that maximises a chosen distance
00049 ///
00050 /// class to help us get a clean (almost parameter-free) handle on
00051 /// substructure inside a C/A jet. It follows the logic described in
00052 /// arXiv:0906.0728 (and is inspired by the original Cambridge
00053 /// algorithm paper in its use of separate angular and dimensionful
00054 /// distances), but provides some extra flexibility.
00055 ///
00056 /// It searches for all splittings that pass a symmetry cut (zcut) and
00057 /// then selects the one with the largest auxiliary scale choice
00058 /// (e.g. jade distance of the splitting, kt distance of the
00059 /// splitting, etc.)
00060 ///
00061 /// By default, the zcut is calculated from the fraction of the child
00062 /// pt carried by the parent jet. If one calls set_absolute_z_cut the
00063 /// fraction of transverse momentum will be computed wrt the original
00064 /// jet.
00065 ///
00066 /// original code copyright (C) 2009 by Gavin Salam, released under
00067 /// the GPL.
00068 ///
00069 /// \section desc Options
00070 /// 
00071 ///  - the distance choice: options are
00072 ///        kt2_distance        : usual min(kti^2,ktj^2)DeltaR_{ij}^2
00073 ///        jade_distance       : kti . ktj DeltaR_{ij}^2 (LI version of jade)
00074 ///        jade2_distance      : kti . ktj DeltaR_{ij}^4 (LI version of jade * DR^2)
00075 ///        plain_distance      :           DeltaR_{ij}^2
00076 ///        mass_drop_distance  : m_jet - max(m_parent1,m_parent2)
00077 ///        dot_product_distance: parent1.parent2
00078 ///    (kt2_distance by default)
00079 ///
00080 ///  - the z cut (0 by default)
00081 ///
00082 ///  - by calling set_absolute_z_cut(), one can ask that the pt
00083 ///    fraction if calculated wrt the original jet
00084 ///
00085 ///  - by calling set_dr_min(drmin), one can ask that only the
00086 ///    recombinations where the 2 objects are (geometrically) distant
00087 ///    by at least drmin are kept in the maximisation.
00088 ///
00089 /// \section input Input conditions
00090 /// 
00091 ///  - the jet must have been obtained from a Cambridge/Aachen cluster
00092 ///    sequence
00093 ///
00094 /// \section output Output/structure
00095 /// 
00096 ///  - the element of the cluster sequence maximising the requested
00097 ///    distance (and satisfying the zcut) is returned.
00098 ///
00099 ///  - if the original jet has no parents, it will be returned
00100 ///
00101 ///  - the value of the "z" and distance corresponding to that history
00102 ///    element are stored and accessible through
00103 ///      result.structure_of<CASubJetTagger>().z();
00104 ///      result.structure_of<CASubJetTagger>().distance();
00105 ///
00106 class CASubJetTagger : public Transformer {
00107 public:
00108 
00109   /// the available choices of auxiliary scale with respect to which
00110   /// to order the splittings
00111   enum ScaleChoice {
00112     kt2_distance,        //< usual min(kti^2,ktj^2)DeltaR_{ij}^2
00113     jade_distance,       //< kti . ktj DeltaR_{ij}^2 (LI version of jade)
00114     jade2_distance,      //< kti . ktj DeltaR_{ij}^4 (LI version of jade * DR^2)
00115     plain_distance,      //<           DeltaR_{ij}^2
00116     mass_drop_distance,  //<    m_jet - max(m_parent1,m_parent2)
00117     dot_product_distance //<  parent1.parent2
00118   };
00119 
00120   /// just constructs
00121   CASubJetTagger(ScaleChoice scale_choice = jade_distance,
00122                  double      z_threshold  = 0.1)
00123     : _scale_choice(scale_choice), _z_threshold(z_threshold),
00124       _dr2_min(0.0), _absolute_z_cut(false){};
00125 
00126   /// sets a minimum delta R below which spliting will be ignored
00127   /// (only relevant if set prior to calling run())
00128   void set_dr_min(double drmin) {_dr2_min = drmin*drmin;}
00129 
00130   /// the tagger's description
00131   virtual std::string description() const;
00132 
00133   /// If (abs_z_cut) is set to false (the default) then for a
00134   /// splitting to be considered, each subjet must satisfy 
00135   /// 
00136   ///        p_{t,sub} > z_threshold * p_{t,parent}
00137   ///
00138   /// whereas if it is set to true, then each subject must satisfy
00139   ///
00140   ///        p_{t,sub} > z_threshold * p_{t,original-jet}
00141   ///
00142   /// where parent is the immediate parent of the splitting, and
00143   /// original jet is the one supplied to the run() function.
00144   ///
00145   /// Only relevant is called prior to run().
00146   void set_absolute_z_cut(bool abs_z_cut=true) {_absolute_z_cut = abs_z_cut;}
00147   
00148   /// run the tagger on the given cs/jet
00149   virtual PseudoJet result(const fastjet::PseudoJet & jet) const;
00150 
00151   /// the type of Structure returned
00152   typedef CASubJetStructure StructureType;
00153 
00154 protected:
00155   /// class that contains the result internally
00156   class JetAux {
00157   public:
00158     fastjet::PseudoJet jet;          //< the subjet (immediate parent of splitting)
00159     double             aux_distance; //< the auxiliary distance between its two subjets
00160     double             delta_r;      //< the angular distance between its two subjets
00161     double             z;            //< the transverse momentum fraction
00162   };
00163 
00164 
00165   void _recurse_through_jet(const PseudoJet & current_jet, 
00166                             JetAux &aux_max,
00167                             const PseudoJet & original_jet) const;
00168 
00169   ScaleChoice _scale_choice;
00170   double      _z_threshold;
00171   double      _dr2_min;
00172   bool        _absolute_z_cut;
00173 
00174   static  LimitedWarning _non_ca_warnings;
00175 };
00176 
00177 
00178 //------------------------------------------------------------------------
00179 /// @ingroup tools
00180 /// the structure returned by a CASubJetTagger
00181 ///
00182 /// Since this is directly an element of the ClusterSequence, we keep
00183 /// basically the original ClusterSequenceStructure (wrapped for
00184 /// memory-management reasons) and add information about the pt
00185 /// fraction and distance of the subjet structure
00186 class CASubJetStructure : public WrappedStructure{
00187 public:
00188   /// default ctor
00189   ///  \param result_jet   the jet for which we have to keep the
00190   ///                      structure
00191   CASubJetStructure(const PseudoJet & result_jet)
00192     : WrappedStructure(result_jet.structure_shared_ptr()){}
00193 
00194   /// returns the scale choice asked for the maximisation
00195   CASubJetTagger::ScaleChoice scale_choice() const {return _scale_choice;}
00196 
00197   /// returns the value of the distance measure (corresponding to
00198   /// ScaleChoice) for this jet's splitting
00199   double distance() const {return _distance;}
00200 
00201   /// returns the pt fraction contained by the softer of the two component
00202   /// pieces of this jet (normalised relative to this jet)
00203   double z() const {return _z;}
00204 
00205   /// returns the pt fraction contained by the softer of the two component
00206   /// pieces of this jet (normalised relative to the original jet)
00207   bool absolute_z() const {return _absolute_z;}
00208 
00209 
00210 protected:
00211   CASubJetTagger::ScaleChoice _scale_choice; ///< the user scale choice 
00212   double _distance;  ///< the maximal distance associated with the result
00213   bool _absolute_z;  ///< whether z is computed wrt to the original jet or not
00214   double _z;         ///< the transverse momentum fraction
00215 
00216   friend class CASubJetTagger; ///< to allow setting the internal information
00217 };
00218 
00219 FASTJET_END_NAMESPACE
00220 
00221 #endif // __CASUBJET_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends