00001 #ifndef __FASTJET_TRANSFORMER_HH__ 00002 #define __FASTJET_TRANSFORMER_HH__ 00003 00004 //STARTHEADER 00005 // $Id$ 00006 // 00007 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin Salam and Gregory Soyez 00008 // 00009 //---------------------------------------------------------------------- 00010 // This file is part of FastJet. 00011 // 00012 // FastJet is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU General Public License as published by 00014 // the Free Software Foundation; either version 2 of the License, or 00015 // (at your option) any later version. 00016 // 00017 // The algorithms that underlie FastJet have required considerable 00018 // development and are described in hep-ph/0512210. If you use 00019 // FastJet as part of work towards a scientific publication, please 00020 // include a citation to the FastJet paper. 00021 // 00022 // FastJet is distributed in the hope that it will be useful, 00023 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 // GNU General Public License for more details. 00026 // 00027 // You should have received a copy of the GNU General Public License 00028 // along with FastJet; if not, write to the Free Software 00029 // Foundation, Inc.: 00030 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00031 //---------------------------------------------------------------------- 00032 //ENDHEADER 00033 00034 #include <fastjet/SharedPtr.hh> 00035 #include <fastjet/PseudoJet.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 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 filter). 00053 /// 00054 /// Any new transformer must implement the operator(). 00055 /// 00056 /// In addition many transformers will want to associated extra 00057 /// information on the resulting jet's substructure, by setting a 00058 /// shared pointer to some class derived from PseudoJetInterfaceBase. 00059 /// It is the user's responsability to implement this and also set 00060 /// up a typedef so that DerivedTransformer::InterfaceType is the 00061 /// corresponding Interface type. 00062 /// 00063 /// [.......comments still under preparation......] 00064 /// 00065 /// transformation on them and return the list of modified jets This 00066 /// base class sets the fundamental requirements for all the 00067 /// transformers. 00068 /// 00069 /// Similarly, to gain access to the information relative to the 00070 /// transformation, a "transformed" PseudoJet will have a 00071 /// corresponding PropertyInterface. Any transformer thus must 00072 /// provide (at least) 2 classes: 00073 /// - the transformer itself (derived from Transformer) 00074 /// - the associated property class (derived from TransformerInterface see below) 00075 class Transformer{ 00076 public: 00077 /// default ctor 00078 Transformer(){} 00079 00080 /// default dtor 00081 virtual ~Transformer(){} 00082 00083 /// description of the transformer 00084 virtual std::string description() const; 00085 00086 /// information about the associated structure type 00087 typedef PseudoJetStructureBase StructureType; 00088 00089 /// action of the transformer on a single jet 00090 virtual PseudoJet operator()(const PseudoJet & original) const; 00091 00092 /// action of the transformer on each jet from the vector 00093 virtual std::vector<PseudoJet> operator()(const std::vector<PseudoJet> & originals) const; 00094 }; 00095 00096 FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh 00097 00098 #endif // __FASTJET_TRANSFORMER_HH__