FastJet 3.4.1
AreaDefinition.hh
1//FJSTARTHEADER
2// $Id$
3//
4// Copyright (c) 2006-2023, 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. They are described in the original FastJet paper,
16// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
17// FastJet as part of work towards a scientific publication, please
18// quote the version you use and include a citation to the manual and
19// optionally also to hep-ph/0512210.
20//
21// FastJet is distributed in the hope that it will be useful,
22// but WITHOUT ANY WARRANTY; without even the implied warranty of
23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24// GNU General Public License for more details.
25//
26// You should have received a copy of the GNU General Public License
27// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
28//----------------------------------------------------------------------
29//FJENDHEADER
30
31
32#ifndef __FASTJET_AREADEFINITION_HH__
33#define __FASTJET_AREADEFINITION_HH__
34
35#include "fastjet/GhostedAreaSpec.hh"
36
37FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
38
39//----------------------------------------------------------------------
40//
41/// @ingroup area_classes
42/// \class VoronoiAreaSpec
43/// Specification for the computation of the Voronoi jet area
44///
45/// class for holding a "Voronoi area" specification; an area will be
46/// assigned to each particle, which is the area of the intersection
47/// of the particle's Voronoi cell with a circle of radius
48/// R*effective_Rfact.
49///
51public:
52
53 /// default constructor (effective_Rfact = 1);
54 VoronoiAreaSpec() : _effective_Rfact(1.0) {};
55
56 /// constructor that allows you to set effective_Rfact.
57 VoronoiAreaSpec(double effective_Rfact_in) :
58 _effective_Rfact(effective_Rfact_in) {};
59
60 /// return the value of effective_Rfact
61 double effective_Rfact() const {return _effective_Rfact;}
62
63 /// return a textual description of the area definition.
64 std::string description() const;
65
66private:
67 double _effective_Rfact;
68};
69
70
71/// the different types of area that are supported
72enum AreaType {invalid_area = -1,
73 active_area = 0, active_area_explicit_ghosts = 1,
74 one_ghost_passive_area = 10, passive_area = 11,
75 voronoi_area=20};
76
77
78//----------------------------------------------------------------------
79/// @ingroup area_classes
80/// \class AreaDefinition
81/// class that holds a generic area definition
83public:
84
85 /// default constructor, which provides a ghosted active area, with
86 /// sensible defaults for the ghosts.
88 _area_type = active_area;
89 _ghost_spec = GhostedAreaSpec();
90 }
91
92 /// constructor for an area definition based on an area type and a
93 /// ghosted area specification
95 _ghost_spec = spec;
96 _area_type = type;
97 assert(type != voronoi_area);
98 }
99
100 /// constructor for an area definition based on an area type and a
101 /// voronoi area specification (type must be voronoi_area)
103 _voronoi_spec = spec;
104 _area_type = type;
105 assert(type == voronoi_area);
106 }
107
108 /// constructor for an area definition based on an area type and
109 /// which attempts to provide sensible defaults for everything else
111 _area_type = type;
112 if (type == voronoi_area) {
113 _voronoi_spec = VoronoiAreaSpec();
114 } else {
115 _ghost_spec = GhostedAreaSpec();
116 }
117 }
118
119 /// constructor for an area definition based on an ghosted area
120 /// specification, and an option to select which ghosted area you want
121 AreaDefinition(const GhostedAreaSpec & spec, AreaType type = active_area) {
122 _ghost_spec = spec;
123 _area_type = type;
124 assert(type != voronoi_area);
125 }
126
127 /// constructor for an area definition based on a voronoi area
128 /// specification
130 _voronoi_spec = spec;
131 _area_type = voronoi_area;
132 }
133
134 /// return a description of the current area definition
135 std::string description() const;
136
137 /// return info about the type of area being used by this defn
138 AreaType area_type() const {return _area_type;}
139
140 /// return a reference to the active area spec
141 const GhostedAreaSpec & ghost_spec() const {return _ghost_spec;}
142 GhostedAreaSpec & ghost_spec() {return _ghost_spec;}
143
144 /// return a reference to the voronoi area spec
145 const VoronoiAreaSpec & voronoi_spec() const {return _voronoi_spec;}
146
147 /// return a copy of this AreaDefinition with a user-defined set of seeds
148 AreaDefinition with_fixed_seed(const std::vector<int> & iseed) const{
149 if (_area_type == voronoi_area) {
150 return *this;
151 } else {
152 return AreaDefinition(_area_type, _ghost_spec.with_fixed_seed(iseed));
153 }
154 }
155
156private:
157
158 AreaType _area_type;
159 GhostedAreaSpec _ghost_spec;
160 VoronoiAreaSpec _voronoi_spec;
161};
162
163FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
164
165
166#endif // __FASTJET_AREADEFINITION_HH__
class that holds a generic area definition
const GhostedAreaSpec & ghost_spec() const
return a reference to the active area spec
AreaDefinition()
default constructor, which provides a ghosted active area, with sensible defaults for the ghosts.
AreaDefinition(AreaType type, const GhostedAreaSpec &spec)
constructor for an area definition based on an area type and a ghosted area specification
const VoronoiAreaSpec & voronoi_spec() const
return a reference to the voronoi area spec
AreaDefinition(AreaType type, const VoronoiAreaSpec &spec)
constructor for an area definition based on an area type and a voronoi area specification (type must ...
AreaDefinition with_fixed_seed(const std::vector< int > &iseed) const
return a copy of this AreaDefinition with a user-defined set of seeds
AreaDefinition(const VoronoiAreaSpec &spec)
constructor for an area definition based on a voronoi area specification
AreaType area_type() const
return info about the type of area being used by this defn
AreaDefinition(AreaType type)
constructor for an area definition based on an area type and which attempts to provide sensible defau...
AreaDefinition(const GhostedAreaSpec &spec, AreaType type=active_area)
constructor for an area definition based on an ghosted area specification, and an option to select wh...
Parameters to configure the computation of jet areas using ghosts.
Specification for the computation of the Voronoi jet area.
VoronoiAreaSpec()
default constructor (effective_Rfact = 1);
VoronoiAreaSpec(double effective_Rfact_in)
constructor that allows you to set effective_Rfact.
double effective_Rfact() const
return the value of effective_Rfact
AreaType
the different types of area that are supported