Fork me on GitHub

source: git/external/fastjet/AreaDefinition.hh@ 058667b

Last change on this file since 058667b was cb80e6f, checked in by Pavel Demin <pavel.demin@…>, 4 years ago

update FastJet library to 3.3.4 and FastJet Contrib library to 1.045

  • Property mode set to 100644
File size: 5.1 KB
Line 
1//FJSTARTHEADER
2// $Id: AreaDefinition.hh 4442 2020-05-05 07:50:11Z soyez $
3//
4// Copyright (c) 2006-2020, 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///
50class VoronoiAreaSpec {
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
82class AreaDefinition {
83public:
84
85 /// default constructor, which provides a ghosted active area, with
86 /// sensible defaults for the ghosts.
87 AreaDefinition() {
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
94 AreaDefinition(AreaType type, const GhostedAreaSpec & spec) {
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)
102 AreaDefinition(AreaType type, const VoronoiAreaSpec & spec) {
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
110 AreaDefinition(AreaType type) {
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
129 AreaDefinition(const VoronoiAreaSpec & spec) {
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
147private:
148
149 AreaType _area_type;
150 GhostedAreaSpec _ghost_spec;
151 VoronoiAreaSpec _voronoi_spec;
152};
153
154FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
155
156
157#endif // __FASTJET_AREADEFINITION_HH__
Note: See TracBrowser for help on using the repository browser.