Belle II Software  release-08-01-10
TrepsInputModule.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 #pragma once
10 
11 #include <framework/datastore/StoreArray.h>
12 
13 #include <generators/modules/GeneratorBaseModule.h>
14 #include <generators/treps/Treps3B.h>
15 #include <generators/treps/UtrepsB.h>
16 
17 #include <mdst/dataobjects/MCParticle.h>
18 #include <mdst/dataobjects/MCParticleGraph.h>
19 #include <generators/utilities/InitialParticleGeneration.h>
20 #include <string>
21 
22 namespace Belle2 {
34 
35  public:
40 
42  virtual void generatorInitialize() override;
43 
45  virtual void terminate() override;
46 
48  virtual void generatorEvent() override;
49 
51  double simulateW();
52 
54  double getCrossSection(double W);
55 
57  void initializeGenerator();
58 
59  private:
60 
62  UtrepsB m_generator;
63 
65  std::string m_parameterFile;
66 
68  std::string m_wListTableFile;
69 
72 
87  double m_maximalQ2;
88 
94 
97 
100 
106 
107  bool m_initialized{false};
109  };
111 }
112 
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
The base module for generator modules, which sets the generator information as EventExtraInfo.
Class to build, validate and sort a particle decay chain.
Input from TREPS generator for ee->eeff.
std::string m_parameterFile
Parameter file which configures the setting of beam, production particle etc.
UtrepsB m_generator
Treps generator.
std::string m_differentialCrossSectionFile
Differential cross section table file.
double m_maximalQ2
Maximal Q^2 = -q^2, where q is the difference between the initial and final electron or positron mome...
DBObjPtr< BeamParameters > m_beamParams
BeamParameter.
bool m_initialized
True if generator has been initialized.
double getCrossSection(double W)
Returns the differential cross section for given W [GeV].
bool m_useDiscreteAndSortedW
if it is true, W-list table is used for discrete and sorted W
double m_minimalTransverseMomentum
Minimal transverse momentum of the final-state particles.
StoreArray< MCParticle > m_mcparticles
MCParticle collection.
virtual void terminate() override
initialization for trepsinput
bool m_applyCosThetaCutCharged
Whether to apply cut on |cos(theta)| for charged particles only.
virtual void generatorInitialize() override
initialization for trepsinput
double simulateW()
Simulate W distribution according to given input file of cross section table.
TrepsInputModule()
Constructor: Sets the description, the properties and the parameters of the module.
double m_maximalAbsCosTheta
Maximal |cos(theta)|, where theta is the final-state particle polar angle.
InitialParticleGeneration m_initial
initial particle used by BeamParameter class
MCParticleGraph m_mpg
An instance of the MCParticle graph.
std::string m_wListTableFile
W-List table file.
void initializeGenerator()
Initialize the TREPS generator
bool m_applyTransverseMomentumCutCharged
Whether to apply cut on the minimal transverse momentum for charged particles only.
virtual void generatorEvent() override
input event from TREPS
Abstract base class for different kinds of events.