Belle II Software development
SVDDigitizerModule Class Reference

The SVD Digitizer module. More...

#include <SVDDigitizerModule.h>

Inheritance diagram for SVDDigitizerModule:
Module PathElement

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

 SVDDigitizerModule ()
 Constructor.
 
void processHit ()
 Process one SVDSimHit by dividing the step in smaller steps and drifting the charge.
 
void driftCharge (const ROOT::Math::XYZVector &position, double carriers, SVD::SensorInfo::CarrierType carrierType)
 Drift the charge inside the silicon.
 
double addNoise (double charge, double noise)
 Calculate the noise contribution to one strip with given charge.
 
void saveDigits ()
 Save digits to the DataStore Saves samples of generated waveforms.
 
void saveWaveforms ()
 Save waveforms to the statistics file.
 
void saveSignals ()
 Save signals to a root-delimited file (to be analyzed in Python).
 
virtual void initialize () override
 Initialize the module and check module parameters.
 
virtual void beginRun () override
 Initialize the list of existing SVD Sensors.
 
virtual void event () override
 Digitize one event.
 
virtual void terminate () override
 Terminate the module.
 
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.
 
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

int getFirstSample (int triggerBin, int relativShift)
 return the starting sample
 
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.
 

Protected Attributes

std::string m_storeMCParticlesName = ""
 Name of the collection for the MCParticles.
 
std::string m_storeSimHitsName = ""
 Name of the collection for the SVDSimhits.
 
std::string m_storeTrueHitsName = ""
 Name of the collection for the SVDTrueHits.
 
std::string m_relMCParticleSimHitName = ""
 Name of the relation between MCParticles and SVDSimHits.
 
std::string m_relTrueHitSimHitName = ""
 Name of the relation between SVDTrueHits and SVDSimHits.
 
std::string m_storeShaperDigitsName = ""
 Name of the collection for the SVDShaperDigits.
 
std::string m_relShaperDigitMCParticleName = ""
 Name of the relation between SVDShaperDigits and MCParticles.
 
std::string m_relShaperDigitTrueHitName = ""
 Name of the relation between SVDShaperDigits and SVDTrueHits.
 
std::string m_svdEventInfoName = "SVDEventInfoSim"
 Name of the SVDEventInfo object.
 
double m_segmentLength = 0.020
 Max.
 
bool m_applyPoisson = true
 Whether or not to apply poisson fluctuation of charge (Fano factor)
 
double m_SNAdjacent = 3.0
 Zero-suppression cut.
 
bool m_roundZS = true
 Round ZS cut to nearest ADU.
 
int m_nSamplesOverZS = 1
 Keep digit if at least m_nSamplesOverZS are over threshold.
 
double m_noiseFraction = 0.01
 (derived from SNAdjacent) Fraction of noisy strips per sensor.
 
DBObjPtr< HardwareClockSettingsm_hwClock
 Hardware Clocks.
 
double m_betaPrimeDecayTimeU = 250.0
 Decay time of betaprime waveform U-side.
 
double m_betaPrimeDecayTimeV = 250.0
 Decay time of betaprime waveform V-side.
 
double m_samplingTime = -1
 Interval between two waveform samples, by default taken from HardwareClockSettings.
 
double m_startSampling = -2
 Time window start, excluding trigger bin effect.
 
double m_initTime = 0
 Time window start, including the triggerBin effect.
 
bool m_randomizeEventTimes = false
 Randomize event times? If set to true, event times will be randomized uniformly from m_minTimeFrame to m_maxTimeFrame.
 
float m_minTimeFrame = -300
 Low edge of randomization time frame.
 
float m_maxTimeFrame = 150
 High edge of randomization time frame.
 
float m_currentEventTime = 0.0
 Current event time.
 
bool m_is3sampleEvent = false
 True if the event should be simulated with 3 sample.
 
int m_nAPV25Samples = 6
 number of digitized samples read from SVDEventInfo
 
std::string m_rootFilename = ""
 Name of the ROOT filename to output statistics.
 
bool m_storeWaveforms = false
 Store waveform data in the reporting file?
 
std::string m_signalsList = ""
 Name of the tab-delimited listing of waveforms.
 
Waveforms m_waveforms
 Structure containing waveforms in all existing sensors.
 
const SVDSimHitm_currentHit = nullptr
 Pointer to the SVDSimhit currently digitized.
 
int m_currentParticle = -1
 Index of the particle which caused the current hit.
 
int m_currentTrueHit = -1
 Index of the TrueHit the current hit belongs to.
 
SensorWaveformsm_currentSensorWaveforms = nullptr
 Pointer to the sensor in which the current hit occurred.
 
const SensorInfom_currentSensorInfo = nullptr
 Pointer to the SensorInfo of the current sensor.
 
double m_currentTime = 0
 Time of the current SimHit.
 
double m_sensorThickness = 0.03
 Thickness of current sensor (read from m_currentSensorInfo)
 
int m_relativeShift = 0
 relative shift in SVDEventInfo obj
 
int m_startingSample = 0
 Starting sample for the selection of 3 samples in 3-mixed-6.
 
SVDFADCMaskedStrips m_MaskedStr
 FADC masked strip payload.
 
DBObjPtr< PayloadFilem_mapping
 channel mapping payload
 
std::unique_ptr< SVDOnlineToOfflineMapm_map
 channel mapping map
 
SVDChargeSimulationCalibrations m_ChargeSimCal
 SVDChargeSimulationCalibrations calibrations db object.
 
SVDNoiseCalibrations m_NoiseCal
 SVDNoise calibrations db object.
 
SVDPulseShapeCalibrations m_PulseShapeCal
 SVDPulseShapeCalibrations calibrations db object.
 
TFile * m_rootFile = nullptr
 Pointer to the ROOT filename for statistics.
 
TH1D * m_histChargeSharing_u = nullptr
 Histogram showing the charge sharing + diffusion in u (r-phi).
 
TH1D * m_histChargeSharing_v = nullptr
 Histogram showing the charge sharing + diffusion in v (z).
 
TH1D * m_histMobility_e = nullptr
 Histogram showing the mobility of e-.
 
TH1D * m_histMobility_h = nullptr
 Histogram showing the mobility of h.
 
TH1D * m_histVelocity_e = nullptr
 Histogram showing the velocity of e-.
 
TH1D * m_histVelocity_h = nullptr
 Histogram showing the velocity of h.
 
TH1D * m_histDistanceToPlane_e = nullptr
 Histogram showing the distance to plane for e.
 
TH1D * m_histDistanceToPlane_h = nullptr
 Histogram showing the distance to plane for h.
 
TH1D * m_histDriftTime_e = nullptr
 Histogram showing the drift time of e.
 
TH1D * m_histDriftTime_h = nullptr
 Histogram showing the drift time of h.
 
TH1D * m_histHitTime = nullptr
 Histogram showing the hit time.
 
TH2F * m_histHitTimeTB = nullptr
 Histogram showing the hit time vs TB.
 
TH1D * m_histLorentz_u = nullptr
 Histogram showing the Lorentz angles in u (r-phi).
 
TH1D * m_histLorentz_v = nullptr
 Histogram showing the Lorentz angles in v (z).
 
TH1D * m_signalDist_u = nullptr
 Histogram showing the distribution of digit signals in u (r-phi).
 
TH1D * m_signalDist_v = nullptr
 Histogram showing the distribution of digit signals in v (z).
 
TTree * m_waveTree = nullptr
 Tree for waveform storage.
 

Static Protected Attributes

static std::string m_xmlFileName = std::string("SVDChannelMapping.xml")
 < channel mapping xml filename
 

Private Member Functions

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::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 SVD Digitizer module.

This module is responsible for converting the simulated energy deposition from Geant4 into real SVD detector response of single strips.

Definition at line 54 of file SVDDigitizerModule.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.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,
85 };
@ 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_DontCollectStatistics
No statistics is collected for this module.
Definition: Module.h:84
@ 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
@ 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

Constructor & Destructor Documentation

◆ SVDDigitizerModule()

Constructor.


Definition at line 59 of file SVDDigitizerModule.cc.

