Belle II Software development
ARICHBadChannels.cc
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#include <arich/dbobjects/ARICHBadChannels.h>
10
11#include <algorithm>
12
13using namespace Belle2;
14using namespace std;
15
16int ARICHBadChannels::getHapdCutChannel(unsigned int i) const
17{
18 if (i < m_hapdCutChannels.size()) return m_hapdCutChannels[i];
19 else return -1;
20}
21
22
23int ARICHBadChannels::getHapdBadChannel(unsigned int i) const
24{
25 if (i < m_hapdBadChannels.size()) return m_hapdBadChannels[i];
26 else return -1;
27}
28
29void ARICHBadChannels::setHapdCutChannel(std::vector<int> channels)
30{
31 m_hapdCutChannels = channels;
32 m_hapdListOfBadChannels.insert(m_hapdListOfBadChannels.end(), channels.begin(), channels.end());
33 std::sort(m_hapdListOfBadChannels.begin(), m_hapdListOfBadChannels.end());
36}
37
38void ARICHBadChannels::setHapdBadChannel(std::vector<int> channels)
39{
40 m_hapdBadChannels = channels;
41 m_hapdListOfBadChannels.insert(m_hapdListOfBadChannels.end(), channels.begin(), channels.end());
42 std::sort(m_hapdListOfBadChannels.begin(), m_hapdListOfBadChannels.end());
45}
46
48{
49 std::vector<int> m_hapdAllBadCHs = ARICHBadChannels::getHapdListOfBadChannels();
50 if (i < m_hapdAllBadCHs.size()) return m_hapdAllBadCHs[i];
51 else return -1;
52}
53
54int ARICHBadChannels::getFebDeadChannel(unsigned int i) const
55{
56 if (i < m_febDeadChannels.size()) return m_febDeadChannels[i];
57 else return -1;
58}
59
60
61int ARICHBadChannels::getAsicDeadChannel(unsigned int i) const
62{
63 if (i < m_asicDeadChannels.size()) return m_asicDeadChannels[i];
64 else return -1;
65}
66
67
69{
70 if (i < m_asicBadConnChannels.size()) return m_asicBadConnChannels[i];
71 else return -1;
72}
73
74
76{
77 if (i < m_asicBadOffsetChannels.size()) return m_asicBadOffsetChannels[i];
78 else return -1;
79}
80
81
83{
84 if (i < m_asicBadLinChannels.size()) return m_asicBadLinChannels[i];
85 else return -1;
86}
87
88void ARICHBadChannels::setFebDeadChannels(std::vector<int> deadChannels)
89{
90 m_febDeadChannels = deadChannels;
91 m_febListOfBadChannels.insert(m_febListOfBadChannels.end(), deadChannels.begin(), deadChannels.end());
92 std::sort(m_febListOfBadChannels.begin(), m_febListOfBadChannels.end());
95}
96
97
98void ARICHBadChannels::setAsicDeadChannels(std::vector<int> deadChannels)
99{
100 m_asicDeadChannels = deadChannels;
101 m_febListOfBadChannels.insert(m_febListOfBadChannels.end(), deadChannels.begin(), deadChannels.end());
102 std::sort(m_febListOfBadChannels.begin(), m_febListOfBadChannels.end());
105}
106
107void ARICHBadChannels::setAsicBadConnChannels(std::vector<int> badConnChannels)
108{
109 m_asicBadConnChannels = badConnChannels;
110 m_febListOfBadChannels.insert(m_febListOfBadChannels.end(), badConnChannels.begin(), badConnChannels.end());
111 std::sort(m_febListOfBadChannels.begin(), m_febListOfBadChannels.end());
114}
115
116void ARICHBadChannels::setAsicBadOffsetChannels(std::vector<int> badOffsetChannels)
117{
118 m_asicBadOffsetChannels = badOffsetChannels;
119 m_febListOfBadChannels.insert(m_febListOfBadChannels.end(), badOffsetChannels.begin(), badOffsetChannels.end());
120 std::sort(m_febListOfBadChannels.begin(), m_febListOfBadChannels.end());
123}
124
125
126void ARICHBadChannels::setAsicBadLinChannels(std::vector<int> badLinChannels)
127{
128 m_asicBadLinChannels = badLinChannels;
129 m_febListOfBadChannels.insert(m_febListOfBadChannels.end(), badLinChannels.begin(), badLinChannels.end());
130 std::sort(m_febListOfBadChannels.begin(), m_febListOfBadChannels.end());
133}
134
136{
137 std::vector<int> m_febAllBadCHs = ARICHBadChannels::getFebListOfBadChannels();
138 if (i < m_febAllBadCHs.size()) return m_febAllBadCHs[i];
139 else return -1;
140}
std::vector< int > m_asicDeadChannels
List of dead channels on the ASIC chip.
std::vector< int > getFebListOfBadChannels() const
Get a list of all bad channels.
std::vector< int > m_hapdCutChannels
List of cut channels on the HAPD chip.
void setHapdBadChannel(std::vector< int > channels)
Set the list of bad channels.
int getAsicBadConnChannel(unsigned int i) const
Get a channel number from the list of channels with bad connections.
int getAsicDeadChannel(unsigned int i) const
Get a channel number from the list of dead channels.
std::vector< int > m_asicBadOffsetChannels
List of channels with bad offset adjustment.
void setFebDeadChannels(std::vector< int > deadChannels)
Set vector of dead channel numbers.
int getFebListOfBadChannel(unsigned int i) const
Get a channel number from the list of channels with bad linearity.
std::vector< int > m_febListOfBadChannels
List of all bad channels on the FEB.
std::vector< int > m_febDeadChannels
List of dead channels on the FEB.
void setHapdCutChannel(std::vector< int > channels)
Set the list of cut channels.
void setAsicBadConnChannels(std::vector< int > badConnChannels)
Set vector of bad connection channel numbers.
int getHapdCutChannel(unsigned int i) const
Get a channel number from the list of cut channels.
int getHapdListOfBadChannel(unsigned int i) const
Get a channel number from the list of bad channels.
std::vector< int > m_asicBadConnChannels
List of channels with bad connections during the measurement.
std::vector< int > getHapdListOfBadChannels() const
Get a list of all bad channels.
void setAsicBadLinChannels(std::vector< int > badLinChannels)
Set vector of bad linearity channel numbers.
std::vector< int > m_asicBadLinChannels
List of channels with bad linearity.
int getHapdBadChannel(unsigned int i) const
Get a channel number from the list of bad channels.
void setAsicBadOffsetChannels(std::vector< int > badOffsetChannels)
Set vector of bad offset channel numbers.
int getAsicBadLinChannel(unsigned int i) const
Get a channel number from the list of channels with bad linearity.
std::vector< int > m_hapdBadChannels
List of bad (cut and dead channels) on the HAPD chip.
int getAsicBadOffsetChannel(unsigned int i) const
Get a channel number from the list of channels with bad offset adjustment.
int getFebDeadChannel(unsigned int i) const
Get a channel number from the list of dead channels.
std::vector< int > m_hapdListOfBadChannels
List of all bad channels on the HAPD.
void setAsicDeadChannels(std::vector< int > deadChannels)
Set vector of dead channel numbers.
Abstract base class for different kinds of events.
STL namespace.