Belle II Software  release-06-00-14
BHWideInputModule.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 #ifndef BHWIDEINPUTMODULE_H
10 #define BHWIDEINPUTMODULE_H
11 
12 #include <framework/core/Module.h>
13 #include <framework/logging/Logger.h>
14 
15 #include <generators/bhwide/BHWide.h>
16 
17 #include <mdst/dataobjects/MCParticleGraph.h>
18 
19 #include <generators/utilities/InitialParticleGeneration.h>
20 
21 #include <vector>
22 
23 namespace Belle2 {
33  class BHWideInputModule : public Module {
34 
35  public:
36 
42 
44  virtual ~BHWideInputModule();
45 
47  virtual void initialize() override;
48 
50  virtual void event() override;
51 
53  virtual void terminate() override;
54 
55  protected:
56 
57  double getBeamEnergyCM(double e1, double e2, double angle);
60  std::vector<double>
62  std::vector<double>
66  std::string m_vacPolString;
68  double m_eMin;
70  double m_wtMax;
76  template <typename T>
77  std::vector<T> make_vector(T const& t1, T const& t2);
79  template <typename T>
80  std::pair<T, T> vectorToPair(std::vector<T>& vec, const std::string& name = "");
81 
82  private:
83 
85  void initializeGenerator();
86 
87  bool m_initialized{false};
92  };
94  template <typename T>
95  inline std::vector<T> BHWideInputModule::make_vector(T const& t1, T const& t2)
96  {
97  std::vector<T> v;
98  v.push_back(t1);
99  v.push_back(t2);
100  return v;
101  }
102 
103  template <typename T>
104  inline std::pair<T, T> BHWideInputModule::vectorToPair(std::vector<T>& vec, const std::string& name)
105  {
106  std::pair<T, T> p;
107  if (vec.size() != 2) {
108  B2ERROR("The parameter " + name + " has to have exactly 2 elements !");
109  } else {
110  p.first = vec[0];
111  p.second = vec[1];
112  }
113  return p;
114  }
115 
117 } // end namespace Belle2
118 
119 #endif /* BHWIDEINPUTMODULE_H */
The BHWide Generator module.vectorToPair.
std::string m_vacPolString
Vacuum polarization as string.
double m_maxAcollinearity
maximum acollinearity angle between finale state leptons in degrees.
DBObjPtr< BeamParameters > m_beamParams
BeamParameter.
bool m_initialized
True if generator has been initialized.
std::vector< double > m_ScatteringAngleRangeElectron
Min [0] and Max [1] value for the scattering angle [deg] of the electron.
virtual void initialize() override
Initializes the module.
BHWide m_generator
Variables.
virtual void event() override
Method is called for each event.
virtual void terminate() override
Method is called at the end of the event processing.
std::vector< double > m_ScatteringAngleRangePositron
Module parameters.
bool m_weakCorrections
EW corrections on/off.
BHWide::PhotonVacPolarization m_vacPol
Vacuum polarization.
double getBeamEnergyCM(double e1, double e2, double angle)
Get CM beam energy from LER, HER and crossing angle.
virtual ~BHWideInputModule()
Destructor.
MCParticleGraph m_mcGraph
The MCParticle graph object.
double m_eMin
Minimum energy for leptons in the final state, in GeV.
InitialParticleGeneration m_initial
initial particle used by BeamParameter class
void initializeGenerator()
Method is called to initialize the generator.
double m_wtMax
Maximum weight (wtmax).
C++ Interface for the Fortran Bhabha scattering generator BHWide.
Definition: BHWide.h:31
PhotonVacPolarization
Call photon polarization.
Definition: BHWide.h:60
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class to build, validate and sort a particle decay chain.
Base class for Modules.
Definition: Module.h:72
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.
Abstract base class for different kinds of events.