herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
CellGridSampler.h
1 // -*- C++ -*-
2 //
3 // CellGridSampler.hpp is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef Herwig_CellGridSampler_H
10 #define Herwig_CellGridSampler_H
11 //
12 // This is the declaration of the CellGridSampler class.
13 //
14 
15 #include "Herwig/Sampling/BinSampler.h"
16 
17 #include "SimpleCellGrid.h"
18 
19 
20 namespace Herwig {
21 
22 using namespace ThePEG;
23 
35 
36 public:
37 
44 
48  virtual ~CellGridSampler();
50 
51 public:
52 
56  Ptr<CellGridSampler>::ptr cloneMe() const {
57  return dynamic_ptr_cast<Ptr<CellGridSampler>::ptr>(clone());
58  }
59 
60 public:
61 
67  virtual double generate();
68 
72  virtual void initialize(bool progress);
73 
77  virtual void finalize(bool);
78 
82  virtual void adapt();
83 
87  virtual bool existsGrid() const;
88 
92  virtual void saveGrid() const;
93 
98  const vector<int>& pre_adaption_splits() const { return the_pre_adaption_splits; }
99 
100 public:
101 
108  void persistentOutput(PersistentOStream & os) const;
109 
115  void persistentInput(PersistentIStream & is, int version);
117 
124  static void Init();
125 
126 protected:
127 
134  virtual IBPtr clone() const;
135 
140  virtual IBPtr fullclone() const;
142 
143 
144 // If needed, insert declarations of virtual function defined in the
145 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
146 
147 private:
148 
153  CellGridSampler & operator=(const CellGridSampler &) = delete;
154 
159 
164 
168  double theGain;
169 
173  double theEpsilon;
174 
179 
184 
190 
195 
200 
205 
206 };
207 
208 }
209 
210 #endif /* Herwig_CellGridSampler_H */
A simple cell grid providing basic adaption and sampling.
double theGain
The adaption threshold.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
int theChannelSplits
The number of splits to put into channel degrees of freedom.
size_t theExplorationPoints
The number of points used to explore a cell.
vector< int > the_pre_adaption_splits
The splittings for each dimension befor adaption.
BinSampler samples XCombs bins. This default implementation performs flat MC integration.
Definition: BinSampler.h:38
CellGridSampler samples XCombs bins using CellGrids.
bool theUnweightCells
Perform unweighting in cells.
size_t theExplorationSteps
The number of exploration steps.
double theEpsilon
The adaption threshold.
double theMinimumSelection
The minimum probability for cell selection.
pair< double, double > generate(const Generator< Density > &gen, double r)
Generate a random variable and return its weight.
bool theAllChannelSplits
Perform splits for all channels.
Ptr< CellGridSampler >::ptr cloneMe() const
Clone this object.
-*- C++ -*-
int theLuminositySplits
The number of splits to put into parton luminiosity degrees of freedom.
const vector< int > & pre_adaption_splits() const
The splittings for each dimension befor adaption.