 |
Belle II Software
release-05-01-25
|
27 class CDCTimeWalks:
public TObject {
53 m_tws.insert(std::pair<
unsigned short, std::vector<float>>(boardID, params));
61 void addTimeWalks(
unsigned short boardID,
const std::vector<float>& deltas)
63 std::map<unsigned short, std::vector<float>>::iterator it =
m_tws.find(boardID);
64 if (it !=
m_tws.end()) {
66 (it->second)[i] += deltas[i];
69 B2FATAL(
"Specified tw params not found in addTimeWalks !");
105 std::map<unsigned short, std::vector<float>>::const_iterator it =
m_tws.find(boardID);
106 if (it !=
m_tws.end()) {
109 B2FATAL(
"Specified tw params not found in getTimeWalks !");
118 std::cout <<
" " << std::endl;
119 std::cout <<
"Time walk coefficient list" << std::endl;
120 std::cout <<
"#entries= " <<
m_tws.size() << std::endl;
122 std::cout <<
"in order of board# and coefficients" << std::endl;
125 std::cout << ent.first;
127 std::cout <<
" " << (ent.second)[i];
129 std::cout << std::endl;
138 std::ofstream fout(fileName);
141 B2ERROR(
"Specified output file could not be opened!");
145 fout << std::setw(3) << std::right << ent.first;
147 fout <<
" " << std::setw(15) << std::scientific << std::setprecision(8) << ent.second[i];
159 double getGlobalParam(
unsigned short element,
unsigned short i)
const
164 void setGlobalParam(
double value,
unsigned short element,
unsigned short i)
170 std::map<unsigned short, std::vector<float>>::iterator it =
m_tws.find(element);
171 if (it !=
m_tws.end()) {
172 it->second[i] = value;
174 B2FATAL(
"Specified tw params not found in setGlobalParam !");
178 std::vector<std::pair<unsigned short, unsigned short>>
listGlobalParams()
const
180 std::vector<std::pair<unsigned short, unsigned short>> result;
181 for (
auto id_timewalk :
m_tws) {
182 result.push_back({id_timewalk.first, 0});
193 std::map<unsigned short, std::vector<float>>
m_tws;
unsigned short getTwParamMode() const
Get tw parameterization mode.
std::map< unsigned short, std::vector< float > > getTimeWalkParams() const
Get the whole list.
double getGlobalParam(unsigned short element, unsigned short i) const
Get global parameter.
ClassDef(CDCTimeWalks, 2)
ClassDef.
Database object for time-walk.
std::vector< std::pair< unsigned short, unsigned short > > listGlobalParams() const
list stored global parameters
void addTimeWalks(unsigned short boardID, const std::vector< float > &deltas)
Update the time-walk coefficients in the list.
unsigned short getEntries() const
Get the no.
void setTimeWalkParams(unsigned short boardID, const std::vector< float > ¶ms)
Set the time-walk coefficients in the list.
Abstract base class for different kinds of events.
std::map< unsigned short, std::vector< float > > m_tws
tw list
unsigned short m_twParamMode
Mode for tw parameterization; the initial value should be the one for classdef=1; do not modify it.
void setTwParamMode(unsigned short mode)
Set tw parameterization mode mode=0: tw (in ns) = p0/sqrt(FADCsum); mode=1: tw( in ns) = p0*exp(-p1*F...
CDCTimeWalks()
Default constructor.
void setGlobalParam(double value, unsigned short element, unsigned short i)
Set global parameter.
void dump() const
Print all contents.
void outputToFile(std::string fileName) const
Output the contents in text file format.
static unsigned short getGlobalUniqueID()
Get global unique id.
unsigned short m_nTwParams
No.