Database object for energy-deposit to ADC-count conversion.
More...
#include <CDCEDepToADCConversions.h>
|
| CDCEDepToADCConversions () |
| Default constructor.
|
|
void | setParamMode (unsigned short mode) |
| Set conversion parameterization mode.
|
|
void | setGroupID (unsigned short mode) |
| Set group id (parameterized per group) id=0: superLayerID; =1: layerID; =2: wireID.
|
|
void | setParams (unsigned short id, const std::vector< float > ¶ms) |
| Set the conv.
|
|
unsigned short | getParamMode () const |
| Get mode of conversion parameterization.
|
|
unsigned short | getGroupID () const |
| Get group id.
|
|
unsigned short | getEntries () const |
| Get the no.
|
|
std::map< unsigned short, std::vector< float > > | getParams () const |
| Get the whole list.
|
|
const std::vector< float > & | getParams (unsigned short id) const |
| Get the conv.
|
|
void | dump () const |
| Print all contents.
|
|
void | outputToFile (std::string fileName) const |
| Output the contents in text file format.
|
|
|
unsigned short | m_paramMode = 0 |
| Mode for parameterization.
|
|
unsigned short | m_groupID = 0 |
| Group id (parameterized per group)
|
|
std::map< unsigned short, std::vector< float > > | m_cvs |
| cv list
|
|
Database object for energy-deposit to ADC-count conversion.
Definition at line 25 of file CDCEDepToADCConversions.h.
◆ CDCEDepToADCConversions()
◆ dump()
Print all contents.
Definition at line 110 of file CDCEDepToADCConversions.h.
111 {
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;
117
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];
123 }
124 std::cout << std::endl;
125 }
126 }
unsigned short m_paramMode
Mode for parameterization.
std::map< unsigned short, std::vector< float > > m_cvs
cv list
◆ getEntries()
unsigned short getEntries |
( |
| ) |
const |
|
inline |
◆ getGroupID()
unsigned short getGroupID |
( |
| ) |
const |
|
inline |
Get group id.
Definition at line 71 of file CDCEDepToADCConversions.h.
72 {
74 }
unsigned short m_groupID
Group id (parameterized per group)
◆ getParamMode()
unsigned short getParamMode |
( |
| ) |
const |
|
inline |
◆ getParams() [1/2]
std::map< unsigned short, std::vector< float > > getParams |
( |
| ) |
const |
|
inline |
◆ getParams() [2/2]
const std::vector< float > & getParams |
( |
unsigned short |
id | ) |
const |
|
inline |
Get the conv.
parameters for the id
- Parameters
-
- Returns
- conversion paramseters for the id
Definition at line 97 of file CDCEDepToADCConversions.h.
98 {
99 std::map<unsigned short, std::vector<float>>::const_iterator it =
m_cvs.find(
id);
100 if (it !=
m_cvs.end()) {
101 return it->second;
102 } else {
103 B2FATAL("Specified id not found in getParams !");
104 }
105 }
◆ outputToFile()
void outputToFile |
( |
std::string |
fileName | ) |
const |
|
inline |
Output the contents in text file format.
Definition at line 132 of file CDCEDepToADCConversions.h.
133 {
134 std::ofstream fout(fileName);
135
136 if (fout.bad()) {
137 B2ERROR("Specified output file could not be opened!");
138 } else {
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];
147 }
148 fout << std::endl;
149 }
150 fout.close();
151 }
152 }
◆ setGroupID()
void setGroupID |
( |
unsigned short |
mode | ) |
|
|
inline |
Set group id (parameterized per group) id=0: superLayerID; =1: layerID; =2: wireID.
Definition at line 45 of file CDCEDepToADCConversions.h.
◆ setParamMode()
void setParamMode |
( |
unsigned short |
mode | ) |
|
|
inline |
◆ setParams()
void setParams |
( |
unsigned short |
id, |
|
|
const std::vector< float > & |
params |
|
) |
| |
|
inline |
Set the conv.
paramseters in the list
- Parameters
-
id | superLayerid(0-8), laerID(0-55) or wireID |
params | parameters for conversion |
Definition at line 55 of file CDCEDepToADCConversions.h.
56 {
57 m_cvs.insert(std::pair<
unsigned short, std::vector<float>>(
id, params));
58 }
◆ m_cvs
std::map<unsigned short, std::vector<float> > m_cvs |
|
private |
◆ m_groupID
unsigned short m_groupID = 0 |
|
private |
◆ m_paramMode
unsigned short m_paramMode = 0 |
|
private |
The documentation for this class was generated from the following file: