k4SimGeant4
Loading...
Searching...
No Matches
SimG4ParticleSmearRootFile Class Reference

Root file particle smearing tool. More...

#include <SimG4ParticleSmearRootFile.h>

Inheritance diagram for SimG4ParticleSmearRootFile:
Collaboration diagram for SimG4ParticleSmearRootFile:

Public Member Functions

 SimG4ParticleSmearRootFile (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~SimG4ParticleSmearRootFile ()
 
virtual StatusCode initialize () final
 Initialize the tool and a random number generator.
 
virtual StatusCode finalize () final
 Finalize.
 
virtual StatusCode smearMomentum (CLHEP::Hep3Vector &aMom, int aPdg=0) final
 Smear the momentum of the particle.
 
StatusCode readResolutions ()
 Read the file with the resolutions.
 
double resolution (double aEta, double aMom)
 Read the file with the resolutions.
 
virtual StatusCode checkConditions (double aMinMomentum, double aMaxMomentum, double aMaxEta) const final
 Check conditions of the smearing model, especially if the given parametrs do not exceed the parameters of the model.
 
- Public Member Functions inherited from ISimG4ParticleSmearTool
 DeclareInterfaceID (ISimG4ParticleSmearTool, 1, 0)
 

Private Attributes

SmartIF< IRndmGenSvc > m_randSvc
 Random Number Service.
 
IRndmGen * m_gauss
 Gaussian random number generator used for smearing with a constant resolution (m_sigma)
 
std::map< double, TGraph > m_momentumResolutions
 Map of p-dependent resolutions and the end of eta bin that it refers to (lower end is defined by previous entry, and eta=0 for the first one)
 
Gaudi::Property< std::string > m_resolutionFileName
 File name with the resolutions obtained from root file (set by job options)
 
double m_minMomentum
 minimum momentum defined in the resolution file
 
double m_maxMomentum
 maximum momentum defined in the resolution file
 
double m_maxEta
 maximum pseudorapidity defined in the resolution file
 

Detailed Description

Root file particle smearing tool.

The resolution dependence is read from the ROOT file, which path is given in configuration. Root file contains trees 'info' and 'resolutions'. 'info' has two arrays of type TArrayD containing edges of eta bins ('eta') and momentum values ('p'). 'resolutions' tree has TArrayD with resolutions computed for momentum values. An array is defined for every eta bin. Momentum of the particle is smeared following a Gaussian distribution, using the evaluated resolution as the mean. User needs to specify the min/max momentum nad max eta for fast sim in the SimG4FastSimTrackerRegion tool. The defined values cannot be broader than eta and p values for which the resolutions were computed.

Author
Anna Zaborowska

Constructor & Destructor Documentation

◆ SimG4ParticleSmearRootFile()

SimG4ParticleSmearRootFile::SimG4ParticleSmearRootFile ( const std::string & type,
const std::string & name,
const IInterface * parent )
explicit

◆ ~SimG4ParticleSmearRootFile()

SimG4ParticleSmearRootFile::~SimG4ParticleSmearRootFile ( )
virtual

Member Function Documentation

◆ checkConditions()

StatusCode SimG4ParticleSmearRootFile::checkConditions ( double aMinMomentum,
double aMaxMomentum,
double aMaxEta ) const
finalvirtual

Check conditions of the smearing model, especially if the given parametrs do not exceed the parameters of the model.

Parameters
[in]aMinMomentumMinimum momentum.
[in]aMaxMomentumMaximum momentum.
[in]aMaxEtaMaximum pseudorapidity.
Returns
status code

Implements ISimG4ParticleSmearTool.

◆ finalize()

StatusCode SimG4ParticleSmearRootFile::finalize ( )
finalvirtual

Finalize.

Returns
status code

◆ initialize()

StatusCode SimG4ParticleSmearRootFile::initialize ( )
finalvirtual

Initialize the tool and a random number generator.

Returns
status code

◆ readResolutions()

StatusCode SimG4ParticleSmearRootFile::readResolutions ( )

Read the file with the resolutions.

File name is set by job options.

Returns
status code

◆ resolution()

double SimG4ParticleSmearRootFile::resolution ( double aEta,
double aMom )

Read the file with the resolutions.

File name is set by job options.

Parameters
[in]aEtaParticle's pseudorapidity
[in]aMomParticle's momentum
Returns
Resolution

◆ smearMomentum()

StatusCode SimG4ParticleSmearRootFile::smearMomentum ( CLHEP::Hep3Vector & aMom,
int aPdg = 0 )
finalvirtual

Smear the momentum of the particle.

Parameters
aMomParticle momentum to be smeared.
[in]aPdgParticle PDG code.
Returns
status code

Implements ISimG4ParticleSmearTool.

Member Data Documentation

◆ m_gauss

IRndmGen* SimG4ParticleSmearRootFile::m_gauss
private

Gaussian random number generator used for smearing with a constant resolution (m_sigma)

◆ m_maxEta

double SimG4ParticleSmearRootFile::m_maxEta
private

maximum pseudorapidity defined in the resolution file

◆ m_maxMomentum

double SimG4ParticleSmearRootFile::m_maxMomentum
private

maximum momentum defined in the resolution file

◆ m_minMomentum

double SimG4ParticleSmearRootFile::m_minMomentum
private

minimum momentum defined in the resolution file

◆ m_momentumResolutions

std::map<double, TGraph> SimG4ParticleSmearRootFile::m_momentumResolutions
private

Map of p-dependent resolutions and the end of eta bin that it refers to (lower end is defined by previous entry, and eta=0 for the first one)

◆ m_randSvc

SmartIF<IRndmGenSvc> SimG4ParticleSmearRootFile::m_randSvc
private

Random Number Service.

◆ m_resolutionFileName

Gaudi::Property<std::string> SimG4ParticleSmearRootFile::m_resolutionFileName
private
Initial value:
{this, "filename", "",
"File name with the resolutions obtained from root file"}

File name with the resolutions obtained from root file (set by job options)


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