Belle II Software development
ECLDigitizerModule Class Reference

The ECLDigitizer module. More...

#include <ECLDigitizerModule.h>

Inheritance diagram for ECLDigitizerModule:
Module PathElement

Classes

struct  calibration_t
 calibration constants per channel More...
 
struct  crystallinks_t
 Indices in arrays with info on ECL channels. More...
 

Public Types

enum  EModulePropFlags {
  c_Input = 1 ,
  c_Output = 2 ,
  c_ParallelProcessingCertified = 4 ,
  c_HistogramManager = 8 ,
  c_InternalSerializer = 16 ,
  c_TerminateInAllProcesses = 32 ,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 ECLDigitizerModule ()
 Constructor.
 
 ~ECLDigitizerModule () override
 Destructor.
 
virtual void initialize () override
 Initialize variables.
 
virtual void beginRun () override
 Nothing so far.
 
virtual void event () override
 Actual digitization of all hits in the ECL.
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
virtual void endRun ()
 This method is called if the current run ends.
 
virtual void terminate ()
 This method is called at the end of the event processing.
 
const std::string & getName () const
 Returns the name of the module.
 
const std::string & getType () const
 Returns the type of the module (i.e.
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module.
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties.
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level.
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module.
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module.
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module.
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true.
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished.
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module.
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T>
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter.
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module.
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module.
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters.
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python.
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side.
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module.
 
void setType (const std::string &type)
 Set the module type.
 
template<typename T>
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module.
 
template<typename T>
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module.
 
void setReturnValue (int value)
 Sets the return value for this module as integer.
 
void setReturnValue (bool value)
 Sets the return value for this module as bool.
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Private Types

using algoparams_t = ECL::EclConfiguration::algoparams_t
 algorithm parameters
 
using fitparams_t = ECL::EclConfiguration::fitparams_t
 fit parameters
 
using signalsample_t = ECL::EclConfiguration::signalsample_t
 signal sample
 
using adccounts_t = ECL::EclConfiguration::adccounts_t
 ADC counts.
 
using int_array_192x16_t = fitparams_t::int_array_192x16_t
 weighting coefficients for time and amplitude calculation
 
using int_array_24x16_t
 weighting coefficients amplitude calculation.
 
using uint_pair_t = std::pair<unsigned int, unsigned int>
 a pair of unsigned ints
 

Private Member Functions

void shapeFitterWrapper (const int j, const int *FitA, const int m_ttrig, int &m_lar, int &m_ltr, int &m_lq, int &m_chi) const
 function wrapper for waveform fit
 
void callbackHadronSignalShapes ()
 callback hadron signal shapes from database
 
void readDSPDB ()
 read Shaper-DSP data from root file
 
void shapeSignals ()
 Emulate response of energy deposition in a crystal and attached photodiode and make waveforms.
 
void makeWaveforms ()
 Produce and compress waveforms for beam background overlay.
 
void repack (const ECLWFAlgoParams &, algoparams_t &)
 repack waveform fit parameters from ROOT format to plain array of unsigned short for the shapeFitter function
 
void getfitparams (const ECLWaveformData &, const ECLWFAlgoParams &, fitparams_t &)
 load waveform fit parameters for the shapeFitter function
 
void makeElectronicNoiseAndPedestal (int j, int *FitA)
 fill the waveform array FitA by electronic noise and bias it for channel J [0-8735]
 
std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects.
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary.
 

Private Attributes

std::vector< crystallinks_tm_tbl
 Lookup table for ECL channels.
 
std::vector< algoparams_tm_idn
 Fit algorithm parameters shared by group of crystals.
 
std::vector< fitparams_tm_fitparams
 Pairs of (waveform parameters, fit parameters)
 
std::vector< ECLNoiseDatam_noise
 parameters for correlated noise simulation
 
std::vector< signalsample_tm_ss
 tabulated shape line
 
std::vector< signalsample_tm_ss_HadronShapeSimulations
 tabulated shape line for hadron shape simulations
 
std::vector< adccounts_tm_adc
 Storage for adc hits from entire calorimeter (8736 crystals)
 
std::vector< calibration_tm_calib
 Storage for calibration constants.
 
std::vector< double > m_Awave
 Storage for waveform saving thresholds.
 
unsigned char m_ttime [ECL::ECL_CRATES] = {}
 storage for trigger time in each ECL.
 
bool m_loadOnce = true
 Always load waveform parameters at least once.
 
DBObjPtr< ECLDigitWaveformParametersForMCm_waveformParametersMC
 Hadron signal shapes.
 
DBObjPtr< TTree > m_waveformParameters
 CellID-specific signal shapes.
 
DBObjPtr< TTree > m_algoParameters
 Shape fitting algorithm parameters.
 
DBObjPtr< TTree > m_noiseParameters
 Electronics noise covariance matrix.
 
DBObjPtr< ECLCrystalCalibm_CrystalElectronics {"ECLCrystalElectronics"}
 Crystal electronics.
 
DBObjPtr< ECLCrystalCalibm_CrystalEnergy {"ECLCrystalEnergy"}
 Crystal energy.
 
DBObjPtr< ECLCrystalCalibm_CrystalElectronicsTime {"ECLCrystalElectronicsTime"}
 Crystal electronics time.
 
DBObjPtr< ECLCrystalCalibm_CrystalTimeOffset {"ECLCrystalTimeOffset"}
 Crystal time offset.
 
DBObjPtr< ECLCrystalCalibm_CrateTimeOffset {"ECLCrateTimeOffset"}
 Crate time offset.
 
DBObjPtr< ECLCrystalCalibm_MCTimeOffset {"ECLMCTimeOffset"}
 MC time offset.
 
DBObjPtr< ECLCrystalCalibm_FPGAWaveform {"ECL_FPGA_StoreWaveform"}
 FPGA waveform.
 
StoreObjPtr< EventMetaDatam_EventMetaData
 Event metadata.
 
StoreArray< ECLHitm_eclHits
 Hits array.
 
StoreArray< ECLHitm_eclDiodeHits
 Diode hits array.
 
StoreArray< ECLSimHitm_eclSimHits
 SimHits array.
 
StoreObjPtr< ECLWaveformsm_eclWaveforms
 Compressed waveforms.
 
StoreArray< ECLDigitm_eclDigits
 Output Arrays.
 
StoreArray< ECLDspm_eclDsps
 Generated waveforms.
 
StoreArray< ECLDspWithExtraMCInfom_eclDspsWithExtraMCInfo
 Generated waveforms with extra MC information.
 
StoreArray< ECLTrigm_eclTrigs
 Trigger information.
 
ECL::ECLChannelMapper m_eclMapper
 Channel Mapper.
 
bool m_background
 Module parameters.
 
bool m_calibration
 calibration flag
 
bool m_inter
 internuclear counter effect
 
bool m_waveformMaker
 produce only waveform digits
 
bool m_storeDspWithExtraMCInfo
 DSP with extra info flag.
 
unsigned int m_compAlgo
 compression algorithm for background waveforms
 
int m_ADCThreshold
 ADC threshold for wavefom fits.
 
double m_WaveformThresholdOverride
 If gt 0, value will override ECL_FPGA_StoreWaveform and apply value (in GeV) as threshold for all crystals for waveform saving.
 
double m_DspWithExtraMCInfoThreshold
 Energy threshold above which to store DSPs with extra information.
 
bool m_trigTime
 Use trigger time from beam background overlay.
 
std::string m_eclWaveformsName
 name of background waveforms storage
 
bool m_HadronPulseShape
 hadron pulse shape flag
 
bool m_dspDataTest
 DSP data usage flag.
 
bool m_useWaveformParameters
 If true, use m_waveformParameters, m_algoParameters, m_noiseParameters.
 
double m_unitscale
 Normalization coefficient for ECL signal shape.
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

The ECLDigitizer module.

This module is responsible to digitize all hits found in the ECL from ECLHit First, we simulate the sampling array by waveform and amplitude of hit, and smear this sampling array by corresponding error matrix. We then fit the array as hardware of shaper DSP board to obtain the fit result of amplitude, time and quality. The initial parameters of fit and algorithm are same as hardware. This module outputs two array which are ECLDsp and ECLDigit. An additional array with more MC information for ECLDsp studies is created upon user request.

\correlationdiagram ECLHit = graph.data('ECLHit') ECLDigit = graph.data('ECLDigit') ECLDsp = graph.data('ECLDsp')

graph.module('ECLDigitizer', [ECLHit], [ECLDigit,ECLDsp]) graph.relation(ECLDigitizer, ECLHit) graph.relation(ECLDigitizer, ECLDigit) graph.relation(ECLDigitizer, ECLDsp) graph.relation(ECLDigitizer, ECLDspWithExtraMCInfo) \endcorrelationdiagram

Definition at line 70 of file ECLDigitizerModule.h.

Member Typedef Documentation

◆ adccounts_t

ADC counts.

Definition at line 98 of file ECLDigitizerModule.h.

◆ algoparams_t

algorithm parameters

Definition at line 95 of file ECLDigitizerModule.h.

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.h.

◆ fitparams_t

fit parameters

Definition at line 96 of file ECLDigitizerModule.h.

◆ int_array_192x16_t

using int_array_192x16_t = fitparams_t::int_array_192x16_t
private

weighting coefficients for time and amplitude calculation

Definition at line 100 of file ECLDigitizerModule.h.

◆ int_array_24x16_t

using int_array_24x16_t
private
Initial value:
int int_array_24x16_t[m_ndt/4][16]
Array for DSP coefs in fast fit.

weighting coefficients amplitude calculation.

Time is fixed by trigger

Definition at line 101 of file ECLDigitizerModule.h.

◆ signalsample_t

signal sample

Definition at line 97 of file ECLDigitizerModule.h.

◆ uint_pair_t

using uint_pair_t = std::pair<unsigned int, unsigned int>
private

a pair of unsigned ints

Definition at line 103 of file ECLDigitizerModule.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 77 of file Module.h.

77 {
78 c_Input = 1,
79 c_Output = 2,
80 c_ParallelProcessingCertified = 4,
81 c_HistogramManager = 8,
82 c_InternalSerializer = 16,
83 c_TerminateInAllProcesses = 32,
84 c_DontCollectStatistics = 64,
85 };
@ c_Output
Output Process.
Definition ProcHelper.h:19
@ c_Input
Input Process.
Definition ProcHelper.h:17

Constructor & Destructor Documentation

◆ ECLDigitizerModule()

Constructor.

Definition at line 50 of file ECLDigitizerModule.cc.

50 : Module(), m_waveformParametersMC("ECLDigitWaveformParametersForMC"),
51 m_waveformParameters("ECLWFParameters"),
52 m_algoParameters("ECLWFAlgoParams"),
53 m_noiseParameters("ECLWFNoiseParams")
54{
55 //Set module properties
56 setDescription("Creates ECLDigiHits from ECLHits.");
58 addParam("TriggerTime", m_trigTime,
59 "Flag to use crate trigger times from beam background overlay if there are any (default: false)", false);
60 addParam("Background", m_background, "Flag to use the Digitizer configuration with backgrounds (default: false)", false);
61 addParam("Calibration", m_calibration, "Flag to use the Digitizer for Waveform fit Covariance Matrix calibration (default: false)",
62 false);
63 addParam("DiodeDeposition", m_inter,
64 "Flag to take into account energy deposition in photodiodes; Default diode is sensitive detector (default: true)", true);
65 addParam("WaveformMaker", m_waveformMaker, "Flag to produce background waveform digits (default: false)", false);
66 addParam("CompressionAlgorithm", m_compAlgo, "Waveform compression algorithm (default: 0u)", 0u);
67 addParam("eclWaveformsName", m_eclWaveformsName, "Name of the output/input collection (digitized waveforms)", string(""));
68 addParam("HadronPulseShapes", m_HadronPulseShape, "Flag to include hadron component in pulse shape construction (default: true)",
69 true);
70 addParam("ADCThreshold", m_ADCThreshold, "ADC threshold for waveform fits (default: 25)", 25);
71 addParam("WaveformThresholdOverride", m_WaveformThresholdOverride,
72 "If gt 0 value is applied to all crystals for waveform saving threshold. If lt 0 dbobject is used. (GeV)", -1.0);
73 addParam("StoreDspWithExtraMCInfo", m_storeDspWithExtraMCInfo,
74 "Flag to store Dsp with extra MC information in addition to normal Dsp (default: false)", false);
75 addParam("DspWithExtraMCInfoThreshold", m_DspWithExtraMCInfoThreshold,
76 "Threshold above with to store Dsp with extra MC information [GeV]",
77 0.02);
78 addParam("DspDataTest", m_dspDataTest,
79 "Use DSP coefficients from the database for the processing. This "
80 "will significantly reduce performance so this option is to be "
81 "used for testing only.", false);
82 addParam("useWaveformParameters", m_useWaveformParameters,
83 "Use ECLWF{Parameters,AlgoParams,NoiseParams} payloads", true);
84 addParam("unitscale", m_unitscale,
85 "Normalization coefficient for ECL signal shape. "
86 "If positive, use same static value for all ECL channels. "
87 "If negative, calculate dynamically at beginRun().", -1.0);
88
89}
int m_ADCThreshold
ADC threshold for wavefom fits.
double m_unitscale
Normalization coefficient for ECL signal shape.
DBObjPtr< TTree > m_algoParameters
Shape fitting algorithm parameters.
bool m_dspDataTest
DSP data usage flag.
double m_WaveformThresholdOverride
If gt 0, value will override ECL_FPGA_StoreWaveform and apply value (in GeV) as threshold for all cry...
DBObjPtr< TTree > m_waveformParameters
CellID-specific signal shapes.
double m_DspWithExtraMCInfoThreshold
Energy threshold above which to store DSPs with extra information.
bool m_background
Module parameters.
unsigned int m_compAlgo
compression algorithm for background waveforms
bool m_HadronPulseShape
hadron pulse shape flag
bool m_trigTime
Use trigger time from beam background overlay.
bool m_useWaveformParameters
If true, use m_waveformParameters, m_algoParameters, m_noiseParameters.
bool m_calibration
calibration flag
bool m_storeDspWithExtraMCInfo
DSP with extra info flag.
DBObjPtr< TTree > m_noiseParameters
Electronics noise covariance matrix.
DBObjPtr< ECLDigitWaveformParametersForMC > m_waveformParametersMC
Hadron signal shapes.
bool m_waveformMaker
produce only waveform digits
std::string m_eclWaveformsName
name of background waveforms storage
bool m_inter
internuclear counter effect
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition Module.cc:208
Module()
Constructor.
Definition Module.cc:30
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559

◆ ~ECLDigitizerModule()

~ECLDigitizerModule ( )
override

Destructor.

Definition at line 91 of file ECLDigitizerModule.cc.

92{
93}

Member Function Documentation

◆ beginRun()

void beginRun ( void )
overridevirtual

Nothing so far.

Reimplemented from Module.

Definition at line 129 of file ECLDigitizerModule.cc.

130{
131 const EclConfiguration& ec = EclConfiguration::get();
132 double ns_per_tick = 1.0 / (4.0 * ec.getRF()) * 1e3;// ~0.49126819903043308239 ns/tick
133
135 readDSPDB();
136 m_loadOnce = false;
137 }
138
139 calibration_t def = {1, 0};
141
142 if (m_CrystalElectronics.isValid()) {
143 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
144 m_calib[i].ascale /= m_CrystalElectronics->getCalibVector()[i];
145 }
146 if (m_CrystalEnergy.isValid()) {
147 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
148 m_calib[i].ascale /= m_CrystalEnergy->getCalibVector()[i] * 20000.0;
149 }
150 if (m_CrystalElectronicsTime.isValid()) {
151 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
152 m_calib[i].tshift += m_CrystalElectronicsTime->getCalibVector()[i] * ns_per_tick;
153 }
154 if (m_CrystalTimeOffset.isValid()) {
155 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
156 m_calib[i].tshift += m_CrystalTimeOffset->getCalibVector()[i] * ns_per_tick;
157 }
158 if (m_CrateTimeOffset.isValid()) {
159 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
160 m_calib[i].tshift += m_CrateTimeOffset->getCalibVector()[i] * ns_per_tick;
161 }
162 if (m_MCTimeOffset.isValid()) {
163 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
164 m_calib[i].tshift += m_MCTimeOffset->getCalibVector()[i] * ns_per_tick;
165 }
168 if (m_FPGAWaveform.isValid()) {
169 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
170 m_Awave[i] = m_FPGAWaveform->getCalibVector()[i];
171 }
172 } else {
173 //If m_WaveformThresholdOverride > 0 override ECL_FPGA_StoreWaveform;
174 for (int i = 0; i < ECLElementNumbers::c_NCrystals; i++)
175 m_Awave[i] = m_WaveformThresholdOverride * m_calib[i].ascale; // convert GeV to ADC
176 }
177
180
181 // Initialize channel mapper at run start to account for possible
182 // changes in ECL mapping between runs.
183 if (!m_eclMapper.initFromDB()) {
184 B2FATAL("ECLDigitizer: Can't initialize eclChannelMapper!");
185 }
186}
std::vector< calibration_t > m_calib
Storage for calibration constants.
void callbackHadronSignalShapes()
callback hadron signal shapes from database
ECL::ECLChannelMapper m_eclMapper
Channel Mapper.
DBObjPtr< ECLCrystalCalib > m_CrateTimeOffset
Crate time offset.
DBObjPtr< ECLCrystalCalib > m_MCTimeOffset
MC time offset.
std::vector< double > m_Awave
Storage for waveform saving thresholds.
DBObjPtr< ECLCrystalCalib > m_CrystalElectronicsTime
Crystal electronics time.
DBObjPtr< ECLCrystalCalib > m_CrystalElectronics
Crystal electronics.
DBObjPtr< ECLCrystalCalib > m_CrystalEnergy
Crystal energy.
DBObjPtr< ECLCrystalCalib > m_FPGAWaveform
FPGA waveform.
bool m_loadOnce
Always load waveform parameters at least once.
void readDSPDB()
read Shaper-DSP data from root file
DBObjPtr< ECLCrystalCalib > m_CrystalTimeOffset
Crystal time offset.
static EclConfiguration & get()
return this instance
static double getRF()
See m_rf.
const int c_NCrystals
Number of crystals.
calibration constants per channel

