FairRoot/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 
12 #include "TClonesArray.h"
13 
14 
16 
17 
18 
20 {
21 public:
24 
25  // Initialization:
26 
28  void SetNumberOfSensors(int n_detectors_, int n_readout_modules_, int n_sensors_);
30  void SetSensorGrid(double sensor_width_, double sensor_height_, int n_pixel_x_, int n_pixel_y_);
32  void SetSensorTiling(int sensor_tiles_x, int sensor_tiles_y);
33  void SetPerCellDCR(double dcr_Hz) { dcr_per_pixel = dcr_Hz*1E-9; }
34 
35  // Noise generation and access to noise digits:
36  int GenerateNoise(double t_start_ns, double t_end_ns);
38  void Clear();
39 
40 private:
41  bool GetPixelPosition(int n_pixel, double & pos_x, double & pos_y);
42 
43 protected:
44  TClonesArray * noise_digits;
46 
49  int n_sensors;
52 
55  int n_pixel_x;
56  int n_pixel_y;
58 
59  double pitch_x;
60  double pitch_y;
61 
62  double dcr_per_pixel; // pixel means a single SPAD here - unit: dark counts / ns
63 };
64 
65 #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)
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.
bool GetPixelPosition(int n_pixel, double &pos_x, double &pos_y)
int n_sensor_tiles_y
number of sensor tiles = number of dies
int n_sensors
number of sensors (untiled) at a readout module
PndDiscDigitizedHit * GetNextNoiseDigit()
Iterate over all generated hits.
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)