Belle II Software  release-05-02-19
TOPPackerModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <top/geometry/TOPGeometryPar.h>
15 #include <top/RawDataTypes.h>
16 #include <string>
17 
18 namespace Belle2 {
30  class TOPPackerModule : public Module {
31 
32  public:
33 
38 
42  virtual ~TOPPackerModule();
43 
48  virtual void initialize() override;
49 
54  virtual void beginRun() override;
55 
59  virtual void event() override;
60 
65  virtual void endRun() override;
66 
71  virtual void terminate() override;
72 
73  private:
74 
79  void packProductionDraft();
80 
85  void packType0Ver16();
86 
90  void packProductionDebug();
91 
95  unsigned short sumShorts(unsigned int x) const
96  {
97  return x + (x >> 16);
98  }
99 
100  std::string m_inputDigitsName;
101  std::string m_inputRawDigitsName;
102  std::string m_outputRawDataName;
103  std::string m_format;
104  TOP::RawDataType m_dataType = TOP::RawDataType::c_Draft;
108  };
109 
111 } // Belle2 namespace
112 
Belle2::TOPPackerModule::m_inputRawDigitsName
std::string m_inputRawDigitsName
name of TOPRawDigit store array
Definition: TOPPackerModule.h:109
Belle2::TOPPackerModule::sumShorts
unsigned short sumShorts(unsigned int x) const
sum both 16-bit words of 32-bit integer
Definition: TOPPackerModule.h:103
Belle2::TOPPackerModule::event
virtual void event() override
Event processor.
Definition: TOPPackerModule.cc:103
Belle2::TOPPackerModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPPackerModule.cc:127
Belle2::TOPPackerModule::packProductionDraft
void packProductionDraft()
Pack in format: c_Draft (tentative production format) this format was never implemented in firmware!
Definition: TOPPackerModule.cc:132
Belle2::TOPPackerModule::packType0Ver16
void packType0Ver16()
Pack in format: c_Type0Ver16 (Feature-extracted data) this format was never implemented in firmware!
Definition: TOPPackerModule.cc:201
Belle2::TOPPackerModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPPackerModule.cc:99
Belle2::TOP::TOPGeometryPar::Instance
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
Definition: TOPGeometryPar.cc:45
Belle2::TOPPackerModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TOPPackerModule.cc:123
Belle2::TOPPackerModule::m_topgp
TOP::TOPGeometryPar * m_topgp
geometry
Definition: TOPPackerModule.h:114
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPPackerModule::m_inputDigitsName
std::string m_inputDigitsName
name of TOPDigit store array
Definition: TOPPackerModule.h:108
Belle2::TOPPackerModule::packProductionDebug
void packProductionDebug()
Pack in format: Production Debugging Data Format 01.
Definition: TOPPackerModule.cc:295
Belle2::TOPPackerModule::TOPPackerModule
TOPPackerModule()
Constructor.
Definition: TOPPackerModule.cc:48
Belle2::TOPPackerModule::~TOPPackerModule
virtual ~TOPPackerModule()
Destructor.
Definition: TOPPackerModule.cc:66
Belle2::TOPPackerModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPPackerModule.cc:70
Belle2::TOPPackerModule::m_format
std::string m_format
data format
Definition: TOPPackerModule.h:111
Belle2::TOP::TOPGeometryPar
Singleton class for TOP Geometry Parameters.
Definition: TOPGeometryPar.h:47
Belle2::TOPPackerModule::m_dataType
TOP::RawDataType m_dataType
enum for data format
Definition: TOPPackerModule.h:112
Belle2::TOPPackerModule::m_outputRawDataName
std::string m_outputRawDataName
name of RawTOP store array
Definition: TOPPackerModule.h:110