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