Belle II Software  release-08-01-10
KoralW.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 /* Basf2 headers. */
12 #include <mdst/dataobjects/MCParticleGraph.h>
13 
14 /* ROOT headers. */
15 #include <Math/LorentzRotation.h>
16 #include <Math/Vector3D.h>
17 
18 /* C++ headers. */
19 #include <string>
20 
21 namespace Belle2 {
30  class KoralW {
31 
32  public:
33 
35  KoralW() :
36  m_crossSection(0.0),
38  m_cmsEnergy(0.0),
39  m_seed1(900000000),
40  m_seed2(10000),
41  m_seed3(1000)
42  {for (int i = 0; i < m_numXPar; i++) m_XPar[i] = 0.0;}
43 
44 
46  ~KoralW() {};
47 
51  void setCMSEnergy(double cmsEnergy) { m_cmsEnergy = cmsEnergy; }
52 
57  void init(const std::string& dataPath, const std::string& userDataFile);
58 
64  void generateEvent(MCParticleGraph& mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost);
65 
70  void term();
71 
75  double getCrossSection() { return m_crossSection; }
76 
81 
82 
83  protected:
84 
85  double m_crossSection;
89  double m_cmsEnergy;
101  void storeParticle(MCParticleGraph& mcGraph, const float* mom, const float* vtx, int pdg, ROOT::Math::XYZVector vertex,
102  ROOT::Math::LorentzRotation boost,
103  bool isVirtual = false, bool isInitial = false);
104 
105  private:
106 
107  static constexpr int m_numXPar = 10000;
109  double m_XPar[m_numXPar];
111  unsigned int m_seed1;
113  unsigned int m_seed2;
115  unsigned int m_seed3;
117  };
119 }
C++ interface for the FORTRAN 4-fermion final state generator KoralW.
Definition: KoralW.h:30
void generateEvent(MCParticleGraph &mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
Generates one single event.
Definition: KoralW.cc:107
KoralW()
Constructor.
Definition: KoralW.h:35
double m_crossSection
The cross section of the generated KoralW events.
Definition: KoralW.h:85
double m_cmsEnergy
CMS Energy = 2*Ebeam [GeV].
Definition: KoralW.h:89
static constexpr int m_numXPar
Number of parameters for KoralW.
Definition: KoralW.h:107
unsigned int m_seed2
Second seed for the random number generator.
Definition: KoralW.h:113
void setCMSEnergy(double cmsEnergy)
Sets the CMS energy.
Definition: KoralW.h:51
unsigned int m_seed3
Third seed for the random number generator.
Definition: KoralW.h:115
void term()
Terminates the generator.
Definition: KoralW.cc:122
void init(const std::string &dataPath, const std::string &userDataFile)
Initializes the generator.
Definition: KoralW.cc:71
double m_crossSectionError
The error on the cross section of the generated KoralW events.
Definition: KoralW.h:87
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
double m_XPar[m_numXPar]
Values of parameters for KoralW.
Definition: KoralW.h:109
double getCrossSection()
Returns the total cross section of the generated process.
Definition: KoralW.h:75
~KoralW()
Destructor.
Definition: KoralW.h:46
double getCrossSectionError()
Returns the error on the total cross section of the generated process.
Definition: KoralW.h:80
unsigned int m_seed1
First seed for the random number generator.
Definition: KoralW.h:111
Class to build, validate and sort a particle decay chain.
Abstract base class for different kinds of events.