Belle II Software  release-08-01-10
TOPPackerModule.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/core/Module.h>
12 #include <top/geometry/TOPGeometryPar.h>
13 #include <top/RawDataTypes.h>
14 #include <string>
15 
16 namespace Belle2 {
28  class TOPPackerModule : public Module {
29 
30  public:
31 
36 
40  virtual ~TOPPackerModule();
41 
46  virtual void initialize() override;
47 
52  virtual void beginRun() override;
53 
57  virtual void event() override;
58 
63  virtual void endRun() override;
64 
69  virtual void terminate() override;
70 
71  private:
72 
77  void packProductionDraft();
78 
83  void packType0Ver16();
84 
88  void packProductionDebug();
89 
93  unsigned short sumShorts(unsigned int x) const
94  {
95  return x + (x >> 16);
96  }
97 
98  std::string m_inputDigitsName;
99  std::string m_inputRawDigitsName;
100  std::string m_outputRawDataName;
101  std::string m_format;
102  TOP::RawDataType m_dataType = TOP::RawDataType::c_Draft;
106  };
107 
109 } // Belle2 namespace
110 
Base class for Modules.
Definition: Module.h:72
std::string m_format
data format
std::string m_inputDigitsName
name of TOPDigit store array
unsigned short sumShorts(unsigned int x) const
sum both 16-bit words of 32-bit integer
TOP::RawDataType m_dataType
enum for data format
std::string m_outputRawDataName
name of RawTOP store array
std::string m_inputRawDigitsName
name of TOPRawDigit store array
TOP::TOPGeometryPar * m_topgp
geometry
Singleton class for TOP Geometry Parameters.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
virtual void initialize() override
Initialize the Module.
void packProductionDraft()
Pack in format: c_Draft (tentative production format) this format was never implemented in firmware!
void packProductionDebug()
Pack in format: Production Debugging Data Format 01.
virtual void event() override
Event processor.
virtual ~TOPPackerModule()
Destructor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
TOPPackerModule()
Constructor.
void packType0Ver16()
Pack in format: c_Type0Ver16 (Feature-extracted data) this format was never implemented in firmware!
Abstract base class for different kinds of events.