Belle II Software development
LinearGlobalADCCountTranslator.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 <cdc/translators/ADCCountTranslatorBase.h>
12
13namespace Belle2 {
18 namespace CDC {
21 public:
23 explicit LinearGlobalADCCountTranslator(const float conversionFactor = 3.2 * 1e-8) :
24 m_conversionFactor(conversionFactor)
25 {}
26
29
31 float getCharge(unsigned short adcCount,
32 const WireID&,
33 bool,
34 float, float)
35 {
36 // const float EnergyLossOffset = 1.6 * 1e-8; // GeV
37 // return (adcCount * m_conversionFactor + EnergyLossOffset);
38
39 //round-down -> round-up to be consistent with real adc module
40 return (static_cast<float>(adcCount) - 0.5) * m_conversionFactor;
41 }
42
43 private:
46 };
47 }
49}
Abstract Base class for the ADC count translator.
This class simply assumes a linear translation through (0,0)
LinearGlobalADCCountTranslator(const float conversionFactor=3.2 *1e-8)
Constructor with a default calibration constant.
float getCharge(unsigned short adcCount, const WireID &, bool, float, float)
just multiply with the conversion factor and return.
float m_conversionFactor
Conversion factor as determined from calibration.
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Abstract base class for different kinds of events.