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
Smear::Device Class Reference

#include <Device.h>

Inheritance diagram for Smear::Device:
Smear::Smearer Smear::Bremsstrahlung

Public Member Functions

 Device (KinType=kE, const TString &formula="0", EGenre=kAll)
 
 Device (const TString &, const TString &resolution="0", EGenre=kAll)
 
 Device (const Device &)
 
virtual ~Device ()
 
virtual DeviceClone (const char *="") const
 
virtual void Smear (const erhic::VirtualParticle &, ParticleMCS &)
 
virtual void SetDistribution (const Distributor &)
 
virtual void Print (Option_t *="") const
 
- Public Member Functions inherited from Smear::Smearer
virtual ~Smearer ()
 

Protected Member Functions

bool Init (const TString &, const TString &, int)
 

Protected Attributes

KinType mSmeared
 Smeared variable.
 
TF1 * mKinematicFunction
 
FormulaStringmFormula
 Expression for resolution standard deviation.
 
std::vector< Smear::KinType > mDimensions
 
Distributor mDistribution
 Random distribution.
 

Additional Inherited Members

- Public Attributes inherited from Smear::Smearer
Acceptance Accept
 

Detailed Description

Performs smearing of a single kinematic variable according to a simple expression defined via a string.

Definition at line 44 of file Device.h.

Constructor & Destructor Documentation

Smear::Device::Device ( KinType  type = kE,
const TString &  formula = "0",
EGenre  genre = kAll 
)

Constructor. The first argument is the type of kinematic variable to smear. The second argument is a formula giving the width of the resolution in the variable selected with the first argument, i.e. sigma(A) = f(B, C...) where A, B, C... are selected from: E, P, theta, phi, pZ and pT, A is the variable type given for the first argument and B, C... are the variables listed in the formula. For example, for resolution in pT of 1% pT times sin of polar angle: Smear::Device(Smear::kPt, "0.01 * pT * sin(theta)"); See ROOT::TFormula for the form of valid expressions. Formulae can be a function of up to four variables. The third argument allows selection of the types of particles that are smeared: electromagnetic, hadronic or all.

Definition at line 43 of file Device.cxx.

Smear::Device::Device ( const TString &  variable,
const TString &  resolution = "0",
EGenre  genre = kAll 
)

Constructor for smearing with an arbitrary function of a single variable. The first argument is a function of E, P, theta, phi, pT, or pZ. See ROOT::TFormula for syntax. For example, to smear in 1/pT: Smear::Device('1/pT', '<some resolution="" function>="">')

Definition at line 51 of file Device.cxx.

Smear::Device::Device ( const Device that)

Copy constructor.

Definition at line 59 of file Device.cxx.

Smear::Device::~Device ( )
virtual

Destructor.

Definition at line 74 of file Device.cxx.

Member Function Documentation

Device * Smear::Device::Clone ( const char *  = "") const
virtual

Returns a dynamically allocated copy of this object. The argument is unused and is present for compatibility with ROOT::TObject::Clone().

Implements Smear::Smearer.

Definition at line 112 of file Device.cxx.

void Smear::Device::Print ( Option_t *  = "") const
virtual

Print information about this device to standard output.

Definition at line 116 of file Device.cxx.

void Smear::Device::SetDistribution ( const Distributor d)
inlinevirtual

Set the random distribution from which to sample smeared kinematics. By default a Gaussian distribution is used.

Definition at line 132 of file Device.h.

void Smear::Device::Smear ( const erhic::VirtualParticle prt,
ParticleMCS out 
)
virtual

Smear the kinematic value of the input particle and store the result in the ParticleMCS. Smearing works in the following way. If we smear a variable VirtualParticle.X == x with parametrization f(x), then z[x,f(x)] will be stored in ParticleMCS.X, where z is a randomly generated number from a distribution of which x is the mean and f(xi) is the standard deviation. By default a Gaussian distribution is used. Use SetDistribution() for other distributions (and see Smear::Distributor).

Implements Smear::Smearer.

Reimplemented in Smear::Bremsstrahlung.

Definition at line 85 of file Device.cxx.

Member Data Documentation

std::vector<Smear::KinType> Smear::Device::mDimensions
protected

Variables on which smearing is dependent (up to 4)

Definition at line 121 of file Device.h.


The documentation for this class was generated from the following files: