15#include <cdc/dataobjects/WireID.h>
40 void setT0(
unsigned short iCLayer,
unsigned short iWire,
float t0)
42 m_t0s.insert(std::pair<unsigned short, float>(
WireID(iCLayer, iWire).getEWire(), t0));
52 m_t0s.insert(std::pair<unsigned short, float>(wid.
getEWire(), t0));
61 void addT0(
unsigned short iCLayer,
unsigned short iWire,
float delta)
63 WireID wid(iCLayer, iWire);
64 std::map<unsigned short, float>::iterator it =
m_t0s.find(wid.
getEWire());
75 std::map<unsigned short, float>::iterator it =
m_t0s.find(wid.
getEWire());
90 std::map<unsigned short, float>
getT0s()
const
102 std::map<unsigned short, float>::const_iterator it =
m_t0s.find(wid.
getEWire());
111 std::cout <<
" " << std::endl;
112 std::cout <<
"t0 list" << std::endl;
113 std::cout <<
"# of entries= " <<
m_t0s.size() << std::endl;
114 std::cout <<
"in order of clayer#, wire#, t0" << std::endl;
115 for (
auto const& ent :
m_t0s) {
125 std::ofstream fout(fileName);
128 B2ERROR(
"Specified output file could not be opened!");
130 for (
auto const& ent :
m_t0s) {
132 ent.first).
getIWire() <<
" " << std::setw(15) << std::scientific << std::setprecision(8) << ent.second << std::endl;
157 std::vector<std::pair<unsigned short, unsigned short>> result;
158 for (
auto id_t0 :
getT0s()) {
159 result.push_back({id_t0.first, 0});
166 std::map<unsigned short, float>
m_t0s;
Database object for timing offset (t0).
void setT0(const WireID &wid, float t0)
Set t0 in the list.
std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams()
list stored global parameters
static unsigned short getGlobalUniqueID()
Get global unique id.
void outputToFile(std::string fileName) const
Output the contents in text file format.
ClassDef(CDCTimeZeros, 2)
ClassDef.
void addT0(const WireID &wid, float delta)
Update t0 in the list.
double getGlobalParam(unsigned short element, unsigned short)
Get global parameter.
CDCTimeZeros()
Default constructor.
std::map< unsigned short, float > getT0s() const
Get the whole list.
void setT0(unsigned short iCLayer, unsigned short iWire, float t0)
Set t0 in the list.
unsigned short getEntries() const
Get the no.
float getT0(const WireID &wid) const
Get t0 for the specified wire.
std::map< unsigned short, float > m_t0s
t0 list
void setGlobalParam(double value, unsigned short element, unsigned short)
Set global parameter.
void dump() const
Print out all contents.
void addT0(unsigned short iCLayer, unsigned short iWire, float delta)
Update t0 in the list.
Class to identify a wire inside the CDC.
unsigned short getICLayer() const
Getter for continuous layer numbering.
unsigned short getIWire() const
Getter for wire within the layer.
unsigned short getEWire() const
Getter for encoded wire number.
Abstract base class for different kinds of events.