17 #include <cdc/dataobjects/WireID.h>
28 class CDCTimeZeros:
public TObject {
42 void setT0(
unsigned short iCLayer,
unsigned short iWire,
float t0)
44 m_t0s.insert(std::pair<unsigned short, float>(
WireID(iCLayer, iWire).getEWire(), t0));
54 m_t0s.insert(std::pair<unsigned short, float>(wid.
getEWire(), t0));
63 void addT0(
unsigned short iCLayer,
unsigned short iWire,
float delta)
65 WireID wid(iCLayer, iWire);
66 std::map<unsigned short, float>::iterator it =
m_t0s.find(wid.
getEWire());
75 void addT0(
const WireID& wid,
float delta)
77 std::map<unsigned short, float>::iterator it =
m_t0s.find(wid.getEWire());
92 std::map<unsigned short, float>
getT0s()
const
104 std::map<unsigned short, float>::const_iterator it =
m_t0s.find(wid.
getEWire());
113 std::cout <<
" " << std::endl;
114 std::cout <<
"t0 list" << std::endl;
115 std::cout <<
"# of entries= " <<
m_t0s.size() << std::endl;
116 std::cout <<
"in order of clayer#, wire#, t0" << std::endl;
117 for (
auto const& ent :
m_t0s) {
118 std::cout << WireID(ent.first).getICLayer() <<
" " << WireID(ent.first).getIWire() <<
" " << ent.second << std::endl;
127 std::ofstream fout(fileName);
130 B2ERROR(
"Specified output file could not be opened!");
132 for (
auto const& ent :
m_t0s) {
134 ent.first).
getIWire() <<
" " << std::setw(15) << std::scientific << std::setprecision(8) << ent.second << std::endl;
146 return getT0(WireID(element));
149 void setGlobalParam(
double value,
unsigned short element,
unsigned short)
159 std::vector<std::pair<unsigned short, unsigned short>> result;
160 for (
auto id_t0 :
getT0s()) {
161 result.push_back({id_t0.first, 0});
168 std::map<unsigned short, float>
m_t0s;