Belle II Software  release-05-01-25
BBBrem.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <mdst/dataobjects/MCParticleGraph.h>
14 
15 #include <TLorentzRotation.h>
16 
17 namespace Belle2 {
32  class BBBrem {
33 
34  public:
35 
38  BBBrem() :
39  m_eventCount(0),
40  m_unweighted(true),
41  m_weightCount(0),
43  m_maxWeight(0.0),
49  m_cmsEnergy(10.58),
50  m_photonEFrac(0.000001),
51  m_crossSection(0.0),
53  m_crossSectionOver(0.0),
57  alpha(0.0),
58  rme(0.0),
59  s(0.0),
60  rme2(0.0),
61  rme2s(0.0),
62  rls(0.0),
63  z0(0.0),
64  a1(0.0),
65  a2(0.0),
66  ac(0.0),
67  sigapp(0.0),
68  eb(0.0),
69  pb(0.0),
70  rin2pb(0.0),
71  weight(0.0)
72  {for (int i = 0; i < 4; i++) p1[i] = p2[i] = q1[i] = q2[i] = qk[i] = 0.0;}
73 
74 
75  //BBBrem() : m_applyBoost(false), m_unweighted(true), m_cmsEnergy(10.58), m_photonEFrac(0.000001) {};
76 
78  ~BBBrem() {};
79 
86  void init(double cmsEnergy, double minPhotonEFrac, bool unweighted = true, double maxWeight = 2000.0, int densitymode = 1,
87  double densityparameter = 1.68e-17);
88 
93  double generateEvent(MCParticleGraph& mcGraph, TVector3 vertex, TLorentzRotation boost);
94 
98  double getCrossSection() { return m_crossSection; }
99 
103  double getCrossSectionError() { return m_crossSectionError; }
104 
108  double getCrossSectionOver() { return m_crossSectionOver; }
109 
114 
118  double getMaxWeightDelivered() { return m_maxWeightDelivered; }
119 
123  double getSumWeightDelivered() { return m_sumWeightDelivered; }
124 
128  void term();
129 
130 
131  protected:
132 
133  int m_eventCount;
134  bool m_unweighted;
135  long m_weightCount;
136  long m_weightCountOver;
137  double m_maxWeight;
138  double m_maxWeightDelivered;
139  double m_sumWeightDelivered;
140  double m_sumWeightDeliveredSqr;
143  double m_cmsEnergy;
144  double m_photonEFrac;
146  double m_crossSection;
158 
168  void storeParticle(MCParticleGraph& mcGraph, const double* mom, int pdg, TVector3 vertex, TLorentzRotation boost,
169  bool isVirtual = false, bool isInitial = false);
170 
171  private:
172 
173  static constexpr double tomb = 3.8937966e5 / 1e6;
174  static constexpr double twopi = 2.0 * M_PI;
176  //Variable names directly taken from the FORTRAN code. Sorry.
177  double alpha;
178  double rme;
179  double s;
180  double rme2;
181  double rme2s;
182  double rls;
183  double z0;
184  double a1;
185  double a2;
186  double ac;
187  double sigapp;
188  double eb;
189  double pb;
190  double rin2pb;
191  double p1[4];
192  double p2[4];
193  double q1[4];
194  double q2[4];
195  double qk[4];
196  double weight;
197  };
198 
200 }
201 
202 
Belle2::BBBrem::~BBBrem
~BBBrem()
Destructor.
Definition: BBBrem.h:86
Belle2::BBBrem::ac
double ac
variable
Definition: BBBrem.h:194
Belle2::BBBrem::p1
double p1[4]
variable
Definition: BBBrem.h:199
Belle2::BBBrem::m_sumWeightDelivered
double m_sumWeightDelivered
The sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:147
Belle2::BBBrem::getCrossSectionError
double getCrossSectionError()
Returns the error on the total cross section of the generated process in millibarn.
Definition: BBBrem.h:111
Belle2::BBBrem::alpha
double alpha
variable
Definition: BBBrem.h:185
Belle2::BBBrem::getSumWeightDelivered
double getSumWeightDelivered()
Returns the sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:131
Belle2::BBBrem::m_unweighted
bool m_unweighted
True if BBBrem should produce unweighted events.
Definition: BBBrem.h:142
Belle2::BBBrem::a2
double a2
variable
Definition: BBBrem.h:193
Belle2::BBBrem::m_weightCount
long m_weightCount
Internal weighted event counter.
Definition: BBBrem.h:143
Belle2::BBBrem::m_maxWeightDelivered
double m_maxWeightDelivered
The maximum weight given by the BBBrem generation.
Definition: BBBrem.h:146
Belle2::MCParticleGraph
Class to build, validate and sort a particle decay chain.
Definition: MCParticleGraph.h:48
Belle2::BBBrem::m_photonEFrac
double m_photonEFrac
Minimum photon energy fraction.
Definition: BBBrem.h:152
Belle2::BBBrem::rme
double rme
in MeV
Definition: BBBrem.h:186
Belle2::BBBrem::pb
double pb
variable
Definition: BBBrem.h:197
Belle2::BBBrem::tomb
static constexpr double tomb
Conversion factor (hc)^2.
Definition: BBBrem.h:181
Belle2::BBBrem::m_densityCorrectionParameter
double m_densityCorrectionParameter
Density correction parameter tc.
Definition: BBBrem.h:160
Belle2::BBBrem::m_weightCountOver
long m_weightCountOver
Internal overweighted event counter.
Definition: BBBrem.h:144
Belle2::BBBrem::rme2s
double rme2s
variable
Definition: BBBrem.h:189
Belle2::BBBrem::init
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:23
Belle2::BBBrem::m_crossSectionOver
double m_crossSectionOver
The overweight bias cross-section in millibarns.
Definition: BBBrem.h:156
Belle2::BBBrem::a1
double a1
variable
Definition: BBBrem.h:192
Belle2::BBBrem::q2
double q2[4]
variable
Definition: BBBrem.h:202
Belle2::BBBrem::m_crossSectionErrorOver
double m_crossSectionErrorOver
The overweight bias error on the cross-section in millibarns.
Definition: BBBrem.h:157
Belle2::BBBrem::m_densityCorrectionMode
int m_densityCorrectionMode
Mode for bunch density correction.
Definition: BBBrem.h:159
Belle2::BBBrem::calcOutgoingLeptonsAndWeight
void calcOutgoingLeptonsAndWeight()
Calculate the outgoing leptons and the event weight for one single radiative Bhabha scattering.
Definition: BBBrem.cc:157
Belle2::BBBrem::storeParticle
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:384
Belle2::BBBrem::q1
double q1[4]
variable
Definition: BBBrem.h:201
Belle2::BBBrem::m_sumWeightDeliveredSqrOver
double m_sumWeightDeliveredSqrOver
The square of the sum of all overweights.
Definition: BBBrem.h:150
Belle2::BBBrem::BBBrem
BBBrem()
Constructor.
Definition: BBBrem.h:46
Belle2::BBBrem::z0
double z0
variable
Definition: BBBrem.h:191
Belle2::BBBrem::eb
double eb
variable
Definition: BBBrem.h:196
Belle2::BBBrem::getCrossSection
double getCrossSection()
Returns the total cross section of the generated process in millibarn.
Definition: BBBrem.h:106
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BBBrem::m_crossSectionError
double m_crossSectionError
The error on the cross-section in millibarns.
Definition: BBBrem.h:155
Belle2::BBBrem::getMaxWeightDelivered
double getMaxWeightDelivered()
Returns the maximum weight given by the BBBrem generation.
Definition: BBBrem.h:126
Belle2::BBBrem::getCrossSectionErrorOver
double getCrossSectionErrorOver()
Returns the error on the total overweight bias cross section of the generated process in millibarn.
Definition: BBBrem.h:121
Belle2::BBBrem::p2
double p2[4]
variable
Definition: BBBrem.h:200
Belle2::BBBrem::rin2pb
double rin2pb
variable
Definition: BBBrem.h:198
Belle2::BBBrem::rme2
double rme2
variable
Definition: BBBrem.h:188
Belle2::BBBrem::m_eventCount
int m_eventCount
Internal event counter.
Definition: BBBrem.h:141
Belle2::BBBrem::rls
double rls
variable
Definition: BBBrem.h:190
Belle2::BBBrem::m_crossSection
double m_crossSection
The cross-section in millibarns.
Definition: BBBrem.h:154
Belle2::BBBrem::m_maxWeight
double m_maxWeight
The maximum weight.
Definition: BBBrem.h:145
Belle2::BBBrem::m_sumWeightDeliveredOver
double m_sumWeightDeliveredOver
The sum of all overweights.
Definition: BBBrem.h:149
Belle2::BBBrem::s
double s
variable
Definition: BBBrem.h:187
Belle2::BBBrem::getCrossSectionOver
double getCrossSectionOver()
Returns the total overweight bias cross section of the generated process in millibarn.
Definition: BBBrem.h:116
Belle2::BBBrem::weight
double weight
variable
Definition: BBBrem.h:204
Belle2::BBBrem::generateEvent
double generateEvent(MCParticleGraph &mcGraph, TVector3 vertex, TLorentzRotation boost)
Generates one single event.
Definition: BBBrem.cc:82
Belle2::BBBrem::term
void term()
Terminates the generator.
Definition: BBBrem.cc:137
Belle2::BBBrem::m_sumWeightDeliveredSqr
double m_sumWeightDeliveredSqr
The square of the sum of all weights returned by the BBBrem generation.
Definition: BBBrem.h:148
Belle2::BBBrem::twopi
static constexpr double twopi
2*pi.
Definition: BBBrem.h:182
Belle2::BBBrem::m_cmsEnergy
double m_cmsEnergy
Center of mass energy (sqrt(s)).
Definition: BBBrem.h:151
Belle2::BBBrem::qk
double qk[4]
variable
Definition: BBBrem.h:203
Belle2::BBBrem::sigapp
double sigapp
variable
Definition: BBBrem.h:195