◆ callbackHadronSignalShapes()

void callbackHadronSignalShapes ( )
private

callback hadron signal shapes from database

Definition at line 526 of file ECLDigitizerModule.cc.

527{
528
529 if (m_waveformParametersMC.hasChanged()) {
530
532
533 //read MC templates from database
534 float photonParsPSD[10];
535 float hadronParsPSD[10];
536 float diodeParsPSD[10];
537 for (int i = 0; i < 10; i++) {
538 photonParsPSD[i] = m_waveformParametersMC->getPhotonParameters()[i + 1];
539 hadronParsPSD[i] = m_waveformParametersMC->getHadronParameters()[i + 1];
540 diodeParsPSD[i] = m_waveformParametersMC->getDiodeParameters()[i + 1];
541 }
542
543 //Initialize templates for hadron shape simulations
544 m_ss_HadronShapeSimulations[0].InitSample(photonParsPSD, m_waveformParametersMC->getPhotonParameters()[0]);
545 m_ss_HadronShapeSimulations[1].InitSample(hadronParsPSD, m_waveformParametersMC->getHadronParameters()[0]);
546 m_ss_HadronShapeSimulations[2].InitSample(diodeParsPSD, m_waveformParametersMC->getDiodeParameters()[0]);
547
548 }
549
550}
std::vector< signalsample_t > m_ss_HadronShapeSimulations
tabulated shape line for hadron shape simulations

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 179 of file Module.cc.

