 |
Belle II Software
release-05-02-19
|
12 #include <klm/eklm/modules/EKLMADC/EKLMADCModule.h>
15 #include <klm/eklm/geometry/GeometryData.h>
16 #include <klm/simulation/ScintillatorSimulator.h>
19 #include <framework/gearbox/Unit.h>
28 static const char MemErr[] =
"Memory allocation error.";
37 setDescription(
"Standalone generation and studies of ADC output.");
39 addParam(
"OutputFile",
m_out,
"Output file.", std::string(
"EKLMADC.root"));
41 std::string(
"Strips"));
58 }
catch (std::bad_alloc& ba) {
65 fe.generatePhotoelectrons(l, d, npe, 0,
false);
66 fe.generatePhotoelectrons(l, d, npe, 0,
true);
67 fe.fillSiPMOutput(
m_hDir,
true,
false);
68 fe.fillSiPMOutput(
m_hRef,
false,
true);
73 h->SetBinContent(j, (
m_hDir[j - 1] +
m_hRef[j - 1]) / s);
87 B2FATAL(
"EKLM digitization parameters are not available.");
92 }
catch (std::bad_alloc& ba) {
101 if (
m_mode.compare(
"Strips") == 0) {
104 snprintf(str, 32,
"h%d_near", i);
106 snprintf(str, 32,
"h%d_far", i);
109 }
else if (
m_mode.compare(
"Shape") == 0) {
113 B2FATAL(
"Unknown operation mode.");
float * m_hDir
Direct histogram.
Digitize EKLMSim2Hits to get EKLM StripHits.
void setDescription(const std::string &description)
Sets the description of the module.
std::string m_mode
Operation mode.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
TFile * m_fout
Output file.
std::string m_out
Name of output file.
int getNDigitizations() const
Get number of digitizations (points) in one sample.
void beginRun() override
Called when entering a new run.
float getADCSamplingTime() const
Get ADC sampling time in ns.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void event() override
This method is called for each event.
int getNStrips() const
Get number of strips.
Abstract base class for different kinds of events.
double getStripLength(int strip) const
Get strip length.
Class to store KLM scintillator simulation parameters in the database.
EKLMADCModule()
Constructor.
KLMScintillatorDigitizationParameters * m_SciSimPar
Scintillator simulation parameters.
DBObjPtr< KLMScintillatorDigitizationParameters > m_SciSimParDatabase
Scintillator simulation parameters.
void generateHistogram(const char *name, double l, double d, int npe)
Generate output histogram.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
static const double mm
[millimeters]
void terminate() override
This method is called at the end of the event processing.
void setMirrorReflectiveIndex(float reflectiveIndex)
Set mirror reflective index.
~EKLMADCModule()
Destructor.
void endRun() override
This method is called if the current run ends.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
void initialize() override
Initializer.
float * m_hRef
Reflected histogram.