Belle II Software development
BabayagaNLOInputModule.h
1
2/**************************************************************************
3 * basf2 (Belle II Analysis Software Framework) *
4 * Author: The Belle II Collaboration *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9
10#pragma once
11
12#include <framework/logging/Logger.h>
13
14#include <generators/modules/GeneratorBaseModule.h>
15#include <generators/babayaganlo/BabayagaNLO.h>
16#include <generators/utilities/InitialParticleGeneration.h>
17
18#include <mdst/dataobjects/MCParticleGraph.h>
19
20#include <vector>
21#include <TFile.h>
22#include <TH1D.h>
23
24
25namespace Belle2 {
36
37 public:
38
43 BabayagaNLOInputModule();//: Module(), m_initial(BeamParameters::c_smearALL) {}
44
47
49 virtual void generatorInitialize() override;
50
52 virtual void generatorEvent() override;
53
55 virtual void terminate() override;
56
58 static double generateCMSEnergy()
59 {
60 return s_initial.generate().getMass();
61 }
62
63 protected:
64
65 double getBeamEnergyCM(double e1, double e2, double angle);
68 std::string m_order;
69 std::string m_model;
70 std::string m_mode;
71 std::string m_vacPol;
72 std::string m_finalState;
73 double m_eMinFrac;
74 double m_eMin;
75 double m_epsilon;
77 double m_fMax;
79 int m_nPhot;
80 std::vector<double> m_ScatteringAngleRange;
81 std::string m_fileNameExtraInfo;
82 double m_Spread;
84 std::string m_NSKDataFile;
86 std::string m_userMode;
87 double m_eemin;
88 double m_temin;
89 double m_egmin;
90 double m_tgmin;
91 double m_eeveto;
92 double m_teveto;
93 double m_egveto;
94 double m_tgveto;
103 template <typename T>
104 std::vector<T> make_vector(T const& t1, T const& t2);
106 template <typename T>
107 std::pair<T, T> vectorToPair(std::vector<T>& vec, const std::string& name = "");
108
109 private:
111 void initializeGenerator();
112
113 bool m_initialized{false};
118 };
119
120
121 template <typename T>
122 inline std::vector<T> BabayagaNLOInputModule::make_vector(T const& t1, T const& t2)
123 {
124 std::vector<T> v;
125 v.push_back(t1);
126 v.push_back(t2);
127 return v;
128 }
129
130 template <typename T>
131 inline std::pair<T, T> BabayagaNLOInputModule::vectorToPair(std::vector<T>& vec, const std::string& name)
132 {
133 std::pair<T, T> p;
134 if (vec.size() != 2) {
135 B2ERROR("The parameter " + name + " has to have exactly 2 elements !");
136 } else {
137 p.first = vec[0];
138 p.second = vec[1];
139 }
140 return p;
141 }
142
144} // end namespace Belle2
The Babayaga.NLO Generator module.
double m_eeveto
Minimum CMS energy to veto e-/e+ (GeV).
std::string m_NSKDataFile
data file for the NSK VP data.
double m_tgveto
Maximum CMS angle between the gamma and -z axis (deg).
static InitialParticleGeneration s_initial
Initial particle for beam parameters, static because we need to call it from FORTRAN here.
double m_maxAcollinearity
maximum acollinearity angle between finale state leptons in degrees.
double m_maxprescale
Maximum prescale value.
DBObjPtr< BeamParameters > m_beamParams
BeamParameter.
bool m_initialized
True if generator has been initialized.
double m_Spread
TEMPORARY SOLUTION! Approximate energy spread per beam (CMS).
std::string m_order
Module parameters.
double m_tgmin
Minimum CMS angle between the gamma and -z axis (deg).
double m_epsilon
Soft/hard photon separator in units of CMS/2.
double m_teveto
Maximum CMS theta of e-/e+ in final state (deg).
virtual void terminate() override
Method is called at the end of the event processing.
double m_temin
Minimum CMS angle between the tagged e-/e+ and -z axis (deg).
std::string m_fileNameExtraInfo
Extra ROOT file that contains the weight distribution to check overweight bias.
std::string m_userMode
User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE or NONE.
int m_nSearchMax
Events used to search maximum of differential cross section.
virtual ~BabayagaNLOInputModule()
Destructor.
int m_nPhot
fixed number of nphot (hard) photons are generated.
virtual void generatorInitialize() override
Initializes the module.
bool m_Uncertainty
vary all VP related parameters and extracted total uncertainty.
std::string m_vacPol
Vacuum polarization: off, hadr5 or hmnt.
double getBeamEnergyCM(double e1, double e2, double angle)
Get the CM energy from LER, HER and the crossing angle.
double m_egmin
Minimum CMS energy of the gamma (GeV).
double m_eMinFrac
Fractional energy (of cms energy) for leptons in the final state.
static double generateCMSEnergy()
Static method to get a random CMS energy (used via extern C from fortran).
double m_eemin
Minimum CMS energy of the tagged e-/e+ (GeV).
std::string m_finalState
Final state: ee, mm or gg.
MCParticleGraph m_mcGraph
The MCParticle graph object.
double m_egveto
Minimum CMS energy to veto gamma (GeV).
double m_eMin
Minimum energy for leptons in the final state, in GeV.
std::vector< double > m_ScatteringAngleRange
Min [0] and Max [1] value for the scat.
void initializeGenerator()
Method is called to initialize the generator.
std::string m_model
model: matched or ps.
std::string m_mode
mode: weighted or unweighted.
virtual void generatorEvent() override
Method is called for each event.
TH1D * m_th1dSDif
Histograms with the event weights.
double m_fMax
Maximum differential cross section weight.
C++ Interface for the Fortran Bhabha and exclusive two photon generator BABAYAGA.NLO.
Definition: BabayagaNLO.h:27
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
The base module for generator modules, which sets the generator information as EventExtraInfo.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
Class to build, validate and sort a particle decay chain.
std::pair< T, T > vectorToPair(std::vector< T > &vec, const std::string &name="")
std::vector< T > make_vector(T const &t1, T const &t2)
make_vector.
MCInitialParticles & generate()
Generate a new event.
Abstract base class for different kinds of events.