180{
183 newModule->setName(getName());
184 newModule->m_package = m_package;
185 newModule->m_propertyFlags = m_propertyFlags;
186 newModule->m_logConfig = m_logConfig;
187 newModule->m_conditions = m_conditions;
188
189 return newModule;
190}
std::shared_ptr< Module > registerModule(const std::string &moduleName, std::string sharedLibPath="") noexcept(false)
Creates an instance of a module and registers it to the ModuleManager.
static ModuleManager & Instance()
Exception is thrown if the requested module could not be created by the ModuleManager.
void setParameters(const ModuleParamList &params)
Set values for parameters from other parameter list.
const ModuleParamList & getParamList() const
Return module param list.
Definition Module.h:362
const std::string & getName() const
Returns the name of the module.
Definition Module.h:186
const std::string & getType() const
Returns the type of the module (i.e.
Definition Module.cc:41
unsigned int m_propertyFlags
The properties of the module as bitwise or (with |) of EModulePropFlags.
Definition Module.h:511
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition Module.h:515
void setName(const std::string &name)
Set the name of the module.
Definition Module.h:213
LogConfig m_logConfig
The log system configuration of the module.
Definition Module.h:513
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition Module.h:520
std::string m_package
Package this module is found in (may be empty).
Definition Module.h:509
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition Module.h:43

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 425 of file Module.h.

425{ beginRun(); }

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 438 of file Module.h.

438{ endRun(); }

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 431 of file Module.h.

431{ event(); }

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 419 of file Module.h.

419{ initialize(); }

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 444 of file Module.h.

444{ terminate(); }

◆ endRun()

virtual void endRun ( void )
inlinevirtualinherited

This method is called if the current run ends.

Use this method to store information, which should be aggregated over one run.

This method can be implemented by subclasses.

Reimplemented in AlignDQMModule, AnalysisPhase1StudyModule, arichBtestModule, ARICHDQMModule, AWESOMEBasicModule, B2BIIConvertMdstModule, B2BIIMCParticlesMonitorModule, B2BIIMdstInputModule, BeamabortModule, BeamabortStudyModule, BeamDigitizerModule, BeamBkgHitRateMonitorModule, BelleMCOutputModule, BgoDigitizerModule, BgoModule, BgoStudyModule, BKLMDigitAnalyzerModule, BKLMTrackingModule, CalibrationCollectorModule, CaveModule, CDCPackerModule, CDCUnpackerModule, CDCDedxDQMModule, CDCDedxValidationModule, CDCDQMModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CertifyParallelModule, ClawDigitizerModule, ClawModule, ClawStudyModule, ClawsDigitizerModule, CLAWSModule, ClawsStudyModule, Convert2RawDetModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DAQPerfModule, DeSerializerPXDModule, DosiDigitizerModule, DosiModule, DosiStudyModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEcmsMonObjModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisExampleModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisKLMModule, DQMHistAnalysisKLMMonObjModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistAnalysisTRGModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DqmHistoManagerModule, DQMHistOutputToEPICSModule, DQMHistReferenceModule, DQMHistSnapshotsModule, Ds2RawFileModule, Ds2RawModule, Ds2RbufModule, Ds2SampleModule, ECLBackgroundModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLShowerCorrectorModule, ECLSplitterN2Module, EffPlotsModule, ElapsedTimeModule, EventInfoPrinterModule, EventT0ValidationModule, EvReductionModule, EvtGenDecayModule, ExtModule, FANGSDigitizerModule, FANGSModule, FANGSStudyModule, FastRbuf2DsModule, TRGGDLUnpackerModule, GenfitVisModule, GenRawSendModule, GetEventFromSocketModule, He3DigitizerModule, He3tubeModule, He3tubeStudyModule, HistoManagerModule, HitXPModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, KLMDigitizerModule, KLMTrackingModule, KLMTriggerModule, MCMatcherTRGECLModule, MCTrackCandClassifierModule, MicrotpcModule, MicrotpcStudyModule, TpcDigitizerModule, TPCStudyModule, MonitorDataModule, MuidModule, NoKickCutsEvalModule, NtuplePhase1_v6Module, OverrideGenerationFlagsModule, PartialSeqRootReaderModule, Ph1bpipeModule, Ph1sustrModule, PhysicsObjectsDQMModule, PinDigitizerModule, PindiodeModule, PindiodeStudyModule, PlumeDigitizerModule, PlumeModule, PrintDataModule, PrintEventRateModule, PXDROIFinderModule, PyModule, QcsmonitorDigitizerModule, QcsmonitorModule, QcsmonitorStudyModule, RandomBarrierModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, ReceiveEventModule, ReprocessorModule, Root2BinaryModule, Root2RawModule, RT2SPTCConverterModule, RxSocketModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, SectorMapBootstrapModule, SeqRootInputModule, SeqRootMergerModule, SeqRootOutputModule, SerializerModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, SrsensorModule, StatisticsSummaryModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, SubEventModule, SVDClusterizerModule, SVDRecoDigitCreatorModule, SVDUnpackerModule, SVDB4CommissioningPlotsModule, SVDClusterCalibrationsMonitorModule, SVDClusterEvaluationModule, SVDClusterEvaluationTrueInfoModule, SVDDataFormatCheckModule, svdDumpModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsMonitorModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDPositionErrorScaleFactorImporterModule, SVDROIDQMModule, SVDROIFinderModule, SVDTimeCalibrationsMonitorModule, SVDUnpackerDQMModule, SwitchDataStoreModule, TOPBackgroundModule, TOPTBCComparatorModule, TOPUnpackerModule, TOPWaveformQualityPlotterModule, TrackAnaModule, TrackFinderMCTruthRecoTracksModule, TrackFinderVXDAnalizerModule, TrackingPerformanceEvaluationModule, FindletModule< AFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackFinderLegendre >, FindletModule< CDCHitsRemover >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< FacetCreator >, FindletModule< FacetCreator >, FindletModule< HitBasedT0Extractor >, FindletModule< HitBasedT0Extractor >, FindletModule< HitReclaimer >, FindletModule< HitReclaimer >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackExporter >, FindletModule< TrackFinder >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackLinker >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< TrackRejecter >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, FindletModule< WireHitPreparer >, TrackSetEvaluatorHopfieldNNDEVModule, TRGCDCETFUnpackerModule, TRGCDCModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSStreamModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLFAMModule, TRGECLModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLModule, TRGGDLSummaryModule, TRGGRLDQMModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLUnpackerModule, TRGRAWDATAModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TxModule, TxSocketModule, V0findingPerformanceEvaluationModule, vxdDigitMaskingModule, VXDSimpleClusterizerModule, ZMQTxInputModule, and ZMQTxWorkerModule.

Definition at line 165 of file Module.h.

165{};

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 96 of file Module.cc.

97{
98 if (m_conditions.empty()) return false;
99
100 //okay, a condition was set for this Module...
101 if (!m_hasReturnValue) {
102 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
103 }
104
105 for (const auto& condition : m_conditions) {
106 if (condition.evaluate(m_returnValue)) {
107 return true;
108 }
109 }
110 return false;
111}
int m_returnValue
The return value.
Definition Module.h:518
bool m_hasReturnValue
True, if the return value is set.
Definition Module.h:517

◆ event()

void event ( void )
overridevirtual

Actual digitization of all hits in the ECL.

The digitized hits are written into the DataStore.

Reimplemented from Module.

Definition at line 390 of file ECLDigitizerModule.cc.

391{
392 const EclConfiguration& ec = EclConfiguration::get();
393
394 // make relation between cellid and eclhits
395 struct ch_t {int cell, id;};
396 vector<ch_t> hitmap;
397 for (const auto& hit : m_eclHits) {
398 int j = hit.getCellId() - 1; //0~8735
399 if (hit.getBackgroundTag() == BackgroundMetaData::bg_none) hitmap.push_back({j, hit.getArrayIndex()});
400 // cout<<"C:"<<hit.getBackgroundTag()<<" "<<hit.getCellId()<<" "<<hit.getEnergyDep()<<" "<<hit.getTimeAve()<<endl;
401 }
402
403 bool isBGOverlay = m_eclWaveforms.isValid(), isTrigTime = false;
404 BitStream out;
405 ECLCompress* comp = nullptr;
406
407 // check background overlay
408 if (isBGOverlay) {
409 std::swap(out.getStore(), m_eclWaveforms->getStore());
410 out.setPos(0);
411 unsigned int compAlgo = out.getNBits(8);
412 comp = selectAlgo(compAlgo & 0x7f);
413 if (comp == nullptr)
414 B2FATAL("Unknown compression algorithm: " << compAlgo);
415 isTrigTime = compAlgo >> 7; // crate trigger times are stored and retrieved
416 if (isTrigTime) {
417 for (int i = 0; i < ECL::ECL_CRATES; i++) {
418 unsigned char t = out.getNBits(7); // [0..72)
419 m_ttime[i] = t;
420 }
421 }
422 }
423
424 if (!m_trigTime || !isTrigTime) { // reproduce previous logic -- one trigger time for all crates
425 int DeltaT = gRandom->Uniform(0, double(ec.m_ntrg) * 0.5); // trigger decision can come in any time [0..72)
426 for (int id = 0; id < ECL::ECL_CRATES; id++) m_ttime[id] = DeltaT;
427 }
428
429 int triggerTag0 = m_EventMetaData->getEvent();
430 for (int id = 0; id < ECL::ECL_CRATES; id++) {
431 auto eclTrig = m_eclTrigs.appendNew();
432 int triggerPhase0 = 2 * (m_ttime[id] + m_ttime[id] / 3);
433 eclTrig->setTrigId(id);
434 eclTrig->setTimeTrig(triggerPhase0);
435 eclTrig->setTrigTag(triggerTag0);
436 }
437
438 shapeSignals();
439
440 // We want to produce background waveforms in simulation first than
441 // dump to a disk, read from the disk to test before real data
442 if (m_waveformMaker) { makeWaveforms(); return; }
443
444 std::vector<int> FitA(ec.m_nsmp); // buffer for the waveform fitter
445
446 // loop over entire calorimeter
447 for (int j = 0; j < ec.m_nch; j++) {
448 const adccounts_t& a = m_adc[j];
449
450 //normalize the MC true arrival times
451 if (m_adc[j].totalDep > 0) {
452 m_adc[j].flighttime /= m_adc[j].totalDep;
453 m_adc[j].timeshift /= m_adc[j].totalDep;
454 m_adc[j].timetosensor /= m_adc[j].totalDep;
455 }
456
457 // if background waveform is here there is no need to generate
458 // electronic noise since it is already in the waveform
459 if (isBGOverlay) {
460 comp->uncompress(out, FitA.data());
461 } else {
462 // Signal amplitude should be above 100 keV
463 if (a.total < 0.0001) continue;
464 makeElectronicNoiseAndPedestal(j, FitA.data());
465 }
466
467 for (int i = 0; i < ec.m_nsmp; i++) {
468 int A = 20000 * a.c[i] + FitA[i];
469 FitA[i] = max(0, min(A, (1 << 18) - 1));
470 }
471
472 int energyFit = 0; // fit output : Amplitude 18 bits
473 int tFit = 0; // fit output : T_ave 12 bits
474 int qualityFit = 0; // fit output : quality 2 bits
475 int chi = 0; // fit output : chi square it is not available in the experiment
476
477 int id = m_eclMapper.getCrateID(j + 1) - 1; // 0 .. 51
478 int ttrig = 2 * m_ttime[id];
479
480 shapeFitterWrapper(j, FitA.data(), ttrig, energyFit, tFit, qualityFit, chi);
481
482 if (energyFit > m_ADCThreshold) {
483 int CellId = j + 1;
484
485 //note energyFit and m_Awave is in ADC units
486 if (energyFit > m_Awave[CellId - 1]) {
487 //only save waveforms above ADC threshold
488 const auto eclDsp = m_eclDsps.appendNew();
489 eclDsp->setCellId(CellId);
490 eclDsp->setDspA(FitA.data());
491 }
492
493 // only store extra MC info if requested and above threshold
495 const auto eclDspWithExtraMCInfo = m_eclDspsWithExtraMCInfo.appendNew();
496 eclDspWithExtraMCInfo->setCellId(CellId);
497 eclDspWithExtraMCInfo->setDspA(FitA.data());
498 eclDspWithExtraMCInfo->setEnergyDep(a.totalDep);
499 eclDspWithExtraMCInfo->setHadronEnergyDep(a.totalHadronDep);
500 eclDspWithExtraMCInfo->setFlightTime(a.flighttime);
501 eclDspWithExtraMCInfo->setTimeShift(a.timeshift);
502 eclDspWithExtraMCInfo->setTimeToSensor(a.timetosensor);
503 eclDspWithExtraMCInfo->setEnergyConversion(a.energyConversion * 20000);
504 }
505
506 const auto eclDigit = m_eclDigits.appendNew();
507 eclDigit->setCellId(CellId); // cellId in range from 1 to 8736
508 eclDigit->setAmp(energyFit); // E (GeV) = energyFit/20000;
509 eclDigit->setTimeFit(tFit); // t0 (us)= (1520 - m_ltr)*24.*12/508/(3072/2) ;
510 eclDigit->setQuality(qualityFit);
511 if (qualityFit == 2)
512 eclDigit->setChi(chi);
513 else eclDigit->setChi(0);
514 for (const auto& hit : hitmap)
515 if (hit.cell == j) eclDigit->addRelationTo(m_eclHits[hit.id]);
516
517 // set relation to DspWithExtraInfo
518 for (auto& DspWithExtraMCInfo : m_eclDspsWithExtraMCInfo) {
519 if (eclDigit->getCellId() == DspWithExtraMCInfo.getCellId()) DspWithExtraMCInfo.addRelationTo(eclDigit);
520 }
521 }
522 } //store each crystal hit
523 if (comp) delete comp;
524}
StoreArray< ECLDsp > m_eclDsps
Generated waveforms.
void shapeSignals()
Emulate response of energy deposition in a crystal and attached photodiode and make waveforms.
StoreObjPtr< ECLWaveforms > m_eclWaveforms
Compressed waveforms.
StoreArray< ECLTrig > m_eclTrigs
Trigger information.
StoreArray< ECLDigit > m_eclDigits
Output Arrays.
void shapeFitterWrapper(const int j, const int *FitA, const int m_ttrig, int &m_lar, int &m_ltr, int &m_lq, int &m_chi) const
function wrapper for waveform fit
ECL::EclConfiguration::adccounts_t adccounts_t
ADC counts.
std::vector< adccounts_t > m_adc
Storage for adc hits from entire calorimeter (8736 crystals)
StoreArray< ECLDspWithExtraMCInfo > m_eclDspsWithExtraMCInfo
Generated waveforms with extra MC information.
StoreArray< ECLHit > m_eclHits
Hits array.
unsigned char m_ttime[ECL::ECL_CRATES]
storage for trigger time in each ECL.
void makeWaveforms()
Produce and compress waveforms for beam background overlay.
StoreObjPtr< EventMetaData > m_EventMetaData
Event metadata.
void makeElectronicNoiseAndPedestal(int j, int *FitA)
fill the waveform array FitA by electronic noise and bias it for channel J [0-8735]
virtual void uncompress(BitStream &in, int *adc)=0
Decompress the ECL waveform.
static constexpr int m_nch
total number of electronic channels (crystals) in calorimeter
static constexpr int m_ntrg
number of trigger counts per ADC clock tick
static constexpr int m_nsmp
number of ADC measurements for signal fitting

◆ exposePythonAPI()

void exposePythonAPI ( )
staticinherited

Exposes methods of the Module class to Python.

Definition at line 325 of file Module.cc.

