Belle II Software development
CDCDedxWireGain.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/logging/Logger.h>
12
13#include <TObject.h>
14
15namespace Belle2 {
25 class CDCDedxWireGain: public TObject {
26
27 public:
28
33
37 explicit CDCDedxWireGain(const std::vector<double>& wiregains): m_wiregains(wiregains) {};
38
43
48 {
49 for (unsigned int bin = 0; bin < m_wiregains.size(); ++bin) {
50 m_wiregains[bin] *= rhs.getWireGain(bin);
51 }
52 return *this;
53 }
54
58 void setWireGain(int wire, double gain)
59 {
60 if (wire < 0 || (unsigned)wire >= m_wiregains.size())
61 B2WARNING("Asking for a CDC Wire that is not found!");
62 else m_wiregains[wire] = gain;
63 }
64
68 float getWireGain(int wire) const
69 {
70 if (wire < 0 || (unsigned)wire >= m_wiregains.size()) {
71 B2WARNING("Asking for a CDC Wire that is not found!");
72 return 1.0;
73 }
74 double gain = m_wiregains[wire];
75 return gain;
76 };
77
78 private:
83 std::vector<double> m_wiregains;
87 };
89} // end namespace Belle2
dE/dx wire gain calibration constants
CDCDedxWireGain()
Default constructor.
ClassDef(CDCDedxWireGain, 5)
ClassDef.
float getWireGain(int wire) const
Return wire gain.
CDCDedxWireGain(const std::vector< double > &wiregains)
Constructor.
CDCDedxWireGain & operator*=(CDCDedxWireGain const &rhs)
Combine payloads.
~CDCDedxWireGain()
Destructor.
std::vector< double > m_wiregains
Note, we are using dense packed wire number (0-14336) defined as follows: const int iwire = (superlay...
void setWireGain(int wire, double gain)
Set wire gain.
Abstract base class for different kinds of events.