Belle II Software development
PXDIgnoredPixelsMap.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#pragma once
10
11#include <vxd/dataobjects/VxdID.h>
12
13#include <functional>
14#include <map>
15#include <unordered_map>
16#include <set>
17#include <unordered_set>
18
19namespace Belle2 {
40 public:
42 typedef std::pair<unsigned short, unsigned short> map_pixel;
44 typedef std::function< bool(unsigned short, unsigned short) > pixel_range_test_prototype;
46 typedef std::multimap< unsigned int, pixel_range_test_prototype, std::greater<unsigned int> > IgnoredPixelsRangeSet;
48 typedef std::unordered_set< unsigned int> IgnoredSinglePixelsSet;
49
53 explicit PXDIgnoredPixelsMap(const std::string& xml_filename);
54
57
63 const std::set<map_pixel> getIgnoredPixels(VxdID id);
64
70 bool pixelOK(VxdID id, map_pixel pixel);
71
72 private:
73
75 std::unordered_map<unsigned short, IgnoredPixelsRangeSet> m_Map;
77 std::unordered_map<unsigned short, IgnoredSinglePixelsSet> m_MapSingles;
78
83
87 unsigned short m_lastSensorVCells;
88
89 };
90
92} // namespace Belle2
93
This class provides a check for ignored (=cold, hot or otherwise deffective) pixels for the use in PX...
std::unordered_set< unsigned int > IgnoredSinglePixelsSet
Structure to hold set of masked single pixels indexed by their unique id (unsigned int),...
std::pair< unsigned short, unsigned short > map_pixel
Simple structure for a pixel, u = map_pixel.first, v = map_pixel.second.
std::unordered_map< unsigned short, IgnoredSinglePixelsSet > m_MapSingles
Structure holding sets of ingored single pixels for all sensors by sensor id (unsigned short).
std::unordered_map< unsigned short, IgnoredPixelsRangeSet > m_Map
Structure holding sets of ignored pixel ranges for all sensors by sensor id (unsigned short).
std::multimap< unsigned int, pixel_range_test_prototype, std::greater< unsigned int > > IgnoredPixelsRangeSet
Structure to hold set of masked pixel ranges ordered from largest to smallest by their area (unsigned...
IgnoredSinglePixelsSet m_lastIgnoredSingles
Set of ignored single pixels for the most currently queried sensor.
unsigned short m_lastSensorVCells
The most currently queried sensor number of V pixels (for quick pixel uid evaluation)
IgnoredPixelsRangeSet m_lastIgnored
Set of ignored pixel ranges for the most currently queried sensor.
PXDIgnoredPixelsMap()=delete
No default constructor.
VxdID m_lastSensorID
The most currently queried sensor number.
std::function< bool(unsigned short, unsigned short) > pixel_range_test_prototype
Prototype for lambda function used to check if a pixel is in masked range.
bool pixelOK(VxdID id, map_pixel pixel)
Check whether a pixel on a given sensor is OK or not.
const std::set< map_pixel > getIgnoredPixels(VxdID id)
Get the set of ignored pixels for a sensor.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.