Belle II Software development
|
Digitize EKLMSim2Hits to get EKLM StripHits. More...
#include <ScintillatorSimulator.h>
Classes | |
struct | Photoelectron |
Photoelectron data. More... | |
Public Member Functions | |
ScintillatorSimulator (const KLMScintillatorDigitizationParameters *digPar, ScintillatorFirmware *fitter, double digitizationInitialTime, bool debug) | |
Constructor. | |
ScintillatorSimulator (const ScintillatorSimulator &)=delete | |
Copy constructor (disabled). | |
ScintillatorSimulator & | operator= (const ScintillatorSimulator &)=delete |
Operator = (disabled). | |
~ScintillatorSimulator () | |
Destructor. | |
void | simulate (const std::multimap< KLMChannelNumber, const KLMSimHit * >::iterator &firstHit, const std::multimap< KLMChannelNumber, const KLMSimHit * >::iterator &end) |
Simulate a strip. | |
KLMScintillatorFirmwareFitResult * | getFPGAFit () |
Get fit data. | |
enum ScintillatorFirmwareFitStatus | getFitStatus () const |
Get fit status. | |
double | getNPhotoelectrons () |
Get number of photoelectrons (fit result). | |
int | getNGeneratedPhotoelectrons () |
Get generated number of photoelectrons. | |
double | getEnergy () |
Get total energy deposited in the strip (sum over ssimulation hits). | |
void | setFEEData (const KLMScintillatorFEEData *FEEData) |
Set FEE data. | |
void | generatePhotoelectrons (double stripLen, double distSiPM, int nPhotons, double timeShift, bool isReflected) |
Generate photoelectrons. | |
void | fillSiPMOutput (float *hist, bool useDirect, bool useReflected) |
Fill SiPM output. | |
float | getMCTime () const |
Get MC time. | |
float | getSiPMMCTime () const |
Get SiPM MC time. | |
Private Member Functions | |
void | reallocPhotoElectronBuffers (int size) |
Reallocate photoelectron buffers. | |
void | prepareSimulation () |
Prepare simulation. | |
void | performSimulation () |
Perform common simulation stage. | |
int * | sortPhotoelectrons (int nPhotoelectrons) |
Sort photoelectrons. | |
void | addRandomSiPMNoise () |
Add random noise to the signal (amplitude-dependend). | |
void | simulateADC () |
Simulate ADC (create digital signal from analog),. | |
void | debugOutput () |
Debug output (signal and fit result histograms). | |
Private Attributes | |
const KLMTime * | m_Time |
Time. | |
const KLMScintillatorDigitizationParameters * | m_DigPar |
Parameters. | |
ScintillatorFirmware * | m_fitter |
Fitter. | |
double | m_DigitizationInitialTime |
Initial digitization time. | |
bool | m_Debug |
Debug mode (generates additional output files with histograms). | |
double | m_histRange |
Time range, (number of digitizations) * (ADC sampling time). | |
float * | m_amplitudeDirect |
Analog amplitude (direct). | |
float * | m_amplitudeReflected |
Analog amplitude (reflected). | |
float * | m_amplitude |
Analog amplitude. | |
int * | m_ADCAmplitude |
Digital amplitude. | |
double * | m_SignalTimeDependence |
Buffer for signal time dependence calculation. | |
double * | m_SignalTimeDependenceDiff |
Buffer for signal time dependence calculation. | |
struct Photoelectron * | m_Photoelectrons |
Buffer for photoelectron data. | |
int * | m_PhotoelectronIndex |
Buffer for photoelectron indices. | |
int * | m_PhotoelectronIndex2 |
Buffer for photoelectron indices. | |
int | m_PhotoelectronBufferSize |
Size of photoelectron data buffer. | |
enum ScintillatorFirmwareFitStatus | m_FPGAStat |
FPGA fit status. | |
KLMScintillatorFirmwareFitResult | m_FPGAFit |
FPGA fit data. | |
int | m_npe |
Number of photoelectrons (generated). | |
double | m_Energy |
Total energy deposited in the strip. | |
std::string | m_stripName |
Name of the strip. | |
double | m_Pedestal |
Pedestal. | |
double | m_PhotoelectronAmplitude |
Photoelectron amplitude. | |
int | m_Threshold |
Threshold. | |
float | m_MCTime |
MC time. | |
float | m_SiPMMCTime |
MC time at SiPM. | |
Digitize EKLMSim2Hits to get EKLM StripHits.
Definition at line 30 of file ScintillatorSimulator.h.
ScintillatorSimulator | ( | const KLMScintillatorDigitizationParameters * | digPar, |
ScintillatorFirmware * | fitter, | ||
double | digitizationInitialTime, | ||
bool | debug | ||
) |
Constructor.
[in] | digPar | Digitization parameters. |
[in] | digitizationInitialTime | Initial digitization time. |
[in] | fitter | Fitter. |
[in] | debug | Use debug mode. |
Definition at line 62 of file ScintillatorSimulator.cc.
Destructor.
Definition at line 127 of file ScintillatorSimulator.cc.
|
private |
Add random noise to the signal (amplitude-dependend).
Definition at line 252 of file ScintillatorSimulator.cc.
|
private |
Debug output (signal and fit result histograms).
Definition at line 513 of file ScintillatorSimulator.cc.
void fillSiPMOutput | ( | float * | hist, |
bool | useDirect, | ||
bool | useReflected | ||
) |
Fill SiPM output.
[in,out] | hist | Output histogram (signal is added to it). |
[in] | useDirect | Use direct photons. |
[in] | useReflected | Use reflected photons. |
Definition at line 418 of file ScintillatorSimulator.cc.
void generatePhotoelectrons | ( | double | stripLen, |
double | distSiPM, | ||
int | nPhotons, | ||
double | timeShift, | ||
bool | isReflected | ||
) |
Generate photoelectrons.
[in] | stripLen | Strip length. |
[in] | distSiPM | Distance from hit to SiPM. |
[in] | nPhotons | Number of photons to be simulated. |
[in] | timeShift | Time of hit. |
[in] | isReflected | Whether the hits are reflected or not. |
Definition at line 308 of file ScintillatorSimulator.cc.
double getEnergy | ( | ) |
Get total energy deposited in the strip (sum over ssimulation hits).
Definition at line 508 of file ScintillatorSimulator.cc.
enum KLM::ScintillatorFirmwareFitStatus getFitStatus | ( | ) | const |
KLMScintillatorFirmwareFitResult * getFPGAFit | ( | ) |
Get fit data.
Definition at line 485 of file ScintillatorSimulator.cc.
|
inline |
int getNGeneratedPhotoelectrons | ( | ) |
Get generated number of photoelectrons.
Definition at line 503 of file ScintillatorSimulator.cc.
double getNPhotoelectrons | ( | ) |
Get number of photoelectrons (fit result).
Definition at line 495 of file ScintillatorSimulator.cc.
|
inline |
|
private |
Perform common simulation stage.
Definition at line 230 of file ScintillatorSimulator.cc.
|
private |
Prepare simulation.
Definition at line 148 of file ScintillatorSimulator.cc.
|
private |
Reallocate photoelectron buffers.
[in] | size | New size of buffers. |
Definition at line 41 of file ScintillatorSimulator.cc.
void setFEEData | ( | const KLMScintillatorFEEData * | FEEData | ) |
Set FEE data.
Definition at line 140 of file ScintillatorSimulator.cc.
void simulate | ( | const std::multimap< KLMChannelNumber, const KLMSimHit * >::iterator & | firstHit, |
const std::multimap< KLMChannelNumber, const KLMSimHit * >::iterator & | end | ||
) |
Simulate a strip.
[in] | firstHit | First hit in this strip. |
[in] | end | End of hit range. |
Definition at line 163 of file ScintillatorSimulator.cc.
|
private |
Simulate ADC (create digital signal from analog),.
Definition at line 470 of file ScintillatorSimulator.cc.
|
private |
Sort photoelectrons.
[in] | nPhotoelectrons | Number of photoelectrons. |
Definition at line 260 of file ScintillatorSimulator.cc.
|
private |
Digital amplitude.
Definition at line 214 of file ScintillatorSimulator.h.
|
private |
Analog amplitude.
Definition at line 211 of file ScintillatorSimulator.h.
|
private |
Analog amplitude (direct).
Definition at line 205 of file ScintillatorSimulator.h.
|
private |
Analog amplitude (reflected).
Definition at line 208 of file ScintillatorSimulator.h.
|
private |
Debug mode (generates additional output files with histograms).
Definition at line 199 of file ScintillatorSimulator.h.
|
private |
Initial digitization time.
Definition at line 196 of file ScintillatorSimulator.h.
|
private |
Parameters.
Definition at line 190 of file ScintillatorSimulator.h.
|
private |
Total energy deposited in the strip.
Definition at line 244 of file ScintillatorSimulator.h.
|
private |
Fitter.
Definition at line 193 of file ScintillatorSimulator.h.
|
private |
FPGA fit data.
Definition at line 238 of file ScintillatorSimulator.h.
|
private |
FPGA fit status.
Definition at line 235 of file ScintillatorSimulator.h.
|
private |
Time range, (number of digitizations) * (ADC sampling time).
Definition at line 202 of file ScintillatorSimulator.h.
|
private |
MC time.
Definition at line 259 of file ScintillatorSimulator.h.
|
private |
Number of photoelectrons (generated).
Definition at line 241 of file ScintillatorSimulator.h.
|
private |
Pedestal.
Definition at line 250 of file ScintillatorSimulator.h.
|
private |
Photoelectron amplitude.
Definition at line 253 of file ScintillatorSimulator.h.
|
private |
Size of photoelectron data buffer.
Definition at line 232 of file ScintillatorSimulator.h.
|
private |
Buffer for photoelectron indices.
Definition at line 226 of file ScintillatorSimulator.h.
|
private |
Buffer for photoelectron indices.
Definition at line 229 of file ScintillatorSimulator.h.
|
private |
Buffer for photoelectron data.
Definition at line 223 of file ScintillatorSimulator.h.
|
private |
Buffer for signal time dependence calculation.
Definition at line 217 of file ScintillatorSimulator.h.
|
private |
Buffer for signal time dependence calculation.
Definition at line 220 of file ScintillatorSimulator.h.
|
private |
MC time at SiPM.
Definition at line 262 of file ScintillatorSimulator.h.
|
private |
Name of the strip.
Definition at line 247 of file ScintillatorSimulator.h.
|
private |
Threshold.
Definition at line 256 of file ScintillatorSimulator.h.
|
private |
Time.
Definition at line 187 of file ScintillatorSimulator.h.