]>
Commit | Line | Data |
---|---|---|
370be031 | 1 | //STARTHEADER |
2 | // $Id: AreaDefinition.hh 635 2007-05-10 18:37:10Z salam $ | |
3 | // | |
4 | // Copyright (c) 2006-2007, Matteo Cacciari, Gavin 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, write to the Free Software | |
26 | // Foundation, Inc.: | |
27 | // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
28 | //---------------------------------------------------------------------- | |
29 | //ENDHEADER | |
30 | ||
31 | ||
32 | #ifndef __FASTJET_AREADEFINITION_HH__ | |
33 | #define __FASTJET_AREADEFINITION_HH__ | |
34 | ||
35 | #include "fastjet/GhostedAreaSpec.hh" | |
36 | ||
37 | namespace fastjet { // defined in fastjet/internal/base.hh | |
38 | ||
39 | //---------------------------------------------------------------------- | |
40 | // | |
41 | /// class for holding a "Voronoi area" specification; an area will be | |
42 | /// assigned to each particle, which is the area of the intersection | |
43 | /// of the particle's Voronoi cell with a circle of radius | |
44 | /// R*effective_Rfact. | |
45 | /// | |
46 | class VoronoiAreaSpec { | |
47 | public: | |
48 | ||
49 | /// default constructor (effective_Rfact = 1); | |
50 | VoronoiAreaSpec() : _effective_Rfact(1.0) {}; | |
51 | ||
52 | /// constructor that allows you to set effective_Rfact. | |
53 | VoronoiAreaSpec(double effective_Rfact) : | |
54 | _effective_Rfact(effective_Rfact) {}; | |
55 | ||
56 | /// return the value of effective_Rfact | |
57 | double effective_Rfact() const {return _effective_Rfact;} | |
58 | ||
59 | /// return a textual description of the area definition. | |
60 | std::string description() const; | |
61 | ||
62 | private: | |
63 | double _effective_Rfact; | |
64 | }; | |
65 | ||
66 | ||
67 | /// the different types of area that are supported | |
68 | enum AreaType {invalid_area = -1, | |
69 | active_area = 0, active_area_explicit_ghosts = 1, | |
70 | one_ghost_passive_area = 10, passive_area = 11, | |
71 | voronoi_area=20}; | |
72 | ||
73 | ||
74 | //---------------------------------------------------------------------- | |
75 | /// class that holds a generic area definition | |
76 | /// | |
77 | class AreaDefinition { | |
78 | public: | |
79 | ||
80 | /// default constructor, which provides a ghosted active area, with | |
81 | /// sensible defaults for the ghosts. | |
82 | AreaDefinition() { | |
83 | _area_type = active_area; | |
84 | _ghost_spec = GhostedAreaSpec(); | |
85 | } | |
86 | ||
87 | /// constructor for an area definition based on an area type and a | |
88 | /// ghosted area specification | |
89 | AreaDefinition(AreaType type, const GhostedAreaSpec & spec) { | |
90 | _ghost_spec = spec; | |
91 | _area_type = type; | |
92 | assert(type != voronoi_area); | |
93 | } | |
94 | ||
95 | /// constructor for an area definition based on an area type and a | |
96 | /// voronoi area specification (type must be voronoi_area) | |
97 | AreaDefinition(AreaType type, const VoronoiAreaSpec & spec) { | |
98 | _voronoi_spec = spec; | |
99 | _area_type = type; | |
100 | assert(type == voronoi_area); | |
101 | } | |
102 | ||
103 | /// constructor for an area definition based on an area type and | |
104 | /// which attempts to provide sensible defaults for everything else | |
105 | AreaDefinition(AreaType type) { | |
106 | _area_type = type; | |
107 | if (type == voronoi_area) { | |
108 | _voronoi_spec = VoronoiAreaSpec(); | |
109 | } else { | |
110 | _ghost_spec = GhostedAreaSpec(); | |
111 | } | |
112 | } | |
113 | ||
114 | /// constructor for an area definition based on an ghosted area | |
115 | /// specification, and an option to select which ghosted area you want | |
116 | AreaDefinition(const GhostedAreaSpec & spec, AreaType type = active_area) { | |
117 | _ghost_spec = spec; | |
118 | _area_type = type; | |
119 | assert(type != voronoi_area); | |
120 | } | |
121 | ||
122 | /// constructor for an area definition based on a voronoi area | |
123 | /// specification | |
124 | AreaDefinition(const VoronoiAreaSpec & spec) { | |
125 | _voronoi_spec = spec; | |
126 | _area_type = voronoi_area; | |
127 | } | |
128 | ||
129 | /// return a description of the current area definition | |
130 | std::string description() const; | |
131 | ||
132 | /// return info about the type of area being used by this defn | |
133 | AreaType area_type() const {return _area_type;} | |
134 | ||
135 | /// return a reference to the active area spec | |
136 | const GhostedAreaSpec & ghost_spec() const {return _ghost_spec;} | |
137 | GhostedAreaSpec & ghost_spec() {return _ghost_spec;} | |
138 | ||
139 | /// return a reference to the voronoi area spec | |
140 | const VoronoiAreaSpec & voronoi_spec() const {return _voronoi_spec;} | |
141 | ||
142 | private: | |
143 | ||
144 | AreaType _area_type; | |
145 | GhostedAreaSpec _ghost_spec; | |
146 | VoronoiAreaSpec _voronoi_spec; | |
147 | }; | |
148 | ||
149 | } // fastjet namespace | |
150 | ||
151 | ||
152 | #endif // __FASTJET_AREADEFINITION_HH__ |