Database object for bad wires.
More...
#include <CDCBadWires.h>
|
| CDCBadWires () |
| Default constructor.
|
|
void | setWire (const WireID &wid, double eff=0) |
| Set the wire in the list.
|
|
void | setWire (unsigned short iCLayer, unsigned short iWire, double eff=0) |
| Set the wire in the list.
|
|
unsigned short | getEntries () const |
| Get the no.
|
|
std::map< unsigned short, float > | getWires () const |
| Get the whole list.
|
|
bool | isBadWire (const WireID &wid) const |
| Check if the wire is totally-dead (eff=0); to be replaced by isDeadWire() in future...
|
|
bool | isDeadWire (const WireID &wid, double &eff) const |
| Check if dead wire.
|
|
bool | isHotWire (const WireID &wid) const |
| Check if the wire is hot/noisy.
|
|
void | dump () const |
| Print out contents.
|
|
void | outputToFile (std::string fileName) const |
| Output the contents in text file format.
|
|
|
std::map< unsigned short, float > | m_wires |
| badwire list
|
|
Database object for bad wires.
Definition at line 27 of file CDCBadWires.h.
◆ CDCBadWires()
◆ dump()
Print out contents.
Definition at line 122 of file CDCBadWires.h.
123 {
124 std::cout << " " << std::endl;
125 std::cout << "Bad wire list" << std::endl;
126 std::cout <<
"#entries= " <<
m_wires.size() << std::endl;
127 std::cout << "in order of ICLayer and IWire and EWire" << std::endl;
128
129 for (
auto const ent :
m_wires) {
130 std::cout << WireID(ent.first).getICLayer() << " " << WireID(ent.first).getIWire() << " " << ent.second << std::endl;
131 }
132 }
std::map< unsigned short, float > m_wires
badwire list
◆ getEntries()
unsigned short getEntries |
( |
| ) |
const |
|
inline |
Get the no.
of entries in the list
Definition at line 59 of file CDCBadWires.h.
◆ getWires()
std::map< unsigned short, float > getWires |
( |
| ) |
const |
|
inline |
◆ isBadWire()
bool isBadWire |
( |
const WireID & |
wid | ) |
const |
|
inline |
Check if the wire is totally-dead (eff=0); to be replaced by isDeadWire() in future...
- Parameters
-
- Returns
- true if dead wire; false if not
Definition at line 77 of file CDCBadWires.h.
78 {
79 std::map<unsigned short, float>::const_iterator it =
m_wires.find(wid.getEWire());
80 if (it !=
m_wires.end() && it->second == 0.) {
81 return true;
82 } else {
83 return false;
84 }
85 }
◆ isDeadWire()
bool isDeadWire |
( |
const WireID & |
wid, |
|
|
double & |
eff |
|
) |
| const |
|
inline |
Check if dead wire.
- Parameters
-
wid | wire id to be checked |
eff | efficiency of the wirte |
- Returns
- true if dead wire; false if not
Definition at line 93 of file CDCBadWires.h.
94 {
95 std::map<unsigned short, float>::const_iterator it =
m_wires.find(wid.getEWire());
96 if (it !=
m_wires.end() && 0. <= it->second && it->second < 1.) {
97 eff = it->second;
98 return true;
99 } else {
100 return false;
101 }
102 }
◆ isHotWire()
bool isHotWire |
( |
const WireID & |
wid | ) |
const |
|
inline |
Check if the wire is hot/noisy.
- Parameters
-
- Returns
- true if hot wire; false if not
Definition at line 109 of file CDCBadWires.h.
110 {
111 std::map<unsigned short, float>::const_iterator it =
m_wires.find(wid.getEWire());
112 if (it !=
m_wires.end() && it->second > 1.) {
113 return true;
114 } else {
115 return false;
116 }
117 }
◆ outputToFile()
void outputToFile |
( |
std::string |
fileName | ) |
const |
|
inline |
Output the contents in text file format.
Definition at line 137 of file CDCBadWires.h.
138 {
139 std::ofstream fout(fileName);
140
141 if (fout.bad()) {
142 B2ERROR("Specified output file could not be opened!");
143 } else {
144 for (
auto const ent :
m_wires) {
145 fout << std::setw(2) << std::right << WireID(ent.first).getICLayer() << " " << std::setw(3) << WireID(
146 ent.first).getIWire() << " " << ent.second << std::endl;
147 }
148 fout.close();
149 }
150 }
◆ setWire() [1/2]
void setWire |
( |
const WireID & |
wid, |
|
|
double |
eff = 0 |
|
) |
| |
|
inline |
Set the wire in the list.
- Parameters
-
wid | wire-id to be registered |
eff | wire efficiency; specify 0 <= eff < 1 for dead wire; eff > 1 for hot/noisy wire |
Definition at line 40 of file CDCBadWires.h.
41 {
42 m_wires.insert(std::pair(wid.getEWire(), eff));
43 }
◆ setWire() [2/2]
void setWire |
( |
unsigned short |
iCLayer, |
|
|
unsigned short |
iWire, |
|
|
double |
eff = 0 |
|
) |
| |
|
inline |
Set the wire in the list.
- Parameters
-
iCLayer | (continuous) layer-id of badwire |
iWire | wire-id of badwire |
eff | wire efficiency; specify 0 <= eff < 1 for dead wire; eff > 1 for hot/noisy wire |
Definition at line 51 of file CDCBadWires.h.
52 {
53 m_wires.insert(std::pair(WireID(iCLayer, iWire).getEWire(), eff));
54 }
◆ m_wires
std::map<unsigned short, float> m_wires |
|
private |
The documentation for this class was generated from the following file: