Belle II Software  release-06-02-00
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 /* Belle 2 headers. */
12 #include <mdst/dataobjects/MCParticleGraph.h>
13 
14 /* ROOT headers. */
15 #include <TLorentzRotation.h>
16 
17 /* C++ headers. */
18 #include <string>
19 
20 namespace Belle2 {
29  class KoralW {
30 
31  public:
32 
34  KoralW() :
35  m_crossSection(0.0),
37  m_cmsEnergy(0.0),
38  m_seed1(900000000),
39  m_seed2(10000),
40  m_seed3(1000)
41  {for (int i = 0; i < m_numXPar; i++) m_XPar[i] = 0.0;}
42 
43 
45  ~KoralW() {};
46 
50  void setCMSEnergy(double cmsEnergy) { m_cmsEnergy = cmsEnergy; }
51 
57  void init(const std::string& dataPath, const std::string& userDataFile);
58 
64  void generateEvent(MCParticleGraph& mcGraph, TVector3 vertex, TLorentzRotation 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;
100  void storeParticle(MCParticleGraph& mcGraph, const float* mom, const float* vtx, int pdg, TVector3 vertex, TLorentzRotation boost,
101  bool isVirtual = false, bool isInitial = false);
102 
103  private:
104 
105  static constexpr int m_numXPar = 10000;
107  double m_XPar[m_numXPar];
109  unsigned int m_seed1;
111  unsigned int m_seed2;
113  unsigned int m_seed3;
115  };
117 }
C++ interface for the FORTRAN 4-fermion final state generator KoralW.
Definition: KoralW.h:29
KoralW()
Constructor.
Definition: KoralW.h:34
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:105
unsigned int m_seed2
Second seed for the random number generator.
Definition: KoralW.h:111
void setCMSEnergy(double cmsEnergy)
Sets the CMS energy.
Definition: KoralW.h:50
unsigned int m_seed3
Third seed for the random number generator.
Definition: KoralW.h:113
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 generateEvent(MCParticleGraph &mcGraph, TVector3 vertex, TLorentzRotation boost)
Generates one single event.
Definition: KoralW.cc:107
double m_XPar[m_numXPar]
Values of parameters for KoralW.
Definition: KoralW.h:107
double getCrossSection()
Returns the total cross section of the generated process.
Definition: KoralW.h:75
~KoralW()
Destructor.
Definition: KoralW.h:45
double getCrossSectionError()
Returns the error on the total cross section of the generated process.
Definition: KoralW.h:80
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:134
unsigned int m_seed1
First seed for the random number generator.
Definition: KoralW.h:109
Class to build, validate and sort a particle decay chain.
Abstract base class for different kinds of events.