FastJet 3.0.5
Transformer.hh
00001 //STARTHEADER
00002 // $Id: Transformer.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_TRANSFORMER_HH__
00030 #define __FASTJET_TRANSFORMER_HH__
00031 
00032 #include <fastjet/PseudoJet.hh>
00033 #include <fastjet/FunctionOfPseudoJet.hh>
00034 #include <fastjet/PseudoJetStructureBase.hh>
00035 
00036 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00037 
00038 // forward declarations of what we will have down here
00039 class Transformer;
00040 
00041 /// @ingroup tools_generic
00042 /// \class Transformer
00043 ///
00044 /// Base (abstract) class for a jet transformer.
00045 ///
00046 /// A transformer, when it acts on a jet, returns a modified version
00047 /// of that jet, one that may have a different momentum and/or
00048 /// different internal structure.
00049 ///
00050 /// The typical usage of a class derived from Transformer is
00051 /// \code
00052 ///   SomeTransformer transformer(...);
00053 ///   PseudoJet transformed_jet = transformer(original_jet);
00054 ///   // or
00055 ///   vector<PseudoJet> transformed_jets = transformer(original_jets);
00056 /// \endcode
00057 ///
00058 /// For many transformers, the transformed jets have
00059 /// transformer-specific information that can be accessed through the
00060 ///
00061 /// \code
00062 ///   transformed_jet.structure_of<SomeTransformer>().transformer_specific_info();
00063 /// \endcode
00064 ///
00065 /// See the description of the Filter class for a more detailed usage
00066 /// example. See the FastJet manual to find out how to implement
00067 /// new transformers.
00068 ///
00069 class Transformer : public FunctionOfPseudoJet<PseudoJet>{
00070 public:
00071   /// default ctor
00072   Transformer(){}
00073 
00074   /// default dtor
00075   virtual ~Transformer(){}
00076 
00077   /// the result of the Transformer acting on the PseudoJet.
00078   /// this _has_ to be overloaded in derived classes
00079   /// \param original   the PseudoJet input to the Transformer
00080   virtual PseudoJet result(const PseudoJet & original) const = 0;
00081 
00082   /// This should be overloaded to return a description of the
00083   /// Transformer
00084   virtual std::string description() const = 0;
00085 
00086   /// A typedef that is needed to ensure that the
00087   /// PseudoJet::structure_of() template function works
00088   //
00089   // Make sure you reimplement this appropriately in any
00090   // derived classes
00091   typedef PseudoJetStructureBase StructureType;
00092 };
00093 
00094 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
00095 
00096 #endif // __FASTJET_TRANSFORMER_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends