Belle II Software  release-05-02-19
KLMDigitizerModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Timofey Uglov, Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/dataobjects/bklm/BKLMSimHit.h>
15 #include <klm/dataobjects/eklm/EKLMSimHit.h>
16 #include <klm/dataobjects/eklm/EKLMElementNumbers.h>
17 #include <klm/dataobjects/KLMDigit.h>
18 #include <klm/dataobjects/KLMElementNumbers.h>
19 #include <klm/dbobjects/eklm/EKLMChannels.h>
20 #include <klm/dbobjects/KLMChannelStatus.h>
21 #include <klm/dbobjects/KLMScintillatorDigitizationParameters.h>
22 #include <klm/dbobjects/KLMStripEfficiency.h>
23 #include <klm/dbobjects/KLMTimeConversion.h>
24 #include <klm/simulation/ScintillatorFirmware.h>
25 
26 /* Belle 2 headers. */
27 #include <framework/core/Module.h>
28 #include <framework/database/DBObjPtr.h>
29 #include <framework/datastore/StoreArray.h>
30 
31 namespace Belle2 {
43  class KLMDigitizerModule : public Module {
44 
45  public:
46 
51 
55  virtual ~KLMDigitizerModule();
56 
60  virtual void initialize() override;
61 
65  virtual void beginRun() override;
66 
70  virtual void event() override;
71 
75  virtual void endRun() override;
76 
80  virtual void terminate() override;
81 
82  private:
83 
87  enum EfficiencyMode {
88 
90  c_Strip,
91 
93  c_Plane,
94 
95  };
96 
100  void checkChannelParameters();
101 
105  void digitizeBKLM();
106 
110  void digitizeEKLM();
111 
116  bool checkActive(uint16_t channel);
117 
123  bool efficiencyCorrection(float efficiency);
124 
127 
130 
133 
136 
139 
142 
145 
147  std::string m_SimulationMode;
148 
151 
154 
156  bool m_SaveFPGAFit;
157 
159  std::string m_Efficiency;
160 
163 
165  bool m_Debug;
166 
168  std::multimap<uint16_t, const BKLMSimHit*> m_bklmSimHitChannelMap;
169 
171  std::multimap<uint16_t, const BKLMSimHit*> m_bklmSimHitPlaneMap;
172 
174  std::multimap<uint16_t, const EKLMSimHit*> m_eklmSimHitChannelMap;
175 
177  std::multimap<uint16_t, const EKLMSimHit*> m_eklmSimHitPlaneMap;
178 
181 
184 
187 
190 
193 
194  };
195 
197 }
Belle2::KLMDigitizerModule::initialize
virtual void initialize() override
Initializer.
Definition: KLMDigitizerModule.cc:58
Belle2::KLMDigitizerModule::m_SaveFPGAFit
bool m_SaveFPGAFit
Save FPGA fit data (KLMScintillatorFirmwareFitResult).
Definition: KLMDigitizerModule.h:164
Belle2::KLMDigitizerModule::digitizeBKLM
void digitizeBKLM()
Digitization in BKLM.
Definition: KLMDigitizerModule.cc:150
Belle2::KLMDigitizerModule::m_SimulationMode
std::string m_SimulationMode
Simulation mode.
Definition: KLMDigitizerModule.h:155
Belle2::EKLMElementNumbers
EKLM element numbers.
Definition: EKLMElementNumbers.h:34
Belle2::KLMDigitizerModule::m_eklmSimHitPlaneMap
std::multimap< uint16_t, const EKLMSimHit * > m_eklmSimHitPlaneMap
Simulation hit map for EKLM (by plane).
Definition: KLMDigitizerModule.h:185
Belle2::KLMDigitizerModule::c_Plane
@ c_Plane
Plane.
Definition: KLMDigitizerModule.h:101
Belle2::KLMDigitizerModule::m_Digits
StoreArray< KLMDigit > m_Digits
KLM digits.
Definition: KLMDigitizerModule.h:197
Belle2::KLMDigitizerModule::efficiencyCorrection
bool efficiencyCorrection(float efficiency)
Efficiency correction.
Definition: KLMDigitizerModule.cc:142
Belle2::KLMDigitizerModule::m_bklmSimHitChannelMap
std::multimap< uint16_t, const BKLMSimHit * > m_bklmSimHitChannelMap
Simulation hit map for BKLM (by channel).
Definition: KLMDigitizerModule.h:176
Belle2::KLMDigitizerModule::m_DigitizationInitialTime
int m_DigitizationInitialTime
Initial digitization time in TDC periods.
Definition: KLMDigitizerModule.h:161
Belle2::KLMDigitizerModule::m_Efficiency
std::string m_Efficiency
Efficiency determination mode ("Strip" or "Plane").
Definition: KLMDigitizerModule.h:167
Belle2::KLMDigitizerModule::event
virtual void event() override
This method is called for each event.
Definition: KLMDigitizerModule.cc:277
Belle2::KLMDigitizerModule::m_StripEfficiency
DBObjPtr< KLMStripEfficiency > m_StripEfficiency
Strip efficiency.
Definition: KLMDigitizerModule.h:146
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::KLMDigitizerModule::m_eklmSimHitChannelMap
std::multimap< uint16_t, const EKLMSimHit * > m_eklmSimHitChannelMap
Simulation hit map for EKLM (by channel).
Definition: KLMDigitizerModule.h:182
Belle2::KLMDigitizerModule::m_ElementNumbers
const KLMElementNumbers * m_ElementNumbers
Element numbers.
Definition: KLMDigitizerModule.h:149
Belle2::KLMDigitizerModule::m_bklmSimHits
StoreArray< BKLMSimHit > m_bklmSimHits
BKLM simulation hits.
Definition: KLMDigitizerModule.h:191
Belle2::KLMDigitizerModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: KLMDigitizerModule.cc:111
Belle2::KLMDigitizerModule::m_Fitter
KLM::ScintillatorFirmware * m_Fitter
FPGA fitter.
Definition: KLMDigitizerModule.h:188
Belle2::KLMDigitizerModule::m_bklmSimHitPlaneMap
std::multimap< uint16_t, const BKLMSimHit * > m_bklmSimHitPlaneMap
Simulation hit map for BKLM (by plane).
Definition: KLMDigitizerModule.h:179
Belle2::KLMDigitizerModule::m_FPGAFits
StoreArray< KLMScintillatorFirmwareFitResult > m_FPGAFits
FPGA fits.
Definition: KLMDigitizerModule.h:200
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMDigitizerModule::~KLMDigitizerModule
virtual ~KLMDigitizerModule()
Destructor.
Definition: KLMDigitizerModule.cc:54
Belle2::KLMDigitizerModule::terminate
virtual void terminate() override
This method is called at the end of the event processing.
Definition: KLMDigitizerModule.cc:491
Belle2::KLMDigitizerModule::m_DigPar
DBObjPtr< KLMScintillatorDigitizationParameters > m_DigPar
Digitization parameters.
Definition: KLMDigitizerModule.h:134
Belle2::KLMDigitizerModule::m_EfficiencyMode
EfficiencyMode m_EfficiencyMode
Efficiency determination mode (converted from the string parameter).
Definition: KLMDigitizerModule.h:170
Belle2::KLMDigitizerModule::m_eklmSimHits
StoreArray< EKLMSimHit > m_eklmSimHits
EKLM simulation hits.
Definition: KLMDigitizerModule.h:194
Belle2::KLMDigitizerModule::digitizeEKLM
void digitizeEKLM()
Digitization in EKLM.
Definition: KLMDigitizerModule.cc:217
Belle2::KLMDigitizerModule::checkActive
bool checkActive(uint16_t channel)
Check if channel is active (status is not KLMChannelStatus::c_Dead).
Definition: KLMDigitizerModule.cc:133
Belle2::KLMDigitizerModule::m_TimeConversion
DBObjPtr< KLMTimeConversion > m_TimeConversion
Time conversion.
Definition: KLMDigitizerModule.h:137
Belle2::KLMDigitizerModule::c_Strip
@ c_Strip
Strip.
Definition: KLMDigitizerModule.h:98
Belle2::KLM::ScintillatorFirmware
FPGA fitter class.
Definition: ScintillatorFirmware.h:33
Belle2::KLMDigitizerModule::m_eklmElementNumbers
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
Definition: KLMDigitizerModule.h:152
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::KLMDigitizerModule::m_Debug
bool m_Debug
Use debug mode in EKLM::ScintillatorSimulator or not.
Definition: KLMDigitizerModule.h:173
Belle2::KLMDigitizerModule::KLMDigitizerModule
KLMDigitizerModule()
Constructor.
Definition: KLMDigitizerModule.cc:30
Belle2::KLMDigitizerModule::checkChannelParameters
void checkChannelParameters()
Check channel parameters for channel-specific simulation.
Definition: KLMDigitizerModule.cc:84
Belle2::KLMDigitizerModule::m_ChannelSpecificSimulation
bool m_ChannelSpecificSimulation
Whether the simulation is channel-specific.
Definition: KLMDigitizerModule.h:158
Belle2::KLMDigitizerModule::EfficiencyMode
EfficiencyMode
Efficiency determination mode.
Definition: KLMDigitizerModule.h:95
Belle2::KLMDigitizerModule::m_ChannelStatus
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
Definition: KLMDigitizerModule.h:143
Belle2::KLMDigitizerModule::m_Channels
DBObjPtr< EKLMChannels > m_Channels
Channel data.
Definition: KLMDigitizerModule.h:140
Belle2::KLMDigitizerModule::endRun
virtual void endRun() override
This method is called if the current run ends.
Definition: KLMDigitizerModule.cc:486