FastJet 3.0beta1
Transformer.hh
00001 //STARTHEADER
00002 // $Id: Transformer.hh 2411 2011-07-08 16:29:00Z 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_TRANSFORMER_HH__
00032 #define __FASTJET_TRANSFORMER_HH__
00033 
00034 #include <fastjet/PseudoJet.hh>
00035 #include <fastjet/FunctionOfPseudoJet.hh>
00036 #include <fastjet/PseudoJetStructureBase.hh>
00037 
00038 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00039 
00040 // forward declarations of what we will have down here
00041 class Transformer;
00042 
00043 /// @ingroup tools_generic
00044 /// \class Transformer
00045 /// Base (abstract) class for a jet transformer.
00046 ///
00047 /// The idea of a transformer is that applied to a jet, it somehow
00048 /// modifies its momentum and/or contents. If applied to a vector of
00049 /// jets, the Transformer is applied to each one individually.
00050 ///
00051 /// This class here is a base class that provides a basic template on
00052 /// which actual Transformers may be built (one example is a tagger).
00053 ///
00054 /// Any new transformer must implement result(), but its action can
00055 /// equivalently be accessed through the operator() that works either
00056 /// on a single PseudoJet or on a vector of PseudoJet.
00057 ///
00058 /// In addition many transformers will want to associated extra
00059 /// information on the resulting jet's substructure, by setting a
00060 /// shared pointer to some class derived from PseudoJetStructureBase.
00061 /// It is the user's responsability to implement this and also set up
00062 /// a typedef so that DerivedTransformer::StructureType is the
00063 /// corresponding Structure type. See any of the derived transformers
00064 /// already implemented for explicit examples). 
00065 /// 
00066 /// This associated information about the structure of the PseudoJet
00067 /// can then be accessed using either
00068 ///   p.structure<DerivedStructureType>()
00069 /// or
00070 ///   p.extra_properties<DerivedTransformer>()
00071 /// which both return a reference to the associated structure.
00072 ///
00073 /// To check if the structure associated to a given PseudoJet is
00074 /// compatible with the one produced by a DerivedTransformer, one can
00075 /// also use
00076 ///   if (p.has_properties_of<DerivedTransformer>()) ...;
00077 ///
00078 /// [.......comments still under preparation......]
00079 ///
00080 /// transformation on them and return the list of modified jets This
00081 /// base class sets the fundamental requirements for all the
00082 /// transformers.
00083 /// 
00084 /// Similarly, to gain access to the information relative to the
00085 /// transformation, a "transformed" PseudoJet will have a
00086 /// corresponding PropertyInterface. Any transformer thus must
00087 /// provide (at least) 2 classes:
00088 ///  - the transformer itself (derived from Transformer)
00089 ///  - the associated property class (derived from TransformerInterface see below)
00090 ///
00091 class Transformer : public FunctionOfPseudoJet<PseudoJet>{
00092 public:
00093   /// default ctor
00094   Transformer(){}
00095 
00096   /// default dtor
00097   virtual ~Transformer(){}
00098 
00099   /// the result of the Transformer acting on the PseudoJet.
00100   /// this _has_ to be overloaded in derived classes
00101   /// \param original   the PseudoJet input to the Transformer
00102   virtual PseudoJet result(const PseudoJet & original) const = 0;
00103 
00104   /// This should be overloaded to return a description of the
00105   /// Transformer
00106   virtual std::string description() const = 0;
00107 
00108 
00109   /// information about the associated structure type
00110   typedef PseudoJetStructureBase StructureType;
00111 };
00112 
00113 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
00114 
00115 #endif // __FASTJET_TRANSFORMER_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends