Belle II Software development
ParticleGun Class Reference

Class to generate tracks in the particle gun and store them in a MCParticle graph. More...

#include <ParticleGun.h>

Classes

struct  Parameters
 Struct to keep all necessary parameters for the particle gun. More...
 

Public Types

enum  EDistribution {
  c_fixedValue ,
  c_uniformDistribution ,
  c_uniformPtDistribution ,
  c_uniformCosDistribution ,
  c_uniformLogDistribution ,
  c_uniformLogPtDistribution ,
  c_normalDistribution ,
  c_normalPtDistribution ,
  c_normalCosDistribution ,
  c_discreteSpectrum ,
  c_discretePtSpectrum ,
  c_inversePtDistribution ,
  c_polylineDistribution ,
  c_polylinePtDistribution ,
  c_polylineCosDistribution
}
 enum containing all known distributions available for generation of values More...
 

Public Member Functions

 ParticleGun ()
 Default constructor.
 
 ~ParticleGun ()
 Default destructor.
 
bool generateEvent (MCParticleGraph &graph)
 Generate the next event and store the result in the given MCParticle graph.
 
bool setParameters (const Parameters &parameters)
 Set the parameters for generating the Particles.
 

Protected Member Functions

double generateValue (EDistribution dist, const std::vector< double > &params)
 Generate a value according to the given distribution with the given parameters.
 

Protected Attributes

Parameters m_params
 All relevant parameters.
 

Detailed Description

Class to generate tracks in the particle gun and store them in a MCParticle graph.

The class supports multiple tracks per event, different PDGcodes and the range for track momenta, track angle and track origin is configurable.

Definition at line 26 of file ParticleGun.h.

Member Enumeration Documentation

◆ EDistribution

enum containing all known distributions available for generation of values

Enumerator
c_fixedValue 

Fixed value, no random generation at all, 1 parameter.

c_uniformDistribution 

Uniform distribution, parameters are min and max value.

c_uniformPtDistribution 

Uniform distribution of Pt, parameters are min and max value.

c_uniformCosDistribution 

Uniform distribution of the cosine of the values, parameters are min and max value.

c_uniformLogDistribution 

Uniform distribution of the logarithm of the values, parameters are min and max value.

c_uniformLogPtDistribution 

Uniform distribution of the logarithm of the Pt, parameters are min and max value.

c_normalDistribution 

Normal distribution, parameters are mean and sigma.

c_normalPtDistribution 

Normal distribution of Pt, parameters are mean and sigma.

c_normalCosDistribution 

Normal distribution of the cosinge, parameters are mean and sigma.

c_discreteSpectrum 

Discrete spectrum, parameters are first the values and then the weights (non-negative) for each value.

c_discretePtSpectrum 

Discrete pt spectrum, parameters are first the values and then the weights (non-negative) for each value.

c_inversePtDistribution 

Distribution uniform in the inverse pt distribution, that is uniform in track curvature.

c_polylineDistribution 

Distribution given as list of (x,y) points.

The Distribution will follow the line connection all points. Parameters are first the x coordinates (sorted) and then the y coordinates (non-negative)

c_polylinePtDistribution 

Same as polylineDistribution but for the transverse momentum.

c_polylineCosDistribution 

Same as polylineDistribution but for the cosine of the angle.

Definition at line 29 of file ParticleGun.h.

29 {
62 };
@ c_polylineDistribution
Distribution given as list of (x,y) points.
Definition: ParticleGun.h:57
@ c_uniformLogPtDistribution
Uniform distribution of the logarithm of the Pt, parameters are min and max value.
Definition: ParticleGun.h:41
@ c_normalDistribution
Normal distribution, parameters are mean and sigma.
Definition: ParticleGun.h:43
@ c_normalCosDistribution
Normal distribution of the cosinge, parameters are mean and sigma.
Definition: ParticleGun.h:47
@ c_uniformPtDistribution
Uniform distribution of Pt, parameters are min and max value.
Definition: ParticleGun.h:35
@ c_polylinePtDistribution
Same as polylineDistribution but for the transverse momentum.
Definition: ParticleGun.h:59
@ c_discretePtSpectrum
Discrete pt spectrum, parameters are first the values and then the weights (non-negative) for each va...
Definition: ParticleGun.h:51
@ c_uniformDistribution
Uniform distribution, parameters are min and max value.
Definition: ParticleGun.h:33
@ c_discreteSpectrum
Discrete spectrum, parameters are first the values and then the weights (non-negative) for each value...
Definition: ParticleGun.h:49
@ c_fixedValue
Fixed value, no random generation at all, 1 parameter.
Definition: ParticleGun.h:31
@ c_normalPtDistribution
Normal distribution of Pt, parameters are mean and sigma.
Definition: ParticleGun.h:45
@ c_uniformCosDistribution
Uniform distribution of the cosine of the values, parameters are min and max value.
Definition: ParticleGun.h:37
@ c_inversePtDistribution
Distribution uniform in the inverse pt distribution, that is uniform in track curvature.
Definition: ParticleGun.h:53
@ c_polylineCosDistribution
Same as polylineDistribution but for the cosine of the angle.
Definition: ParticleGun.h:61
@ c_uniformLogDistribution
Uniform distribution of the logarithm of the values, parameters are min and max value.
Definition: ParticleGun.h:39

Constructor & Destructor Documentation

◆ ParticleGun()

ParticleGun ( )
inline

Default constructor.

Definition at line 114 of file ParticleGun.h.

114: m_params() {}
Parameters m_params
All relevant parameters.
Definition: ParticleGun.h:133

◆ ~ParticleGun()

~ParticleGun ( )
inline

Default destructor.

Definition at line 117 of file ParticleGun.h.

117{}

Member Function Documentation

◆ generateEvent()

bool generateEvent ( MCParticleGraph graph)

Generate the next event and store the result in the given MCParticle graph.

Returns
true if the event was generated.

Member Data Documentation

◆ m_params

Parameters m_params
protected

All relevant parameters.

Definition at line 133 of file ParticleGun.h.


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