59 : Module(),
62{
63 //Set module properties
64 setDescription("Creates SVDShaperDigits from SVDSimHits");
66
67 // Define module parameters
68
69 // 1. Collections
70 addParam("MCParticles", m_storeMCParticlesName,
71 "MCParticle collection name", m_storeMCParticlesName);
72 addParam("SimHits", m_storeSimHitsName, "SimHit collection name",
74 addParam("TrueHits", m_storeTrueHitsName, "TrueHit collection name",
76 addParam("ShaperDigits", m_storeShaperDigitsName, "ShaperDigits collection name", m_storeShaperDigitsName);
77 addParam("SVDEventInfo", m_svdEventInfoName, "SVDEventInfo name", m_svdEventInfoName);
78
79 // 2. Physics
80 addParam("SegmentLength", m_segmentLength,
81 "Maximum segment length (in millimeters)", m_segmentLength);
82
83 // 3. Noise
84 addParam("PoissonSmearing", m_applyPoisson,
85 "Apply Poisson smearing on chargelets", m_applyPoisson);
86 addParam("ZeroSuppressionCut", m_SNAdjacent,
87 "Zero suppression cut in sigmas of strip noise", m_SNAdjacent);
88 addParam("FADCmode", m_roundZS,
89 "FADC mode: if True, ZS cut is rounded to nearest ADU ", m_roundZS);
90 addParam("numberOfSamples", m_nSamplesOverZS,
91 "Keep digit if numberOfSamples or more samples are over ZS threshold",
93
94 // 4. Timing
95 addParam("BetaPrimeDecayTimeU", m_betaPrimeDecayTimeU, "Decay time of betaprime waveform in ns, U-side",
97 addParam("BetaPrimeDecayTimeV", m_betaPrimeDecayTimeV, "Decay time of betaprime waveform in ns, V-side",
99 addParam("ADCSamplingTime", m_samplingTime,
100 "Interval between ADC samples in ns, if = -1 taken from HardwareClockSettings payload (default).", m_samplingTime);
101 addParam("StartSampling", m_startSampling,
102 "Start of the sampling window, in ns. Used to tune the SVD latency.", m_startSampling);
103 addParam("RandomizeEventTimes", m_randomizeEventTimes,
104 "Randomize event times over a frame interval", m_randomizeEventTimes);
105 addParam("TimeFrameLow", m_minTimeFrame,
106 "Left edge of event time randomization window, ns", m_minTimeFrame);
107 addParam("TimeFrameHigh", m_maxTimeFrame,
108 "Right edge of event time randomization window, ns", m_maxTimeFrame);
109
110
111 // 6. Reporting
112 addParam("statisticsFilename", m_rootFilename,
113 "ROOT Filename for statistics generation. If filename is empty, no statistics will be produced",
115 addParam("storeWaveforms", m_storeWaveforms,
116 "Store waveforms in a TTree in the statistics file.", m_storeWaveforms);
117 addParam("signalsList", m_signalsList,
118 "Store signals (time/charge/tau) in a tab-delimited file",
120}
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
double m_startSampling
Time window start, excluding trigger bin effect.
double m_samplingTime
Interval between two waveform samples, by default taken from HardwareClockSettings.
bool m_randomizeEventTimes
Randomize event times? If set to true, event times will be randomized uniformly from m_minTimeFrame t...
int m_nSamplesOverZS
Keep digit if at least m_nSamplesOverZS are over threshold.
bool m_roundZS
Round ZS cut to nearest ADU.
std::string m_storeShaperDigitsName
Name of the collection for the SVDShaperDigits.
double m_SNAdjacent
Zero-suppression cut.
SensorWaveforms * m_currentSensorWaveforms
Pointer to the sensor in which the current hit occurred.
std::string m_storeTrueHitsName
Name of the collection for the SVDTrueHits.
DBObjPtr< PayloadFile > m_mapping
channel mapping payload
std::string m_storeMCParticlesName
Name of the collection for the MCParticles.
static std::string m_xmlFileName
< channel mapping xml filename
double m_betaPrimeDecayTimeU
Decay time of betaprime waveform U-side.
bool m_applyPoisson
Whether or not to apply poisson fluctuation of charge (Fano factor)
std::string m_svdEventInfoName
Name of the SVDEventInfo object.
std::string m_signalsList
Name of the tab-delimited listing of waveforms.
bool m_storeWaveforms
Store waveform data in the reporting file?
float m_maxTimeFrame
High edge of randomization time frame.
float m_minTimeFrame
Low edge of randomization time frame.
double m_betaPrimeDecayTimeV
Decay time of betaprime waveform V-side.
std::string m_rootFilename
Name of the ROOT filename to output statistics.
std::string m_storeSimHitsName
Name of the collection for the SVDSimhits.
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:560

Member Function Documentation

◆ addNoise()

double addNoise ( double  charge,
double  noise 
)

Calculate the noise contribution to one strip with given charge.

Parameters
chargethe original charge on the strip
noisethe standard RMS noise on the strip
Returns
the new charge of the strip.

Definition at line 684 of file SVDDigitizerModule.cc.

685{
686 charge += gRandom->Gaus(0., noise);
687 return charge;
688}
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ beginRun()

void beginRun ( void  )
overridevirtual

Initialize the list of existing SVD Sensors.

Reimplemented from Module.

Definition at line 266 of file SVDDigitizerModule.cc.

267{
268
269 if (m_mapping.hasChanged()) { m_map = std::make_unique<SVDOnlineToOfflineMap>(m_mapping->getFileName()); }
270
271 //read sampling time from HardwareClockSettings
272 if (m_samplingTime == -1 && m_hwClock.isValid())
273 m_samplingTime = 1. / m_hwClock->getClockFrequency(Const::EDetector::SVD, "sampling");
274 else if (m_samplingTime == -1)
275 m_samplingTime = 16000. / 509;
276
277 //Fill map with all possible sensors This is too slow to be done every event so
278 //we fill it once and only clear the content of the sensors per event, not
279 //the whole map
280 m_waveforms.clear();
282 for (VxdID layer : geo.getLayers(SensorInfo::SVD)) {
283 for (VxdID ladder : geo.getLadders(layer)) {
284 for (VxdID sensor : geo.getSensors(ladder)) {
285 m_waveforms[sensor] = SensorWaveforms();
286 }
287 }
288 }
289
290 if (!m_MaskedStr.isValid())
291 B2WARNING("No valid SVDFADCMaskedStrip for the requested IoV -> no strips masked");
292 if (!m_map)
293 B2WARNING("No valid channel mapping -> all APVs will be enabled");
294
295
296}
bool hasChanged()
Check whether the object has changed since the last call to hasChanged of the accessor).
std::string getFileName() const
Get the name of the downloaded payload file.
Definition: PayloadFile.h:35
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
SVDFADCMaskedStrips m_MaskedStr
FADC masked strip payload.
Waveforms m_waveforms
Structure containing waveforms in all existing sensors.
DBObjPtr< HardwareClockSettings > m_hwClock
Hardware Clocks.
std::unique_ptr< SVDOnlineToOfflineMap > m_map
channel mapping map
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:176
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
Definition: GeoCache.cc:204
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Definition: GeoCache.cc:193
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
std::pair< StripWaveforms, StripWaveforms > SensorWaveforms
Waveforms of u- and v- channels in one sensor.

◆ 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{
182 newModule->m_moduleParamList.setParameters(getParamList());
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.
const ModuleParamList & getParamList() const
Return module param list.
Definition: Module.h:363
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:187
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:512
LogConfig m_logConfig
The log system configuration of the module.
Definition: Module.h:514
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition: Module.h:521
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:510
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 426 of file Module.h.

426{ beginRun(); }
virtual void beginRun()
Called when entering a new run.
Definition: Module.h:147

◆ 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 439 of file Module.h.

439{ endRun(); }
virtual void endRun()
This method is called if the current run ends.
Definition: Module.h:166

◆ 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 432 of file Module.h.

432{ event(); }
virtual void event()
This method is the core of the module.
Definition: Module.h:157

◆ 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 420 of file Module.h.

420{ initialize(); }
virtual void initialize()
Initialize the Module.
Definition: Module.h:109

◆ 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 445 of file Module.h.

445{ terminate(); }
virtual void terminate()
This method is called at the end of the event processing.
Definition: Module.h:176

◆ driftCharge()

void driftCharge ( const ROOT::Math::XYZVector &  position,
double  carriers,
SVD::SensorInfo::CarrierType  carrierType 
)

Drift the charge inside the silicon.

This method will drift the charge inside the silicon along the E/B fieldlines.

Parameters
positionstart position of the charge
carriersnumber of electrons and holes to drift
carrierTypeelectrons or holes

Definition at line 467 of file SVDDigitizerModule.cc.

469{
470 bool have_electrons = (carrierType == SVD::SensorInfo::electron);
471
472 string carrierName = (have_electrons) ? "electron" : "hole";
473 B2DEBUG(29,
474 "Drifting " << carriers << " " << carrierName << "s at position (" << position.X() << ", " << position.Y() << ", " << position.Z()
475 << ").");
476 B2DEBUG(29, "@@@ driftCharge: drifting " << carriers << " " << carrierName << "s at position (" << position.X() << ", " <<
477 position.Y() << ", " << position.Z()
478 << ").");
479
480 // Get references to current sensor/info for ease of use
481 const SensorInfo& info = *m_currentSensorInfo;
482 StripWaveforms& waveforms = (!have_electrons) ? m_currentSensorWaveforms->first : m_currentSensorWaveforms->second;
483
484 double distanceToPlane = (have_electrons) ?
485 0.5 * m_sensorThickness - position.Z() :
486 -0.5 * m_sensorThickness - position.Z(); //cm
487
488 if (m_histDistanceToPlane_e && have_electrons) m_histDistanceToPlane_e->Fill(distanceToPlane);
489 if (m_histDistanceToPlane_h && !have_electrons) m_histDistanceToPlane_h->Fill(distanceToPlane);
490
491 // Approximation: calculate drift velocity at the point halfway towards
492 // the respective sensor surface.
493 ROOT::Math::XYZVector mean_pos(position.X(), position.Y(), position.Z() + 0.5 * distanceToPlane);
494
495 // Calculate drift times and widths of charge clouds.
496 ROOT::Math::XYZVector v = info.getVelocity(carrierType, mean_pos);
497 if (m_histVelocity_e && have_electrons) m_histVelocity_e->Fill(v.Z()); //Unit::cm/Unit::cm*Unit::eV/Unit::e*Unit::s);
498 if (m_histVelocity_h && !have_electrons) m_histVelocity_h->Fill(v.Z()); //Unit::cm/Unit::cm*Unit::eV/Unit::e*Unit::s);
499
500 double driftTime = distanceToPlane / v.Z(); //ns
501 if (m_histDriftTime_e && have_electrons) m_histDriftTime_e->Fill(driftTime); //ns
502 if (m_histDriftTime_h && !have_electrons) m_histDriftTime_h->Fill(driftTime); //ns
503
504 ROOT::Math::XYZVector center = position + driftTime * v; //cm
505 double mobility = (have_electrons) ?
506 info.getElectronMobility(info.getEField(mean_pos).R()) :
507 info.getHoleMobility(info.getEField(mean_pos).R());
508
509 if (m_histMobility_e && have_electrons) m_histMobility_e->Fill(mobility); //cm2/V/ns
510 if (m_histMobility_h && !have_electrons) m_histMobility_h->Fill(mobility); //cm2/V/ns
511
512 double D = Const::kBoltzmann * info.getTemperature() / Unit::e * mobility;
513 double sigma = std::max(1.0e-4, sqrt(2.0 * D * driftTime));
514 double tanLorentz = (!have_electrons) ? v.X() / v.Z() : v.Y() / v.Z();
515
516 B2DEBUG(29, "velocity (" << v.X() / Unit::um << ", " << v.Y() / Unit::um << ", " << v.Z() / Unit::um << ") um/ns");
517 B2DEBUG(29, "D = " << D << ", driftTime = " << driftTime / Unit::ns << " ns");
518 B2DEBUG(29, "sigma = " << sigma / Unit::um << " um");
519 B2DEBUG(29, "tan Lorentz = " << tanLorentz);
520
521 sigma *= sqrt(1.0 + tanLorentz * tanLorentz);
522 if (m_histLorentz_u && !have_electrons) m_histLorentz_u->Fill(tanLorentz);
523 if (m_histLorentz_v && have_electrons) m_histLorentz_v->Fill(tanLorentz);
524
525 //Distribute carrier cloud on strips
526 int vID = info.getVCellID(center.Y(), true);
527 int uID = info.getUCellID(center.X(), center.Y(), true);
528 int seedStrip = (!have_electrons) ? uID : vID;
529 double seedPos = (!have_electrons) ?
530 info.getUCellPosition(seedStrip, vID) :
531 info.getVCellPosition(seedStrip);
532 double geomPitch = (!have_electrons) ? 0.5 * info.getUPitch(center.Y()) : 0.5 * info.getVPitch();
533 int nCells = (!have_electrons) ? info.getUCells() : info.getVCells();
534 std::deque<double> stripCharges;
535 std::deque<double> strips; // intermediate strips will be half-integers, like 2.5.
536#define NORMAL_CDF(z) 0.5 * std::erfc( - (z) * 0.707107)
537 double current_pos = (!have_electrons) ? seedPos - center.X() : seedPos - center.Y();
538 double current_strip = seedStrip;
539 double cdf_low = NORMAL_CDF((current_pos - 0.5 * geomPitch) / sigma);
540 double cdf_high = NORMAL_CDF((current_pos + 0.5 * geomPitch) / sigma);
541 double charge = carriers * (cdf_high - cdf_low);
542
543 B2DEBUG(29, "geomPitch = " << geomPitch / Unit::um << " um");
544 B2DEBUG(29, "charge = " << charge << " = " << carriers << "(carriers) * (" << cdf_high << "(cdf_high) - " << cdf_low <<
545 "(cdf_low));");
546
547 stripCharges.push_back(charge);
548 strips.push_back(current_strip);
549 while (cdf_low > 1.0e-5) {
550 current_pos -= geomPitch;
551 current_strip -= 0.5;
552 double cdf_current = NORMAL_CDF((current_pos - 0.5 * geomPitch) / sigma);
553 charge = carriers * (cdf_low - cdf_current);
554 stripCharges.push_front(charge);
555 strips.push_front(current_strip);
556 cdf_low = cdf_current;
557 }
558 current_pos = (!have_electrons) ? seedPos - center.X() : seedPos - center.Y();
559 current_strip = seedStrip;
560 while (cdf_high < 1.0 - 1.0e-5) {
561 current_pos += geomPitch;
562 current_strip += 0.5;
563 double cdf_current = NORMAL_CDF((current_pos + 0.5 * geomPitch) / sigma);
564 charge = carriers * (cdf_current - cdf_high);
565 stripCharges.push_back(charge);
566 strips.push_back(current_strip);
567 cdf_high = cdf_current;
568 }
569#undef NORMAL_CDF
570
571 // Pad with zeros for smoothing
572 int npads = (strips.front() - floor(strips.front()) == 0) ? 5 : 4;
573 for (int i = 0; i < npads; ++i) {
574 strips.push_front(strips.front() - 0.5);
575 stripCharges.push_front(0);
576 }
577 npads = (strips.back() - floor(strips.back()) == 0) ? 5 : 4;
578 for (int i = 0; i < npads; ++i) {
579 strips.push_back(strips.back() + 0.5);
580 stripCharges.push_back(0);
581 }
582 // Charge sharing
583 B2DEBUG(29, " --> charge sharing simulation, # strips = " << strips.size());
584 std::deque<double> readoutCharges;
585 std::deque<int> readoutStrips;
586 VxdID currentSensorID = m_currentHit->getSensorID();
587 for (std::size_t index = 3; index < strips.size() - 3; index += 2) {
588 B2DEBUG(29, " index = " << index << ", strip = " << strips[index] << ", stripCharge = " << stripCharges[index]);
589 int currentStrip = static_cast<int>(strips[index]);
590
591 double c0 = m_ChargeSimCal.getCouplingConstant(currentSensorID, !have_electrons, "C0");
592 double c1 = m_ChargeSimCal.getCouplingConstant(currentSensorID, !have_electrons, "C1");
593 double c2 = m_ChargeSimCal.getCouplingConstant(currentSensorID, !have_electrons, "C2");
594 double c3 = m_ChargeSimCal.getCouplingConstant(currentSensorID, !have_electrons, "C3");
595
596 B2DEBUG(29, " current strip = " << currentStrip);
597 B2DEBUG(29, " index-3 = " << index - 3 << ", strip = " << strips[index - 3] << ", stripCharge = " << stripCharges[index - 3]);
598 B2DEBUG(29, " index-2 = " << index - 2 << ", strip = " << strips[index - 2] << ", stripCharge = " << stripCharges[index - 2]);
599 B2DEBUG(29, " index-1 = " << index - 1 << ", strip = " << strips[index - 1] << ", stripCharge = " << stripCharges[index - 1]);
600 B2DEBUG(29, " index = " << index << ", strip = " << strips[index] << ", stripCharge = " << stripCharges[index]);
601 B2DEBUG(29, " index+1 = " << index + 1 << ", strip = " << strips[index + 1] << ", stripCharge = " << stripCharges[index + 1]);
602 B2DEBUG(29, " index+2 = " << index + 2 << ", strip = " << strips[index + 2] << ", stripCharge = " << stripCharges[index + 2]);
603 B2DEBUG(29, " index+3 = " << index + 3 << ", strip = " << strips[index + 3] << ", stripCharge = " << stripCharges[index + 3]);
604
605 readoutCharges.push_back(c3 * stripCharges[index - 3]
606 + c2 * stripCharges[index - 2]
607 + c1 * stripCharges[index - 1]
608 + c0 * stripCharges[index]
609 + c1 * stripCharges[index + 1]
610 + c2 * stripCharges[index + 2]
611 + c3 * stripCharges[index + 3]
612 );
613 readoutStrips.push_back(currentStrip);
614 B2DEBUG(29, " post simulation: " << index << ", strip = " << currentStrip << ", readoutCharge = " <<
615 readoutCharges[readoutCharges.size() - 1]);
616 }
617 // Trim at sensor edges
618 double tail = 0;
619 while (readoutStrips.size() > 0 && readoutStrips.front() < 0) {
620 readoutStrips.pop_front();
621 tail += readoutCharges.front();
622 readoutCharges.pop_front();
623 }
624 readoutCharges.front() += tail;
625 tail = 0;
626 while (readoutStrips.size() > 0 && readoutStrips.back() > nCells - 1) {
627 readoutStrips.pop_back();
628 tail += readoutCharges.back();
629 readoutCharges.pop_back();
630 }
631 readoutCharges.back() += tail;
632 // Poisson smearing - Gaussian approximation
633 if (m_applyPoisson)
634 for (auto& c : readoutCharges)
635 c = (c <= 0) ? 0 : std::max(0.0, gRandom->Gaus(c, std::sqrt(info.c_fanoFactorSi * c)));
636
637 // Fill diagnostic charts
639 TH1D* histo = (!have_electrons) ? m_histChargeSharing_u : m_histChargeSharing_v;
640 double d = (!have_electrons) ? seedPos - center.X() : seedPos - center.Y();
641 for (std::size_t index = 0; index < readoutStrips.size(); ++ index) {
642 double dist = d + (readoutStrips[index] - seedStrip) * 2 * geomPitch;
643 histo->Fill(dist / Unit::um, readoutCharges[index]);
644 }
645 }
646 if (m_histHitTime) {
649 SVDModeByte modeByte = storeSVDEvtInfo->getModeByte();
651 }
652
653 // Store
654 B2DEBUG(29, "currentTime = " << m_currentTime << " + 0.5 driftTime = " << 0.5 * driftTime << " = " << m_currentTime + 0.5 *
655 driftTime);
656
657 // Specify beta prime decay time
658 double betaPrimeDecayTime = (!have_electrons) ? m_betaPrimeDecayTimeU : m_betaPrimeDecayTimeV;
659
660 // Specify coupling and adjacent-channel waveform shape
661 double apvCoupling = m_ChargeSimCal.getCouplingConstant(currentSensorID, !have_electrons, "APVCoupling");
662 WaveformShape w_adjacent = (!have_electrons) ? w_adjacentU : w_adjacentV;
663
664 double recoveredCharge = 0;
665 for (std::size_t index = 0; index < readoutStrips.size(); index ++) {
666 // NB> To first approximation, we assign to the signal 1/2*driftTime.
667 // This doesn't change the charge collection, only charge collection timing.
668 waveforms[readoutStrips[index]].add(m_currentTime + 0.5 * driftTime, readoutCharges[index],
669 betaPrimeDecayTime, m_currentParticle, m_currentTrueHit, w_betaprime);
670 // coupled signal left neighbour
671 if (index > 0)
672 waveforms[readoutStrips[index]].add(m_currentTime + 0.5 * driftTime, apvCoupling * readoutCharges[index - 1],
673 1, m_currentParticle, m_currentTrueHit, w_adjacent);
674 // coupled signal right neighbour
675 if (index < readoutStrips.size() - 1)
676 waveforms[readoutStrips[index]].add(m_currentTime + 0.5 * driftTime, apvCoupling * readoutCharges[index + 1],
677 1, m_currentParticle, m_currentTrueHit, w_adjacent);
678 recoveredCharge += readoutCharges[index];
679 B2DEBUG(29, "strip: " << readoutStrips[index] << " charge: " << readoutCharges[index]);
680 }
681 B2DEBUG(29, "Digitized " << recoveredCharge << " of " << carriers << " original carriers.");
682}
static const double kBoltzmann
Boltzmann constant in GeV/K.
Definition: Const.h:696
float getCouplingConstant(const VxdID &sensorID, const bool &isU, const std::string &couplingName) const
Return coupling constant.
Class to store SVD mode information.
Definition: SVDModeByte.h:69
baseType getTriggerBin() const
Get the triggerBin id.
Definition: SVDModeByte.h:140
TH1D * m_histHitTime
Histogram showing the hit time.
TH1D * m_histDistanceToPlane_e
Histogram showing the distance to plane for e.
TH1D * m_histChargeSharing_u
Histogram showing the charge sharing + diffusion in u (r-phi).
double m_sensorThickness
Thickness of current sensor (read from m_currentSensorInfo)
TH1D * m_histVelocity_h
Histogram showing the velocity of h.
TH1D * m_histVelocity_e
Histogram showing the velocity of e-.
TH1D * m_histLorentz_v
Histogram showing the Lorentz angles in v (z).
int m_currentParticle
Index of the particle which caused the current hit.
TH1D * m_histChargeSharing_v
Histogram showing the charge sharing + diffusion in v (z).
TH1D * m_histMobility_h
Histogram showing the mobility of h.
double m_currentTime
Time of the current SimHit.
TH1D * m_histMobility_e
Histogram showing the mobility of e-.
SVDChargeSimulationCalibrations m_ChargeSimCal
SVDChargeSimulationCalibrations calibrations db object.
TH1D * m_histDistanceToPlane_h
Histogram showing the distance to plane for h.
TH1D * m_histDriftTime_e
Histogram showing the drift time of e.
const SensorInfo * m_currentSensorInfo
Pointer to the SensorInfo of the current sensor.
TH1D * m_histLorentz_u
Histogram showing the Lorentz angles in u (r-phi).
TH2F * m_histHitTimeTB
Histogram showing the hit time vs TB.
TH1D * m_histDriftTime_h
Histogram showing the drift time of h.
int m_currentTrueHit
Index of the TrueHit the current hit belongs to.
const SVDSimHit * m_currentHit
Pointer to the SVDSimhit currently digitized.
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:25
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
static const double e
Standard of [electric charge].
Definition: Unit.h:53
static const double um
[micrometers]
Definition: Unit.h:71
static const double ns
Standard of [time].
Definition: Unit.h:48
VxdID getSensorID() const
Return the sensorID of the sensor the electron was deposited in.
Definition: VXDSimHit.h:66
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
double w_adjacentU(double t)
Adjacent-channel waveform U-side.
double w_betaprime(double t)
Beta-prime waveform shape, x^alpha/(1+x)^beta.
std::function< double(double)> WaveformShape
WaveformShape type.
double w_adjacentV(double t)
Adjacent-channel waveform V-side.
std::map< short int, SVDWaveform > StripWaveforms
Map of all channels' waveforms in one sensor side.

◆ 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 BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, GetEventFromSocketModule, CalibrationCollectorModule, AlignDQMModule, CosmicsAlignmentValidationModule, CurlTaggerModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, arichBtestModule, ARICHDQMModule, B2BIIMCParticlesMonitorModule, B2BIIConvertMdstModule, B2BIIMdstInputModule, BelleMCOutputModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgTagSetterModule, BGOverlayInputModule, AnalysisPhase1StudyModule, NtuplePhase1_v6Module, ReprocessorModule, BeamabortStudyModule, BeamDigitizerModule, BgoDigitizerModule, BgoStudyModule, ClawDigitizerModule, ClawStudyModule, ClawsDigitizerModule, ClawsStudyModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, DosiDigitizerModule, DosiStudyModule, FANGSDigitizerModule, FANGSStudyModule, He3DigitizerModule, He3tubeStudyModule, MicrotpcStudyModule, TpcDigitizerModule, TPCStudyModule, PinDigitizerModule, PindiodeStudyModule, PlumeDigitizerModule, QcsmonitorDigitizerModule, QcsmonitorStudyModule, CDCCosmicAnalysisModule, CDCCRTestModule, cdcDQM7Module, CDCDQMModule, CDCPackerModule, CDCRecoTrackFilterModule, CDCUnpackerModule, DAQPerfModule, RxSocketModule, TxSocketModule, DqmHistoManagerModule, MonitorDataModule, TrackAnaModule, Ds2SampleModule, ReceiveEventModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, ElapsedTimeModule, DeSerializerPXDModule, GenRawSendModule, Root2RawModule, SerializerModule, CertifyParallelModule, Ds2RawModule, Ds2RbufModule, EvReductionModule, FastRbuf2DsModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, Ds2RawFileModule, PartialSeqRootReaderModule, SeqRootMergerModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, PhysicsObjectsDQMModule, PhysicsObjectsMiraBelleBhabhaModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, PhysicsObjectsMiraBelleHadronModule, PhysicsObjectsMiraBelleModule, ECLBackgroundModule, ECLChargedPIDModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLClusterPSDModule, ECLCovarianceMatrixModule, ECLCRFinderModule, ECLDataAnalysisModule, ECLDigitCalibratorModule, ECLDigitizerModule, ECLDigitizerPureCsIModule, EclDisplayModule, ECLDQMModule, ECLDQMEXTENDEDModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLLocalRunCalibratorModule, ECLLOMModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLUnpackerModule, ECLWaveformFitModule, HistoModule, SubEventModule, SwitchDataStoreModule, EventInfoPrinterModule, RandomBarrierModule, HistoManagerModule, StatisticsSummaryModule, SeqRootInputModule, SeqRootOutputModule, RxModule, TxModule, ZMQTxInputModule, ZMQTxWorkerModule, EvtGenDecayModule, OverrideGenerationFlagsModule, BKLMAnaModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, EKLMDataCheckerModule, KLMClusterEfficiencyModule, KLMClustersReconstructorModule, KLMDigitizerModule, KLMDQMModule, KLMDQM2Module, KLMPackerModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMUnpackerModule, AWESOMEBasicModule, PXDBackgroundModule, PXDClustersFromTracksModule, PXDPerformanceModule, Convert2RawDetModule, PrintDataModule, PrintEventRateModule, Root2BinaryModule, CDCDedxDQMModule, CDCDedxValidationModule, EventT0ValidationModule, DataWriterModule, KlongValidationModule, KLMMuonIDDNNExpertModule, FullSimModule, SVDBackgroundModule, SVDClusterCalibrationsMonitorModule, SVDHotStripFinderModule, SVDLatencyCalibrationModule, SVDLocalCalibrationsMonitorModule, SVDPositionErrorScaleFactorImporterModule, SVDTimeCalibrationsMonitorModule, svdDumpModule, SVDPackerModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, SVDClusterEvaluationTrueInfoModule, SVDClusterFilterModule, SVDOccupancyAnalysisModule, SVDPerformanceModule, SVDShaperDigitsFromTracksModule, SVDClusterizerModule, SVDCoGTimeEstimatorModule, SVDDataFormatCheckModule, SVDRecoDigitCreatorModule, SVD3SamplesEmulatorModule, SVDTriggerQualityGeneratorModule, SVDUnpackerModule, TOPBackgroundModule, TOPChannelT0MCModule, TOPTriggerDigitizerModule, TOPDoublePulseGeneratorModule, TOPGainEfficiencyCalculatorModule, TOPLaserHitSelectorModule, TOPInterimFENtupleModule, TOPLaserCalibratorModule, TOPMCTrackMakerModule, TOPNtupleModule, TOPPackerModule, TOPRawDigitConverterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TOPUnpackerModule, TOPWaveformFeatureExtractorModule, TOPWaveformQualityPlotterModule, TOPXTalkChargeShareSetterModule, ExtModule, GenfitVisModule, MCV0MatcherModule, MCTrackCandClassifierModule, MuidModule, MCSlowPionPXDROICreatorModule, PXDROIFinderModule, SVDROIDQMModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, RT2SPTCConverterModule, SPTCmomentumSeedRetrieverModule, SPTCvirtualIPRemoverModule, TrackFinderMCTruthRecoTracksModule, EffPlotsModule, HitXPModule, TrackingPerformanceEvaluationModule, V0findingPerformanceEvaluationModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, TrackFinderVXDAnalizerModule, VXDSimpleClusterizerModule, NoKickCutsEvalModule, SectorMapBootstrapModule, VXDTFTrainingDataCollectorModule, FindletModule< AFindlet >, FindletModule< HitBasedT0Extractor >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< FacetCreator >, FindletModule< HitReclaimer >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinder >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerNDFinderModule, TRGCDCModule, TRGCDCETFUnpackerModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSFUnpackerModule, TRGCDCTSStreamModule, MCMatcherTRGECLModule, TRGECLFAMModule, TRGECLModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLModule, TRGEFFDQMModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLSummaryModule, TRGGDLUnpackerModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLDQMModule, TRGGRLUnpackerModule, KLMTriggerModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TRGRAWDATAModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisExampleModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisKLM2Module, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDDoseModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDGeneralModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DQMHistReferenceModule, DQMHistSnapshotsModule, PyModule, SVDUnpackerDQMModule, TrackSetEvaluatorHopfieldNNDEVModule, vxdDigitMaskingModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisEpicsOutputModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisTRGModule, and DQMHistOutputToEPICSModule.

Definition at line 166 of file Module.h.

166{};

◆ 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:519
bool m_hasReturnValue
True, if the return value is set.
Definition: Module.h:518

◆ event()

void event ( void  )
overridevirtual

Digitize one event.

Reimplemented from Module.

Definition at line 298 of file SVDDigitizerModule.cc.

299{
300
301 //get number of samples and relativeShift
303 SVDModeByte modeByte = storeSVDEvtInfo->getModeByte();
304 m_relativeShift = storeSVDEvtInfo->getRelativeShift();
305 m_nAPV25Samples = storeSVDEvtInfo->getNSamples();
306
307 //Compute time of the first sample, update latency
308 const double systemClockPeriod = 1. / m_hwClock->getGlobalClockFrequency();
309 int triggerBin = modeByte.getTriggerBin();
310
311 m_initTime = m_startSampling - systemClockPeriod * triggerBin;
312
313 m_is3sampleEvent = false;
314 if (m_nAPV25Samples == 3) {
315 m_is3sampleEvent = true;
317 B2DEBUG(25, "3-sample event, starting sample = " << m_startingSample);
318 } else m_startingSample = 0; //not used
319
320 // set APV mode for background overlay
322
323 // Generate current event time
327 // We have negative event times, so we have to encode!
328 storeEvent->setTime(static_cast<unsigned long>(1000 + m_currentEventTime));
329 } else
330 m_currentEventTime = 0.0;
331
332 // Clear sensors' waveforms and process SimHits
333 for (Waveforms::value_type& sensorWaveforms : m_waveforms) {
334 sensorWaveforms.second.first.clear(); // u-side channels
335 sensorWaveforms.second.second.clear(); // v-side channels
336 }
337 // m_currentSensorWaveforms = 0;
338 // m_currentSensorInfo = 0;
339
343
344 RelationArray mcParticlesToSimHits(storeMCParticles, storeSimHits, m_relMCParticleSimHitName);
345 RelationArray trueHitsToSimHits(storeTrueHits, storeSimHits, m_relTrueHitSimHitName);
346
347 RelationIndex<MCParticle, SVDSimHit> relMCParticleSimHit(storeMCParticles, storeSimHits, m_relMCParticleSimHitName);
348 RelationIndex<SVDTrueHit, SVDSimHit> relTrueHitSimHit(storeTrueHits, storeSimHits, m_relTrueHitSimHitName);
349
350 unsigned int nSimHits = storeSimHits.getEntries();
351 if (nSimHits == 0) {
352 return;
353 }
354
355 //Check sensor info and set pointers to current sensor
356 for (unsigned int i = 0; i < nSimHits; ++i) {
357 m_currentHit = storeSimHits[i];
359 relMCParticleSimHit.getFirstElementTo(m_currentHit);
360 if (mcRel) {
362 if (mcRel->weight < 0) {
363 //This simhit is from a particle which was not saved by the simulation
364 //so we do not take it into account for relations. Otherwise we might
365 //end up adding positive and negative weights together
367 }
368 } else {
369 // Don't bother with warnings for background SimHits
371 B2WARNING(
372 "Could not find MCParticle which produced SVDSimhit " << i);
374 }
376 relTrueHitSimHit.getFirstElementTo(m_currentHit);
377 //We only care about true hits from particles which have not been ignored
378 if (trueRel && trueRel->weight > 0) {
379 m_currentTrueHit = trueRel->indexFrom;
380 } else {
381 m_currentTrueHit = -1;
382 }
383
384 VxdID sensorID = m_currentHit->getSensorID();
385 if (!m_currentSensorInfo || sensorID != m_currentSensorInfo->getID()) {
387 dynamic_cast<const SensorInfo*>(&VXD::GeoCache::getInstance().getSensorInfo(sensorID));
389 B2FATAL(
390 "Sensor Information for Sensor " << sensorID << " not found, make sure that the geometry is set up correctly");
391
392 const SensorInfo& info = *m_currentSensorInfo;
393 // Publish some useful data
394 m_sensorThickness = info.getThickness();
396 B2DEBUG(29,
397 "Sensor Parameters for Sensor " << sensorID << ": " << endl
398 << " --> Width: " << m_currentSensorInfo->getWidth() << endl
399 << " --> Length: " << m_currentSensorInfo->getLength() << endl
400 << " --> uPitch: " << m_currentSensorInfo->getUPitch() << endl
401 << " --> vPitch: " << m_currentSensorInfo->getVPitch(-m_currentSensorInfo->getLength() / 2.0)
402 << ", " << m_currentSensorInfo->getVPitch(m_currentSensorInfo->getLength() / 2.0) << endl
403 << " --> Thickness: " << m_currentSensorInfo->getThickness() << endl
404 << " --> Deplet. voltage:" << m_currentSensorInfo->getDepletionVoltage() << endl
405 << " --> Bias voltage: " << m_currentSensorInfo->getBiasVoltage() << endl
406 );
407
408 }
409 B2DEBUG(28,
410 "Processing hit " << i << " in Sensor " << sensorID << ", related to MCParticle " << m_currentParticle);
411 processHit();
412 }
413 // If storage of waveforms is required, store them in the statistics file.
414 if (m_storeWaveforms) {
415 m_rootFile->cd();
417 }
418 if (m_signalsList != "")
419 saveSignals();
420
421
422 saveDigits();
423
424
425
426}
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation.
Definition: RelationIndex.h:76
static void setAPVMode(size_t mode, size_t firstSample)
set APV mode for the event
void processHit()
Process one SVDSimHit by dividing the step in smaller steps and drifting the charge.
std::string m_relTrueHitSimHitName
Name of the relation between SVDTrueHits and SVDSimHits.
void saveDigits()
Save digits to the DataStore Saves samples of generated waveforms.
int getFirstSample(int triggerBin, int relativShift)
return the starting sample
int m_startingSample
Starting sample for the selection of 3 samples in 3-mixed-6.
bool m_is3sampleEvent
True if the event should be simulated with 3 sample.
TFile * m_rootFile
Pointer to the ROOT filename for statistics.
void saveSignals()
Save signals to a root-delimited file (to be analyzed in Python).
int m_nAPV25Samples
number of digitized samples read from SVDEventInfo
int m_relativeShift
relative shift in SVDEventInfo obj
void saveWaveforms()
Save waveforms to the statistics file.
double m_initTime
Time window start, including the triggerBin effect.
std::string m_relMCParticleSimHitName
Name of the relation between MCParticles and SVDSimHits.
float m_currentEventTime
Current event time.
double getBiasVoltage() const
Return the bias voltage on the sensor.
Definition: SensorInfo.h:163
double getDepletionVoltage() const
Return the depletion voltage of the sensor.
Definition: SensorInfo.h:161
virtual unsigned short getBackgroundTag() const
Get background tag.
Definition: SimHitBase.h:46
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
double getUPitch(double v=0) const
Return the pitch of the sensor.
double getWidth(double v=0) const
Return the width of the sensor.
VxdID getID() const
Return the ID of the Sensor.
double getVPitch(double v=0) const
Return the pitch of the sensor.
double getThickness() const
Return the thickness of the sensor.
double getLength() const
Return the length of the sensor.
RelationElement::index_type indexFrom
index of the element from which the relation points.
RelationElement::weight_type weight
weight of the relation.

◆ 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 pathes */
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://confluence.desy.de/display/BI/Software+Basf2manual#Module_Development
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>()),
@ 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: "<"
Base class for Modules.
Definition: Module.h:72
LogConfig & getLogConfig()
Returns the log system configuration.
Definition: Module.h:225
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
void setLogConfig(const LogConfig &logConfig)
Set the log system configuration.
Definition: Module.h:230
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:202
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
bool hasCondition() const
Returns true if at least one condition was set for the module.
Definition: Module.h:311
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:197
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:214
bool hasProperties(unsigned int propertyFlags) const
Returns true if all specified property flags are available in this module.
Definition: Module.cc:160
std::string getPathString() const override
return the module name.
Definition: Module.cc:192

◆ 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 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

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

Definition at line 314 of file Module.h.

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

◆ 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 202 of file Module.h.

202{return m_description;}
std::string m_description
The description of the module.
Definition: Module.h:511

◆ 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, StorageRootOutputModule, and RootOutputModule.

Definition at line 134 of file Module.h.

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

◆ getFirstSample()

int getFirstSample ( int  triggerBin,
int  relativShift 
)
protected

return the starting sample

Definition at line 968 of file SVDDigitizerModule.cc.

969{
970 int nTriggerClocks = triggerBin + relativeShift;
971 return floor(nTriggerClocks / 4);
972}

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

506{ 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 187 of file Module.h.

187{return m_name;}
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition: Module.h:508

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{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.
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition: Module.h:516

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ 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 381 of file Module.h.

381{ 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:509

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

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

Definition at line 311 of file Module.h.

311{ 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 378 of file Module.h.

378{ 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://confluence.desy.de/display/BI/Software+ModCondTut 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 the module and check module parameters.

Reimplemented from Module.

Definition at line 122 of file SVDDigitizerModule.cc.

123{
124
125 //Register all required collections
127
129
131 storeShaperDigits.registerInDataStore();
132 storeShaperDigits.registerRelationTo(storeMCParticles);
133 storeShaperDigits.registerRelationTo(storeTrueHits);
134
136 DataStore::arrayName<SVDShaperDigit>(m_storeShaperDigitsName),
137 DataStore::arrayName<MCParticle>(m_storeMCParticlesName));
139 DataStore::arrayName<SVDShaperDigit>(m_storeShaperDigitsName),
140 DataStore::arrayName<SVDTrueHit>(m_storeTrueHitsName));
141
143 StoreObjPtr<EventMetaData> storeEvents;
144
145 //Set names in case default was used. We need the names to initialize the RelationIndices.
147 DataStore::arrayName<MCParticle>(m_storeMCParticlesName),
148 DataStore::arrayName<SVDSimHit>(m_storeSimHitsName));
150 DataStore::arrayName<SVDTrueHit>(m_storeTrueHitsName),
151 DataStore::arrayName<SVDSimHit>(m_storeSimHitsName));
152
153 // Convert parameters to correct units
155 m_noiseFraction = TMath::Freq(m_SNAdjacent); // 0.9... !
161
162 B2DEBUG(29,
163 "SVDDigitizer parameters (in default system units, *=cannot be set directly):");
164 B2DEBUG(29, " DATASTORE COLLECTIONS:");
165 B2DEBUG(29,
166 " --> MCParticles: " << DataStore::arrayName<MCParticle>(m_storeMCParticlesName));
167 B2DEBUG(29,
168 " --> Digits: " << DataStore::arrayName<SVDShaperDigit>(m_storeShaperDigitsName));
169 B2DEBUG(29,
170 " --> SimHits: " << DataStore::arrayName<SVDSimHit>(m_storeSimHitsName));
171 B2DEBUG(29,
172 " --> TrueHits: " << DataStore::arrayName<SVDTrueHit>(m_storeTrueHitsName));
173 B2DEBUG(29, " --> MCSimHitRel: " << m_relMCParticleSimHitName);
174 B2DEBUG(29, " --> DigitMCRel: " << m_relShaperDigitMCParticleName);
175 B2DEBUG(29, " --> TrueSimRel: " << m_relTrueHitSimHitName);
176 B2DEBUG(29, " --> DigitTrueRel: " << m_relShaperDigitTrueHitName);
177 B2DEBUG(29, " PHYSICS: ");
178 B2DEBUG(29, " --> SegmentLength: " << m_segmentLength);
179 B2DEBUG(29, " NOISE: ");
180 B2DEBUG(29, " --> Add Poisson noise " << (m_applyPoisson ? "true" : "false"));
181 B2DEBUG(29, " --> Zero suppression cut" << m_SNAdjacent);
182 B2DEBUG(29, " --> Round ZS cut: " << (m_roundZS ? "true" : "false"));
183 B2DEBUG(29, " --> Samples over ZS cut:" << m_nSamplesOverZS);
184 B2DEBUG(29, " --> Noise fraction*: " << 1.0 - m_noiseFraction);
185 B2DEBUG(29, " TIMING: ");
186 B2DEBUG(29, " --> Sampling time: " << m_samplingTime);
187 B2DEBUG(29, " --> Start of int. wind.:" << m_startSampling);
188 B2DEBUG(29, " --> Random event times. " << (m_randomizeEventTimes ? "true" : "false"));
189 B2DEBUG(29, " REPORTING: ");
190 B2DEBUG(29, " --> statisticsFilename: " << m_rootFilename);
191 B2DEBUG(29,
192 " --> storeWaveforms: " << (m_storeWaveforms ? "true" : "false"));
193
194 if (!m_rootFilename.empty()) {
195 m_rootFile = new TFile(m_rootFilename.c_str(), "RECREATE");
196 m_rootFile->cd();
197 m_histChargeSharing_v = new TH1D("h_Diffusion_v", " 'Diffusion' distance, v",
198 200, -500, 500);
199 m_histChargeSharing_v->GetXaxis()->SetTitle(" distance v [um]");
200 m_histChargeSharing_u = new TH1D("h_Diffusion_u",
201 " 'Diffusion' distance, u", 100, -200, 200);
202 m_histChargeSharing_u->GetXaxis()->SetTitle("distance u [um]");
203 m_histLorentz_u = new TH1D("h_LorentzAngle_u", "Lorentz angle, holes",
204 100, -0.08, 0);
205 m_histLorentz_u->GetXaxis()->SetTitle("Lorentz angle");
206 m_histLorentz_v = new TH1D("h_LorentzAngle_v",
207 "Lorentz angle, electrons", 100, -0.002, 0.002);
208 m_histLorentz_v->GetXaxis()->SetTitle("Lorentz angle");
209 m_signalDist_u = new TH1D("h_signalDist_u",
210 "Strip signals vs. TrueHits, holes", 100, -400, 400);
211 m_signalDist_u->GetXaxis()->SetTitle("U strip position - TrueHit u [um]");
212 m_signalDist_v = new TH1D("h_signalDist_v",
213 "Strip signals vs. TrueHits, electrons", 100, -400, 400);
214 m_signalDist_v->GetXaxis()->SetTitle("V strip position - TrueHit v [um]");
215
216 m_histMobility_e = new TH1D("h_elecMobility", "electron Mobility",
217 30, 900, 1200);
218 m_histMobility_e->GetXaxis()->SetTitle("Electron Mobility");
219 m_histMobility_h = new TH1D("h_holeMobility", "hole Mobility",
220 30, 400, 500);
221 m_histMobility_h->GetXaxis()->SetTitle("Holes Mobility");
222
223 m_histDistanceToPlane_e = new TH1D("h_elecDistToPlane", "electron Distance to Plane",
224 50, -0.05, 0.05);
225 m_histDistanceToPlane_e->GetXaxis()->SetTitle("Electron Distance To Plane [cm]");
226 m_histDistanceToPlane_h = new TH1D("h_holeDistToPlane", "holes Distance to Plane",
227 50, -0.05, 0.05);
228 m_histDistanceToPlane_h->GetXaxis()->SetTitle("Holes Distance To Plane [cm]");
229
230 m_histVelocity_e = new TH1D("h_elecVelocity", "electrons Velocity (z)",
231 100, 0.001, 0.01);
232
233 m_histVelocity_e->GetXaxis()->SetTitle("Electron Velocity [cm/s]");
234 m_histVelocity_h = new TH1D("h_holeVelocity", "holes Velocity (z)",
235 30, -0.002, -0.0004);
236 m_histVelocity_h->GetXaxis()->SetTitle("holes Velocity [cm/s]");
237
238 m_histDriftTime_e = new TH1D("h_elecDriftTime", "electron Drift Time",
239 30, 0, 30);
240 m_histDriftTime_e->GetXaxis()->SetTitle("Electron Drift Time");
241 m_histDriftTime_h = new TH1D("h_holeDriftTime", "hole Drift Time",
242 30, 0, 30);
243 m_histDriftTime_h->GetXaxis()->SetTitle("Hole Drift Time");
244
245 m_histHitTime = new TH1D("h_startAPVTime", "start APV Time",
246 200, -100, 100);
247 m_histHitTime->GetXaxis()->SetTitle("time (ns)");
248 m_histHitTimeTB = new TH2F("h_startAPVTimeTB", "start APV Time vs TB",
249 200, -100, 100, 4, -0.5, 3.5);
250 m_histHitTimeTB->GetXaxis()->SetTitle("time (ns)");
251 m_histHitTimeTB->GetYaxis()->SetTitle("TB");
252
253 if (m_storeWaveforms) {
254 m_waveTree = new TTree("waveTree", "SVD waveforms");
255 m_waveTree->Branch("sensor", &tree_vxdID, "sensor/I");
256 m_waveTree->Branch("u_or_v", &tree_uv, "u_or_v/I");
257 m_waveTree->Branch("strip", &tree_strip, "strip/I");
258 m_waveTree->Branch("signal", tree_signal, "signal[20]/D");
259 }
260 } else {
261 // No waveforms can be stored if there is no statistics file.
262 m_storeWaveforms = false;
263 }
264}
static std::string relationName(const std::string &fromName, const std::string &toName, std::string const &namedRelation="")
Return storage name for a relation between two arrays of the given names.
Definition: DataStore.h:180
std::string m_relShaperDigitMCParticleName
Name of the relation between SVDShaperDigits and MCParticles.
TH1D * m_signalDist_u
Histogram showing the distribution of digit signals in u (r-phi).
TH1D * m_signalDist_v
Histogram showing the distribution of digit signals in v (z).
double m_noiseFraction
(derived from SNAdjacent) Fraction of noisy strips per sensor.
std::string m_relShaperDigitTrueHitName
Name of the relation between SVDShaperDigits and SVDTrueHits.
TTree * m_waveTree
Tree for waveform storage.
static const double mm
[millimeters]
Definition: Unit.h:70

◆ processHit()

void processHit ( )

Process one SVDSimHit by dividing the step in smaller steps and drifting the charge.

Definition at line 428 of file SVDDigitizerModule.cc.

429{
430 // Set time of the hit
432
433 //Get Steplength and direction
434 const ROOT::Math::XYZVector& startPoint = m_currentHit->getPosIn();
435 const ROOT::Math::XYZVector& stopPoint = m_currentHit->getPosOut();
436 ROOT::Math::XYZVector direction = stopPoint - startPoint;
437 double trackLength = direction.R();
438
439 if (m_currentHit->getPDGcode() == Const::photon.getPDGCode() || trackLength < 0.1 * Unit::um) {
440 //Photons deposit energy at the end of their step
441 driftCharge(stopPoint, m_currentHit->getElectrons(), SVD::SensorInfo::electron);
443 } else {
444 //Otherwise, split into segments of (default) max. 5µm and
445 //drift the charges from the center of each segment
447 double lastFraction {0};
448 double lastElectrons {0};
449
450 for (auto& segment : segments) {
451 //Simhit returns step fraction and cumulative electrons. We want the
452 //center of these steps and electrons in this step
453 const double f = (segment.first + lastFraction) / 2;
454 const double e = segment.second - lastElectrons;
455 //Update last values
456 std::tie(lastFraction, lastElectrons) = segment;
457
458 //And drift charge from that position
459 const ROOT::Math::XYZVector position = startPoint + f * direction;
460 driftCharge(position, e, SVD::SensorInfo::electron);
462 }
463 }
464}
int getPDGCode() const
PDG code.
Definition: Const.h:473
static const ParticleType photon
photon particle
Definition: Const.h:673
void driftCharge(const ROOT::Math::XYZVector &position, double carriers, SVD::SensorInfo::CarrierType carrierType)
Drift the charge inside the silicon.
float getGlobalTime() const override
Return the time of the electron deposition.
Definition: VXDSimHit.h:78
int getPDGcode() const
Return the PDG code of the particle causing the electron deposition.
Definition: VXDSimHit.h:68
ROOT::Math::XYZVector getPosOut() const
Return the end point of the electron deposition in local coordinates.
Definition: VXDSimHit.h:72
std::vector< std::pair< float, float > > getElectronsConstantDistance(double length) const
Get the electron deposition along constant stepsize.
Definition: VXDSimhit.cc:32
float getElectrons() const
Return the number of created electrons.
Definition: VXDSimhit.cc:15
ROOT::Math::XYZVector getPosIn() const
Return the start point of the electron deposition in local coordinates.
Definition: VXDSimHit.h:70

◆ saveDigits()

void saveDigits ( )

Save digits to the DataStore Saves samples of generated waveforms.

Definition at line 690 of file SVDDigitizerModule.cc.

691{
692
696 RelationArray relShaperDigitMCParticle(storeShaperDigits, storeMCParticles,
698 RelationArray relShaperDigitTrueHit(storeShaperDigits, storeTrueHits,
700
701 //Get SVD config from SVDEventInfo
702 // int runType = (int) modeByte.getRunType();
703 // int eventType = (int) modeByte.getEventType();
704
705
706 // ... to store digit-digit relations
707 vector<pair<unsigned int, float> > digit_weights;
708
709 // Take samples at the desired times, add noise, zero-suppress and save digits.
710 for (Waveforms::value_type& sensorWaveforms : m_waveforms) {
711 int sensorID = sensorWaveforms.first;
712 // u-side digits:
713
714 // Cycle through signals and generate samples
715 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.first) {
716 short int iStrip = stripWaveform.first;
717 SVDWaveform& s = stripWaveform.second;
718 // Now generate samples in time and save as digits.
719 vector<double> samples;
720 // ... to store digit-digit relations
721 digit_weights.clear();
722 digit_weights.reserve(SVDShaperDigit::c_nAPVSamples);
723
724 double elNoise = m_NoiseCal.getNoiseInElectrons(sensorID, true, iStrip);
725 double gain = 1 / m_PulseShapeCal.getChargeFromADC(sensorID, true, iStrip, 1);
726 double electronWeight = m_ChargeSimCal.getElectronWeight(sensorID, true);
727
728 double t = m_initTime;
729 B2DEBUG(25, "start sampling at " << m_initTime);
730 for (int iSample = 0; iSample < (int) SVDShaperDigit::c_nAPVSamples; iSample ++) {
731 samples.push_back(addNoise(electronWeight * s(t), elNoise));
732 t += m_samplingTime;
733 }
734
735 SVDWaveform::relations_map particles = s.getMCParticleRelations();
736 SVDWaveform::relations_map truehits = s.getTrueHitRelations();
737
738 // Save SVDShaperDigits
739
740 // 1. Convert to ADU
742 std::transform(samples.begin(), samples.end(), rawSamples.begin(),
743 [&](double x)->SVDShaperDigit::APVRawSampleType {
744 return SVDShaperDigit::trimToSampleRange(x * gain);
745 });
746
747 // 2.a Check if over threshold
748 auto rawThreshold = m_SNAdjacent * elNoise * gain;
749 if (m_roundZS) rawThreshold = round(rawThreshold);
750 auto n_over = std::count_if(rawSamples.begin(), rawSamples.end(),
751 std::bind(std::greater<double>(), _1, rawThreshold)
752 );
753 if (n_over < m_nSamplesOverZS) continue;
754
755 // 2.b check if the strip is masked
756 if (m_MaskedStr.isMasked(sensorID, true, iStrip)) continue;
757
758 // 2.c check if the APV is disabled
759 if (!m_map->isAPVinMap(sensorID, true, iStrip)) continue;
760
761 // 2.d.1 check if it's a 3-sample event
762 if (m_is3sampleEvent) {
763 rawSamples[0] = rawSamples[m_startingSample];
764 rawSamples[1] = rawSamples[m_startingSample + 1];
765 rawSamples[2] = rawSamples[m_startingSample + 2];
766 rawSamples[3] = 0.;
767 rawSamples[4] = 0.;
768 rawSamples[5] = 0.;
769 //2.d.2 check if still over threshold
770 n_over = std::count_if(rawSamples.begin(), rawSamples.end(),
771 std::bind(std::greater<double>(), _1, rawThreshold)
772 );
773 if (n_over < m_nSamplesOverZS) continue;
774
775 }
776
777 // 3. Save as a new digit
778 int digIndex = storeShaperDigits.getEntries();
779 storeShaperDigits.appendNew(sensorID, true, iStrip, rawSamples, 0);
780
781 //If the digit has any relations to MCParticles, add the Relation
782 if (particles.size() > 0) {
783 relShaperDigitMCParticle.add(digIndex, particles.begin(), particles.end());
784 }
785 //If the digit has any relations to truehits, add the Relations.
786 if (truehits.size() > 0) {
787 relShaperDigitTrueHit.add(digIndex, truehits.begin(), truehits.end());
788 }
789 // generate SVDShaperDigits
790 } // for stripSignals
791
792 // v-side digits:
793
794 // Cycle through signals and generate samples
795 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.second) {
796 short int iStrip = stripWaveform.first;
797 SVDWaveform& s = stripWaveform.second;
798 // Now generate samples in time and save as digits.
799 vector<double> samples;
800 // ... to store digit-digit relations
801 digit_weights.clear();
802 digit_weights.reserve(SVDShaperDigit::c_nAPVSamples);
803
804 double elNoise = m_NoiseCal.getNoiseInElectrons(sensorID, false, iStrip);
805 double gain = 1 / m_PulseShapeCal.getChargeFromADC(sensorID, false, iStrip, 1);
806 double electronWeight = m_ChargeSimCal.getElectronWeight(sensorID, false);
807
808 double t = m_initTime;
809 for (int iSample = 0; iSample < (int)SVDShaperDigit::c_nAPVSamples; iSample ++) {
810 samples.push_back(addNoise(electronWeight * s(t), elNoise));
811 t += m_samplingTime;
812 }
813
814 SVDWaveform::relations_map particles = s.getMCParticleRelations();
815 SVDWaveform::relations_map truehits = s.getTrueHitRelations();
816
817 // Save SVDShaperDigits
818 // 1. Convert to ADU
820 std::transform(samples.begin(), samples.end(), rawSamples.begin(),
821 [&](double x)->SVDShaperDigit::APVRawSampleType {
822 return SVDShaperDigit::trimToSampleRange(x * gain);
823 });
824
825 // 2.a Check if over threshold
826 auto rawThreshold = m_SNAdjacent * elNoise * gain;
827 if (m_roundZS) rawThreshold = round(rawThreshold);
828 auto n_over = std::count_if(rawSamples.begin(), rawSamples.end(),
829 std::bind(std::greater<double>(), _1, rawThreshold)
830 );
831 if (n_over < m_nSamplesOverZS) continue;
832
833 // 2.b check if the strip is masked
834 if (m_MaskedStr.isMasked(sensorID, false, iStrip)) continue;
835
836 // 2.c check if the APV is disabled
837 if (!m_map->isAPVinMap(sensorID, false, iStrip)) continue;
838
839 // 2.d.1 check if it's a 3-sample event
840 if (m_is3sampleEvent) {
841 rawSamples[0] = rawSamples[m_startingSample];
842 rawSamples[1] = rawSamples[m_startingSample + 1];
843 rawSamples[2] = rawSamples[m_startingSample + 2];
844 rawSamples[3] = 0.;
845 rawSamples[4] = 0.;
846 rawSamples[5] = 0.;
847 //2.d.2 check if still over threshold
848 n_over = std::count_if(rawSamples.begin(), rawSamples.end(),
849 std::bind(std::greater<double>(), _1, rawThreshold)
850 );
851 if (n_over < m_nSamplesOverZS) continue;
852 }
853
854 // 3. Save as a new digit
855 int digIndex = storeShaperDigits.getEntries();
856 storeShaperDigits.appendNew(sensorID, false, iStrip, rawSamples, 0);
857
858 //If the digit has any relations to MCParticles, add the Relation
859 if (particles.size() > 0) {
860 relShaperDigitMCParticle.add(digIndex, particles.begin(), particles.end());
861 }
862 //If the digit has any relations to truehits, add the Relations.
863 if (truehits.size() > 0) {
864 relShaperDigitTrueHit.add(digIndex, truehits.begin(), truehits.end());
865 }
866 } // for stripSignals
867 } // FOREACH sensor
868}
float getElectronWeight(const VxdID &sensorID, const bool &isU) const
Return Geant4 electron weight.
float isMasked(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the comprehensive list of masked strips at FADC level.
float getNoiseInElectrons(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This method provides the correct noise conversion into electrons, taking into account that the noise ...
double getChargeFromADC(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &pulseADC) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
static const std::size_t c_nAPVSamples
Number of APV samples stored.
std::array< APVRawSampleType, c_nAPVSamples > APVRawSamples
array of APVRawSamplesType objects
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibrations db object.
SVDPulseShapeCalibrations m_PulseShapeCal
SVDPulseShapeCalibrations calibrations db object.
double addNoise(double charge, double noise)
Calculate the noise contribution to one strip with given charge.
The SVD waveform class.
Definition: SVDWaveform.h:38
std::map< RelationElement::index_type, RelationElement::weight_type > relations_map
Type to store contributions to strip signal by different particles on output of SVDWaveform.
Definition: SVDWaveform.h:80

◆ saveSignals()

void saveSignals ( )

Save signals to a root-delimited file (to be analyzed in Python).

This method is only called when a name is set for the file.

Definition at line 908 of file SVDDigitizerModule.cc.

909{
910 static size_t recordNo = 0;
911 static const string header("Event\tSensor\tSide\tStrip\tContrib\tTime\tCharge\tTau");
912 regex startLine("^|\n"); // for inserting event/sensor/etc info
913 ofstream outfile(m_signalsList, ios::out | ios::app);
914 if (recordNo == 0) outfile << header << endl;
915 for (Waveforms::value_type& sensorWaveforms : m_waveforms) {
916 VxdID sensorID(sensorWaveforms.first);
917 const SensorInfo& info =
918 dynamic_cast<const SensorInfo&>(VXD::GeoCache::getInstance().getSensorInfo(sensorWaveforms.first));
919 // u-side digits:
920 size_t isU = 1;
921 double thresholdU = 3.0 * info.getElectronicNoiseU();
922 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.first) {
923 size_t strip = stripWaveform.first;
924 SVDWaveform& s = stripWaveform.second;
925 // Read the value only if the signal is large enough.
926 if (s.getCharge() < thresholdU)
927 continue;
928 // Else print to a string
929 ostringstream preamble;
930 // We don't have eventNo, but we don't care about event boundaries.
931 preamble << "$&" << recordNo << '\t' << sensorID << '\t' << isU << '\t' << strip << '\t';
932 string signalString = s.toString();
933 signalString.pop_back(); // remove the last newline!!!
934 string tableString = regex_replace(signalString, startLine, preamble.str());
935 outfile << tableString << endl; // now we have to add the newline back.
936 } // FOREACH stripSignal
937 // x-side digits:
938 isU = 0;
939 double thresholdV = 3.0 * info.getElectronicNoiseV();
940 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.second) {
941 size_t strip = stripWaveform.first;
942 SVDWaveform& s = stripWaveform.second;
943 // Read the value only if the signal is large enough.
944 if (s.getCharge() < thresholdV)
945 continue;
946 // Else print to a string
947 ostringstream preamble;
948 // We don't have eventNo, but we don't care about event boundaries.
949 preamble << "$&" << recordNo << '\t' << sensorID << '\t' << isU << '\t' << strip << '\t';
950 string signalString = s.toString();
951 signalString.pop_back(); // remove the last newline!!!
952 string tableString = regex_replace(signalString, startLine, preamble.str());
953 outfile << tableString << endl; // now we have to add the newline back.
954 } // FOREACH stripSignal
955 } // for sensors
956 outfile.close();
957 recordNo++;
958}

◆ saveWaveforms()

void saveWaveforms ( )

Save waveforms to the statistics file.

This method is only called when storage of waveforms is required.

Definition at line 870 of file SVDDigitizerModule.cc.

871{
872 for (Waveforms::value_type& sensorWaveforms : m_waveforms) {
873 tree_vxdID = sensorWaveforms.first;
874 const SensorInfo& info =
875 dynamic_cast<const SensorInfo&>(VXD::GeoCache::getInstance().getSensorInfo(sensorWaveforms.first));
876 // u-side digits:
877 tree_uv = 1;
878 double thresholdU = 3.0 * info.getElectronicNoiseU();
879 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.first) {
880 tree_strip = stripWaveform.first;
881 SVDWaveform& s = stripWaveform.second;
882 // Read the value only if the signal is large enough.
883 if (s.getCharge() < thresholdU)
884 continue;
885 for (int iTime = 0; iTime < 20; ++iTime) {
886 tree_signal[iTime] = s(10 * iTime);
887 }
888 m_waveTree->Fill();
889 } // FOREACH stripSignal
890 // v-side digits:
891 tree_uv = 0;
892 double thresholdV = 3.0 * info.getElectronicNoiseV();
893 for (StripWaveforms::value_type& stripWaveform : sensorWaveforms.second.second) {
894 tree_strip = stripWaveform.first;
895 SVDWaveform& s = stripWaveform.second;
896 // Read the values only if the signal is large enough
897 if (s.getCharge() < thresholdV)
898 continue;
899 for (int iTime = 0; iTime < 20; ++iTime) {
900 tree_signal[iTime] = s(10. * iTime);
901 }
902 m_waveTree->Fill();
903 } // FOREACH stripSignal
904 } // FOREACH sensor
905 m_rootFile->Flush();
906}

◆ 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}

◆ setLogConfig()

void setLogConfig ( const LogConfig logConfig)
inlineinherited

Set the log system configuration.

Definition at line 230 of file Module.h.

230{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 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ 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}
Class for logging debug, info and error messages.
Definition: LogSystem.h:46
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:191
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition: LogSystem.cc:31
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}

◆ terminate()

void terminate ( void  )
overridevirtual

Terminate the module.

Reimplemented from Module.

Definition at line 960 of file SVDDigitizerModule.cc.

961{
962 if (m_rootFile) {
963 m_rootFile->Write();
964 m_rootFile->Close();
965 }
966}

Member Data Documentation

◆ m_applyPoisson

bool m_applyPoisson = true
protected

Whether or not to apply poisson fluctuation of charge (Fano factor)

Definition at line 131 of file SVDDigitizerModule.h.

◆ m_betaPrimeDecayTimeU

double m_betaPrimeDecayTimeU = 250.0
protected

Decay time of betaprime waveform U-side.

Definition at line 145 of file SVDDigitizerModule.h.

◆ m_betaPrimeDecayTimeV

double m_betaPrimeDecayTimeV = 250.0
protected

Decay time of betaprime waveform V-side.

Definition at line 147 of file SVDDigitizerModule.h.

◆ m_ChargeSimCal

SVDChargeSimulationCalibrations m_ChargeSimCal
protected

SVDChargeSimulationCalibrations calibrations db object.

Definition at line 222 of file SVDDigitizerModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 521 of file Module.h.

◆ m_currentEventTime

float m_currentEventTime = 0.0
protected

Current event time.

This is what gets randomized if m_randomizeEventTimes is true.

Definition at line 171 of file SVDDigitizerModule.h.

◆ m_currentHit

const SVDSimHit* m_currentHit = nullptr
protected

Pointer to the SVDSimhit currently digitized.

Definition at line 194 of file SVDDigitizerModule.h.

◆ m_currentParticle

int m_currentParticle = -1
protected

Index of the particle which caused the current hit.

Definition at line 196 of file SVDDigitizerModule.h.

◆ m_currentSensorInfo

const SensorInfo* m_currentSensorInfo = nullptr
protected

Pointer to the SensorInfo of the current sensor.

Definition at line 202 of file SVDDigitizerModule.h.

◆ m_currentSensorWaveforms

SensorWaveforms* m_currentSensorWaveforms = nullptr
protected

Pointer to the sensor in which the current hit occurred.

Definition at line 200 of file SVDDigitizerModule.h.

◆ m_currentTime

double m_currentTime = 0
protected

Time of the current SimHit.

Definition at line 204 of file SVDDigitizerModule.h.

◆ m_currentTrueHit

int m_currentTrueHit = -1
protected

Index of the TrueHit the current hit belongs to.

Definition at line 198 of file SVDDigitizerModule.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 of file Module.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 518 of file Module.h.

◆ m_histChargeSharing_u

TH1D* m_histChargeSharing_u = nullptr
protected

Histogram showing the charge sharing + diffusion in u (r-phi).

Definition at line 230 of file SVDDigitizerModule.h.

◆ m_histChargeSharing_v

TH1D* m_histChargeSharing_v = nullptr
protected

Histogram showing the charge sharing + diffusion in v (z).

Definition at line 232 of file SVDDigitizerModule.h.

◆ m_histDistanceToPlane_e

TH1D* m_histDistanceToPlane_e = nullptr
protected

Histogram showing the distance to plane for e.

Definition at line 243 of file SVDDigitizerModule.h.

◆ m_histDistanceToPlane_h

TH1D* m_histDistanceToPlane_h = nullptr
protected

Histogram showing the distance to plane for h.

Definition at line 245 of file SVDDigitizerModule.h.

◆ m_histDriftTime_e

TH1D* m_histDriftTime_e = nullptr
protected

Histogram showing the drift time of e.

Definition at line 247 of file SVDDigitizerModule.h.

◆ m_histDriftTime_h

TH1D* m_histDriftTime_h = nullptr
protected

Histogram showing the drift time of h.

Definition at line 249 of file SVDDigitizerModule.h.

◆ m_histHitTime

TH1D* m_histHitTime = nullptr
protected

Histogram showing the hit time.

Definition at line 251 of file SVDDigitizerModule.h.

◆ m_histHitTimeTB

TH2F* m_histHitTimeTB = nullptr
protected

Histogram showing the hit time vs TB.

Definition at line 253 of file SVDDigitizerModule.h.

◆ m_histLorentz_u

TH1D* m_histLorentz_u = nullptr
protected

Histogram showing the Lorentz angles in u (r-phi).

Definition at line 256 of file SVDDigitizerModule.h.

◆ m_histLorentz_v

TH1D* m_histLorentz_v = nullptr
protected

Histogram showing the Lorentz angles in v (z).

Definition at line 258 of file SVDDigitizerModule.h.

◆ m_histMobility_e

TH1D* m_histMobility_e = nullptr
protected

Histogram showing the mobility of e-.

Definition at line 235 of file SVDDigitizerModule.h.

◆ m_histMobility_h

TH1D* m_histMobility_h = nullptr
protected

Histogram showing the mobility of h.

Definition at line 237 of file SVDDigitizerModule.h.

◆ m_histVelocity_e

TH1D* m_histVelocity_e = nullptr
protected

Histogram showing the velocity of e-.

Definition at line 239 of file SVDDigitizerModule.h.

◆ m_histVelocity_h

TH1D* m_histVelocity_h = nullptr
protected

Histogram showing the velocity of h.

Definition at line 241 of file SVDDigitizerModule.h.

◆ m_hwClock

DBObjPtr<HardwareClockSettings> m_hwClock
protected

Hardware Clocks.

Definition at line 143 of file SVDDigitizerModule.h.

◆ m_initTime

double m_initTime = 0
protected

Time window start, including the triggerBin effect.

Starting from this time, signal samples are taken in samplingTime intervals.

Definition at line 157 of file SVDDigitizerModule.h.

◆ m_is3sampleEvent

bool m_is3sampleEvent = false
protected

True if the event should be simulated with 3 sample.

Definition at line 175 of file SVDDigitizerModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 514 of file Module.h.

◆ m_map

std::unique_ptr<SVDOnlineToOfflineMap> m_map
protected

channel mapping map

Definition at line 220 of file SVDDigitizerModule.h.

◆ m_mapping

DBObjPtr<PayloadFile> m_mapping
protected

channel mapping payload

Definition at line 219 of file SVDDigitizerModule.h.

◆ m_MaskedStr

SVDFADCMaskedStrips m_MaskedStr
protected

FADC masked strip payload.

Definition at line 217 of file SVDDigitizerModule.h.

◆ m_maxTimeFrame

float m_maxTimeFrame = 150
protected

High edge of randomization time frame.

Definition at line 167 of file SVDDigitizerModule.h.

◆ m_minTimeFrame

float m_minTimeFrame = -300
protected

Low edge of randomization time frame.

Definition at line 165 of file SVDDigitizerModule.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 516 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 508 of file Module.h.

◆ m_nAPV25Samples

int m_nAPV25Samples = 6
protected

number of digitized samples read from SVDEventInfo

Definition at line 177 of file SVDDigitizerModule.h.

◆ m_NoiseCal

SVDNoiseCalibrations m_NoiseCal
protected

SVDNoise calibrations db object.

Definition at line 223 of file SVDDigitizerModule.h.

◆ m_noiseFraction

double m_noiseFraction = 0.01
protected

(derived from SNAdjacent) Fraction of noisy strips per sensor.

Definition at line 139 of file SVDDigitizerModule.h.

◆ m_nSamplesOverZS

int m_nSamplesOverZS = 1
protected

Keep digit if at least m_nSamplesOverZS are over threshold.

Definition at line 137 of file SVDDigitizerModule.h.

◆ m_package

std::string m_package
privateinherited

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

Definition at line 510 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 512 of file Module.h.

◆ m_PulseShapeCal

SVDPulseShapeCalibrations m_PulseShapeCal
protected

SVDPulseShapeCalibrations calibrations db object.

Definition at line 224 of file SVDDigitizerModule.h.

◆ m_randomizeEventTimes

bool m_randomizeEventTimes = false
protected

Randomize event times? If set to true, event times will be randomized uniformly from m_minTimeFrame to m_maxTimeFrame.

Definition at line 163 of file SVDDigitizerModule.h.

◆ m_relativeShift

int m_relativeShift = 0
protected

relative shift in SVDEventInfo obj

Definition at line 209 of file SVDDigitizerModule.h.

◆ m_relMCParticleSimHitName

std::string m_relMCParticleSimHitName = ""
protected

Name of the relation between MCParticles and SVDSimHits.

Definition at line 113 of file SVDDigitizerModule.h.

◆ m_relShaperDigitMCParticleName

std::string m_relShaperDigitMCParticleName = ""
protected

Name of the relation between SVDShaperDigits and MCParticles.

Definition at line 119 of file SVDDigitizerModule.h.

◆ m_relShaperDigitTrueHitName

std::string m_relShaperDigitTrueHitName = ""
protected

Name of the relation between SVDShaperDigits and SVDTrueHits.

Definition at line 121 of file SVDDigitizerModule.h.

◆ m_relTrueHitSimHitName

std::string m_relTrueHitSimHitName = ""
protected

Name of the relation between SVDTrueHits and SVDSimHits.

Definition at line 115 of file SVDDigitizerModule.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 of file Module.h.

◆ m_rootFile

TFile* m_rootFile = nullptr
protected

Pointer to the ROOT filename for statistics.

Definition at line 228 of file SVDDigitizerModule.h.

◆ m_rootFilename

std::string m_rootFilename = ""
protected

Name of the ROOT filename to output statistics.

Definition at line 181 of file SVDDigitizerModule.h.

◆ m_roundZS

bool m_roundZS = true
protected

Round ZS cut to nearest ADU.

Definition at line 135 of file SVDDigitizerModule.h.

◆ m_samplingTime

double m_samplingTime = -1
protected

Interval between two waveform samples, by default taken from HardwareClockSettings.

Definition at line 149 of file SVDDigitizerModule.h.

◆ m_segmentLength

double m_segmentLength = 0.020
protected

Max.

Segment length to use for charge drifting

Definition at line 127 of file SVDDigitizerModule.h.

◆ m_sensorThickness

double m_sensorThickness = 0.03
protected

Thickness of current sensor (read from m_currentSensorInfo)

Definition at line 206 of file SVDDigitizerModule.h.

◆ m_signalDist_u

TH1D* m_signalDist_u = nullptr
protected

Histogram showing the distribution of digit signals in u (r-phi).

Definition at line 260 of file SVDDigitizerModule.h.

◆ m_signalDist_v

TH1D* m_signalDist_v = nullptr
protected

Histogram showing the distribution of digit signals in v (z).

Definition at line 262 of file SVDDigitizerModule.h.

◆ m_signalsList

std::string m_signalsList = ""
protected

Name of the tab-delimited listing of waveforms.

Definition at line 185 of file SVDDigitizerModule.h.

◆ m_SNAdjacent

double m_SNAdjacent = 3.0
protected

Zero-suppression cut.

Definition at line 133 of file SVDDigitizerModule.h.

◆ m_startingSample

int m_startingSample = 0
protected

Starting sample for the selection of 3 samples in 3-mixed-6.

Definition at line 211 of file SVDDigitizerModule.h.

◆ m_startSampling

double m_startSampling = -2
protected

Time window start, excluding trigger bin effect.

This is the parameter used to tune the latency wrt L1 trigger.

Definition at line 153 of file SVDDigitizerModule.h.

◆ m_storeMCParticlesName

std::string m_storeMCParticlesName = ""
protected

Name of the collection for the MCParticles.

Definition at line 107 of file SVDDigitizerModule.h.

◆ m_storeShaperDigitsName

std::string m_storeShaperDigitsName = ""
protected

Name of the collection for the SVDShaperDigits.

Definition at line 117 of file SVDDigitizerModule.h.

◆ m_storeSimHitsName

std::string m_storeSimHitsName = ""
protected

Name of the collection for the SVDSimhits.

Definition at line 109 of file SVDDigitizerModule.h.

◆ m_storeTrueHitsName

std::string m_storeTrueHitsName = ""
protected

Name of the collection for the SVDTrueHits.

Definition at line 111 of file SVDDigitizerModule.h.

◆ m_storeWaveforms

bool m_storeWaveforms = false
protected

Store waveform data in the reporting file?

Definition at line 183 of file SVDDigitizerModule.h.

◆ m_svdEventInfoName

std::string m_svdEventInfoName = "SVDEventInfoSim"
protected

Name of the SVDEventInfo object.

Definition at line 123 of file SVDDigitizerModule.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 509 of file Module.h.

◆ m_waveforms

Waveforms m_waveforms
protected

Structure containing waveforms in all existing sensors.

Definition at line 191 of file SVDDigitizerModule.h.

◆ m_waveTree

TTree* m_waveTree = nullptr
protected

Tree for waveform storage.

Definition at line 264 of file SVDDigitizerModule.h.

◆ m_xmlFileName

std::string m_xmlFileName = std::string("SVDChannelMapping.xml")
staticprotected

< channel mapping xml filename

Definition at line 218 of file SVDDigitizerModule.h.


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