PandaRoot
PndDiscNoiseGeneration.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------
2 // Author: Oliver Merle (Oliver.Merle@exp2.physik.uni-giessen.de)
3 // Changes: Mustafa Schmidt (Mustafa.A.Schmidt@physik.uni-giessen.de)
4 // Date: 30.11.2015
5 // Description: Class to emulate noise for the readout electronics
6 //------------------------------------------------------------------------
7 
8 #ifndef PNDDISCNOISEGENERATION_H
9 #define PNDDISCNOISEGENERATION_H
10 
11 #include "TClonesArray.h"
12 
14 
16  public:
19 
20  // Initialization:
21 
23  void SetNumberOfSensors(int n_detectors_, int n_readout_modules_, int n_sensors_);
25  void SetSensorGrid(double sensor_width_, double sensor_height_, int n_pixel_x_, int n_pixel_y_);
27  void SetSensorTiling(int sensor_tiles_x, int sensor_tiles_y);
28  void SetPerCellDCR(double dcr_Hz) { dcr_per_pixel = dcr_Hz * 1E-9; }
29 
30  // Noise generation and access to noise digits:
31  int GenerateNoise(double t_start_ns, double t_end_ns);
33  void Clear();
34 
35  private:
36  bool GetPixelPosition(int n_pixel, double &pos_x, double &pos_y);
37 
38  protected:
39  TClonesArray *noise_digits;
41 
44  int n_sensors;
47 
50  int n_pixel_x;
51  int n_pixel_y;
53 
54  double pitch_x;
55  double pitch_y;
56 
57  double dcr_per_pixel; // pixel means a single SPAD here - unit: dark counts / ns
58 };
59 
60 #endif // PNDDISCNOISEGENERATION_HH_
void SetSensorTiling(int sensor_tiles_x, int sensor_tiles_y)
Set a logical tiling (used for dead time handling)
void SetPerCellDCR(double dcr_Hz)
PndDiscDigitizedHit * GetNextNoiseDigit()
Iterate over all generated hits.
int n_sensor_tiles_x
number of sensor tiles = number of dies
int n_readout_modules
number of readout modules on a detector
void SetSensorGrid(double sensor_width_, double sensor_height_, int n_pixel_x_, int n_pixel_y_)
Set the pixel grid on the sensors.
void SetNumberOfSensors(int n_detectors_, int n_readout_modules_, int n_sensors_)
Set the number of sensors for the whole apparatus.
TClonesArray * noise_digits
Memory pool to store the digits.
int n_sensor_tiles_y
number of sensor tiles = number of dies
int n_sensors
number of sensors (untiled) at a readout module
int n_detectors
number of detectors
void Clear()
Clears the digit buffer.
int GenerateNoise(double t_start_ns, double t_end_ns)
Generate noise pattern in time window given by t_start, t_end.
int current_index
current index in pool (used in iteration)