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