Belle II Software development
KLMDigitizerModule.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/* KLM headers. */
12#include <klm/dataobjects/KLMDigit.h>
13#include <klm/dataobjects/KLMElementNumbers.h>
14#include <klm/dataobjects/KLMSimHit.h>
15#include <klm/dbobjects/KLMChannelStatus.h>
16#include <klm/dbobjects/KLMElectronicsMap.h>
17#include <klm/dbobjects/KLMScintillatorDigitizationParameters.h>
18#include <klm/dbobjects/KLMScintillatorFEEParameters.h>
19#include <klm/dbobjects/KLMScintillatorFirmware.h>
20#include <klm/dbobjects/KLMStripEfficiency.h>
21#include <klm/rawdata/RawData.h>
22#include <klm/simulation/ScintillatorFirmware.h>
23#include <klm/time/KLMTime.h>
24
25/* Basf2 headers. */
26#include <framework/core/Module.h>
27#include <framework/database/DBObjPtr.h>
28#include <framework/datastore/StoreArray.h>
29
30namespace Belle2 {
39 class KLMDigitizerModule : public Module {
40
41 public:
42
47
52
56 void initialize() override;
57
61 void beginRun() override;
62
66 void event() override;
67
71 void endRun() override;
72
76 void terminate() override;
77
78 private:
79
84
87
90
91 };
92
97
101 void digitizeRPC();
102
107
111 void digitizeAsic();
112
117 bool checkActive(KLMChannelNumber channel);
118
124 bool efficiencyCorrection(float efficiency);
125
128
131
134
137
140
143
146
149
151 std::string m_SimulationMode;
152
155
158
161
163 std::string m_Efficiency;
164
167
170
173
176
178 std::multimap<KLMPlaneNumber, const KLMSimHit*> m_MapPlaneSimHit;
179
181 std::multimap<KLMChannelNumber, const KLMSimHit*> m_MapChannelSimHit;
182
184 std::multimap<KLMElectronicsChannel, const KLMSimHit*> m_MapAsicSimHit;
185
187 KLMDigit* m_AsicDigits[KLM::c_NChannelsAsic];
188
190 std::multimap<KLMChannelNumber, const KLMSimHit*>::iterator
191 m_AsicDigitSimHitsLowerBound[KLM::c_NChannelsAsic];
192
194 std::multimap<KLMChannelNumber, const KLMSimHit*>::iterator
195 m_AsicDigitSimHitsUpperBound[KLM::c_NChannelsAsic];
196
199
202
205
208
209 };
210
212}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
KLM digitization module.
std::multimap< KLMElectronicsChannel, const KLMSimHit * > m_MapAsicSimHit
Simulation hit map (by ASIC).
std::multimap< KLMPlaneNumber, const KLMSimHit * > m_MapPlaneSimHit
Simulation hit map (by plane).
KLMDigit * m_AsicDigits[KLM::c_NChannelsAsic]
Digits corresponding to ASIC channels.
EfficiencyMode m_EfficiencyMode
Efficiency determination mode (converted from the string parameter).
StoreArray< KLMDigit > m_Digits
KLM digits.
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
DBObjPtr< KLMScintillatorFEEParameters > m_FEEPar
Scintillator FEE parameters.
void initialize() override
Initializer.
bool m_CreateMultiStripDigitsByRun
Whether to create multi-strip digits for one particular run.
bool efficiencyCorrection(float efficiency)
Efficiency correction.
void event() override
This method is called for each event.
const KLMElementNumbers * m_ElementNumbers
Element numbers.
bool m_SaveFPGAFit
Save FPGA fit data (KLMScintillatorFirmwareFitResult).
bool checkActive(KLMChannelNumber channel)
Check if channel is active (status is not KLMChannelStatus::c_Dead).
void endRun() override
This method is called if the current run ends.
DBObjPtr< KLMScintillatorDigitizationParameters > m_DigPar
Scintillator digitization parameters.
std::multimap< KLMChannelNumber, const KLMSimHit * > m_MapChannelSimHit
Simulation hit map (by channel).
void terminate() override
This method is called at the end of the event processing.
EfficiencyMode
Efficiency determination mode.
bool m_Debug
Use debug mode in EKLM::ScintillatorSimulator or not.
StoreArray< KLMSimHit > m_SimHits
Simulation hits.
void digitizeRPC()
Digitization in RPCs.
int m_DigitizationInitialTime
Initial digitization time in CTIME periods.
std::multimap< KLMChannelNumber, constKLMSimHit * >::iterator m_AsicDigitSimHitsUpperBound[KLM::c_NChannelsAsic]
Simulation hits upper bound for ASIC digit.
void digitizeScintillator()
Digitization in scintillators.
void checkScintillatorFEEParameters()
Check scintillator FEE parameters for channel-specific simulation.
std::string m_Efficiency
Efficiency determination mode ("Strip" or "Plane").
void beginRun() override
Called when entering a new run.
DBObjPtr< KLMScintillatorFirmware > m_ScintillatorFirmware
Scintillator FEE firmware version.
DBObjPtr< KLMElectronicsMap > m_ElectronicsMap
Electronics map.
std::multimap< KLMChannelNumber, constKLMSimHit * >::iterator m_AsicDigitSimHitsLowerBound[KLM::c_NChannelsAsic]
Simulation hits lower bound for ASIC digit.
void digitizeAsic()
Digitization in ASIC.
StoreArray< KLMScintillatorFirmwareFitResult > m_FPGAFits
FPGA fits.
bool m_ChannelSpecificSimulation
Whether the simulation is channel-specific.
KLMTime * m_Time
Time conversion.
bool m_CreateMultiStripDigits
Whether to create multi-strip digits.
DBObjPtr< KLMStripEfficiency > m_StripEfficiency
Strip efficiency.
KLM::ScintillatorFirmware * m_Fitter
FPGA fitter.
std::string m_SimulationMode
Simulation mode.
KLM element numbers.
KLM time conversion.
Definition: KLMTime.h:27
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
uint16_t KLMChannelNumber
Channel number.
Abstract base class for different kinds of events.