EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Smear::Device Class Reference

#include <eic-smear/blob/master/include/eicsmear/smear/Device.h>

+ Inheritance diagram for Smear::Device:
+ Collaboration diagram for Smear::Device:

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::KinTypemDimensions
 
Distributor mDistribution
 Random distribution.
 

Private Member Functions

Deviceoperator= (const Device &)
 

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.

View newest version in sPHENIX GitHub 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 56 of file Device.cxx.

View newest version in sPHENIX GitHub at line 56 of file Device.cxx

References Smear::Smearer::Accept, Smear::FormulaString::GetKinName(), Init(), and Smear::Acceptance::SetGenre().

Referenced by Clone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 64 of file Device.cxx.

View newest version in sPHENIX GitHub at line 64 of file Device.cxx

References Init().

+ Here is the call graph for this function:

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

Copy constructor.

Definition at line 72 of file Device.cxx.

View newest version in sPHENIX GitHub at line 72 of file Device.cxx

References Detector::AsString(), mFormula, and mKinematicFunction.

+ Here is the call graph for this function:

Smear::Device::~Device ( )
virtual

Destructor.

Definition at line 87 of file Device.cxx.

View newest version in sPHENIX GitHub at line 87 of file Device.cxx

References mFormula, and mKinematicFunction.

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 144 of file Device.cxx.

View newest version in sPHENIX GitHub at line 144 of file Device.cxx

References Device().

+ Here is the call graph for this function:

bool Smear::Device::Init ( const TString &  kinematicFunction,
const TString &  resolutionFunction,
int  genre 
)
protected

TODO: KK It seems the use of kinematicFunction is unnecessary All it does is

Definition at line 38 of file Device.cxx.

View newest version in sPHENIX GitHub at line 38 of file Device.cxx

References Smear::Smearer::Accept, Detector::AsString(), mFormula, mKinematicFunction, mSmeared, and Smear::Acceptance::SetGenre().

Referenced by Device().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Device& Smear::Device::operator= ( const Device )
inlineprivate

Definition at line 127 of file Device.h.

View newest version in sPHENIX GitHub at line 127 of file Device.h

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

Print information about this device to standard output.

Definition at line 148 of file Device.cxx.

View newest version in sPHENIX GitHub at line 148 of file Device.cxx

References Smear::FormulaString::GetInputString(), Smear::FormulaString::GetKinName(), mFormula, mSmeared, and name.

+ Here is the call graph for this function:

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.

View newest version in sPHENIX GitHub at line 132 of file Device.h

References d, and mDistribution.

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 98 of file Device.cxx.

View newest version in sPHENIX GitHub at line 98 of file Device.cxx

References kdfinder::abs(), Smear::Smearer::Accept, charm_jet_coverage::args, Smear::FormulaString::Eval(), Smear::FixPhi(), Smear::FixTheta(), Smear::Distributor::Generate(), erhic::VirtualParticle::GetEta(), Smear::ParticleMCS::GetPhi(), Smear::ParticleMCS::GetTheta(), Smear::GetVariable(), Smear::ParticleMCS::HandleBogusValues(), erhic::VirtualParticle::Id(), Smear::Acceptance::Is(), Smear::kPhi, Smear::kTheta, mDistribution, mFormula, mKinematicFunction, mSmeared, Smear::ParticleMCS::SetPhi(), Smear::ParticleMCS::SetTheta(), Smear::ParticleMCS::SetVariable(), and Smear::FormulaString::Variables().

+ Here is the call graph for this function:

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.

View newest version in sPHENIX GitHub at line 121 of file Device.h

Distributor Smear::Device::mDistribution
protected

Random distribution.

Definition at line 123 of file Device.h.

View newest version in sPHENIX GitHub at line 123 of file Device.h

Referenced by SetDistribution(), and Smear().

FormulaString* Smear::Device::mFormula
protected

Expression for resolution standard deviation.

Definition at line 120 of file Device.h.

View newest version in sPHENIX GitHub at line 120 of file Device.h

Referenced by Device(), Init(), Print(), Smear(), and ~Device().

TF1* Smear::Device::mKinematicFunction
protected

Definition at line 119 of file Device.h.

View newest version in sPHENIX GitHub at line 119 of file Device.h

Referenced by Device(), Init(), Smear(), and ~Device().

KinType Smear::Device::mSmeared
protected

Smeared variable.

Definition at line 118 of file Device.h.

View newest version in sPHENIX GitHub at line 118 of file Device.h

Referenced by Init(), Print(), and Smear().


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