Belle II Software development
|
Class to read files that have been created by SAD and store their content in a MCParticle graph. More...
#include <ReaderSAD.h>
Classes | |
struct | bendingElement |
Sensitive Element More... | |
struct | straightElement |
Calculates the transformation matrix from local SAD to global geant4 space. More... | |
Public Types | |
enum | AcceleratorRings { c_HER = 0 , c_LER = 1 } |
The both accelerator rings. More... | |
Public Member Functions | |
BELLE2_DEFINE_EXCEPTION (SADCouldNotOpenFileError, "Could not open file %1% !") | |
Exception is thrown if the SAD file could not be opened. | |
BELLE2_DEFINE_EXCEPTION (SADEndOfFile, "End of the SAD file.") | |
Exception is thrown if the end of the SAD file has been reached. | |
ReaderSAD () | |
Constructor of the ReaderSAD class. | |
~ReaderSAD () | |
Destructor. | |
void | initialize (TGeoHMatrix *transMatrix, double sRange, AcceleratorRings accRing, double readoutTime) |
Initializes the reader, sets the particle parameters and calculates important values. | |
void | open (const std::string &filename) |
Opens a root file and prepares it for reading. | |
void | setMomentumRes (double pxRes, double pyRes) |
Sets the resolution of the momentum for the real particles. | |
double | getSADParticle (MCParticleGraph &graph) |
Reads one SAD particle from the file and creates one event per SAD particle. | |
bool | getRealParticle (MCParticleGraph &graph) |
Reads one SAD particle from the file, calculates the number of real particles which are represented by the SAD particle and creates one event per real particle. | |
void | addAllSADParticles (MCParticleGraph &graph) |
Reads all SAD particles from the file into the MCParticles collection which are inside the specified s range. | |
TGeoHMatrix | SADtoGeant (ReaderSAD::AcceleratorRings accRing, double s) |
Transformation matrix. | |
Protected Attributes | |
TFile * | m_file |
The input root file. | |
TTree * | m_tree |
The input root tree. | |
TGeoHMatrix * | m_transMatrix |
Transformation matrix from local SAD to global geant4 space. | |
double | m_sRange |
The +- range for the s value for which particles are loaded. | |
AcceleratorRings | m_accRing |
The accelerator ring from which the particles originate. | |
double | m_pxRes |
The resolution for the x momentum component of the SAD real particle. | |
double | m_pyRes |
The resolution for the y momentum component of the SAD real particle. | |
double | m_SADToRealFactor |
The factor to calculate the number of real particles from a SAD particle. | |
double | m_readoutTime |
The readout time. | |
unsigned int | m_realPartNum |
The current number of the created real particles. | |
unsigned int | m_realPartEntry |
The current number of the created real particles. | |
int | m_readEntry |
The current number of the SAD entry that is read. | |
double | m_lostX |
x at lost position [m]. | |
double | m_lostY |
y at lost position [m]. | |
double | m_lostS |
lost position [m] along ring. | |
double | m_lostPx |
x momentum at lost position [m]. | |
double | m_lostPy |
y momentum at lost position [m]. | |
double | m_lostRate |
loss rate [Hz]> | |
double | m_lostE |
energy at lost position [m]. | |
double | m_inputSAD_ssraw |
scattered position [m] | |
double | m_inputSAD_sraw |
lost position [m | |
double | m_inputSAD_ss |
scattered position (|s|<Ltot/2) [m] | |
double | m_inputSAD_s |
lost position (|s|<Ltot/2) [m] | |
double | m_inputSAD_Lss |
length of element in which scattered [m] | |
int | m_inputSAD_nturn |
number of turns from scattered to lost | |
double | m_inputSAD_x |
x at lost position [m]. | |
double | m_inputSAD_y |
y at lost position [m]. | |
double | m_inputSAD_px |
x momentum at lost position [m]. | |
double | m_inputSAD_py |
y momentum at lost position [m]. | |
double | m_inputSAD_xraw |
x at lost position [m] before matching onto beam pipe inner surface | |
double | m_inputSAD_yraw |
y at lost position [m] before matching onto beam pipe inner surface | |
double | m_inputSAD_r |
sqrt(x*x+y*y) [m] | |
double | m_inputSAD_rr |
sqrt(x*x+y*y) [m] before matching onto beam pipe inner surface | |
double | m_inputSAD_dp_over_p0 |
dp_over_p0 | |
double | m_inputSAD_E |
energy at lost position [m]. | |
double | m_inputSAD_rate |
loss rate [Hz] | |
double | m_inputSAD_watt |
loss wattage [W] | |
Private Member Functions | |
void | convertParamsToSADUnits () |
Convert the parameters from the SAD units to the basf2 units. | |
void | addParticleToMCParticles (MCParticleGraph &graph, bool gaussSmearing=false) |
Adds the current particle described by the member variables to the MCParticles collection. | |
int | calculateRealParticleNumber (double rate) |
Calculates the number of real particles for a SAD particle. | |
Class to read files that have been created by SAD and store their content in a MCParticle graph.
The input data is stored in a root file and contains the particles together with their lost rate. The reader reads one particle from the file, calculates the number of 'real' particles and creates a new event for each of them.
Definition at line 35 of file ReaderSAD.h.
enum AcceleratorRings |
The both accelerator rings.
Enumerator | |
---|---|
c_HER | High Energy Ring (electrons) |
c_LER | Low Energy Ring (positrons) |
Definition at line 46 of file ReaderSAD.h.
ReaderSAD | ( | ) |
Constructor of the ReaderSAD class.
Definition at line 28 of file ReaderSAD.cc.
~ReaderSAD | ( | ) |
Destructor.
Definition at line 64 of file ReaderSAD.cc.
void addAllSADParticles | ( | MCParticleGraph & | graph | ) |
Reads all SAD particles from the file into the MCParticles collection which are inside the specified s range.
graph | Reference to the graph which should be filled with the information from the SAD file. |
Definition at line 212 of file ReaderSAD.cc.
|
private |
Adds the current particle described by the member variables to the MCParticles collection.
graph | Reference to the graph which should be filled with the information from the SAD file. |
gaussSmearing | If set to true the particle momentum is smeared using a Gaussian. |
Definition at line 266 of file ReaderSAD.cc.
|
private |
Calculates the number of real particles for a SAD particle.
rate | The loss rate of the SAD particle. |
Definition at line 403 of file ReaderSAD.cc.
|
private |
Convert the parameters from the SAD units to the basf2 units.
Definition at line 236 of file ReaderSAD.cc.
bool getRealParticle | ( | MCParticleGraph & | graph | ) |
Reads one SAD particle from the file, calculates the number of real particles which are represented by the SAD particle and creates one event per real particle.
graph | Reference to the graph which should be filled with the information from the SAD file. |
Definition at line 165 of file ReaderSAD.cc.
double getSADParticle | ( | MCParticleGraph & | graph | ) |
Reads one SAD particle from the file and creates one event per SAD particle.
The loss rate of the SAD particle is stored in the weight attribute of the event meta info.
graph | Reference to the graph which should be filled with the information from the SAD file. |
Definition at line 122 of file ReaderSAD.cc.
void initialize | ( | TGeoHMatrix * | transMatrix, |
double | sRange, | ||
ReaderSAD::AcceleratorRings | accRing, | ||
double | readoutTime | ||
) |
Initializes the reader, sets the particle parameters and calculates important values.
transMatrix | Pointer to the matrix which transforms the particles from the local SAD to the global geant4 coordinate system. |
sRange | The +- range for the s value for which particles are loaded. |
accRing | The accelerator ring from which the particles originate. |
readoutTime | The readout time of the detector in [ns]. |
Definition at line 71 of file ReaderSAD.cc.
void open | ( | const std::string & | filename | ) |
Opens a root file and prepares it for reading.
filename | The filename of the SAD root file which should be read. |
Definition at line 80 of file ReaderSAD.cc.
TGeoHMatrix SADtoGeant | ( | ReaderSAD::AcceleratorRings | accRing, |
double | s | ||
) |
Transformation matrix.
accRing | The accelerator ring from which the particles originate. |
s | s value. |
Definition at line 416 of file ReaderSAD.cc.
|
inline |
Sets the resolution of the momentum for the real particles.
Allows each real particle to be smeared according to the specified momentum resolution.
pxRes | The resolution for the x momentum component. |
pyRes | The resolution for the y momentum component. |
Definition at line 82 of file ReaderSAD.h.
|
protected |
The accelerator ring from which the particles originate.
Definition at line 125 of file ReaderSAD.h.
|
protected |
The input root file.
Definition at line 120 of file ReaderSAD.h.
|
protected |
dp_over_p0
Definition at line 158 of file ReaderSAD.h.
|
protected |
energy at lost position [m].
Definition at line 159 of file ReaderSAD.h.
|
protected |
length of element in which scattered [m]
Definition at line 148 of file ReaderSAD.h.
|
protected |
number of turns from scattered to lost
Definition at line 149 of file ReaderSAD.h.
|
protected |
x momentum at lost position [m].
Definition at line 152 of file ReaderSAD.h.
|
protected |
y momentum at lost position [m].
Definition at line 153 of file ReaderSAD.h.
|
protected |
sqrt(x*x+y*y) [m]
Definition at line 156 of file ReaderSAD.h.
|
protected |
loss rate [Hz]
Definition at line 160 of file ReaderSAD.h.
|
protected |
sqrt(x*x+y*y) [m] before matching onto beam pipe inner surface
Definition at line 157 of file ReaderSAD.h.
|
protected |
lost position (|s|<Ltot/2) [m]
Definition at line 147 of file ReaderSAD.h.
|
protected |
lost position [m
Definition at line 145 of file ReaderSAD.h.
|
protected |
scattered position (|s|<Ltot/2) [m]
Definition at line 146 of file ReaderSAD.h.
|
protected |
scattered position [m]
Definition at line 144 of file ReaderSAD.h.
|
protected |
loss wattage [W]
Definition at line 161 of file ReaderSAD.h.
|
protected |
x at lost position [m].
Definition at line 150 of file ReaderSAD.h.
|
protected |
x at lost position [m] before matching onto beam pipe inner surface
Definition at line 154 of file ReaderSAD.h.
|
protected |
y at lost position [m].
Definition at line 151 of file ReaderSAD.h.
|
protected |
y at lost position [m] before matching onto beam pipe inner surface
Definition at line 155 of file ReaderSAD.h.
|
protected |
energy at lost position [m].
Definition at line 142 of file ReaderSAD.h.
|
protected |
x momentum at lost position [m].
Definition at line 139 of file ReaderSAD.h.
|
protected |
y momentum at lost position [m].
Definition at line 140 of file ReaderSAD.h.
|
protected |
loss rate [Hz]>
Definition at line 141 of file ReaderSAD.h.
|
protected |
lost position [m] along ring.
0 is the IP. Range goes from -L/2 to L/2, where L is the ring circumference.
Definition at line 138 of file ReaderSAD.h.
|
protected |
x at lost position [m].
Definition at line 136 of file ReaderSAD.h.
|
protected |
y at lost position [m].
Definition at line 137 of file ReaderSAD.h.
|
protected |
The resolution for the x momentum component of the SAD real particle.
Definition at line 126 of file ReaderSAD.h.
|
protected |
The resolution for the y momentum component of the SAD real particle.
Definition at line 127 of file ReaderSAD.h.
|
protected |
The current number of the SAD entry that is read.
Definition at line 134 of file ReaderSAD.h.
|
protected |
The readout time.
Definition at line 130 of file ReaderSAD.h.
|
protected |
The current number of the created real particles.
Definition at line 133 of file ReaderSAD.h.
|
protected |
The current number of the created real particles.
Definition at line 132 of file ReaderSAD.h.
|
protected |
The factor to calculate the number of real particles from a SAD particle.
Definition at line 129 of file ReaderSAD.h.
|
protected |
The +- range for the s value for which particles are loaded.
Definition at line 124 of file ReaderSAD.h.
|
protected |
Transformation matrix from local SAD to global geant4 space.
Definition at line 123 of file ReaderSAD.h.
|
protected |
The input root tree.
Definition at line 121 of file ReaderSAD.h.