Belle II Software  release-05-01-25
KoralW Class Reference

C++ interface for the FORTRAN 4-fermion final state generator KoralW. More...

#include <KoralW.h>

Public Member Functions

 KoralW ()
 Constructor.
 
 ~KoralW ()
 Destructor.
 
void setCMSEnergy (double cmsEnergy)
 Sets the CMS energy. More...
 
void init (const std::string &dataPath, const std::string &userDataFile)
 Initializes the generator. More...
 
void generateEvent (MCParticleGraph &mcGraph, TVector3 vertex, TLorentzRotation boost)
 Generates one single event. More...
 
void term ()
 Terminates the generator. More...
 
double getCrossSection ()
 Returns the total cross section of the generated process. More...
 
double getCrossSectionError ()
 Returns the error on the total cross section of the generated process. More...
 

Protected Member Functions

void storeParticle (MCParticleGraph &mcGraph, const float *mom, const float *vtx, int pdg, TVector3 vertex, TLorentzRotation boost, bool isVirtual=false, bool isInitial=false)
 Store a single generated particle into the MonteCarlo graph. More...
 

Protected Attributes

double m_crossSection
 The cross section of the generated KoralW events.
 
double m_crossSectionError
 The error on the cross section of the generated KoralW events.
 
double m_cmsEnergy
 CMS Energy = 2*Ebeam [GeV].
 

Private Attributes

double m_XPar [m_numXPar]
 Values of parameters for KoralW.
 
unsigned int m_seed1
 First seed for the random number generator.
 
unsigned int m_seed2
 Second seed for the random number generator.
 
unsigned int m_seed3
 Third seed for the random number generator.
 

Static Private Attributes

static constexpr int m_numXPar = 10000
 Number of parameters for KoralW.
 

Detailed Description

C++ interface for the FORTRAN 4-fermion final state generator KoralW.

Definition at line 39 of file KoralW.h.

Member Function Documentation

◆ generateEvent()

void generateEvent ( MCParticleGraph mcGraph,
TVector3  vertex,
TLorentzRotation  boost 
)

Generates one single event.

Parameters
mcGraphReference to the MonteCarlo graph into which the generated particles will be stored.
vertexgenerated vertex.
boostgenerated boost.

Definition at line 109 of file KoralW.cc.

110 {
111  kw_make_();
112 
113  //Store the particles with status id 3 and 2 as virtual particles, the particles with status id 1 as real particles
114  for (int iPart = 0; iPart < hepevt_.nhep; ++iPart) {
115  if (hepevt_.isthep[iPart] > 1) {
116  storeParticle(mcGraph, hepevt_.phep[iPart], hepevt_.vhep[iPart], hepevt_.idhep[iPart], vertex, boost, true);
117  } else {
118  storeParticle(mcGraph, hepevt_.phep[iPart], hepevt_.vhep[iPart], hepevt_.idhep[iPart], vertex, boost);
119  }
120  }
121 }

◆ getCrossSection()

double getCrossSection ( )
inline

Returns the total cross section of the generated process.

Returns
The total cross section.

Definition at line 85 of file KoralW.h.

85 :
86 

◆ getCrossSectionError()

double getCrossSectionError ( )
inline

Returns the error on the total cross section of the generated process.

Returns
The error on the total cross section.

Definition at line 90 of file KoralW.h.

◆ init()

void init ( const std::string &  dataPath,
const std::string &  userDataFile 
)

Initializes the generator.

Parameters
dataPathThe path to the default input data file for KoralW.
userDataFileThe path and filename of the user input data file, which defines the user settings for the generator.
randomSeedThe random seed for the generator.

Definition at line 73 of file KoralW.cc.

◆ setCMSEnergy()

void setCMSEnergy ( double  cmsEnergy)
inline

Sets the CMS energy.

Parameters
cmsEnergyThe CMS energy in [GeV].

Definition at line 60 of file KoralW.h.

◆ storeParticle()

void storeParticle ( MCParticleGraph mcGraph,
const float *  mom,
const float *  vtx,
int  pdg,
TVector3  vertex,
TLorentzRotation  boost,
bool  isVirtual = false,
bool  isInitial = false 
)
protected

Store a single generated particle into the MonteCarlo graph.

Parameters
mcGraphReference to the MonteCarlo graph into which the particle should be stored.
momThe 3-momentum of the particle in [GeV].
vtxThe vertex of the particle in [mm].
pdgThe PDG code of the particle.
isVirtualIf the particle is a virtual particle, such as the incoming particles, set this to true.
isInitialIf the particle is a initial particle for ISR, set this to true.

Definition at line 136 of file KoralW.cc.

◆ term()

void term ( )

Terminates the generator.

Closes the internal Fortran generator and retrieves the total cross section.

Definition at line 124 of file KoralW.cc.


The documentation for this class was generated from the following files:
hepevt_type::isthep
int isthep[nmxhep]
status code.
Definition: KKGenInterface.h:28
hepevt_type::phep
double phep[nmxhep][5]
four-momentum, mass [GeV].
Definition: KKGenInterface.h:32
hepevt_type::nhep
int nhep
number of particles.
Definition: KKGenInterface.h:27
hepevt_type::vhep
double vhep[nmxhep][4]
vertex [mm].
Definition: KKGenInterface.h:33
Belle2::KoralW::storeParticle
void storeParticle(MCParticleGraph &mcGraph, const float *mom, const float *vtx, int pdg, TVector3 vertex, TLorentzRotation boost, bool isVirtual=false, bool isInitial=false)
Store a single generated particle into the MonteCarlo graph.
Definition: KoralW.cc:136
hepevt_type::idhep
int idhep[nmxhep]
particle ident KF.
Definition: KKGenInterface.h:29