FastJet 3.0beta1
Subtractor.hh
00001 //STARTHEADER
00002 // $Id: Subtractor.hh 2486 2011-08-02 09:38:36Z 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 __FASTJET_TOOLS_SUBTRACTOR_HH__
00032 #define __FASTJET_TOOLS_SUBTRACTOR_HH__
00033 
00034 #include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer
00035 #include "fastjet/tools/BackgroundEstimatorBase.hh" // used as a ctor argument
00036 
00037 FASTJET_BEGIN_NAMESPACE     // defined in fastjet/internal/base.hh
00038 
00039 
00040 //----------------------------------------------------------------------
00041 /// @ingroup tools_background
00042 /// \class Subtractor
00043 /// Class that helps perform jet background subtraction.
00044 ///
00045 /// This class derives from Transformer and makes use of a pointer to
00046 /// a BackgroundEstimatorBase object in order to determine the background
00047 /// in the vicinity of a given jet and then subtract area*background from
00048 /// the jet. It can also be initialised with a specific fixed value for the 
00049 /// background pt density.
00050 ///
00051 /// \section input Input conditions
00052 /// 
00053 /// The original jet must have area support (4-vector)
00054 ///
00055 /// \section output Output/interface
00056 /// 
00057 /// The underlying structure of the returned, subtracted jet
00058 /// (i.e. constituents, pieces, etc.) is identical to that of the
00059 /// original jet.
00060 ///
00061 class Subtractor : public Transformer{
00062 public:
00063   /// define a subtractor based on a BackgroundEstimator
00064   Subtractor(BackgroundEstimatorBase * bge) : 
00065     _bge(bge), _rho(-1.0) {}
00066 
00067   /// define a subtractor that uses a fixed value of rho, the background
00068   /// pt density per unit area (which must be positive)
00069   Subtractor(double rho);
00070 
00071   /// default constructor
00072   Subtractor() : _bge(0), _rho(_invalid_rho) {}
00073 
00074   /// default dtor
00075   virtual ~Subtractor(){};
00076 
00077   /// returns a jet that's subtracted
00078   ///
00079   /// \param jet    the jet that is to be subtracted
00080   /// \return       the subtracted jet
00081   virtual PseudoJet result(const PseudoJet & jet) const;
00082 
00083   /// class description
00084   virtual std::string description() const;
00085 
00086 protected:
00087 
00088   /// the tool used to estimate the background
00089   /// if has to be mutable in case its underlying selector takes a reference jet
00090   mutable BackgroundEstimatorBase * _bge;
00091   /// the fixed value of rho to use if the user has selected that option
00092   double _rho;
00093 
00094   /// a value of rho that is used as a default to label that the stored
00095   /// rho is not valid for subtraction. 
00096   //
00097   // NB: there are two reasons for not having the value written here:
00098   // 1) that it caused problems on karnak with g++ 4.0.1 and 2) that
00099   // we anyway like -infinity as a default, and since that's a function,
00100   // that's not allowed in an include file.
00101   static const double _invalid_rho;
00102 };
00103 
00104 FASTJET_END_NAMESPACE
00105 
00106 #endif  // __FASTJET_TOOLS_SUBTRACTOR_HH__
00107 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends