# Integrators¶

Herwig 7 offer a new infrastructure for Monte Carlo integration, which has been developed along with the Matchbox module; a GeneralSampler class is responsible of exploiting a certain algorithm implemented in BinSampler classes to perform the integration of individual subprocesses. Currently, we offer three main algorithms: CellGridSampler, MonacoSampler and FlatBinSampler for validation purposes. All sampling objects are loacted in the /Herwig/Smaplers directory of the default repository.

## General options¶

We report some of the less-expert settings here; a full and detailed documentation can be found in the manual.

Switch to verbose mode to report results on individual sub-process contributions:

set Sampler:Verbose On


Minimum selection probability for a sub-process if its estimated cross section would give rise to a smaller probability:

set Sampler:MinSelection 0.01


Sample sub-processes flat (validation purposes only):

set Sampler:FlatSubprocesses On


Update grid information from statistics accumulated while running:

set Sampler:WriteGridsOnFinish Yes


## Common sampler options¶

Set the number of initial points to be used for estimating sub-process cross sections:

set Sampler:BinSampler:InitialPoints 10000


The following options make sense for the CellGridSampler and MonacoSampler:

Set the number of iterations to be performed (not applicable to flat sampling):

set Sampler:BinSampler:NIterations 3


Set the enhancement factor for the number of points to be used in the next iteration:

set Sampler:BinSampler:EnhancementFactor 1.2


Set a path for data on random number population versus cross section:

set Sampler:BinSampler:RandomNumbers ./population-data


The following options make sense for the CellGridSampler and FlatBinSampler:

Enable the remapping of phase space dimensions using a given number of points:

set Sampler:BinSampler:RemapperPoints 10000


Remap the dimension used for channel selection (only applicable for TreePhasespace):

set Sampler:BinSampler:RemapChannelDimension Yes


Remap the random numbers corresponding to the parton luminosity using a certain number of bins:

set Sampler:BinSampler:LuminsoityMapperBins 20


Remap all other dimensions using a certain number of bins:

set Sampler:BinSampler:GeneralMapperBins 20


Enforce a minimum selection probability for remapper bins even if the estimated cross section would have given rise to a smaller probability:

set Sampler:BinSampler:RemapperMinSelection 0.01


## CellGrid sampler¶

The CellGridSampler is extending the algorithm initially described in 1108.6182. It can be enabled using:

set Sampler:BinSampler CellGridSampler


Options accepted by the CellGridSampler include:

Set the number of exploration points to presample a cell:

set CellGridSampler:ExplorationPoints 1000


Set the number of exploration steps to be performed:

set CellGridSampler:ExplorationSteps 3


Set the gain parameter of the cell splitting algorithm:

set CellGridSampler:Gain 0.3


Set the epsilon parameter of the cell splitting algorithm:

set CellGridSampler:Epsilon 1.0


Enforce a minimum selection probability for cells even if the estimated cross section would have given rise to a smaller probability:

set CellGridSampler:MinimumSelection 0.01


## Monaco sampler¶

The MonacoSampler is implementing the algorithm described in 0811.4559. It can be enabled using:

set Sampler:BinSampler MonacoSampler


Options accepted by the MonacoSampler include:

Set the grid modification rate:

set MonacoSampler:Alpha 0.8


Set the number of grid divisions:

set MonacoSampler:GridDivisions 48


## Flat sampling¶

Flat sampling is offered as a cross check facitlity. It can be enabled via:

set Sampler:BinSampler FlatBinSampler


There are no parameters for flat sampling.

# NLO consistency checks¶

## Subtraction checks¶

The convergence of the unintegrated subtraction can be checked by indicating a directory where the relevant data should be stored:

set Factory:SubtractionData ./subtraction-checks


Keep in mind that phase space sampling will be highly restricted to the singular regions, so no physics analysis should be run when enabling this test.

Several types of plots are supported:

Perform enveloping of the ratio $$D/M$$:

set Factory:SubtractionPlotType LinRatio


Perform enveloping of the logarithm of the relative difference $$|D-M|/M$$:

set Factory:SubtractionPlotType LogRelDiff


## Pole cancellation¶

Similarly to the subtraction checks, histograms of pole cancellation measures can be performed by indicating a directory to store the data:

set Fatctory:PoleData ./pole-checks


## List of dipoles and mappings¶

The list of dipoles which have been found for a certain process and the mapping of real emission to Born legs can be accessed via:

set Factory:InitVerbose On
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5613068342208862, "perplexity": 6854.333843275227}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030334596.27/warc/CC-MAIN-20220925193816-20220925223816-00211.warc.gz"}