Database object for ADC pedestals.
More...
#include <CDCADCDeltaPedestals.h>
|
| CDCADCDeltaPedestals () |
| Default constructor.
|
|
void | setSamplingWindow (unsigned short sample) |
| Set time window for sampling.
|
|
void | setPedestal (int board, int ch, float pedestal) |
| Set ADC pedestals in the list.
|
|
unsigned short | getEntries () const |
| Get the no.
|
|
std::map< unsigned short, float > | getPedestals () const |
| Get the whole list.
|
|
float | getPedestal (const unsigned short &board, const unsigned short &ch) const |
| Get ADC pedestal for the specified board.
|
|
void | dump () const |
| Print out all contents.
|
|
Database object for ADC pedestals.
Definition at line 23 of file CDCADCDeltaPedestals.h.
◆ CDCADCDeltaPedestals()
◆ dump()
Print out all contents.
Definition at line 98 of file CDCADCDeltaPedestals.h.
99 {
100 std::cout << " " << std::endl;
101 std::cout << "ADC pedestal list" << std::endl;
103 std::cout <<
"# of entries= " <<
m_pedestals.size() << std::endl;
104 std::cout << "in order of board#, ch#, pedestal" << std::endl;
106 if ((ent.first & 0x8000) > 0) {
107 std::cout << (ent.first & 0x1ff) << " " << -1 << " " << ent.second << std::endl;
108 } else {
109 std::cout << (ent.first & 0x1ff) << " " << ((ent.first & 0x7e00) >> 9) << " " << ent.second << std::endl;
110 }
111 }
112 }
std::map< unsigned short, float > m_pedestals
ADC pedestal list.
unsigned short m_samplingWindow
ADC sampling window.
◆ getEntries()
unsigned short getEntries |
( |
| ) |
const |
|
inline |
◆ getPedestal()
float getPedestal |
( |
const unsigned short & |
board, |
|
|
const unsigned short & |
ch |
|
) |
| const |
|
inline |
Get ADC pedestal for the specified board.
- Parameters
-
board | Board id. |
ch | Channel id. |
- Returns
- pedestal for the board (and channel).
Definition at line 78 of file CDCADCDeltaPedestals.h.
79 {
80 unsigned short id0 = (0x8000 | board);
81 std::map<unsigned short, float>::const_iterator it0 =
m_pedestals.find(id0);
83 return it0->second;
84 } else {
85 unsigned short id = ((ch << 9) | board);
86 std::map<unsigned short, float>::const_iterator it =
m_pedestals.find(
id);
88 return it->second;
89 } else {
90 return 0.0;
91 }
92 }
93 }
◆ getPedestals()
std::map< unsigned short, float > getPedestals |
( |
| ) |
const |
|
inline |
◆ setPedestal()
void setPedestal |
( |
int |
board, |
|
|
int |
ch, |
|
|
float |
pedestal |
|
) |
| |
|
inline |
Set ADC pedestals in the list.
- Parameters
-
board | Board id |
ch | Channel id |
pedestal | Pedestal value |
Definition at line 47 of file CDCADCDeltaPedestals.h.
48 {
49 unsigned short mask = ch == -1 ? 0x8000 : 0;
50 unsigned short id = mask == 0x8000 ? (mask | board) : (mask | (ch << 9) | board);
52 m_pedestals.insert(std::pair<unsigned short, float>(
id, pedestal));
53 }
◆ setSamplingWindow()
void setSamplingWindow |
( |
unsigned short |
sample | ) |
|
|
inline |
◆ m_pedestals
std::map<unsigned short, float> m_pedestals |
|
private |
◆ m_samplingWindow
unsigned short m_samplingWindow = 10 |
|
private |
The documentation for this class was generated from the following file: