Belle II Software development
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
17namespace 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::getInstance().getSensorInfo(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); }
67 virtual float getNoise(short) const { return m_noiseLevel; }
68
73 virtual float getNoise(const Sample& sample) const { return m_noiseLevel; }
74
80 bool operator()(const Sample& sample, float significance) const
81 { return getSignificance(sample) >= significance; }
82
87 bool operator()(float signal, float significance) const { return signal / m_noiseLevel >= significance; }
88
89 protected:
91 double m_eInADU;
95 bool m_isU;
98 };
99
100 }
101
103}
104
105#endif //SVD_NOISEMAP_H
Base Class to represent strip-dependent noise map.
Definition: NoiseMap.h:29
virtual float getNoise(const Sample &sample) const
Return the noise value for a given strip.
Definition: NoiseMap.h:73
bool m_isU
Side of current sensor.
Definition: NoiseMap.h:95
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:87
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:97
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:93
double m_eInADU
Charge corresponding to 1 ADU.
Definition: NoiseMap.h:91
bool operator()(const Sample &sample, float significance) const
Check whether a signal exceeds a given significance.
Definition: NoiseMap.h:80
virtual float getNoise(short) const
Return the noise level for a given strip.
Definition: NoiseMap.h:67
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:25
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.