Belle II Software  release-08-01-10
TeeggInputModule.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/core/Module.h>
13 #include <framework/logging/Logger.h>
14 
15 #include <generators/teegg/Teegg.h>
16 #include <generators/utilities/InitialParticleGeneration.h>
17 
18 #include <mdst/dataobjects/MCParticleGraph.h>
19 
20 #include <vector>
21 
22 namespace Belle2 {
34  class TeeggInputModule : public Module {
35 
36  public:
37 
43 
45  virtual ~TeeggInputModule();
46 
48  virtual void initialize() override;
49 
51  virtual void event() override;
52 
54  virtual void terminate() override;
55 
56  protected:
57 
59  std::string m_sVACPOL;
60  double m_cmsEnergy;
61  double m_TEVETO;
62  double m_TEMIN;
63  double m_TGMIN;
64  double m_TGVETO;
65  double m_EEMIN;
66  double m_EGMIN;
67  double m_PEGMIN;
68  double m_EEVETO;
69  double m_EGVETO;
70  double m_PHVETO;
71  double m_CUTOFF;
72  double m_EPS;
73  double m_FRAPHI;
74  double m_EPSPHI;
75  double m_WGHT1M;
76  double m_WGHTMX;
77  std::string m_sRADCOR;
78  std::string m_sCONFIG;
79  std::string m_sMATRIX;
80  std::string m_sMTRXGG;
81  int m_UNWGHT;
87  template <typename T>
88  std::vector<T> make_vector(T const& t1, T const& t2);
90  template <typename T>
91  std::pair<T, T> vectorToPair(std::vector<T>& vec, const std::string& name = "");
92 
93  private:
94 
96  void initializeGenerator();
97 
98  bool m_initialized{false};
103  };
105  template <typename T>
106  inline std::vector<T> TeeggInputModule::make_vector(T const& t1, T const& t2)
107  {
108  std::vector<T> v;
109  v.push_back(t1);
110  v.push_back(t2);
111  return v;
112  }
113 
114  template <typename T>
115  inline std::pair<T, T> TeeggInputModule::vectorToPair(std::vector<T>& vec, const std::string& name)
116  {
117  std::pair<T, T> p;
118  if (vec.size() != 2) {
119  B2ERROR("The parameter " + name + " has to have exactly 2 elements!");
120  } else {
121  p.first = vec[0];
122  p.second = vec[1];
123  }
124  return p;
125  }
126 
128 } // end namespace Belle2
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
The TEEGG Generator module.vectorToPair.
double m_EGVETO
minimum energy to veto(etron/gamma config with hard rad corr)
double m_TEVETO
maximum theta of e+ in final state (in radians)
DBObjPtr< BeamParameters > m_beamParams
BeamParameter.
bool m_initialized
True if generator has been initialized.
double m_EEVETO
minimum energy to veto(gamma config with hard rad corr)
virtual void initialize() override
Initializes the module.
double m_cmsEnergy
CMS energy.
double m_WGHTMX
maximum weight for the trial events
virtual void event() override
Method is called for each event.
virtual ~TeeggInputModule()
Destructor.
double m_EGMIN
minimum energy of the gamma (egamma & gamma configurations)
int m_UNWGHT
logical variable.
virtual void terminate() override
Method is called at the end of the event processing.
std::string m_sMATRIX
specifies which eeg matrix element (BK BKM2 TCHAN or EPA)
double m_WGHT1M
maximum weight for generation of QP0, cos(theta QP)
double m_PHVETO
minimum phi sep to veto(etron/gamma config with hard rad corr
Teegg m_generator
Variables.
std::string m_sCONFIG
specifies the event configuration (EGAMMA GAMMA or ETRON)
std::string m_sMTRXGG
specifies which eegg matrix element (EPADC BEEGG or MEEGG)
MCParticleGraph m_mcGraph
The MCParticle graph object.
double m_TGVETO
maximum angle between the gamma and -z axis(etron conf.
std::string m_sRADCOR
specifies radiative correction (NONE SOFT or HARD)
InitialParticleGeneration m_initial
initial particle used by BeamParameter class
double m_EEMIN
minimum energy of the e- (egamma & etron configurations)
double m_CUTOFF
cutoff energy for radiative corrections (in CM frame)
double m_TGMIN
minimum angle between the gamma and -z axis
std::string m_sVACPOL
Module parameters.
double m_TEMIN
minimum angle between the e- and -z axis (egamma conf.
double m_FRAPHI
fraction of time phi_ks is generated with peak(hard rad corr)
void initializeGenerator()
Method is called to initialize the generator.
double m_PEGMIN
minimum phi sep of e-gamma (egamma config with hard rad corr)
C++ Interface for the Fortran generator TEEGG.
Definition: Teegg.h:25
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.