Belle II Software  release-05-01-25
NoiseMap.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter, Peter Kvasnicka *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef SVD_NOISEMAP_H
12 #define SVD_NOISEMAP_H
13 
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/geometry/SensorInfo.h>
16 #include <svd/reconstruction/Sample.h>
17 #include <vxd/geometry/GeoCache.h>
18 
19 namespace Belle2 {
25  namespace SVD {
26 
31  class NoiseMap {
32  public:
34  NoiseMap(): m_eInADU(1.0), m_sensorID(0), m_isU(false), m_noiseLevel(0) {}
35 
37  virtual ~NoiseMap() {}
38 
44  void setADU(double eInADU) { m_eInADU = eInADU; }
45 
47  void setNoiseLevel(float noise) { m_noiseLevel = noise; }
48 
50  virtual void setSensorID(VxdID sensorID, bool side)
51  {
52  const SensorInfo& info = dynamic_cast<const SensorInfo&>(VXD::GeoCache::get(sensorID));
53  m_sensorID = sensorID;
54  if (side)
55  m_noiseLevel = info.getElectronicNoiseU() / m_eInADU;
56  else
57  m_noiseLevel = info.getElectronicNoiseV() / m_eInADU;
58  m_isU = side;
59  }
60 
65  float getSignificance(const Sample& sample) const { return sample.getCharge() / getNoise(sample); }
70  virtual float getNoise(short) const { return m_noiseLevel; }
71 
76  virtual float getNoise(const Sample&) const { return m_noiseLevel; }
77 
83  bool operator()(const Sample& sample, float significance) const
84  { return getSignificance(sample) >= significance; }
85 
90  bool operator()(float signal, float significance) const { return signal / m_noiseLevel >= significance; }
91 
92  protected:
94  double m_eInADU;
98  bool m_isU;
100  float m_noiseLevel;
101  };
102 
103  }
104 
106 }
107 
108 #endif //SVD_NOISEMAP_H
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVD::NoiseMap::setSensorID
virtual void setSensorID(VxdID sensorID, bool side)
Set the sensorID currently used.
Definition: NoiseMap.h:58
Belle2::VXD::GeoCache::get
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:141
Belle2::SVD::NoiseMap::getSignificance
float getSignificance(const Sample &sample) const
Return the sigma-significance of a signal, that is, signal divided by noise level.
Definition: NoiseMap.h:73
Belle2::SVD::SensorInfo
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:35
Belle2::SVD::NoiseMap::getNoise
virtual float getNoise(short) const
Return the noise level for a given strip.
Definition: NoiseMap.h:78
Belle2::SVD::NoiseMap::setNoiseLevel
void setNoiseLevel(float noise)
Override the noise level.
Definition: NoiseMap.h:55
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVD::NoiseMap::m_eInADU
double m_eInADU
Charge corresponding to 1 ADU.
Definition: NoiseMap.h:102
Belle2::SVD::NoiseMap::setADU
void setADU(double eInADU)
Set charge per ADC unit.
Definition: NoiseMap.h:52
Belle2::SVD::NoiseMap::operator()
bool operator()(const Sample &sample, float significance) const
Check whether a signal exceeds a given significance.
Definition: NoiseMap.h:91
Belle2::SVD::NoiseMap::m_isU
bool m_isU
Side of current sensor.
Definition: NoiseMap.h:106
Belle2::SVD::NoiseMap::~NoiseMap
virtual ~NoiseMap()
Destructor.
Definition: NoiseMap.h:45
Belle2::SVD::NoiseMap::m_sensorID
VxdID m_sensorID
VxdID of the current sensor.
Definition: NoiseMap.h:104
Belle2::SVD::NoiseMap::m_noiseLevel
float m_noiseLevel
Noise level in strips.
Definition: NoiseMap.h:108
Belle2::SVD::NoiseMap::NoiseMap
NoiseMap()
Constructor
Definition: NoiseMap.h:42