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));
78 float getPedestal(
const unsigned short& board,
const unsigned short& ch)
const
80 unsigned short id0 = (0x8000 | board);
81 std::map<unsigned short, float>::const_iterator it0 =
m_pedestals.find(id0);
85 unsigned short id = ((ch << 9) | board);
86 std::map<unsigned short, float>::const_iterator it =
m_pedestals.find(
id);
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;
109 std::cout << (ent.first & 0x1ff) <<
" " << ((ent.first & 0x7e00) >> 9) <<
" " << ent.second << std::endl;
Database object for ADC pedestals.
ClassDef(CDCADCDeltaPedestals, 1)
ClassDef.
void setSamplingWindow(unsigned short sample)
Set time window for sampling.
CDCADCDeltaPedestals()
Default constructor.
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 > m_pedestals
ADC pedestal list.
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.
unsigned short m_samplingWindow
ADC sampling window.
Abstract base class for different kinds of events.