Belle II Software development
CDCDedxBadWires Class Reference

dE/dx wire gain calibration constants More...

#include <CDCDedxBadWires.h>

Inheritance diagram for CDCDedxBadWires:

Public Member Functions

 CDCDedxBadWires ()
 Default constructor.
 
 CDCDedxBadWires (const std::vector< double > &badwires)
 Constructor.
 
 ~CDCDedxBadWires ()
 Destructor.
 
void setBadWireStatus (int wire, bool status)
 Set wire gain.
 
bool getBadWireStatus (int wire) const
 Return wire gain.
 
void printBadWireStatus (bool save=true, std::string sfx="local") const
 print all wire numbers
 

Private Member Functions

 ClassDef (CDCDedxBadWires, 1)
 ClassDef.
 

Private Attributes

std::vector< double > m_badwires
 dE/dx gains for each wire
 

Detailed Description

dE/dx wire gain calibration constants

Definition at line 29 of file CDCDedxBadWires.h.

Constructor & Destructor Documentation

◆ CDCDedxBadWires() [1/2]

CDCDedxBadWires ( )
inline

Default constructor.

Definition at line 36 of file CDCDedxBadWires.h.

36: m_badwires() {};
std::vector< double > m_badwires
dE/dx gains for each wire

◆ CDCDedxBadWires() [2/2]

CDCDedxBadWires ( const std::vector< double > &  badwires)
inlineexplicit

Constructor.

Definition at line 41 of file CDCDedxBadWires.h.

41: m_badwires(badwires) {};

◆ ~CDCDedxBadWires()

~CDCDedxBadWires ( )
inline

Destructor.

Definition at line 46 of file CDCDedxBadWires.h.

46{};

Member Function Documentation

◆ getBadWireStatus()

bool getBadWireStatus ( int  wire) const
inline

Return wire gain.

Parameters
wirenumber

Definition at line 64 of file CDCDedxBadWires.h.

65 {
66 if (wire < 0 || (unsigned)wire >= m_badwires.size()) {
67 B2WARNING("Asking for a CDC Wire that is not found!");
68 }
69
70 bool status = kFALSE;
71 if (m_badwires[wire] == 0)return kTRUE;
72 return status;
73 }

◆ printBadWireStatus()

void printBadWireStatus ( bool  save = true,
std::string  sfx = "local" 
) const
inline

print all wire numbers

Definition at line 78 of file CDCDedxBadWires.h.

79 {
80
81 std::ofstream fBadWires;
82 if (save)fBadWires.open(Form("cdcdedx_badwires_%s.txt", sfx.c_str()));
83
84 unsigned int badcount = 0, goodcount = 0;
85 std::cout << "List of bad wires" << std::endl;
86
87 for (int jwire = 0; jwire < 14336; jwire++) {
88 if (m_badwires.at(jwire) == 0) {
89 badcount++;
90 std::cout << "\t" << badcount << ": wire # " << jwire << std::endl;
91 if (save)fBadWires << jwire << "\n";
92 } else goodcount++;
93 }
94
95 if ((badcount + goodcount) != m_badwires.size())
96 std::cout << "Wire sum is not 14336" << std::endl;
97 else
98 std::cout << "\t Total bad wires # " << badcount << std::endl;
99
100 fBadWires.close();
101 }

◆ setBadWireStatus()

void setBadWireStatus ( int  wire,
bool  status 
)
inline

Set wire gain.

Definition at line 51 of file CDCDedxBadWires.h.

52 {
53 if (wire < 0 || (unsigned)wire >= m_badwires.size())
54 B2WARNING("Asking for a CDC Wire that is not found!");
55 else {
56 if (status)m_badwires[wire] = 1.0;
57 else m_badwires[wire] = 0.0;
58 }
59 }

Member Data Documentation

◆ m_badwires

std::vector<double> m_badwires
private

dE/dx gains for each wire

Definition at line 105 of file CDCDedxBadWires.h.


The documentation for this class was generated from the following file: