11#include <framework/core/Module.h>
16#include <Math/RotationY.h>
17#include <generators/SAD/ReaderSAD.h>
57 virtual void event()
override;
63 virtual void endRun()
override;
Beam background generator based on SAD files.
SADTree m_sad
TTree entry data.
TTree * m_tree
root tree pointer
std::vector< int > m_counters
counters: how many times SAD particles are used
virtual void initialize() override
Initialize the Module.
virtual ~BeamBkgGeneratorModule()
Destructor.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
ReaderSAD m_readerSAD
the transformation from SAD to Belle II system for the far beamline
std::vector< double > m_rates
cumulative rates of SAD particles [Hz]
virtual void terminate() override
Termination action.
BeamBkgGeneratorModule()
Constructor.
ROOT::Math::RotationY m_rotation
rotation from SAD to Belle II frame
std::string m_fileName
name of the SAD file converted to root
int generateEntry() const
Pick up particle randomly from the SAD file according to its rate.
int m_ring
ring number, 1-HER, 2-LER
int m_numEvents
number of events to generate
double m_realTime
equivalent SuperKEKB running time in [ns]
virtual void beginRun() override
Called when entering a new run.
std::vector< int > m_sectionOrdering
superKEKB section ordering
TFile * m_file
root file pointer
int m_eventCounter
event counter
std::string m_ringName
name of the superKEKB ring (LER or HER)
std::string m_treeName
name of the TTree in the SAD file
Class to read files that have been created by SAD and store their content in a MCParticle graph.
Abstract base class for different kinds of events.
Structure of the TTree in the SAD file.
int nturn
number of turns from scattered to lost
double sraw
s at lost position [m] before matching G4 beam pipe inner surface
double ss
scattered position (|s|<Ltot/2) [m]
double rate
lost rate [Hz]
double ssraw
scattered position [m]
double yraw
y at lost position [m] before matching G4 beam pipe inner surface
double rr
sqrt(xraw*xraw+yraw*yraw) [m]
double r
sqrt(x*x+y*y) [m]
double px
px at lost position [GeV]
double dp_over_p0
momentum deviation of the lost particle
double y
y at lost position [m]
double xraw
x at lost position [m] before matching G4 beam pipe inner surface
double py
py at lost position [GeV]
double s
lost position measured from IP along the ring [m]
double watt
loss wattage [W]
double x
x at lost position [m]