55 void setParams(
unsigned short id,
const std::vector<float>& params)
57 m_cvs.insert(std::pair<
unsigned short, std::vector<float>>(
id, params));
87 std::map<unsigned short, std::vector<float>>
getParams()
const
97 const std::vector<float>&
getParams(
unsigned short id)
const
99 std::map<unsigned short, std::vector<float>>::const_iterator it =
m_cvs.find(
id);
100 if (it !=
m_cvs.end()) {
103 B2FATAL(
"Specified id not found in getParams !");
112 std::cout <<
" " << std::endl;
113 std::cout <<
"Edep-to-ADC conversion list" << std::endl;
114 std::cout <<
"#entries= " <<
m_cvs.size() << std::endl;
116 std::cout <<
"in order of id and parameters" << std::endl;
118 for (
auto const& ent :
m_cvs) {
119 std::cout << ent.first;
120 unsigned short np = (ent.second).size();
121 for (
unsigned short i = 0; i < np; ++i) {
122 std::cout <<
" " << (ent.second)[i];
124 std::cout << std::endl;
134 std::ofstream fout(fileName);
137 B2ERROR(
"Specified output file could not be opened!");
139 std::map<unsigned short, std::vector<float>>::const_iterator it =
m_cvs.find(0);
140 int nParams = (it->second).size();
141 fout <<
m_paramMode <<
" " << nParams << std::endl;
143 for (
auto const& ent :
m_cvs) {
144 fout << std::setw(3) << std::right << ent.first;
145 for (
unsigned short i = 0; i < nParams; ++i) {
146 fout <<
" " << std::setw(15) << std::scientific << std::setprecision(8) << (ent.second)[i];
157 std::map<unsigned short, std::vector<float>>
m_cvs;
Database object for energy-deposit to ADC-count conversion.
void outputToFile(std::string fileName) const
Output the contents in text file format.
CDCEDepToADCConversions()
Default constructor.
unsigned short m_paramMode
Mode for parameterization.
void setGroupID(unsigned short mode)
Set group id (parameterized per group) id=0: superLayerID; =1: layerID; =2: wireID.
std::map< unsigned short, std::vector< float > > getParams() const
Get the whole list.
unsigned short getEntries() const
Get the no.
ClassDef(CDCEDepToADCConversions, 3)
ClassDef.
std::map< unsigned short, std::vector< float > > m_cvs
cv list
const std::vector< float > & getParams(unsigned short id) const
Get the conv.
void setParamMode(unsigned short mode)
Set conversion parameterization mode.
unsigned short m_groupID
Group id (parameterized per group)
void setParams(unsigned short id, const std::vector< float > ¶ms)
Set the conv.
void dump() const
Print all contents.
unsigned short getGroupID() const
Get group id.
unsigned short getParamMode() const
Get mode of conversion parameterization.
Abstract base class for different kinds of events.