![]() |
eic-smear
1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
|
#include <Distributor.h>
Public Member Functions | |
Distributor () | |
Distributor (const TString &formula, double lower, double upper, double minimum=-1.e6, double maximum=1.e6) | |
virtual | ~Distributor () |
virtual double | Generate (double midpoint, double width) |
Protected Attributes | |
double | mPlus |
double | mMinus |
TF1 * | mDistribution |
Distribution function for random sampling. Used by devices to generate smearing on some distribution. By default, smearing is generated on a Gaussian of which the Monte Carlo value is the mean, and the standard deviation is given by the device parametrization. It is intended that you access this object via the methods provided in the Device class.
Definition at line 32 of file Distributor.h.
Smear::Distributor::Distributor | ( | ) |
Default constructor. Gaussian distribution.
Definition at line 18 of file Distributor.cxx.
Smear::Distributor::Distributor | ( | const TString & | formula, |
double | lower, | ||
double | upper, | ||
double | minimum = -1.e6 , |
||
double | maximum = 1.e6 |
||
) |
Initialise with a ROOT::TF1-style string. The function should depend on two parameters, the first of which specifies the function midpoint and the second of which species a width. See ROOT::TF1 documentation for details of the string format. For example, for a step function, one could use Distributor("abs(x-[0])<[1]"); where [0] stands for the first parameter (midpoint) and [1] is the second parameter (width). The second and third arguments limit the range of thrown values around the midpoint to [midpoint - lower, midpoint + upper]. Values of <= 0 give no limit. The 4th and 5th arguments define the valid range of the function.
Definition at line 24 of file Distributor.cxx.
|
virtual |
Destructor.
Definition at line 38 of file Distributor.cxx.
|
virtual |
Generate a random value based on a given midpoint and width.
Definition at line 45 of file Distributor.cxx.