Belle II Software  release-08-01-10
NoiseMap.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef SVD_NOISEMAP_H
10 #define SVD_NOISEMAP_H
11 
12 #include <vxd/dataobjects/VxdID.h>
13 #include <svd/geometry/SensorInfo.h>
14 #include <svd/reconstruction/Sample.h>
15 #include <vxd/geometry/GeoCache.h>
16 
17 namespace Belle2 {
23  namespace SVD {
24 
29  class NoiseMap {
30  public:
32  NoiseMap(): m_eInADU(1.0), m_sensorID(0), m_isU(false), m_noiseLevel(0) {}
33 
35  virtual ~NoiseMap() {}
36 
42  void setADU(double eInADU) { m_eInADU = eInADU; }
43 
45  void setNoiseLevel(float noise) { m_noiseLevel = noise; }
46 
48  virtual void setSensorID(VxdID sensorID, bool side)
49  {
50  const SensorInfo& info = dynamic_cast<const SensorInfo&>(VXD::GeoCache::get(sensorID));
51  m_sensorID = sensorID;
52  if (side)
53  m_noiseLevel = info.getElectronicNoiseU() / m_eInADU;
54  else
55  m_noiseLevel = info.getElectronicNoiseV() / m_eInADU;
56  m_isU = side;
57  }
58 
63  float getSignificance(const Sample& sample) const { return sample.getCharge() / getNoise(sample); }
68  virtual float getNoise(short) const { return m_noiseLevel; }
69 
74  virtual float getNoise(const Sample&) const { return m_noiseLevel; }
75 
81  bool operator()(const Sample& sample, float significance) const
82  { return getSignificance(sample) >= significance; }
83 
88  bool operator()(float signal, float significance) const { return signal / m_noiseLevel >= significance; }
89 
90  protected:
92  double m_eInADU;
96  bool m_isU;
98  float m_noiseLevel;
99  };
100 
101  }
102 
104 }
105 
106 #endif //SVD_NOISEMAP_H
Base Class to represent strip-dependent noise map.
Definition: NoiseMap.h:29
bool m_isU
Side of current sensor.
Definition: NoiseMap.h:96
virtual float getNoise(const Sample &) const
Return the noise value for a given strip.
Definition: NoiseMap.h:74
void setNoiseLevel(float noise)
Override the noise level.
Definition: NoiseMap.h:45
bool operator()(float signal, float significance) const
Check whether a signal exceeds a given significance using the average noise level.
Definition: NoiseMap.h:88
void setADU(double eInADU)
Set charge per ADC unit.
Definition: NoiseMap.h:42
float getSignificance(const Sample &sample) const
Return the sigma-significance of a signal, that is, signal divided by noise level.
Definition: NoiseMap.h:63
virtual ~NoiseMap()
Destructor.
Definition: NoiseMap.h:35
NoiseMap()
Constructor
Definition: NoiseMap.h:32
float m_noiseLevel
Noise level in strips.
Definition: NoiseMap.h:98
virtual void setSensorID(VxdID sensorID, bool side)
Set the sensorID currently used.
Definition: NoiseMap.h:48
VxdID m_sensorID
VxdID of the current sensor.
Definition: NoiseMap.h:94
double m_eInADU
Charge corresponding to 1 ADU.
Definition: NoiseMap.h:92
bool operator()(const Sample &sample, float significance) const
Check whether a signal exceeds a given significance.
Definition: NoiseMap.h:81
virtual float getNoise(short) const
Return the noise level for a given strip.
Definition: NoiseMap.h:68
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:25
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:139
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.