Belle II Software  release-08-01-10
OpticalGunModule.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/core/Module.h>
12 #include <string>
13 #include <Math/Transform3D.h>
14 #include <Math/Vector3D.h>
15 #include <Math/Point3D.h>
16 #include <TF1.h>
17 
18 // DataStore
19 #include <framework/datastore/StoreArray.h>
20 #include <mdst/dataobjects/MCParticle.h>
21 #include <top/dataobjects/TOPSimCalPulse.h>
22 
23 namespace Belle2 {
45  class OpticalGunModule : public Module {
46 
47  public:
48 
53 
57  virtual ~OpticalGunModule();
58 
63  virtual void initialize() override;
64 
68  virtual void event() override;
69 
70  private:
71 
72  // steering parameters
73  double m_x = 0;
74  double m_y = 0;
75  double m_z = 0;
76  double m_diameter = 0;
77  double m_maxAlpha = 0;
78  double m_minAlpha = 0;
79  double m_na = 0;
80  double m_wavelength = 0;
81  double m_phi = 0;
82  double m_theta = 0;
83  double m_psi = 0;
84  double m_startTime = 0;
85  double m_pulseWidth = 0;
86  double m_numPhotons = 0;
87  int m_slotID = 0;
88  double m_slitDX = 0;
89  double m_slitDY = 0;
90  double m_slitX0 = 0;
91  double m_slitY0 = 0;
92  double m_slitZ = 0;
93  std::string m_angularDistribution;
95  // others
96  double m_cosMinAlpha = 0;
97  double m_cosMaxAlpha = 0;
98  double m_energy = 0;
99  ROOT::Math::Transform3D m_transform;
102  // data store objects
112  bool isInsideSlit(const ROOT::Math::XYZPoint& point, const ROOT::Math::XYZVector& direction) const;
113 
118  ROOT::Math::XYZVector getDirectionGaussian() const;
119 
124  ROOT::Math::XYZVector getDirectionUniform() const;
125 
130  ROOT::Math::XYZVector getDirectionLambertian() const;
131 
136  ROOT::Math::XYZVector getDirectionUniformRingAngle() const;
137 
142  ROOT::Math::XYZVector getDirectionCustom() const;
143 
144  };
145 
147 } // Belle2 namespace
148 
Base class for Modules.
Definition: Module.h:72
Source of optical photons for the simulation of the TOP laser system.
std::string m_angularDistribution
source angular distribution
double m_minAlpha
minimum emission angle
TF1 * m_customDistribution
Custom angular distribution, that uses m_angularDistribution as formula.
double m_slitZ
slit distance from source
double m_cosMinAlpha
cos of m_minAlpha
StoreArray< TOPSimCalPulse > m_simCalPulses
simulated cal pulse collection
double m_slitDX
slit size in x
double m_wavelength
source wavelenght [nm]
double m_cosMaxAlpha
cos of m_maxAlpha
ROOT::Math::XYZVector getDirectionUniformRingAngle() const
Return photon direction according to a uniform distribution within m_minAlpha and m_maxAlpha.
double m_slitDY
slit size in y
double m_slitX0
slit x-offset in respect to source
double m_na
source numerical aperture.
double m_slitY0
slit y-offset in respect to source
double m_phi
first rotation angle (around z) [deg]
double m_x
source position in x
double m_theta
second rotation angle (around x) [deg]
double m_startTime
start time
double m_maxAlpha
maximum emission angle
double m_energy
photon energy (from wavelength)
double m_diameter
source diameter
double m_psi
third rotation angle (around z) [deg]
double m_z
source position in z
double m_y
source position in y
double m_pulseWidth
pulse duration (Gaussian sigma)
double m_numPhotons
average number of photons in a pulse
StoreArray< MCParticle > m_MCParticles
MC particles collection.
ROOT::Math::Transform3D m_transform
transformation to BelleII frame
ROOT::Math::XYZVector getDirectionGaussian() const
Return photon direction according to a projected 2D gaussian distribution based on numerical aperture...
virtual ~OpticalGunModule()
Destructor.
ROOT::Math::XYZVector getDirectionUniform() const
Return photon direction according to a projected uniform distribution with opening angle alpha.
ROOT::Math::XYZVector getDirectionCustom() const
Return photon direction according to a custom angular distribution given by TFormula.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
bool isInsideSlit(const ROOT::Math::XYZPoint &point, const ROOT::Math::XYZVector &direction) const
Checks if photon passes the slit.
ROOT::Math::XYZVector getDirectionLambertian() const
Return photon direction according to a lambertian distribution with opening angle alpha.
Abstract base class for different kinds of events.