PandaRoot
PndDiscNoiseGeneration.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //------------------------------------------------------------------------
14 // Author: Oliver Merle (Oliver.Merle@exp2.physik.uni-giessen.de)
15 // Changes: Mustafa Schmidt (Mustafa.A.Schmidt@physik.uni-giessen.de)
16 // Date: 30.11.2015
17 // Description: Class to emulate noise for the readout electronics
18 //------------------------------------------------------------------------
19 
20 #ifndef PNDDISCNOISEGENERATION_H
21 #define PNDDISCNOISEGENERATION_H
22 
23 #include "TClonesArray.h"
24 
26 
28  public:
31 
32  // Initialization:
33 
35  void SetNumberOfSensors(int n_detectors_, int n_readout_modules_, int n_sensors_);
37  void SetSensorGrid(double sensor_width_, double sensor_height_, int n_pixel_x_, int n_pixel_y_);
39  void SetSensorTiling(int sensor_tiles_x, int sensor_tiles_y);
40  void SetPerCellDCR(double dcr_Hz) { dcr_per_pixel = dcr_Hz * 1E-9; }
41 
42  // Noise generation and access to noise digits:
43  int GenerateNoise(double t_start_ns, double t_end_ns);
45  void Clear();
46 
47  private:
48  bool GetPixelPosition(int n_pixel, double &pos_x, double &pos_y);
49 
50  protected:
51  TClonesArray *noise_digits;
53 
56  int n_sensors;
59 
62  int n_pixel_x;
63  int n_pixel_y;
65 
66  double pitch_x;
67  double pitch_y;
68 
69  double dcr_per_pixel; // pixel means a single SPAD here - unit: dark counts / ns
70 };
71 
72 #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)