Fork me on GitHub

source: svn/trunk/external/fastjet/tools/Transformer.hh@ 1231

Last change on this file since 1231 was 999, checked in by Pavel Demin, 12 years ago

add fastjet/tools

File size: 3.3 KB
Line 
1//STARTHEADER
2// $Id: Transformer.hh 2577 2011-09-13 15:11:38Z salam $
3//
4// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
5//
6//----------------------------------------------------------------------
7// This file is part of FastJet.
8//
9// FastJet is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// The algorithms that underlie FastJet have required considerable
15// development and are described in hep-ph/0512210. If you use
16// FastJet as part of work towards a scientific publication, please
17// include a citation to the FastJet paper.
18//
19// FastJet is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU General Public License for more details.
23//
24// You should have received a copy of the GNU General Public License
25// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
26//----------------------------------------------------------------------
27//ENDHEADER
28
29#ifndef __FASTJET_TRANSFORMER_HH__
30#define __FASTJET_TRANSFORMER_HH__
31
32#include <fastjet/PseudoJet.hh>
33#include <fastjet/FunctionOfPseudoJet.hh>
34#include <fastjet/PseudoJetStructureBase.hh>
35
36FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
37
38// forward declarations of what we will have down here
39class Transformer;
40
41/// @ingroup tools_generic
42/// \class Transformer
43///
44/// Base (abstract) class for a jet transformer.
45///
46/// A transformer, when it acts on a jet, returns a modified version
47/// of that jet, one that may have a different momentum and/or
48/// different internal structure.
49///
50/// The typical usage of a class derived from Transformer is
51/// \code
52/// SomeTransformer transformer(...);
53/// PseudoJet transformed_jet = transformer(original_jet);
54/// // or
55/// vector<PseudoJet> transformed_jets = transformer(original_jets);
56/// \endcode
57///
58/// For many transformers, the transformed jets have
59/// transformer-specific information that can be accessed through the
60///
61/// \code
62/// transformed_jet.structure_of<SomeTransformer>().transformer_specific_info();
63/// \endcode
64///
65/// See the description of the Filter class for a more detailed usage
66/// example. See the FastJet manual to find out how to implement
67/// new transformers.
68///
69class Transformer : public FunctionOfPseudoJet<PseudoJet>{
70public:
71 /// default ctor
72 Transformer(){}
73
74 /// default dtor
75 virtual ~Transformer(){}
76
77 /// the result of the Transformer acting on the PseudoJet.
78 /// this _has_ to be overloaded in derived classes
79 /// \param original the PseudoJet input to the Transformer
80 virtual PseudoJet result(const PseudoJet & original) const = 0;
81
82 /// This should be overloaded to return a description of the
83 /// Transformer
84 virtual std::string description() const = 0;
85
86 /// A typedef that is needed to ensure that the
87 /// PseudoJet::structure_of() template function works
88 //
89 // Make sure you reimplement this appropriately in any
90 // derived classes
91 typedef PseudoJetStructureBase StructureType;
92};
93
94FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
95
96#endif // __FASTJET_TRANSFORMER_HH__
Note: See TracBrowser for help on using the repository browser.