326{
327 // to avoid confusion between std::arg and boost::python::arg we want a shorthand namespace as well
328 namespace bp = boost::python;
329
330 docstring_options options(true, true, false); //userdef, py sigs, c++ sigs
331
332 void (Module::*setReturnValueInt)(int) = &Module::setReturnValue;
333
334 enum_<Module::EAfterConditionPath>("AfterConditionPath",
335 R"(Determines execution behaviour after a conditional path has been executed:
336
337.. attribute:: END
338
339 End processing of this path after the conditional path. (this is the default for if_value() etc.)
340
341.. attribute:: CONTINUE
342
343 After the conditional path, resume execution after this module.)")
344 .value("END", Module::EAfterConditionPath::c_End)
345 .value("CONTINUE", Module::EAfterConditionPath::c_Continue)
346 ;
347
348 /* Do not change the names of >, <, ... we use them to serialize conditional paths */
349 enum_<Belle2::ModuleCondition::EConditionOperators>("ConditionOperator")
356 ;
357
358 enum_<Module::EModulePropFlags>("ModulePropFlags",
359 R"(Flags to indicate certain low-level features of modules, see :func:`Module.set_property_flags()`, :func:`Module.has_properties()`. Most useful flags are:
360
361.. attribute:: PARALLELPROCESSINGCERTIFIED
362
363 This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)
364
365.. attribute:: HISTOGRAMMANAGER
366
367 This module is used to manage histograms accumulated by other modules
368
369.. attribute:: TERMINATEINALLPROCESSES
370
371 When using parallel processing, call this module's terminate() function in all processes. This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.
372)")
373 .value("INPUT", Module::EModulePropFlags::c_Input)
374 .value("OUTPUT", Module::EModulePropFlags::c_Output)
375 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
376 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
377 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
378 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
379 ;
380
381 //Python class definition
382 class_<Module, PyModule> module("Module", R"(
383Base class for Modules.
384
385A module is the smallest building block of the framework.
386A typical event processing chain consists of a Path containing
387modules. By inheriting from this base class, various types of
388modules can be created. To use a module, please refer to
389:func:`Path.add_module()`. A list of modules is available by running
390``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
391given by e.g. ``basf2 -m RootInput``.
392
393The 'Module Development' section in the manual provides detailed information
394on how to create modules, setting parameters, or using return values/conditions:
395https://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
491 &Module::setLogConfig)
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
@ c_GT
Greater than: ">".
@ c_NE
Not equal: "!=".
@ c_EQ
Equal: "=" or "==".
@ c_ST
Smaller than: "<".
void if_value(const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
Add a condition to the module.
Definition Module.cc:79
void if_true(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to set the condition of the module.
Definition Module.cc:90
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition Module.cc:220
@ c_HistogramManager
This module is used to manage histograms accumulated by other modules.
Definition Module.h:81
@ c_Input
This module is an input module (reads data).
Definition Module.h:78
@ c_InternalSerializer
This module is an internal serializer/deserializer for parallel processing.
Definition Module.h:82
@ c_Output
This module is an output module (writes data).
Definition Module.h:79
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
Definition Module.h:83
void if_false(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to add a condition to the module.
Definition Module.cc:85
ModuleCondition::EAfterConditionPath EAfterConditionPath
Forward the EAfterConditionPath definition from the ModuleCondition.
Definition Module.h:88

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

134{
135 if (m_conditions.empty()) return EAfterConditionPath::c_End;
136
137 //okay, a condition was set for this Module...
138 if (!m_hasReturnValue) {
139 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
140 }
141
142 for (const auto& condition : m_conditions) {
143 if (condition.evaluate(m_returnValue)) {
144 return condition.getAfterConditionPath();
145 }
146 }
147
148 return EAfterConditionPath::c_End;
149}

◆ getAllConditionPaths()

std::vector< std::shared_ptr< Path > > getAllConditionPaths ( ) const
inherited

Return all condition paths currently set (no matter if the condition is true or not).

Definition at line 150 of file Module.cc.

151{
152 std::vector<std::shared_ptr<Path>> allConditionPaths;
153 for (const auto& condition : m_conditions) {
154 allConditionPaths.push_back(condition.getPath());
155 }
156
157 return allConditionPaths;
158}

◆ getAllConditions()

const std::vector< ModuleCondition > & getAllConditions ( ) const
inlineinherited

Return all set conditions for this module.

Definition at line 323 of file Module.h.

324 {
325 return m_conditions;
326 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

Return a pointer to the first condition (or nullptr, if none was set)

Definition at line 313 of file Module.h.

314 {
315 if (m_conditions.empty()) {
316 return nullptr;
317 } else {
318 return &m_conditions.front();
319 }
320 }

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).

Definition at line 113 of file Module.cc.

114{
115 PathPtr p;
116 if (m_conditions.empty()) return p;
117
118 //okay, a condition was set for this Module...
119 if (!m_hasReturnValue) {
120 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
121 }
122
123 for (const auto& condition : m_conditions) {
124 if (condition.evaluate(m_returnValue)) {
125 return condition.getPath();
126 }
127 }
128
129 // if none of the conditions were true, return a null pointer.
130 return p;
131}
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
Definition Path.h:35

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 201 of file Module.h.

201{return m_description;}

◆ getFileNames()

virtual std::vector< std::string > getFileNames ( bool outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Reimplemented in RootInputModule, RootOutputModule, and StorageRootOutputModule.

Definition at line 133 of file Module.h.

134 {
135 return std::vector<std::string>();
136 }

◆ getfitparams()

void getfitparams ( const ECLWaveformData & eclWFData,
const ECLWFAlgoParams & eclWFAlgo,
fitparams_t & p )
private

load waveform fit parameters for the shapeFitter function

Definition at line 736 of file ECLDigitizerModule.cc.

737{
738 const EclConfiguration& ec = EclConfiguration::get();
739
740 double ssd[16][16];
741 eclWFData.getMatrix(ssd);
742 vector<double> MP(10);
743 eclWFData.getWaveformParArray(MP.data());
744
745 // shape function parameters
746 int iff = 1 << 14; //Alex Bobrov for correct chi square
747
748 int ia = 1 << eclWFAlgo.getka();
749 int ib = 1 << eclWFAlgo.getkb();
750 int ic = 1 << eclWFAlgo.getkc();
751
752 double dbl_f [192][16];
753 double dbl_f1 [192][16];
754 double dbl_fg31[192][16];
755 double dbl_fg32[192][16];
756 double dbl_fg33[192][16];
757 double dbl_fg41[24][16];
758 double dbl_fg43[24][16];
759
760 int_array_192x16_t& ref_f = p.f;
761 int_array_192x16_t& ref_f1 = p.f1;
762 int_array_192x16_t& ref_fg31 = p.fg31;
763 int_array_192x16_t& ref_fg32 = p.fg32;
764 int_array_192x16_t& ref_fg33 = p.fg33;
765 int_array_24x16_t& ref_fg41 = p.fg41;
766 int_array_24x16_t& ref_fg43 = p.fg43;
767
768 // Dynamic normalization coefficient for shape function
769 double fm = 0;
770
771 double unitscale = 1.0;
772 if (m_unitscale > 0) unitscale = m_unitscale;
773
774 ShaperDSP_t dsp(MP, unitscale);
775 dsp.settimestride(ec.m_step);
776 dsp.setseedoffset(ec.m_step / ec.m_ndt);
777 dsp.settimeseed(-(ec.m_step - (ec.m_step / ec.m_ndt)));
778 vector<dd_t> f(16);
779 for (int k = 0; k < 2 * ec.m_ndt; k++, dsp.nextseed()) { // calculate fit parameters around 0 +- 1 ADC tick
780 dsp.fillvector(f);
781
782 double g0g0 = 0, g0g1 = 0, g1g1 = 0, g0g2 = 0, g1g2 = 0, g2g2 = 0;
783 double sg0[16], sg1[16], sg2[16];
784 for (int j = 0; j < 16; j++) {
785 double g0 = 0, g1 = 0, g2 = 0;
786 for (int i = 0; i < 16; i++) {
787 if (fm < f[i].first) fm = f[i].first;
788 g0 += ssd[j][i] * f[i].first;
789 g1 += ssd[j][i] * f[i].second;
790 g2 += ssd[j][i];
791 }
792 g0g0 += g0 * f[j].first;
793 g0g1 += g1 * f[j].first;
794 g1g1 += g1 * f[j].second;
795 g0g2 += g0;
796 g1g2 += g1;
797 g2g2 += g2;
798 sg0[j] = g0;
799 sg1[j] = g1;
800 sg2[j] = g2;
801 }
802
803 double a00 = g1g1 * g2g2 - g1g2 * g1g2;
804 double a11 = g0g0 * g2g2 - g0g2 * g0g2;
805 double a22 = g0g0 * g1g1 - g0g1 * g0g1;
806 double a01 = g1g2 * g0g2 - g0g1 * g2g2;
807 double a02 = g0g1 * g1g2 - g1g1 * g0g2;
808 double a12 = g0g1 * g0g2 - g0g0 * g1g2;
809
810 double igg2 = 1 / (a11 * g1g1 + g0g1 * a01 + g1g2 * a12);
811
812 // to fixed point representation
813 const double isd = 3. / 4., sd = 1 / isd ; // conversion factor (???)
814 for (int i = 0; i < 16; i++) {
815 double w = i ? 1.0 : 1. / 16.;
816
817 dbl_f [k][i] = (f[i].first * iff * w);
818 dbl_f1 [k][i] = (f[i].second * iff * w * sd);
819
820 double fg31 = (a00 * sg0[i] + a01 * sg1[i] + a02 * sg2[i]) * igg2;
821 double fg32 = (a01 * sg0[i] + a11 * sg1[i] + a12 * sg2[i]) * igg2;
822 double fg33 = (a02 * sg0[i] + a12 * sg1[i] + a22 * sg2[i]) * igg2;
823
824 dbl_fg31[k][i] = (fg31 * ia * w);
825 dbl_fg32[k][i] = (fg32 * ib * w * isd);
826 dbl_fg33[k][i] = (fg33 * ic * w);
827 }
828
829 //first approximation without time correction
830 int jk = 23 + ((48 - k) >> 2);
831 if (jk >= 0 && jk < 24 && (48 - k) % 4 == 0) {
832
833 double igg1 = 1 / a11;
834 // to fixed point
835 for (int i = 0; i < 16; i++) {
836 double w = i ? 1.0 : 1. / 16.;
837
838 double fg41 = (g2g2 * sg0[i] - g0g2 * sg2[i]) * igg1;
839 double fg43 = (g0g0 * sg2[i] - g0g2 * sg0[i]) * igg1;
840 dbl_fg41[jk][i] = (fg41 * ia * w);
841 dbl_fg43[jk][i] = (fg43 * ic * w);
842 }
843 }
844 }
845 // Ignore dynamically calculated normalization coefficient if
846 // unitscale is set to a static positive value.
847 if (m_unitscale > 0) fm = 1.0;
848 for (int k = 0; k < 2 * ec.m_ndt; k++) {
849 for (int j = 0; j < 16; j++) {
850 ref_f [k][j] = lrint(dbl_f [k][j] / fm);
851 ref_f1 [k][j] = lrint(dbl_f1 [k][j] / fm);
852 ref_fg31[k][j] = lrint(dbl_fg31[k][j] * fm);
853 ref_fg32[k][j] = lrint(dbl_fg32[k][j] * fm);
854 ref_fg33[k][j] = lrint(dbl_fg33[k][j]);
855 if (k >= 24) continue;
856 ref_fg41[k][j] = lrint(dbl_fg41[k][j] * fm);
857 ref_fg43[k][j] = lrint(dbl_fg43[k][j]);
858 }
859 }
860}
fitparams_t::int_array_192x16_t int_array_192x16_t
weighting coefficients for time and amplitude calculation
fitparams_t::int_array_24x16_t int_array_24x16_t
weighting coefficients amplitude calculation.
int getkc() const
getter for multipliers power of 2 for fg33,fg43
int getkb() const
getter for multipliers power of 2 for fg32
int getka() const
getter for multipliers power of 2 for fg31 fg41
void getMatrix(float M[16][16]) const
Getter method for all matrix as two dimensional array (floats)
void getWaveformParArray(float P[10]) const
Getter method for waveform shape parameters as one dimensional array of floats.
static constexpr double m_step
time between points in internal units t_{asrto}*m_rf/2.
static constexpr int m_ndt
number of points per ADC tick where signal fit procedure parameters are evaluated

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 224 of file Module.h.

224{return m_logConfig;}

◆ getModules()

std::list< ModulePtr > getModules ( ) const
inlineoverrideprivatevirtualinherited

no submodules, return empty list

Implements PathElement.

Definition at line 505 of file Module.h.

505{ return std::list<ModulePtr>(); }

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 186 of file Module.h.

186{return m_name;}

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 196 of file Module.h.

196{return m_package;}

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 279 of file Module.cc.

280{
282}
std::shared_ptr< boost::python::list > getParamInfoListPython() const
Returns a python list of all parameters.

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 362 of file Module.h.

362{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

193{
194
195 std::string output = getName();
196
197 for (const auto& condition : m_conditions) {
198 output += condition.getString();
199 }
200
201 return output;
202}

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 380 of file Module.h.

380{ return m_returnValue; }

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 41 of file Module.cc.

42{
43 if (m_type.empty())
44 B2FATAL("Module type not set for " << getName());
45 return m_type;
46}
std::string m_type
The type of the module, saved as a string.
Definition Module.h:508

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

Returns true if at least one condition was set for the module.

Definition at line 310 of file Module.h.

310{ return not m_conditions.empty(); };

◆ hasProperties()

bool hasProperties ( unsigned int propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 160 of file Module.cc.

161{
162 return (propertyFlags & m_propertyFlags) == propertyFlags;
163}

◆ hasReturnValue()

bool hasReturnValue ( ) const
inlineinherited

Return true if this module has a valid return value set.

Definition at line 377 of file Module.h.

377{ return m_hasReturnValue; }

◆ hasUnsetForcedParams()

bool hasUnsetForcedParams ( ) const
inherited

Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.

Definition at line 166 of file Module.cc.

167{
169 std::string allMissing = "";
170 for (const auto& s : missing)
171 allMissing += s + " ";
172 if (!missing.empty())
173 B2ERROR("The following required parameters of Module '" << getName() << "' were not specified: " << allMissing <<
174 "\nPlease add them to your steering file.");
175 return !missing.empty();
176}
std::vector< std::string > getUnsetForcedParams() const
Returns list of unset parameters (if they are required to have a value.

◆ if_false()

void if_false ( const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 85 of file Module.cc.

86{
87 if_value("<1", path, afterConditionPath);
88}

◆ if_true()

void if_true ( const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 90 of file Module.cc.

91{
92 if_value(">=1", path, afterConditionPath);
93}

◆ if_value()

void if_value ( const std::string & expression,
const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://xwiki.desy.de/xwiki/rest/p/a94f2 or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 79 of file Module.cc.

80{
81 m_conditions.emplace_back(expression, path, afterConditionPath);
82}

◆ initialize()

void initialize ( void )
overridevirtual

Initialize variables.

Reimplemented from Module.

Definition at line 95 of file ECLDigitizerModule.cc.

96{
97 m_eclDsps.registerInDataStore();
98 if (m_storeDspWithExtraMCInfo) m_eclDspsWithExtraMCInfo.registerInDataStore();
99 m_eclDigits.registerInDataStore();
100 m_eclTrigs.registerInDataStore();
101
102 if (m_HadronPulseShape) {
103 B2DEBUG(20,
104 "Hadron pulse shapes for ECL simulations are enabled. Pulse shape simulations use techniques validated with test beam data documented in: S. Longo and J. M. Roney 2018 JINST 13 P03018");
105 } else {
106 B2DEBUG(20, "Hadron pulse shapes for ECL simulations are disabled.");
107 }
108
109 if (m_inter) {
110 B2DEBUG(20, "Diode-crossing pulse shapes for ECL simulations are enabled.");
111 } else {
112 B2DEBUG(20, "Diode-crossing pulse shapes for ECL simulations are disabled.");
113 }
114
115 m_eclDiodeHits.registerInDataStore("ECLDiodeHits");
116
117 m_eclDsps.registerRelationTo(m_eclDigits);
119 m_eclDspsWithExtraMCInfo.registerRelationTo(m_eclDigits);
120 m_eclDigits.registerRelationTo(m_eclHits);
121 if (m_waveformMaker)
122 m_eclWaveforms.registerInDataStore(m_eclWaveformsName);
123
125
127}
StoreArray< ECLHit > m_eclDiodeHits
Diode hits array.
void setBackground(bool val)
set the background flag

◆ makeElectronicNoiseAndPedestal()

void makeElectronicNoiseAndPedestal ( int j,
int * FitA )
private

fill the waveform array FitA by electronic noise and bias it for channel J [0-8735]

Definition at line 351 of file ECLDigitizerModule.cc.

352{
353 const EclConfiguration& ec = EclConfiguration::get();
354 std::vector<float> z(ec.m_nsmp), AdcNoise(ec.m_nsmp); // buffers with electronic noise
355 // Noise generation
356 for (int i = 0; i < ec.m_nsmp; i++) z[i] = gRandom->Gaus(0, 1);
357 m_noise[m_tbl[J].inoise].generateCorrelatedNoise(z.data(), AdcNoise.data());
358 for (int i = 0; i < ec.m_nsmp; i++) FitA[i] = 20 * AdcNoise[i] + 3000;
359}
std::vector< crystallinks_t > m_tbl
Lookup table for ECL channels.
std::vector< ECLNoiseData > m_noise
parameters for correlated noise simulation

◆ makeWaveforms()

void makeWaveforms ( )
private

Produce and compress waveforms for beam background overlay.

Definition at line 361 of file ECLDigitizerModule.cc.

362{
363 const EclConfiguration& ec = EclConfiguration::get();
364 BitStream out(ec.m_nch * ec.m_nsmp * 18 / 32);
365 out.putNBits(m_compAlgo & 0xff, 8);
366 ECLCompress* comp = selectAlgo(m_compAlgo & 0xff);
367 if (comp == nullptr)
368 B2FATAL("Unknown compression algorithm: " << m_compAlgo);
369
370 std::vector<int> FitA(ec.m_nsmp); // buffer for the waveform fitter
371 // loop over entire calorimeter
372 for (int j = 0; j < ec.m_nch; j++) {
373 const adccounts_t& a = m_adc[j];
374 makeElectronicNoiseAndPedestal(j, FitA.data());
375 for (int i = 0; i < ec.m_nsmp; i++) {
376 int A = 20000 * a.c[i] + FitA[i];
377 FitA[i] = max(0, min(A, (1 << 18) - 1));
378 }
379 comp->compress(out, FitA.data());
380 }
381 out.resize();
382
383 ECLWaveforms* wf = new ECLWaveforms;
384 m_eclWaveforms.assign(wf);
385
386 std::swap(out.getStore(), wf->getStore());
387 delete comp;
388}
std::vector< unsigned int > & getStore()
get data
virtual void compress(BitStream &out, const int *adc)=0
Compress the ECL waveform.

◆ readDSPDB()

void readDSPDB ( )
private

read Shaper-DSP data from root file

Definition at line 552 of file ECLDigitizerModule.cc.

553{
554 const EclConfiguration& ec = EclConfiguration::get();
555
556 TFile* rootfile = nullptr;
557 TTree* tree = nullptr;
558 TTree* tree2 = nullptr;
559 TTree* tree3 = nullptr;
560
562 bool hasChanged = false;
563 hasChanged |= m_waveformParameters.hasChanged();
564 hasChanged |= m_algoParameters.hasChanged();
565 hasChanged |= m_noiseParameters.hasChanged();
566
567 if (!hasChanged) return;
568
569 tree = const_cast<TTree*>(&*m_waveformParameters);
570 tree2 = const_cast<TTree*>(&*m_algoParameters);
571 tree3 = const_cast<TTree*>(&*m_noiseParameters);
572 } else {
573 string dataFileName;
574 if (m_background) {
575 dataFileName = FileSystem::findFile("/data/ecl/ECL-WF-BG.root");
576 B2DEBUG(150, "ECLDigitizer: Reading configuration data with background from: " << dataFileName);
577 } else {
578 dataFileName = FileSystem::findFile("/data/ecl/ECL-WF.root");
579 B2DEBUG(150, "ECLDigitizer: Reading configuration data without background from: " << dataFileName);
580 }
581 assert(! dataFileName.empty());
582
583 rootfile = new TFile(dataFileName.c_str(), "read");
584 tree = static_cast<TTree*>(rootfile->Get("EclWF"));
585 tree2 = static_cast<TTree*>(rootfile->Get("EclAlgo"));
586 tree3 = static_cast<TTree*>(rootfile->Get("EclNoise"));
587 }
588
589 if (tree == 0 || tree2 == 0 || tree3 == 0) B2FATAL("Data not found");
590
591 m_tbl.resize(ec.m_nch);
592
593 const int maxncellid = 512;
594 int ncellId;
595 vector<int> cellId(maxncellid);//[ncellId] buffer for crystal identification number
596
597 tree->SetBranchAddress("ncellId", &ncellId);
598 tree->SetBranchAddress("cellId", cellId.data());
599
600 vector<int> eclWaveformDataTable(ec.m_nch);
601 for (Long64_t j = 0, jmax = tree->GetEntries(); j < jmax; j++) {
602 tree->GetEntry(j);
603 assert(ncellId <= maxncellid);
604 for (int i = 0; i < ncellId; ++i)
605 eclWaveformDataTable[cellId[i] - 1] = j;
606 }
607 B2DEBUG(150, "ECLDigitizer: " << tree->GetEntries() << " sets of wave form covariance matrices will be used.");
608
609 ECLWFAlgoParams* algo = new ECLWFAlgoParams;
610 tree2->SetBranchAddress("Algopars", &algo);
611 tree2->SetBranchAddress("ncellId", &ncellId);
612 tree2->SetBranchAddress("cellId", cellId.data());
613 Long64_t jmax2 = tree2->GetEntries();
614 vector<ECLWFAlgoParams> eclWFAlgoParams;
615 eclWFAlgoParams.reserve(jmax2);
616 for (Long64_t j = 0; j < jmax2; j++) {
617 tree2->GetEntry(j);
618 assert(ncellId <= maxncellid);
619 eclWFAlgoParams.push_back(*algo);
620 for (int i = 0; i < ncellId; ++i)
621 m_tbl[cellId[i] - 1].idn = j;
622 }
623 if (algo) delete algo;
624 B2DEBUG(150, "ECLDigitizer: " << eclWFAlgoParams.size() << " parameter sets of fitting algorithm were read.");
625
626 ECLNoiseData* noise = new ECLNoiseData;
627 tree3->SetBranchAddress("NoiseM", &noise);
628 tree3->SetBranchAddress("ncellId", &ncellId);
629 tree3->SetBranchAddress("cellId", cellId.data());
630
631 Long64_t jmax3 = tree3->GetEntries();
632 m_noise.reserve(jmax3);
633 for (Long64_t j = 0; j < jmax3; j++) {
634 tree3->GetEntry(j);
635 assert(ncellId <= maxncellid);
636 m_noise.push_back(*noise);
637 if (ncellId == 0) {
638 for (int i = 0; i < ec.m_nch; i++)
639 m_tbl[i].inoise = 0;
640 break;
641 } else {
642 for (int i = 0; i < ncellId; ++i)
643 m_tbl[cellId[i] - 1].inoise = j;
644 }
645 }
646 if (noise) delete noise;
647 B2DEBUG(150, "ECLDigitizer: " << eclWFAlgoParams.size() << " noise matrices were loaded.");
648
649 // repack fitting algorithm parameters
650 m_idn.resize(eclWFAlgoParams.size());
651 for (int i = 0, imax = eclWFAlgoParams.size(); i < imax; i++)
652 repack(eclWFAlgoParams[i], m_idn[i]);
653
654 vector<uint_pair_t> pairIdx;
655 for (int i = 0; i < ec.m_nch; i++) {
656 unsigned int wfIdx = eclWaveformDataTable[i];
657 unsigned int algoIdx = m_tbl[i].idn;
658 uint_pair_t p(wfIdx, algoIdx);
659 vector<uint_pair_t>::iterator ip = find(pairIdx.begin(), pairIdx.end(), p);
660 if (ip != pairIdx.end()) { // crystal i already have the same parameters as before
661 m_tbl[i].ifunc = ip - pairIdx.begin();
662 } else { // new combination of parameters
663 m_tbl[i].ifunc = pairIdx.size();
664 pairIdx.push_back(p);
665 }
666 }
667
668 // now we know how many distinct elements of the (Waveform x AlgoParams) matrix should be
669 m_fitparams.resize(pairIdx.size());
670
671 ECLWaveformData* eclWFData = new ECLWaveformData;
672 tree->SetBranchAddress("CovarianceM", &eclWFData);
673 tree->SetBranchStatus("ncellId", 0); // do not read it at the moment
674 tree->SetBranchStatus("cellId", 0); // do not read it at the moment
675
676 // fill parameters for each (Waveform x AlgoParams) parameter set
677 for (unsigned int ip = 0; ip < pairIdx.size(); ip++) {
678 const uint_pair_t& p = pairIdx[ip];
679 tree->GetEntry(p.first); // retrieve data to eclWFData pointer
680 getfitparams(*eclWFData, eclWFAlgoParams[p.second], m_fitparams[ip]);
681 }
682 B2DEBUG(150, "ECLDigitizer: " << m_fitparams.size() << " fitting crystals groups were created.");
683
684 // at the moment there is only one sampled signal shape in the pool
685 // since all shaper parameters are the same for all crystals
686 m_ss.resize(2);
687 float MP[10]; eclWFData->getWaveformParArray(MP);
688 m_ss[0].InitSample(MP, 27.7221);
689 // parameters vector from ps.dat file, time offset 0.5 usec added to
690 // have peak position with parameters from ps.dat roughly in the
691 // same place as in current MC
692 // double crystal_params[10] = {0.5, 0.301298, 0.631401, 0.470911, 0.903988, -0.11734200/19.5216, 2.26567, 0.675393, 0.683995, 0.0498786};
693 // m_ss[0].InitSample(crystal_params, 0.9999272*19.5216);
694 for (int i = 0; i < ec.m_nch; i++) m_tbl[i].iss = 0;
695 // one sampled diode response in the pool, parameters vector from
696 // pg.dat file, time offset 0.5 usec added to have peak position with
697 // parameters from ps.dat roughly in the same place as in current MC
698 const double diode_params[] = {0 + 0.5, 0.100002, 0.756483, 0.456153, 0.0729031, 0.3906 / 9.98822, 2.85128, 0.842469, 0.854184, 0.110284};
699 m_ss[1].InitSample(diode_params, 0.9569100 * 9.98822);
700
701 B2DEBUG(150, "ECLDigitizer: " << m_ss.size() << " sampled signal templates were created.");
702
703 delete eclWFData;
704
705 if (!m_useWaveformParameters) rootfile->Close();
706}
std::vector< algoparams_t > m_idn
Fit algorithm parameters shared by group of crystals.
std::pair< unsigned int, unsigned int > uint_pair_t
a pair of unsigned ints
std::vector< fitparams_t > m_fitparams
Pairs of (waveform parameters, fit parameters)
void getfitparams(const ECLWaveformData &, const ECLWFAlgoParams &, fitparams_t &)
load waveform fit parameters for the shapeFitter function
void repack(const ECLWFAlgoParams &, algoparams_t &)
repack waveform fit parameters from ROOT format to plain array of unsigned short for the shapeFitter ...
std::vector< signalsample_t > m_ss
tabulated shape line
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...

◆ repack()

void repack ( const ECLWFAlgoParams & eclWFAlgo,
algoparams_t & t )
private

repack waveform fit parameters from ROOT format to plain array of unsigned short for the shapeFitter function

Definition at line 708 of file ECLDigitizerModule.cc.

709{
710 // filling short int array
711 t.id[ 0] = eclWFAlgo.getlAT() + 128;
712 t.id[ 1] = eclWFAlgo.getsT() + 128;
713 t.id[ 2] = eclWFAlgo.gethT();
714 t.id[ 3] = 17952;
715 t.id[ 4] = 19529;
716 t.id[ 5] = 69;
717 t.id[ 6] = 0;
718 t.id[ 7] = 0;
719 t.id[ 8] = 257;
720 t.id[ 9] = -1;
721 t.id[10] = 0;
722 t.id[11] = 0;
723
724 // filling unsigned char array
725 t.ic[12 * 2 + 0] = eclWFAlgo.getk1();
726 t.ic[12 * 2 + 1] = eclWFAlgo.getk2();
727 t.ic[13 * 2 + 0] = eclWFAlgo.getka();
728 t.ic[13 * 2 + 1] = eclWFAlgo.getkb();
729 t.ic[14 * 2 + 0] = eclWFAlgo.getkc();
730 t.ic[14 * 2 + 1] = eclWFAlgo.gety0s() - 16;
731
732 // again, filling short int array
733 t.id[15] = eclWFAlgo.getcT();
734}
int getlAT() const
getter for the threshold to calculate time
int getsT() const
getter for the threshold to send data to collector
int getcT() const
getter for the chi2 threshold for quality bit
int getk1() const
getter for the multipliers power of 2 for f
int getk2() const
getter for multipliers power of 2 for chi2 calculation
int gethT() const
getter for the hardware threshold
int gety0s() const
getter for the start point for pedestal calculation

◆ setAbortLevel()

void setAbortLevel ( int abortLevel)
inherited

Configure the abort log level.

Definition at line 67 of file Module.cc.

68{
69 m_logConfig.setAbortLevel(static_cast<LogConfig::ELogLevel>(abortLevel));
70}
ELogLevel
Definition of the supported log levels.
Definition LogConfig.h:26
void setAbortLevel(ELogLevel abortLevel)
Configure the abort level.
Definition LogConfig.h:112

◆ setDebugLevel()

void setDebugLevel ( int debugLevel)
inherited

Configure the debug messaging level.

Definition at line 61 of file Module.cc.

62{
63 m_logConfig.setDebugLevel(debugLevel);
64}
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
Definition LogConfig.h:98

◆ setDescription()

void setDescription ( const std::string & description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 214 of file Module.cc.

215{
216 m_description = description;
217}
std::string m_description
The description of the module.
Definition Module.h:510

◆ setLogConfig()

void setLogConfig ( const LogConfig & logConfig)
inlineinherited

Set the log system configuration.

Definition at line 229 of file Module.h.

229{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int logLevel,
unsigned int logInfo )
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 73 of file Module.cc.

74{
75 m_logConfig.setLogInfo(static_cast<LogConfig::ELogLevel>(logLevel), logInfo);
76}
void setLogInfo(ELogLevel logLevel, unsigned int logInfo)
Configure the printed log information for the given level.
Definition LogConfig.h:127

◆ setLogLevel()

void setLogLevel ( int logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

56{
57 m_logConfig.setLogLevel(static_cast<LogConfig::ELogLevel>(logLevel));
58}
void setLogLevel(ELogLevel logLevel)
Configure the log level.
Definition LogConfig.cc:25

◆ setName()

void setName ( const std::string & name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 213 of file Module.h.

213{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList & params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 500 of file Module.h.

500{ m_moduleParamList = params; }

◆ setParamPython()

void setParamPython ( const std::string & name,
const boost::python::object & pyObj )
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 234 of file Module.cc.

235{
236 LogSystem& logSystem = LogSystem::Instance();
237 logSystem.updateModule(&(getLogConfig()), getName());
238 try {
240 } catch (std::runtime_error& e) {
241 throw std::runtime_error("Cannot set parameter '" + name + "' for module '"
242 + m_name + "': " + e.what());
243 }
244
245 logSystem.updateModule(nullptr);
246}
void updateModule(const LogConfig *moduleLogConfig=nullptr, const std::string &moduleName="")
Sets the log configuration to the given module log configuration and sets the module name This method...
Definition LogSystem.h:200
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition LogSystem.cc:28
LogConfig & getLogConfig()
Returns the log system configuration.
Definition Module.h:224
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition Module.h:507
void setParamPython(const std::string &name, const PythonObject &pyObj)
Implements a method for setting boost::python objects.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict & dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 249 of file Module.cc.

250{
251
252 LogSystem& logSystem = LogSystem::Instance();
253 logSystem.updateModule(&(getLogConfig()), getName());
254
255 boost::python::list dictKeys = dictionary.keys();
256 int nKey = boost::python::len(dictKeys);
257
258 //Loop over all keys in the dictionary
259 for (int iKey = 0; iKey < nKey; ++iKey) {
260 boost::python::object currKey = dictKeys[iKey];
261 boost::python::extract<std::string> keyProxy(currKey);
262
263 if (keyProxy.check()) {
264 const boost::python::object& currValue = dictionary[currKey];
265 setParamPython(keyProxy, currValue);
266 } else {
267 B2ERROR("Setting the module parameters from a python dictionary: invalid key in dictionary!");
268 }
269 }
270
271 logSystem.updateModule(nullptr);
272}
void setParamPython(const std::string &name, const boost::python::object &pyObj)
Implements a method for setting boost::python objects.
Definition Module.cc:234

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 208 of file Module.cc.

209{
210 m_propertyFlags = propertyFlags;
211}

◆ setReturnValue() [1/2]

void setReturnValue ( bool value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 227 of file Module.cc.

228{
229 m_hasReturnValue = true;
230 m_returnValue = value;
231}

◆ setReturnValue() [2/2]

void setReturnValue ( int value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 220 of file Module.cc.

221{
222 m_hasReturnValue = true;
223 m_returnValue = value;
224}

◆ setType()

void setType ( const std::string & type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 48 of file Module.cc.

49{
50 if (!m_type.empty())
51 B2FATAL("Trying to change module type from " << m_type << " is not allowed, the value is assumed to be fixed.");
52 m_type = type;
53}

◆ shapeFitterWrapper()

void shapeFitterWrapper ( const int j,
const int * FitA,
const int m_ttrig,
int & m_lar,
int & m_ltr,
int & m_lq,
int & m_chi ) const
private

function wrapper for waveform fit

Definition at line 189 of file ECLDigitizerModule.cc.

191{
192 const crystallinks_t& t = m_tbl[j]; //lookup table [0,8735]
193 const fitparams_t& r = m_fitparams[t.ifunc];
194
195 ECLShapeFit result;
196
197 if (!m_dspDataTest) {
198 const short int* id = m_idn[t.idn].id;
199
200 int A0 = (int) * (id + 0) - 128;
201 int Askip = (int) * (id + 1) - 128;
202
203 int Ahard = (int) * (id + 2);
204 int k_a = (int) * (reinterpret_cast<const unsigned char*>(id) + 26);
205 int k_b = (int) * (reinterpret_cast<const unsigned char*>(id) + 27);
206 int k_c = (int) * (reinterpret_cast<const unsigned char*>(id) + 28);
207 int k_16 = (int) * (reinterpret_cast<const unsigned char*>(id) + 29);
208 int k1_chi = (int) * (reinterpret_cast<const unsigned char*>(id) + 24);
209 int k2_chi = (int) * (reinterpret_cast<const unsigned char*>(id) + 25);
210
211 int chi_thres = (int) * (id + 15);
212
213 int trg_time = ttrig;
214
215 result = lftda_(reinterpret_cast<const int*>(r.f), reinterpret_cast<const int*>(r.f1), reinterpret_cast<const int*>(r.fg41),
216 reinterpret_cast<const int*>(r.fg43),
217 reinterpret_cast<const int*>(r.fg31), reinterpret_cast<const int*>(r.fg32), reinterpret_cast<const int*>(r.fg33), FitA,
218 trg_time, A0, Ahard, Askip, k_a, k_b, k_c, k_16, k1_chi,
219 k2_chi, chi_thres);
220 } else {
221 std::vector<int> adc(31);
222 for (int i = 0; i < 31; i++) adc[i] = FitA[i];
223 // NOTE: ttrig_packed is any even number in set {8*Z, 8*Z + 2, 8*Z + 4}
224 // where Z is an integer number in 0..23 range
225 // ttrig = ttrig_packed - 2 * (ttrig_packed / 8);
226 // ttrig = 6*Z + q
227 int ttrig_packed = ttrig / 6 * 8 + ttrig % 6;
228 result = ECLDspUtilities::shapeFitter(j + 1, adc, ttrig_packed);
229 }
230
231 m_lar = result.amp;
232 m_ltr = result.time;
233 m_lq = result.quality;
234 m_chi = result.chi2;
235
236 //== Set precision of chi^2 to be the same as in the raw data.
237 int discarded_bits = 0;
238 if ((m_chi & 0x7800000) != 0) {
239 m_chi = 0x7800000;
240 } else if ((m_chi & 0x0600000) != 0) {
241 discarded_bits = 14;
242 } else if ((m_chi & 0x0180000) != 0) {
243 discarded_bits = 12;
244 } else if ((m_chi & 0x0060000) != 0) {
245 discarded_bits = 10;
246 } else if ((m_chi & 0x0018000) != 0) {
247 discarded_bits = 8;
248 } else if ((m_chi & 0x0006000) != 0) {
249 discarded_bits = 6;
250 } else if ((m_chi & 0x0001800) != 0) {
251 discarded_bits = 4;
252 } else if ((m_chi & 0x0000600) != 0) {
253 discarded_bits = 2;
254 }
255 if (discarded_bits > 0) {
256 m_chi >>= discarded_bits;
257 m_chi <<= discarded_bits;
258 }
259}
ECL::EclConfiguration::fitparams_t fitparams_t
fit parameters
static ECLShapeFit shapeFitter(int cid, const std::vector< int > &adc, int ttrig, bool adjusted_timing=true)
Emulate shape fitting algorithm from ShaperDSP using algorithm from ecl/utility/src/ECLDspEmulator....

◆ shapeSignals()

void shapeSignals ( )
private

Emulate response of energy deposition in a crystal and attached photodiode and make waveforms.

Definition at line 261 of file ECLDigitizerModule.cc.

262{
263 const EclConfiguration& ec = EclConfiguration::get();
264 ECLGeometryPar* eclp = ECLGeometryPar::Instance();
265
266 const double trgtick = ec.s_clock / ec.getRF() / ec.m_ntrg; // trigger tick
267 const double tscale = 2 * trgtick, toff = ec.s_clock / (2 * ec.getRF());
268
269 // clear the storage for the event
270 memset(m_adc.data(), 0, m_adc.size()*sizeof(adccounts_t));
271
272 const double E2GeV = 1 / Unit::GeV; // convert Geant energy units to GeV
273 const double T2us = 1 / Unit::us; // convert Geant time units to microseconds
274
275 // emulate response for ECL hits after ADC measurements
276 for (const auto& hit : m_eclSimHits) {
277 int cellId = hit.getCellId(); // 1 .. 8736
278 int j = cellId - 1; // 0 .. 8735
279 int id = m_eclMapper.getCrateID(cellId) - 1; // 0 .. 51
280 double timeOffset = tscale * m_ttime[id] - toff;
281 double hitE = hit.getEnergyDep() * m_calib[j].ascale * E2GeV;
282 double hitTimeAve = (hit.getFlightTime() + m_calib[j].tshift + eclp->time2sensor(j, hit.getPosition())) * T2us;
283
284 m_adc[j].energyConversion = m_calib[j].ascale * E2GeV * 20000;
285 m_adc[j].flighttime += hit.getFlightTime() * hit.getEnergyDep(); //true time weighted by energy
286 m_adc[j].timeshift += m_calib[j].tshift * hit.getEnergyDep();
287 m_adc[j].timetosensor += eclp->time2sensor(j, hit.getPosition()) * hit.getEnergyDep();
288 m_adc[j].totalHadronDep += hit.getHadronEnergyDep(); // true deposited energy hadron component (in GeV)
289 m_adc[j].totalDep += hit.getEnergyDep(); //true deposited energy (in GeV)
290
291 if (m_HadronPulseShape == true) {
292 double hitHadronE = hit.getHadronEnergyDep() * m_calib[j].ascale * E2GeV;
293 m_adc[j].AddHit(hitE - hitHadronE, hitTimeAve + timeOffset, m_ss_HadronShapeSimulations[0]);//Gamma Component
294 m_adc[j].AddHit(hitHadronE, hitTimeAve + timeOffset, m_ss_HadronShapeSimulations[1]); //Hadron Component
295 } else {
296 m_adc[j].AddHit(hitE, hitTimeAve + timeOffset, m_ss[m_tbl[j].iss]);
297 }
298 }
299
300 // add only background hits
301 for (const auto& hit : m_eclHits) {
302 if (hit.getBackgroundTag() == BackgroundMetaData::bg_none) continue;
303 int cellId = hit.getCellId(); // 1 .. 8736
304 int j = cellId - 1; // 0 .. 8735
305 int id = m_eclMapper.getCrateID(cellId) - 1; // 0 .. 51
306 double timeOffset = tscale * m_ttime[id] - toff;
307 double hitE = hit.getEnergyDep() * m_calib[j].ascale * E2GeV;
308 double hitTimeAve = (hit.getTimeAve() + m_calib[j].tshift) * T2us;
309 m_adc[j].AddHit(hitE, hitTimeAve + timeOffset, m_ss[m_tbl[j].iss]);
310 }
311
312 // internuclear counter effect -- charged particle crosses diode and produces signal
313 if (m_inter) {
314 // ionisation energy in Si is I = 3.6x10^-6 MeV for electron-hole pair
315 // 5000 pairs in the diode per 1 MeV deposited in the crystal attached to the diode
316 // conversion factor to get equivalent energy deposition in the crystal to sum up it with deposition in crystal
317 const double diodeEdep2crystalEdep = E2GeV * (1 / (5000 * 3.6e-6));
318 for (const auto& hit : m_eclDiodeHits) {
319 int cellId = hit.getCellId(); // 1 .. 8736
320 int j = cellId - 1; // 0 .. 8735
321 int id = m_eclMapper.getCrateID(cellId) - 1; // 0 .. 51
322 double timeOffset = tscale * m_ttime[id] - toff;
323 double hitE = hit.getEnergyDep() * m_calib[j].ascale * diodeEdep2crystalEdep;
324 double hitTimeAve = (hit.getTimeAve() + m_calib[j].tshift) * T2us;
325
326 adccounts_t& a = m_adc[j];
327 // cout << "internuclearcountereffect " << j << " " << hit.getEnergyDep() << " " << hit.getTimeAve() << " " << a.total << endl;
328 // for (int i = 0; i < ec.m_nsmp; i++) cout << i << " " << a.c[i] << endl;
329 if (m_HadronPulseShape) {
330 a.AddHit(hitE, hitTimeAve + timeOffset, m_ss_HadronShapeSimulations[2]); // diode component
331 } else {
332 a.AddHit(hitE, hitTimeAve + timeOffset, m_ss[1]); // m_ss[1] is the sampled diode response
333 }
334 // for (int i = 0; i < ec.m_nsmp; i++) cout << i << " " << a.c[i] << endl;
335 }
336 }
337
338 if (m_calibration) {
339 // This has been added by Alex Bobrov for calibration
340 // of covariance matrix artificially generate 100 MeV in time for each crystal
341 double hitE = 0.1, hitTimeAve = 0.0;
342 for (int j = 0; j < ec.m_nch; j++) {
343 int cellId = j + 1; // 1 .. 8736
344 int id = m_eclMapper.getCrateID(cellId) - 1; // 0 .. 51
345 double timeOffset = tscale * m_ttime[id] - toff;
346 m_adc[j].AddHit(hitE, hitTimeAve + timeOffset, m_ss[m_tbl[j].iss]);
347 }
348 }
349}
StoreArray< ECLSimHit > m_eclSimHits
SimHits array.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
double time2sensor(int cid, const G4ThreeVector &hit_pos)
function to calculate flight time to diode sensor
static constexpr double s_clock
digitization clock in RF units
static const double us
[microsecond]
Definition Unit.h:97
static const double GeV
Standard of [energy, momentum, mass].
Definition Unit.h:51

◆ terminate()

virtual void terminate ( void )
inlinevirtualinherited

This method is called at the end of the event processing.

This method is called only once after the event processing finished. Use this method for cleaning up, closing files, etc.

This method can be implemented by subclasses.

Reimplemented in AafhInputModule, AnalysisPhase1StudyModule, ARICHBackgroundModule, arichBtestModule, ARICHNtupleModule, arichToNtupleModule, AsyncWrapper, AWESOMEBasicModule, B2BIIConvertMdstModule, B2BIIFixMdstModule, B2BIIMCParticlesMonitorModule, B2BIIMdstInputModule, BabayagaNLOInputModule, BBBremInputModule, BeamabortModule, BeamabortStudyModule, BeamDigitizerModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgNeutronModule, BeamSpotMonitorModule, BelleMCOutputModule, BgoDigitizerModule, BgoModule, BgoStudyModule, BGOverlayInputModule, BHWideInputModule, BKLMAnaModule, BKLMSimHistogrammerModule, BKLMTrackingModule, CalibrationCollectorModule, CaveModule, CDCCosmicAnalysisModule, CDCPackerModule, CDCUnpackerModule, CDCCrossTalkAdderModule, CDCDedxCorrectionModule, CDCDedxDQMModule, CDCDedxPIDModule, CDCDedxScanModule, CDCDedxSkimCDSTModule, CDCDedxSkimModule, CDCDedxValidationModule, CDCDigitizerModule, CDCInitialT0DeterminationModule, CDCTrigger2DFinderModule, CDCTriggerHoughETFModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDataModule, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerNeuroIDHistModule, CDCTriggerTSFFirmwareModule, CDCTriggerTSFModule, CDCTriggerUnpackerModule, CertifyParallelModule, CheckErrorEventModule, Chi2MCTrackMatcherModule, ClawDigitizerModule, ClawModule, ClawStudyModule, ClawsDigitizerModule, CLAWSModule, ClawsStudyModule, CollectorTestModule, Convert2RawDetModule, CosmicsAlignmentValidationModule, CRYInputModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, CurlingTrackCandSplitterModule, CurlTaggerModule, DAQPerfModule, DataWriterModule, DeSerializerModule, DeSerializerPXDModule, DisplayModule, DosiDigitizerModule, DosiModule, DosiStudyModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEcmsMonObjModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEventT0EfficiencyModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisExampleModule, DQMHistAnalysisHLTModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisKLMMonObjModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPeakModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDERModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisRunNrModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTrackingAbortModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistAnalysisTRGModule, DQMHistAutoCanvasModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DqmHistoManagerModule, DQMHistOutputToEPICSModule, DQMHistReferenceModule, DQMHistSnapshotsModule, Ds2RawFileModule, Ds2RawModule, Ds2RbufModule, Ds2SampleModule, ECLLOMModule, EclBackgroundStudyModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLCompressBGOverlayModule, ECLCovarianceMatrixModule, EclCovMatrixNtupleModule, ECLCRFinderModule, ECLDataAnalysisModule, ECLDigiStudyModule, EclDisplayModule, ECLExpertModule, ECLFillCellIdMappingModule, ECLFinalizerModule, ECLLocalMaximumFinderModule, ECLMatchingPerformanceExpertModule, ECLShowerCorrectorModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLTrackClusterMatchingParametrizationExpertModule, ECLTrackClusterMatchingPerformanceModule, ECLTRGInformationModule, eclWaveformCalibCollectorModule, EffPlotsModule, EKLMDataCheckerModule, ElapsedTimeModule, EvReductionModule, EvtGenDecayModule, ExtModule, FANGSDigitizerModule, FANGSModule, FANGSStudyModule, FastBDTClassifierAnalyzerModule, FastBDTClassifierTrainingModule, FastRbuf2DsModule, FillTrackFitNtupleModule, FragmentationModule, FullSimModule, FullSimTimingModule, TRGGDLUnpackerModule, GeneratedVertexDisplacerModule, GeneratorPreselectionModule, GenRawSendModule, GeometryModule, GetEventFromSocketModule, GFTC2SPTCConverterModule, GRLNeuroModule, He3DigitizerModule, He3tubeModule, He3tubeStudyModule, HepevtOutputModule, HepMCInputModule, HepMCOutputModule, HerwigHepMCFragmentationModule, HerwigLHEWriterModule, HistoManagerModule, HitLevelInfoWriterModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, KinkFinderModule, KKGenInputModule, KLMClusterEfficiencyModule, KLMExpertModule, KLMMuonIDDNNExpertModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMTrackingModule, KLMTriggerModule, KoralWInputModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, MasterClassModule, MCMatcherTRGECLModule, MCTrackCandClassifierModule, MergeDataStoreModule, MicrotpcModule, MicrotpcStudyModule, TpcDigitizerModule, MonitorDataModule, MuidModule, MVAExpertModule, MVAMultipleExpertsModule, NtuplePhase1_v6Module, ParticleKinematicFitterModule, OverrideGenerationFlagsModule, PartialSeqRootReaderModule, ParticleLoaderModule, ParticleMassHypothesesUpdaterModule, ParticleMCDecayStringModule, ParticleMomentumUpdaterModule, ParticleStatsModule, ParticleWeightingLookUpCreatorModule, Ph1bpipeModule, Ph1sustrModule, PhaseSpaceAnalysisModule, PhokharaInputModule, PhysicsObjectsDQMModule, PIDNtupleModule, PinDigitizerModule, PindiodeModule, PindiodeStudyModule, PlumeDigitizerModule, PlumeModule, ProfileModule, ProgressBarModule, PXDBackgroundModule, PXDBgTupleProducerModule, PXDMCBgTupleProducerModule, PXDPackerErrModule, PXDPackerModule, PXDReadRawBonnDAQMatchedModule, PXDReadRawBonnDAQModule, PXDReadRawONSENModule, PXDUnpackerModule, PXDUnpackerOldModule, PXDUnpackerOTModule, PXDDQMEfficiencyNtupleModule, PXDDQMEfficiencyNtupleSelftrackModule, PXDDQMTrackRawNtupleModule, PXDROIFinderAnalysisModule, PXDSpacePointCreatorModule, PyModule, QcsmonitorDigitizerModule, QcsmonitorModule, QcsmonitorStudyModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, ReceiveEventModule, RemoveMCParticlesModule, RemoveParticlesNotInListsModule, ReprocessorModule, ROIDQMModule, ROIReadTestModule, ROISenderModule, Root2BinaryModule, Root2RawModule, RootInputModule, RootOutputModule, RT2SPTCConverterModule, RxModule, RxSocketModule, ScanCDCGeoModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, SegmentNetworkAnalyzerModule, SeqRootInputModule, SeqRootMergerModule, SeqRootOutputModule, SerializerModule, SkimFilterModule, SoftwareTriggerModule, SoftwareTriggerResultPrinterModule, SpacePoint2TrueHitConnectorModule, SPTC2GFTCConverterModule, SPTC2RTConverterModule, SPTCRefereeModule, SrsensorModule, StandardTrackingPerformanceModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, StudyMaterialEffectsModule, SubEventModule, SVDBackgroundModule, SVDDigitizerModule, SVDVariablesToStorageModule, SVDChannelMappingModule, SVDChargeSharingAnalysisModule, SVDClusterQualityEstimatorCalibrationModule, SVDClusterQualityEstimatorModule, SVDCrossTalkFinderModule, SVDDQMClustersOnTrackModule, SVDDQMExpressRecoModule, svdDumpModule, SVDEventT0PerformanceTTreeModule, SVDHotStripFinderModule, SVDMaxStripTTreeModule, SVDPerformanceTTreeModule, SVDROIFinderAnalysisDataModule, SVDROIFinderAnalysisModule, SVDSpacePointCreatorModule, SVDSpacePointQICalibrationModule, SwitchDataStoreModule, TCConvertersTestModule, TeeggInputModule, TOPAlignerModule, TOPBackgroundModule, TOPBunchFinderModule, TOPChannelT0CalibratorModule, TOPChannelT0MCModule, TOPCommonT0CalibratorModule, TOPCosmicT0FinderModule, TOPGainEfficiencyCalculatorModule, TOPLaserCalibratorModule, TOPModuleT0CalibratorModule, TOPNtupleModule, TOPPDFCheckerModule, TOPRingPlotterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TrackAnaModule, TrackFilterModule, TrackFinderVXDAnalizerModule, TrackingPerformanceEvaluationModule, FindletModule< AFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackFinderLegendre >, FindletModule< CDCHitsRemover >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< FacetCreator >, FindletModule< FacetCreator >, FindletModule< HitBasedT0Extractor >, FindletModule< HitBasedT0Extractor >, FindletModule< HitReclaimer >, FindletModule< HitReclaimer >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackExporter >, FindletModule< TrackFinder >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackLinker >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< TrackRejecter >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, FindletModule< WireHitPreparer >, TrackQETrainingDataCollectorModule, TreeFitterModule, TrepsInputModule, TRGCDCETFUnpackerModule, TRGCDCModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSStreamModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLFAMModule, TRGECLModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLModule, TRGGDLSummaryModule, TRGGRLDQMModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLUnpackerModule, TRGRAWDATAModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TxModule, TxSocketModule, V0FinderModule, V0findingPerformanceEvaluationModule, VariablesToEventBasedTreeModule, VariablesToHistogramModule, VariablesToNtupleModule, VXDDedxPIDModule, VXDQETrainingDataCollectorModule, VXDTFTrainingDataCollectorModule, ZMQRxOutputModule, ZMQRxWorkerModule, ZMQTxInputModule, and ZMQTxWorkerModule.

Definition at line 175 of file Module.h.

175{};

Member Data Documentation

◆ m_adc

std::vector<adccounts_t> m_adc
private

Storage for adc hits from entire calorimeter (8736 crystals)

ACD counts

Definition at line 128 of file ECLDigitizerModule.h.

◆ m_ADCThreshold

int m_ADCThreshold
private

ADC threshold for wavefom fits.

Definition at line 244 of file ECLDigitizerModule.h.

◆ m_algoParameters

DBObjPtr<TTree> m_algoParameters
private

Shape fitting algorithm parameters.

Definition at line 177 of file ECLDigitizerModule.h.

◆ m_Awave

std::vector<double> m_Awave
private

Storage for waveform saving thresholds.

Definition at line 139 of file ECLDigitizerModule.h.

◆ m_background

bool m_background
private

Module parameters.

background flag

Definition at line 238 of file ECLDigitizerModule.h.

◆ m_calib

std::vector<calibration_t> m_calib
private

Storage for calibration constants.

Definition at line 136 of file ECLDigitizerModule.h.

◆ m_calibration

bool m_calibration
private

calibration flag

Definition at line 239 of file ECLDigitizerModule.h.

◆ m_compAlgo

unsigned int m_compAlgo
private

compression algorithm for background waveforms

Definition at line 243 of file ECLDigitizerModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 520 of file Module.h.

◆ m_CrateTimeOffset

DBObjPtr<ECLCrystalCalib> m_CrateTimeOffset {"ECLCrateTimeOffset"}
private

Crate time offset.

Definition at line 195 of file ECLDigitizerModule.h.

195{"ECLCrateTimeOffset"};

◆ m_CrystalElectronics

DBObjPtr<ECLCrystalCalib> m_CrystalElectronics {"ECLCrystalElectronics"}
private

Crystal electronics.

Definition at line 183 of file ECLDigitizerModule.h.

183{"ECLCrystalElectronics"};

◆ m_CrystalElectronicsTime

DBObjPtr<ECLCrystalCalib> m_CrystalElectronicsTime {"ECLCrystalElectronicsTime"}
private

Crystal electronics time.

Definition at line 189 of file ECLDigitizerModule.h.

189{"ECLCrystalElectronicsTime"};

◆ m_CrystalEnergy

DBObjPtr<ECLCrystalCalib> m_CrystalEnergy {"ECLCrystalEnergy"}
private

Crystal energy.

Definition at line 186 of file ECLDigitizerModule.h.

186{"ECLCrystalEnergy"};

◆ m_CrystalTimeOffset

DBObjPtr<ECLCrystalCalib> m_CrystalTimeOffset {"ECLCrystalTimeOffset"}
private

Crystal time offset.

Definition at line 192 of file ECLDigitizerModule.h.

192{"ECLCrystalTimeOffset"};

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 510 of file Module.h.

◆ m_dspDataTest

bool m_dspDataTest
private

DSP data usage flag.

Definition at line 251 of file ECLDigitizerModule.h.

◆ m_DspWithExtraMCInfoThreshold

double m_DspWithExtraMCInfoThreshold
private

Energy threshold above which to store DSPs with extra information.

Definition at line 246 of file ECLDigitizerModule.h.

◆ m_eclDigits

StoreArray<ECLDigit> m_eclDigits
private

Output Arrays.

Waveform fit result.

Definition at line 223 of file ECLDigitizerModule.h.

◆ m_eclDiodeHits

StoreArray<ECLHit> m_eclDiodeHits
private

Diode hits array.

Definition at line 212 of file ECLDigitizerModule.h.

◆ m_eclDsps

StoreArray<ECLDsp> m_eclDsps
private

Generated waveforms.

Definition at line 226 of file ECLDigitizerModule.h.

◆ m_eclDspsWithExtraMCInfo

StoreArray<ECLDspWithExtraMCInfo> m_eclDspsWithExtraMCInfo
private

Generated waveforms with extra MC information.

Definition at line 229 of file ECLDigitizerModule.h.

◆ m_eclHits

StoreArray<ECLHit> m_eclHits
private

Hits array.

Definition at line 209 of file ECLDigitizerModule.h.

◆ m_eclMapper

ECL::ECLChannelMapper m_eclMapper
private

Channel Mapper.

channel mapper to utilize trigger information

Definition at line 235 of file ECLDigitizerModule.h.

◆ m_eclSimHits

StoreArray<ECLSimHit> m_eclSimHits
private

SimHits array.

Definition at line 215 of file ECLDigitizerModule.h.

◆ m_eclTrigs

StoreArray<ECLTrig> m_eclTrigs
private

Trigger information.

Definition at line 232 of file ECLDigitizerModule.h.

◆ m_eclWaveforms

StoreObjPtr<ECLWaveforms> m_eclWaveforms
private

Compressed waveforms.

Definition at line 218 of file ECLDigitizerModule.h.

◆ m_eclWaveformsName

std::string m_eclWaveformsName
private

name of background waveforms storage

Definition at line 248 of file ECLDigitizerModule.h.

◆ m_EventMetaData

StoreObjPtr<EventMetaData> m_EventMetaData
private

Event metadata.

Definition at line 204 of file ECLDigitizerModule.h.

◆ m_fitparams

std::vector<fitparams_t> m_fitparams
private

Pairs of (waveform parameters, fit parameters)

Definition at line 122 of file ECLDigitizerModule.h.

◆ m_FPGAWaveform

DBObjPtr<ECLCrystalCalib> m_FPGAWaveform {"ECL_FPGA_StoreWaveform"}
private

FPGA waveform.

Definition at line 201 of file ECLDigitizerModule.h.

201{"ECL_FPGA_StoreWaveform"};

◆ m_HadronPulseShape

bool m_HadronPulseShape
private

hadron pulse shape flag

Definition at line 249 of file ECLDigitizerModule.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 517 of file Module.h.

◆ m_idn

std::vector<algoparams_t> m_idn
private

Fit algorithm parameters shared by group of crystals.

parameters that needs for waveform fit

Definition at line 121 of file ECLDigitizerModule.h.

◆ m_inter

bool m_inter
private

internuclear counter effect

Definition at line 240 of file ECLDigitizerModule.h.

◆ m_loadOnce

bool m_loadOnce = true
private

Always load waveform parameters at least once.

Definition at line 152 of file ECLDigitizerModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 513 of file Module.h.

◆ m_MCTimeOffset

DBObjPtr<ECLCrystalCalib> m_MCTimeOffset {"ECLMCTimeOffset"}
private

MC time offset.

Definition at line 198 of file ECLDigitizerModule.h.

198{"ECLMCTimeOffset"};

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 515 of file Module.h.

◆ m_name

std::string m_name
privateinherited

The name of the module, saved as a string (user-modifiable)

Definition at line 507 of file Module.h.

◆ m_noise

std::vector<ECLNoiseData> m_noise
private

parameters for correlated noise simulation

Definition at line 123 of file ECLDigitizerModule.h.

◆ m_noiseParameters

DBObjPtr<TTree> m_noiseParameters
private

Electronics noise covariance matrix.

Definition at line 180 of file ECLDigitizerModule.h.

◆ m_package

std::string m_package
privateinherited

Package this module is found in (may be empty).

Definition at line 509 of file Module.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

The properties of the module as bitwise or (with |) of EModulePropFlags.

Definition at line 511 of file Module.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 518 of file Module.h.

◆ m_ss

std::vector<signalsample_t> m_ss
private

tabulated shape line

Definition at line 124 of file ECLDigitizerModule.h.

◆ m_ss_HadronShapeSimulations

std::vector<signalsample_t> m_ss_HadronShapeSimulations
private

tabulated shape line for hadron shape simulations

Definition at line 125 of file ECLDigitizerModule.h.

◆ m_storeDspWithExtraMCInfo

bool m_storeDspWithExtraMCInfo
private

DSP with extra info flag.

Definition at line 242 of file ECLDigitizerModule.h.

◆ m_tbl

std::vector<crystallinks_t> m_tbl
private

Lookup table for ECL channels.

Definition at line 118 of file ECLDigitizerModule.h.

◆ m_trigTime

bool m_trigTime
private

Use trigger time from beam background overlay.

Definition at line 247 of file ECLDigitizerModule.h.

◆ m_ttime

unsigned char m_ttime[ECL::ECL_CRATES] = {}
private

storage for trigger time in each ECL.

The crate trigger time is an even number from 0 to 142, so here it is stored as numbers from 0 to 71 inclusive.

Definition at line 145 of file ECLDigitizerModule.h.

145{};

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 508 of file Module.h.

◆ m_unitscale

double m_unitscale
private

Normalization coefficient for ECL signal shape.

If positive, use same static value for all ECL channels. If negative, calculate it dynamically at beginRun(). (for default shape parameters, the static value is 27.7221)

Definition at line 261 of file ECLDigitizerModule.h.

◆ m_useWaveformParameters

bool m_useWaveformParameters
private

If true, use m_waveformParameters, m_algoParameters, m_noiseParameters.

If false, use the data from ecl/data/ECL-WF.root or ECL-WF-BG.root

Definition at line 255 of file ECLDigitizerModule.h.

◆ m_waveformMaker

bool m_waveformMaker
private

produce only waveform digits

Definition at line 241 of file ECLDigitizerModule.h.

◆ m_waveformParameters

DBObjPtr<TTree> m_waveformParameters
private

CellID-specific signal shapes.

Definition at line 174 of file ECLDigitizerModule.h.

◆ m_waveformParametersMC

DBObjPtr<ECLDigitWaveformParametersForMC> m_waveformParametersMC
private

Hadron signal shapes.

Definition at line 171 of file ECLDigitizerModule.h.

◆ m_WaveformThresholdOverride

double m_WaveformThresholdOverride
private

If gt 0, value will override ECL_FPGA_StoreWaveform and apply value (in GeV) as threshold for all crystals for waveform saving.

Definition at line 245 of file ECLDigitizerModule.h.


The documentation for this class was generated from the following files: