ThePEG  1.8.0
ACDCGenCell.h
1 // -*- C++ -*-
2 //
3 // ACDCGenCell.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ACDCGenCell_H
10 #define ACDCGenCell_H
11 
12 #include "ACDCGenConfig.h"
13 #include "ACDCTraits.h"
14 
15 namespace ACDCGenerator {
16 
17 struct ACDCGenCellInfo;
18 
20 class ACDCGenCell {
21 
22 public:
23 
27  inline ACDCGenCell(double newG);
28 
32  inline ACDCGenCell(double newG, double newV);
33 
37  inline ~ACDCGenCell();
38 
48  template <typename RndType>
49  inline ACDCGenCell * generate(DVector & lo, DVector & up, RndType * rnd);
50 
61  inline ACDCGenCell * generate(DVector & lo, DVector & up, DVector & rndv);
62 
69  inline ACDCGenCell * getCell(DVector & lo, const DVector & x, DVector & up);
70 
76  inline void smooth(double frac);
77 
81  inline bool isSplit() const;
82 
88  inline double doMaxInt(double rescale = 1.0);
89 
94  inline double maxInt() const;
95 
101  inline void splitme(double lo, double newDiv, double up, DimType newDim);
102 
106  inline void g(double newG);
107 
111  inline double g() const;
112 
116  inline double v() const;
117 
122  inline DimType dim() const;
123 
128  inline double div() const;
129 
133  inline ACDCGenCell * upper() const;
134 
138  inline ACDCGenCell * lower() const;
139 
144  inline int nBins() const;
145 
149  inline int depth() const;
150 
158  inline void extract(DVector & lo, DVector & up,
159  vector<ACDCGenCellInfo> & v) const;
160 
164  inline long getIndex(const ACDCGenCell * c) const;
165 
170  inline long getIndex(const ACDCGenCell * c, long & indx) const;
171 
175  inline ACDCGenCell * getCell(long i);
176 
181  inline ACDCGenCell * getCell(long i, long & indx);
182 
183 public:
184 
190  double theG;
191 
195  double theV;
196 
201 
206 
210  double theDivision;
211 
216 
217 private:
218 
222  ACDCGenCell();
223 
227  ACDCGenCell(const ACDCGenCell &);
228 
232  ACDCGenCell & operator=(const ACDCGenCell &);
233 
234 };
235 
236 
243 
245  typedef vector<ACDCGenCellInfo>::size_type Index;
246 
250  double g;
251 
255  double v;
256 
265 
271 
277 
278 };
279 
280 }
281 
282 #include "ACDCGenCell.icc"
283 
284 #endif