11#include <framework/core/FrameworkExceptions.h>
13#include <mdst/dataobjects/MCParticleGraph.h>
15#include <TGeoMatrix.h>
74 void open(
const std::string& filename);
Class to build, validate and sort a particle decay chain.
Class to read files that have been created by SAD and store their content in a MCParticle graph.
double m_pyRes
The resolution for the y momentum component of the SAD real particle.
double m_lostPx
x momentum at lost position [m].
double getSADParticle(MCParticleGraph &graph)
Reads one SAD particle from the file and creates one event per SAD particle.
double m_inputSAD_x
x at lost position [m].
double m_lostS
lost position [m] along ring.
TTree * m_tree
The input root tree.
double m_inputSAD_ssraw
scattered position [m]
void addAllSADParticles(MCParticleGraph &graph)
Reads all SAD particles from the file into the MCParticles collection which are inside the specified ...
AcceleratorRings m_accRing
The accelerator ring from which the particles originate.
double m_inputSAD_r
sqrt(x*x+y*y) [m]
BELLE2_DEFINE_EXCEPTION(SADCouldNotOpenFileError, "Could not open file %1% !")
Exception is thrown if the SAD file could not be opened.
double m_lostX
x at lost position [m].
int calculateRealParticleNumber(double rate)
Calculates the number of real particles for a SAD particle.
TGeoHMatrix * m_transMatrix
Transformation matrix from local SAD to global geant4 space.
unsigned int m_realPartEntry
The current number of the created real particles.
void convertParamsToSADUnits()
Convert the parameters from the SAD units to the basf2 units.
void open(const std::string &filename)
Opens a root file and prepares it for reading.
double m_inputSAD_rr
sqrt(x*x+y*y) [m] before matching onto beam pipe inner surface
void initialize(TGeoHMatrix *transMatrix, double sRange, AcceleratorRings accRing, double readoutTime)
Initializes the reader, sets the particle parameters and calculates important values.
double m_SADToRealFactor
The factor to calculate the number of real particles from a SAD particle.
ReaderSAD()
Constructor of the ReaderSAD class.
double m_inputSAD_watt
loss wattage [W]
int m_readEntry
The current number of the SAD entry that is read.
TFile * m_file
The input root file.
void addParticleToMCParticles(MCParticleGraph &graph, bool gaussSmearing=false)
Adds the current particle described by the member variables to the MCParticles collection.
TGeoHMatrix SADtoGeant(ReaderSAD::AcceleratorRings accRing, double s)
Transformation matrix.
double m_lostPy
y momentum at lost position [m].
double m_inputSAD_E
energy at lost position [m].
double m_inputSAD_yraw
y at lost position [m] before matching onto beam pipe inner surface
double m_inputSAD_dp_over_p0
dp_over_p0
double m_inputSAD_xraw
x at lost position [m] before matching onto beam pipe inner surface
double m_inputSAD_y
y at lost position [m].
double m_inputSAD_sraw
lost position [m
int m_inputSAD_nturn
number of turns from scattered to lost
void setMomentumRes(double pxRes, double pyRes)
Sets the resolution of the momentum for the real particles.
double m_inputSAD_Lss
length of element in which scattered [m]
double m_lostY
y at lost position [m].
unsigned int m_realPartNum
The current number of the created real particles.
AcceleratorRings
The both accelerator rings.
@ c_HER
High Energy Ring (electrons)
@ c_LER
Low Energy Ring (positrons)
bool getRealParticle(MCParticleGraph &graph)
Reads one SAD particle from the file, calculates the number of real particles which are represented b...
double m_pxRes
The resolution for the x momentum component of the SAD real particle.
double m_readoutTime
The readout time.
double m_inputSAD_rate
loss rate [Hz]
double m_inputSAD_px
x momentum at lost position [m].
double m_inputSAD_py
y momentum at lost position [m].
double m_lostRate
loss rate [Hz]>
double m_inputSAD_s
lost position (|s|<Ltot/2) [m]
double m_inputSAD_ss
scattered position (|s|<Ltot/2) [m]
BELLE2_DEFINE_EXCEPTION(SADEndOfFile, "End of the SAD file.")
Exception is thrown if the end of the SAD file has been reached.
double m_sRange
The +- range for the s value for which particles are loaded.
double m_lostE
energy at lost position [m].
Abstract base class for different kinds of events.
double z0
Initial position in Z
double sphi
Bending Angle.
double dphi
Bending Angle for torus in phi.
double x0
Initial position in X
Calculates the transformation matrix from local SAD to global geant4 space.
double z0
Initial position in Z.
double x0
Initial position in X.