1 | //STARTHEADER
|
---|
2 | // $Id: GhostedAreaSpec.hh,v 1.1 2008-11-06 14:32:08 ovyn Exp $
|
---|
3 | //
|
---|
4 | // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
|
---|
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_GHOSTEDAREASPEC_HH__
|
---|
33 | #define __FASTJET_GHOSTEDAREASPEC_HH__
|
---|
34 |
|
---|
35 | #include<vector>
|
---|
36 | #include<string>
|
---|
37 | #include "Utilities/Fastjet/include/fastjet/PseudoJet.hh"
|
---|
38 | #include "Utilities/Fastjet/include/fastjet/internal/BasicRandom.hh"
|
---|
39 |
|
---|
40 | //
|
---|
41 | #define STATIC_GENERATOR 1
|
---|
42 |
|
---|
43 | FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
|
---|
44 |
|
---|
45 | /// namespace to hold default parameters for the active area spec
|
---|
46 | namespace gas {
|
---|
47 | const double def_ghost_maxrap = 6.0;
|
---|
48 | const int def_repeat = 1;
|
---|
49 | const double def_ghost_area = 0.01;
|
---|
50 | const double def_grid_scatter = 1.0;
|
---|
51 | const double def_kt_scatter = 0.1;
|
---|
52 | const double def_mean_ghost_kt = 1e-100;
|
---|
53 | }
|
---|
54 |
|
---|
55 | //----------------------------------------------------------------------
|
---|
56 | /// Class that defines the parameters that go into the measurement
|
---|
57 | /// of active jet areas.
|
---|
58 | class GhostedAreaSpec {
|
---|
59 | public:
|
---|
60 | /// default constructor
|
---|
61 | GhostedAreaSpec(): _ghost_maxrap (gas::def_ghost_maxrap),
|
---|
62 | _repeat (gas::def_repeat),
|
---|
63 | _ghost_area (gas::def_ghost_area),
|
---|
64 | _grid_scatter (gas::def_grid_scatter),
|
---|
65 | _kt_scatter (gas::def_kt_scatter),
|
---|
66 | _mean_ghost_kt(gas::def_mean_ghost_kt),
|
---|
67 | _actual_ghost_area(-1.0) {_initialize();};
|
---|
68 |
|
---|
69 | /// explicit constructor
|
---|
70 | explicit GhostedAreaSpec(double ghost_maxrap,
|
---|
71 | int repeat = gas::def_repeat,
|
---|
72 | double ghost_area = gas::def_ghost_area,
|
---|
73 | double grid_scatter = gas::def_grid_scatter,
|
---|
74 | double kt_scatter = gas::def_kt_scatter,
|
---|
75 | double mean_ghost_kt = gas::def_mean_ghost_kt
|
---|
76 | ):
|
---|
77 | _ghost_maxrap(ghost_maxrap),
|
---|
78 | _repeat(repeat),
|
---|
79 | _ghost_area(ghost_area),
|
---|
80 | _grid_scatter(grid_scatter),
|
---|
81 | _kt_scatter(kt_scatter),
|
---|
82 | _mean_ghost_kt(mean_ghost_kt),
|
---|
83 | _actual_ghost_area(-1.0) {_initialize();};
|
---|
84 |
|
---|
85 |
|
---|
86 | /// does the initialization of actual ghost parameters
|
---|
87 | void _initialize();
|
---|
88 |
|
---|
89 | // for accessing values set by the user
|
---|
90 | inline double ghost_etamax() const {return _ghost_maxrap;};
|
---|
91 | inline double ghost_maxrap() const {return _ghost_maxrap;};
|
---|
92 | inline double ghost_area () const {return _ghost_area ;};
|
---|
93 | inline double grid_scatter() const {return _grid_scatter;};
|
---|
94 | inline double kt_scatter () const {return _kt_scatter ;};
|
---|
95 | inline double mean_ghost_kt() const {return _mean_ghost_kt ;};
|
---|
96 | inline int repeat () const {return _repeat ;};
|
---|
97 |
|
---|
98 | // for accessing values
|
---|
99 | inline double actual_ghost_area() const {return _actual_ghost_area;};
|
---|
100 | inline int n_ghosts() const {return _n_ghosts;};
|
---|
101 |
|
---|
102 | // when explicitly modifying values, sometimes call the initializer
|
---|
103 | inline void set_ghost_area (double val) {_ghost_area = val; _initialize();};
|
---|
104 | inline void set_ghost_etamax(double val) {_ghost_maxrap = val; _initialize();};
|
---|
105 | inline void set_ghost_maxrap(double val) {_ghost_maxrap = val; _initialize();};
|
---|
106 | inline void set_grid_scatter(double val) {_grid_scatter = val; };
|
---|
107 | inline void set_kt_scatter (double val) {_kt_scatter = val; };
|
---|
108 | inline void set_mean_ghost_kt(double val){_mean_ghost_kt = val; };
|
---|
109 | inline void set_repeat (int val) {_repeat = val; };
|
---|
110 |
|
---|
111 | /// return nphi (ghosts layed out (-nrap, 0..nphi-1), (-nrap+1,0..nphi-1),
|
---|
112 | /// ... (nrap,0..nphi-1)
|
---|
113 | inline int nphi() const {return _nphi;}
|
---|
114 | inline int nrap() const {return _nrap;}
|
---|
115 |
|
---|
116 | /// get all relevant information about the status of the
|
---|
117 | /// random number generator, so that it can be reset subsequently
|
---|
118 | /// with set_random_status.
|
---|
119 | inline void get_random_status(std::vector<int> & __iseed) const {
|
---|
120 | _random_generator.get_status(__iseed);}
|
---|
121 |
|
---|
122 | /// set the status of the random number generator, as obtained
|
---|
123 | /// previously with get_random_status. Note that the random
|
---|
124 | /// generator is a static member of the class, i.e. common to all
|
---|
125 | /// instances of the class --- so if you modify the random for this
|
---|
126 | /// instance, you modify it for all instances.
|
---|
127 | inline void set_random_status(const std::vector<int> & __iseed) {
|
---|
128 | _random_generator.set_status(__iseed);}
|
---|
129 |
|
---|
130 | inline void checkpoint_random() {get_random_status(_random_checkpoint);}
|
---|
131 | inline void restore_checkpoint_random() {set_random_status(_random_checkpoint);}
|
---|
132 |
|
---|
133 | /// for a summary
|
---|
134 | std::string description() const;
|
---|
135 |
|
---|
136 | /// push the ghost 4-momenta onto the back of the vector of PseudoJets
|
---|
137 | void add_ghosts(std::vector<PseudoJet> & ) const;
|
---|
138 |
|
---|
139 | /// very deprecated public access to a random number
|
---|
140 | /// from the internal generator
|
---|
141 | inline double random_at_own_risk() const {return _our_rand();};
|
---|
142 | /// very deprecated public access to the generator itself
|
---|
143 | inline BasicRandom<double> & generator_at_own_risk() const {
|
---|
144 | return _random_generator;}
|
---|
145 |
|
---|
146 | private:
|
---|
147 |
|
---|
148 | // quantities that determine nature and distribution of ghosts
|
---|
149 | double _ghost_maxrap;
|
---|
150 | int _repeat ;
|
---|
151 | double _ghost_area ;
|
---|
152 | double _grid_scatter;
|
---|
153 | double _kt_scatter ;
|
---|
154 | double _mean_ghost_kt;
|
---|
155 |
|
---|
156 | // derived quantities
|
---|
157 | double _actual_ghost_area, _dphi, _drap;
|
---|
158 | int _n_ghosts, _nphi, _nrap;
|
---|
159 |
|
---|
160 |
|
---|
161 | std::vector<int> _random_checkpoint;
|
---|
162 | static BasicRandom<double> _random_generator;
|
---|
163 | //mutable BasicRandom<double> _random_generator;
|
---|
164 |
|
---|
165 | inline double _our_rand() const {return _random_generator();};
|
---|
166 |
|
---|
167 | };
|
---|
168 |
|
---|
169 | ////----------------------------------------------------------------------
|
---|
170 | //class 1GhostPassiveAreaSpec : public GhostedAreaSpec {
|
---|
171 | //public:
|
---|
172 | //}
|
---|
173 |
|
---|
174 | FASTJET_END_NAMESPACE
|
---|
175 |
|
---|
176 | #endif // __FASTJET_GHOSTEDAREASPEC_HH__
|
---|