Belle II Software development
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
23namespace Belle2 {
42 class OpticalGunModule : public Module {
43
44 public:
45
50
54 virtual ~OpticalGunModule();
55
60 virtual void initialize() override;
61
65 virtual void event() override;
66
67 private:
68
69 // steering parameters
70 double m_x = 0;
71 double m_y = 0;
72 double m_z = 0;
73 double m_diameter = 0;
74 double m_maxAlpha = 0;
75 double m_minAlpha = 0;
76 double m_na = 0;
77 double m_wavelength = 0;
78 double m_phi = 0;
79 double m_theta = 0;
80 double m_psi = 0;
81 double m_startTime = 0;
82 double m_pulseWidth = 0;
83 double m_numPhotons = 0;
84 int m_slotID = 0;
85 double m_slitDX = 0;
86 double m_slitDY = 0;
87 double m_slitX0 = 0;
88 double m_slitY0 = 0;
89 double m_slitZ = 0;
92 // others
93 double m_cosMinAlpha = 0;
94 double m_cosMaxAlpha = 0;
95 double m_energy = 0;
96 ROOT::Math::Transform3D m_transform;
99 // data store objects
109 bool isInsideSlit(const ROOT::Math::XYZPoint& point, const ROOT::Math::XYZVector& direction) const;
110
115 ROOT::Math::XYZVector getDirectionGaussian() const;
116
121 ROOT::Math::XYZVector getDirectionUniform() const;
122
127 ROOT::Math::XYZVector getDirectionLambertian() const;
128
133 ROOT::Math::XYZVector getDirectionUniformRingAngle() const;
134
139 ROOT::Math::XYZVector getDirectionCustom() const;
140
141 };
142
144} // Belle2 namespace
145
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
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
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.