Belle II Software  release-08-01-10
BBBrem.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 #include <mdst/dataobjects/MCParticleGraph.h>
12 
13 #include <Math/LorentzRotation.h>
14 #include <Math/Vector3D.h>
15 
16 namespace Belle2 {
31  class BBBrem {
32 
33  public:
34 
37  BBBrem() :
38  m_eventCount(0),
39  m_unweighted(true),
40  m_weightCount(0),
42  m_maxWeight(0.0),
48  m_cmsEnergy(10.58),
49  m_photonEFrac(0.000001),
50  m_crossSection(0.0),
52  m_crossSectionOver(0.0),
56  alpha(0.0),
57  rme(0.0),
58  s(0.0),
59  rme2(0.0),
60  rme2s(0.0),
61  rls(0.0),
62  z0(0.0),
63  a1(0.0),
64  a2(0.0),
65  ac(0.0),
66  sigapp(0.0),
67  eb(0.0),
68  pb(0.0),
69  rin2pb(0.0),
70  weight(0.0)
71  {for (int i = 0; i < 4; i++) p1[i] = p2[i] = q1[i] = q2[i] = qk[i] = 0.0;}
72 
73 
74  //BBBrem() : m_applyBoost(false), m_unweighted(true), m_cmsEnergy(10.58), m_photonEFrac(0.000001) {};
75 
77  ~BBBrem() {};
78 
87  void init(double cmsEnergy, double minPhotonEFrac, bool unweighted = true, double maxWeight = 2000.0, int densitymode = 1,
88  double densityparameter = 1.68e-17);
89 
96  double generateEvent(MCParticleGraph& mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost);
97 
101  double getCrossSection() { return m_crossSection; }
102 
107 
112 
117 
122 
127 
131  void term();
132 
133 
134  protected:
135 
140  double m_maxWeight;
146  double m_cmsEnergy;
147  double m_photonEFrac;
149  double m_crossSection;
161 
171  void storeParticle(MCParticleGraph& mcGraph, const double* mom, int pdg, ROOT::Math::XYZVector vertex,
172  ROOT::Math::LorentzRotation boost,
173  bool isVirtual = false, bool isInitial = false);
174 
175  private:
176 
177  static constexpr double tomb = 3.8937966e5 / 1e6;
178  static constexpr double twopi = 2.0 * M_PI;
180  //Variable names directly taken from the FORTRAN code. Sorry.
181  double alpha;
182  double rme;
183  double s;
184  double rme2;
185  double rme2s;
186  double rls;
187  double z0;
188  double a1;
189  double a2;
190  double ac;
191  double sigapp;
192  double eb;
193  double pb;
194  double rin2pb;
195  double p1[4];
196  double p2[4];
197  double q1[4];
198  double q2[4];
199  double qk[4];
200  double weight;
201  };
202 
204 }
205 
206 
Generator for low scattering angle radiative Bhabha events (Beam-Beam Bremsstrahlung).
Definition: BBBrem.h:31
double rme2
variable
Definition: BBBrem.h:184
long m_weightCountOver
Internal overweighted event counter.
Definition: BBBrem.h:139
double sigapp
variable
Definition: BBBrem.h:191
double rme2s
variable
Definition: BBBrem.h:185
double alpha
variable
Definition: BBBrem.h:181
double m_maxWeightDelivered
The maximum weight given by the BBBrem generation.
Definition: BBBrem.h:141
void storeParticle(MCParticleGraph &mcGraph, const double *mom, 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: BBBrem.cc:382
double getCrossSectionErrorOver()
Returns the error on the total overweight bias cross section of the generated process in millibarn.
Definition: BBBrem.h:116
double rme
in MeV
Definition: BBBrem.h:182
double m_crossSection
The cross-section in millibarns.
Definition: BBBrem.h:149
bool m_unweighted
True if BBBrem should produce unweighted events.
Definition: BBBrem.h:137
double m_cmsEnergy
Center of mass energy (sqrt(s)).
Definition: BBBrem.h:146
double rin2pb
variable
Definition: BBBrem.h:194
double m_densityCorrectionParameter
Density correction parameter tc.
Definition: BBBrem.h:155
static constexpr double twopi
2*pi.
Definition: BBBrem.h:178
int m_eventCount
Internal event counter.
Definition: BBBrem.h:136
void calcOutgoingLeptonsAndWeight()
Calculate the outgoing leptons and the event weight for one single radiative Bhabha scattering.
Definition: BBBrem.cc:155
long m_weightCount
Internal weighted event counter.
Definition: BBBrem.h:138
double pb
variable
Definition: BBBrem.h:193
double a1
variable
Definition: BBBrem.h:188
static constexpr double tomb
Conversion factor (hc)^2.
Definition: BBBrem.h:177
double m_sumWeightDeliveredOver
The sum of all overweights.
Definition: BBBrem.h:144
void term()
Terminates the generator.
Definition: BBBrem.cc:135
double m_maxWeight
The maximum weight.
Definition: BBBrem.h:140
double z0
variable
Definition: BBBrem.h:187
double p2[4]
variable
Definition: BBBrem.h:196
double generateEvent(MCParticleGraph &mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
Generates one single event.
Definition: BBBrem.cc:80
double p1[4]
variable
Definition: BBBrem.h:195
double getSumWeightDelivered()
Returns the sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:126
double m_sumWeightDelivered
The sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:142
double eb
variable
Definition: BBBrem.h:192
double weight
variable
Definition: BBBrem.h:200
double q1[4]
variable
Definition: BBBrem.h:197
void init(double cmsEnergy, double minPhotonEFrac, bool unweighted=true, double maxWeight=2000.0, int densitymode=1, double densityparameter=1.68e-17)
Initializes the generator.
Definition: BBBrem.cc:21
double m_crossSectionError
The error on the cross-section in millibarns.
Definition: BBBrem.h:150
~BBBrem()
Destructor.
Definition: BBBrem.h:77
double m_sumWeightDeliveredSqrOver
The square of the sum of all overweights.
Definition: BBBrem.h:145
double getCrossSectionOver()
Returns the total overweight bias cross section of the generated process in millibarn.
Definition: BBBrem.h:111
double ac
variable
Definition: BBBrem.h:190
double q2[4]
variable
Definition: BBBrem.h:198
double a2
variable
Definition: BBBrem.h:189
double m_sumWeightDeliveredSqr
The square of the sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:143
double qk[4]
variable
Definition: BBBrem.h:199
double getCrossSection()
Returns the total cross section of the generated process in millibarn.
Definition: BBBrem.h:101
double getCrossSectionError()
Returns the error on the total cross section of the generated process in millibarn.
Definition: BBBrem.h:106
double m_photonEFrac
Minimum photon energy fraction.
Definition: BBBrem.h:147
BBBrem()
Constructor.
Definition: BBBrem.h:37
int m_densityCorrectionMode
Mode for bunch density correction.
Definition: BBBrem.h:154
double m_crossSectionErrorOver
The overweight bias error on the cross-section in millibarns.
Definition: BBBrem.h:152
double s
variable
Definition: BBBrem.h:183
double getMaxWeightDelivered()
Returns the maximum weight given by the BBBrem generation.
Definition: BBBrem.h:121
double rls
variable
Definition: BBBrem.h:186
double m_crossSectionOver
The overweight bias cross-section in millibarns.
Definition: BBBrem.h:151
Class to build, validate and sort a particle decay chain.
Abstract base class for different kinds of events.