RunSampler Class Reference

Samples data-like run numbers in simulation. More...

#include <RunSampler.h>

Collaboration diagram for RunSampler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RunSampler (Dataset &dataset, Options const &options, TabulatedRngEngine &rngEngine)
run_t operator() () const
 Returns the run number for the current event.

Private Member Functions

void Build () const
 Updates per-event cache by sampling or reading new run number.
void LoadData (YAML::Node const &config)
 Loads integrated luminosities for different runs.

Private Attributes

bool samplingEnabled_
 Whether the run sampling is enabled.
EventCache cache_
 Implements per-event caching.
run_t currentRun_
 Sampled or read run number cached for the current event.
std::optional
< TTreeReaderValue< UInt_t > > 
srcRun_
 Reader to access the run number from the input file.
TabulatedRandomGenerator tabulatedRng_
 Random number generator to do the sampling.
std::vector< std::pair< double,
run_t > > 
cumulProb_
 Cumulative probabilities for the sampling.

Detailed Description

Samples data-like run numbers in simulation.

When processing simulation, this class samples randomly run numbers from the corresponding period in real data. The probability to sample each run number is proportional to the luminosity recorded in it. When running on data, the actual run number is returned. This allows accounting for time dependence in simulation. For example, different corrections can be applied for different run ranges.

This class reads section run_sampler from the master configuration. The following fields in this section are checked:


Member Function Documentation

void RunSampler::LoadData ( YAML::Node const &  config  )  [private]

Loads integrated luminosities for different runs.

Parameters:
[in] config YAML node "run_sampler" read from the master configuration.
run_t RunSampler::operator() (  )  const

Returns the run number for the current event.

In simulation the returned run number is sampled randomly; in data this is the actual run number of the current event. The result is cached per event, and subsequent calls of this method for the same event will return the same value.


Member Data Documentation

std::vector<std::pair<double, run_t> > RunSampler::cumulProb_ [private]

Cumulative probabilities for the sampling.

The first element in each pair is the cumulative probability for the run given by the second element. The vector is ordered in the cumulative probability. The cumulative probability is computed post-run, i.e. it's a non-zero value for the first entry in the vector and 1 for the last entry.

Whether the run sampling is enabled.

If not, the run read from the input file is returned.

std::optional<TTreeReaderValue<UInt_t> > RunSampler::srcRun_ [mutable, private]

Reader to access the run number from the input file.

Only used when samplingEnabled_ is false.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator

Generated on 30 Oct 2020 for H→ZZ→2ℓ2ν analysis by  doxygen 1.6.1