Belle II Software  release-06-00-14
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 #ifndef BABAYAGANLOINPUTMODULE_H
11 #define BABAYAGANLOINPUTMODULE_H
12 
13 #include <framework/core/Module.h>
14 #include <framework/logging/Logger.h>
15 
16 #include <generators/babayaganlo/BabayagaNLO.h>
17 #include <generators/utilities/InitialParticleGeneration.h>
18 
19 #include <mdst/dataobjects/MCParticleGraph.h>
20 
21 #include <vector>
22 #include <TFile.h>
23 #include <TH1D.h>
24 
25 
26 namespace Belle2 {
39  class BabayagaNLOInputModule : public Module {
40 
41  public:
42 
47  BabayagaNLOInputModule();//: Module(), m_initial(BeamParameters::c_smearALL) {}
48 
50  virtual ~BabayagaNLOInputModule();
51 
53  virtual void initialize() override;
54 
56  virtual void event() override;
57 
59  virtual void terminate() override;
60 
62  static double generateCMSEnergy()
63  {
64  return s_initial.generate().getMass();
65  }
66 
67  protected:
68 
69  double getBeamEnergyCM(double e1, double e2, double angle);
72  std::string m_order;
73  std::string m_model;
74  std::string m_mode;
75  std::string m_vacPol;
76  std::string m_finalState;
77  double m_eMinFrac;
78  double m_eMin;
79  double m_epsilon;
81  double m_fMax;
83  int m_nPhot;
84  std::vector<double> m_ScatteringAngleRange;
85  std::string m_fileNameExtraInfo;
86  double m_Spread;
88  std::string m_NSKDataFile;
90  std::string m_userMode;
91  double m_eemin;
92  double m_temin;
93  double m_egmin;
94  double m_tgmin;
95  double m_eeveto;
96  double m_teveto;
97  double m_egveto;
98  double m_tgveto;
99  double m_maxprescale;
105  TH1D* m_th1dSDif;
107  template <typename T>
108  std::vector<T> make_vector(T const& t1, T const& t2);
110  template <typename T>
111  std::pair<T, T> vectorToPair(std::vector<T>& vec, const std::string& name = "");
112 
113  private:
115  void initializeGenerator();
116 
117  bool m_initialized{false};
122  };
123 
124 
125  template <typename T>
126  inline std::vector<T> BabayagaNLOInputModule::make_vector(T const& t1, T const& t2)
127  {
128  std::vector<T> v;
129  v.push_back(t1);
130  v.push_back(t2);
131  return v;
132  }
133 
134  template <typename T>
135  inline std::pair<T, T> BabayagaNLOInputModule::vectorToPair(std::vector<T>& vec, const std::string& name)
136  {
137  std::pair<T, T> p;
138  if (vec.size() != 2) {
139  B2ERROR("The parameter " + name + " has to have exactly 2 elements !");
140  } else {
141  p.first = vec[0];
142  p.second = vec[1];
143  }
144  return p;
145  }
146 
148 } // end namespace Belle2
149 
150 #endif /* BABAYAGANLOINPUTMODULE_H */
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).
virtual void initialize() override
Initializes the module.
std::string m_order
Module parameters.
virtual void event() override
Method is called for each event.
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.
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.
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
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
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.
MCInitialParticles & generate()
Generate a new event.
Abstract base class for different kinds of events.