PandaRoot
PndDiscSensorGridPhotodetector.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 handle tiled sensors
18 //-------------------------------------------------------------------------
19 
20 #ifndef SensorGridPhotodetector_HH
21 #define SensorGridPhotodetector_HH
22 
23 #include <vector>
24 
25 namespace SensorGrid {
26 
27 class SensorGridBase;
28 struct PixelInfo;
29 
31  private:
32  struct PixelTraits;
33 
34  public:
35  SensorGridPhotodetector(SensorGridBase *sensor_grid_, bool per_pixel_traits_, double const &pde_init, double const &noise_rate_init, double const &time_res_init);
36 
37  protected:
38  SensorGridPhotodetector(){}; // for use in derived classes
40  void Init(SensorGridBase *sensor_grid_, bool per_pixel_traits_, double const &efficiency_init, double const &noise_rate_init, double const &time_res_init);
41 
42  public:
43  // Per pixel data initialization:
44  void SetPixel(int pixel_id, double efficiency, double noise_rate, double time_res_ns);
45  void UseInhomogenityFactor(bool flag) { use_inhomogenity_factor = flag; }
46 
48  int Detect(double const &hit_pos_x, double const &hit_pos_y, double const &hit_time_ns, double const &wavelength_nm, PixelInfo &pixel_info, double &smeared_time_ns) const;
49 
51  void GenerateNoise(double const &time_start_ns, double const &time_window_ns, std::vector<std::pair<int, double>> &hits) const;
52 
54 
57  virtual double GetPDE(const double &) const { return 1.0; } // FIXME // wavelength_nm //[R.K.03/2017] unused variable(s)
58 
60 
64  virtual double GetInhomegenityFactor(double const &, double const &) const { return 1.0; } // FIXME//hit_pos_x hit_pos_y//[R.K.03/2017] unused variable(s)
65 
67  double GetSmearedTime(double const &time_value, PixelInfo const &pixel_info) const;
68 
70  int GenerateNoise(double const &time_start_ns, double const &time_window_ns);
71 
73  bool GetNoiseHit(int &pixel_number, double &hit_time_ns, double &smeared_time_ns);
74 
76  void SetDCR(double const &dcr_Hz);
77 
78  const SensorGridBase *GetGrid() { return sensor_grid; }
79 
80  protected:
83  PixelTraits *pixel_traits;
85  // state of noise generator:
92 };
93 
94 } // namespace SensorGrid
95 
96 #endif // SensorGridPhotodetector_HH
void SetDCR(double const &dcr_Hz)
Set the dark count rate for all pixels to dcr_Hz.
Common base class for sensor grids.
bool GetNoiseHit(int &pixel_number, double &hit_time_ns, double &smeared_time_ns)
Noise hit generator function which has to be called after GenerateNoise() to retrieve the noise hits...
void SetPixel(int pixel_id, double efficiency, double noise_rate, double time_res_ns)
double GetSmearedTime(double const &time_value, PixelInfo const &pixel_info) const
Apply time smearing.
int Detect(double const &hit_pos_x, double const &hit_pos_y, double const &hit_time_ns, double const &wavelength_nm, PixelInfo &pixel_info, double &smeared_time_ns) const
Handle photon detection:
virtual double GetInhomegenityFactor(double const &, double const &) const
Derived classes should override this function to account for spatial PDE deviations (e...
void Init(SensorGridBase *sensor_grid_, bool per_pixel_traits_, double const &efficiency_init, double const &noise_rate_init, double const &time_res_init)
virtual double GetPDE(const double &) const
Derived classes should override this function and return the average pde of the sensor.
void GenerateNoise(double const &time_start_ns, double const &time_window_ns, std::vector< std::pair< int, double >> &hits) const
Generate noise hits.