Belle II Software  release-08-01-10
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, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation 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, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation 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 30 of file KoralW.h.

Member Function Documentation

◆ generateEvent()

void generateEvent ( MCParticleGraph mcGraph,
ROOT::Math::XYZVector  vertex,
ROOT::Math::LorentzRotation  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 107 of file KoralW.cc.

108 {
109  kw_make_();
110 
111  //Store the particles with status id 3 and 2 as virtual particles, the particles with status id 1 as real particles
112  for (int iPart = 0; iPart < hepevt_.nhep; ++iPart) {
113  if (hepevt_.isthep[iPart] > 1) {
114  storeParticle(mcGraph, hepevt_.phep[iPart], hepevt_.vhep[iPart], hepevt_.idhep[iPart], vertex, boost, true);
115  } else {
116  storeParticle(mcGraph, hepevt_.phep[iPart], hepevt_.vhep[iPart], hepevt_.idhep[iPart], vertex, boost);
117  }
118  }
119 }
void storeParticle(MCParticleGraph &mcGraph, const float *mom, const float *vtx, int pdg, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost, bool isVirtual=false, bool isInitial=false)
Store a single generated particle into the MonteCarlo graph.
Definition: KoralW.cc:134
int isthep[nmxhep]
status code.
double vhep[nmxhep][4]
vertex [mm].
double phep[nmxhep][5]
four-momentum, mass [GeV].
int idhep[nmxhep]
particle ident KF.
int nhep
number of particles.

◆ getCrossSection()

double getCrossSection ( )
inline

Returns the total cross section of the generated process.

Returns
The total cross section.

Definition at line 75 of file KoralW.h.

75 { return m_crossSection; }
double m_crossSection
The cross section of the generated KoralW events.
Definition: KoralW.h:85

◆ 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 80 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.

Definition at line 71 of file KoralW.cc.

◆ setCMSEnergy()

void setCMSEnergy ( double  cmsEnergy)
inline

Sets the CMS energy.

Parameters
cmsEnergyThe CMS energy in [GeV].

Definition at line 51 of file KoralW.h.

◆ storeParticle()

void storeParticle ( MCParticleGraph mcGraph,
const float *  mom,
const float *  vtx,
int  pdg,
ROOT::Math::XYZVector  vertex,
ROOT::Math::LorentzRotation  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.
vertexThe vertex of the particle in [mm].
boostLorentz boost vector.
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 134 of file KoralW.cc.

◆ term()

void term ( )

Terminates the generator.

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

Definition at line 122 of file KoralW.cc.


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