Belle II Software  release-06-02-00
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 #ifndef TEEGGINPUTMODULE_H
11 #define TEEGGINPUTMODULE_H
12 
13 #include <framework/core/Module.h>
14 #include <framework/logging/Logger.h>
15 
16 #include <generators/teegg/Teegg.h>
17 #include <generators/utilities/InitialParticleGeneration.h>
18 
19 #include <mdst/dataobjects/MCParticleGraph.h>
20 
21 #include <vector>
22 
23 namespace Belle2 {
35  class TeeggInputModule : public Module {
36 
37  public:
38 
44 
46  virtual ~TeeggInputModule();
47 
49  virtual void initialize() override;
50 
52  virtual void event() override;
53 
55  virtual void terminate() override;
56 
57  protected:
58 
60  std::string m_sVACPOL;
61  double m_cmsEnergy;
62  double m_TEVETO;
63  double m_TEMIN;
64  double m_TGMIN;
65  double m_TGVETO;
66  double m_EEMIN;
67  double m_EGMIN;
68  double m_PEGMIN;
69  double m_EEVETO;
70  double m_EGVETO;
71  double m_PHVETO;
72  double m_CUTOFF;
73  double m_EPS;
74  double m_FRAPHI;
75  double m_EPSPHI;
76  double m_WGHT1M;
77  double m_WGHTMX;
78  std::string m_sRADCOR;
79  std::string m_sCONFIG;
80  std::string m_sMATRIX;
81  std::string m_sMTRXGG;
82  int m_UNWGHT;
88  template <typename T>
89  std::vector<T> make_vector(T const& t1, T const& t2);
91  template <typename T>
92  std::pair<T, T> vectorToPair(std::vector<T>& vec, const std::string& name = "");
93 
94  private:
95 
97  void initializeGenerator();
98 
99  bool m_initialized{false};
104  };
106  template <typename T>
107  inline std::vector<T> TeeggInputModule::make_vector(T const& t1, T const& t2)
108  {
109  std::vector<T> v;
110  v.push_back(t1);
111  v.push_back(t2);
112  return v;
113  }
114 
115  template <typename T>
116  inline std::pair<T, T> TeeggInputModule::vectorToPair(std::vector<T>& vec, const std::string& name)
117  {
118  std::pair<T, T> p;
119  if (vec.size() != 2) {
120  B2ERROR("The parameter " + name + " has to have exactly 2 elements!");
121  } else {
122  p.first = vec[0];
123  p.second = vec[1];
124  }
125  return p;
126  }
127 
129 } // end namespace Belle2
130 
131 #endif /* TEEGGINPUTMODULE_H */
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.