Belle II Software  release-05-01-25
LinearGlobalADCCountTranslator.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Heck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef LINEARGLOBALADCCOUNTTRANSLATOR_H
12 #define LINEARGLOBALADCCOUNTTRANSLATOR_H
13 
14 #include <cdc/dataobjects/ADCCountTranslatorBase.h>
15 
16 namespace Belle2 {
21  namespace CDC {
23  class LinearGlobalADCCountTranslator : public ADCCountTranslatorBase {
24  public:
26  explicit LinearGlobalADCCountTranslator(const float conversionFactor = 3.2 * 1e-8) :
27  m_conversionFactor(conversionFactor)
28  {}
29 
32 
34  float getCharge(unsigned short adcCount,
35  const WireID&,
36  bool,
37  float, float)
38  {
39  // const float EnergyLossOffset = 1.6 * 1e-8; // GeV
40  // return (adcCount * m_conversionFactor + EnergyLossOffset);
41 
42  //round-down -> round-up to be consistent with real adc module
43  return (static_cast<float>(adcCount) - 0.5) * m_conversionFactor;
44  }
45 
46  private:
48  float m_conversionFactor;
49  };
50  }
52 }
53 #endif /* LINEARGLOBALADCCOUNTTRANSLATOR_H */
Belle2::WireID
Class to identify a wire inside the CDC.
Definition: WireID.h:44
Belle2::CDC::LinearGlobalADCCountTranslator::getCharge
float getCharge(unsigned short adcCount, const WireID &, bool, float, float)
just multiply with the conversion factor and return.
Definition: LinearGlobalADCCountTranslator.h:42
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDC::LinearGlobalADCCountTranslator::~LinearGlobalADCCountTranslator
~LinearGlobalADCCountTranslator()
Destructor.
Definition: LinearGlobalADCCountTranslator.h:39
Belle2::CDC::LinearGlobalADCCountTranslator::LinearGlobalADCCountTranslator
LinearGlobalADCCountTranslator(const float conversionFactor=3.2 *1e-8)
Constructor with a default calibration constant.
Definition: LinearGlobalADCCountTranslator.h:34
Belle2::CDC::LinearGlobalADCCountTranslator::m_conversionFactor
float m_conversionFactor
Conversion factor as determined from calibration.
Definition: LinearGlobalADCCountTranslator.h:56