Time digitization of simulated hits in a single electronic channel.
More...
#include <TimeDigitizer.h>
|
enum | EType {
c_Hit = 0
,
c_ChargeShare = 1
,
c_CrossTalk = 2
,
c_CalPulse = 3
} |
| hit type enumerators
|
|
|
| TimeDigitizer (int moduleID, int pixelID, double timeOffset, double calErrorsSq, int shift, double rmsNoise, const TOPSampleTimes &sampleTimes) |
| Constructor. More...
|
|
void | setSampleTimes (const TOPSampleTimes *sampleTimes) |
| Sets sample times. More...
|
|
void | setNoise (double rmsNoise) |
| Sets noise level. More...
|
|
void | addTimeOfHit (double t, double pulseHeight, EType type, const TOPSimHit *simHit=0) |
| Add time of simulated hit. More...
|
|
int | getModuleID () const |
| Return bar ID. More...
|
|
int | getPixelID () const |
| Return pixel ID. More...
|
|
unsigned | getUniqueID () const |
| Return unique pixel ID. More...
|
|
unsigned | getASICWindow () const |
| Returns ASIC storage window number. More...
|
|
unsigned int | getChannel () const |
| Returns hardware channel number. More...
|
|
unsigned | getScrodID () const |
| Returns SCROD ID. More...
|
|
unsigned | getCarrierNumber () const |
| Returns carrier board number. More...
|
|
unsigned | getASICNumber () const |
| Returns ASIC number. More...
|
|
unsigned | getASICChannel () const |
| Returns ASIC channel number. More...
|
|
bool | isValid () const |
| Check if digitizer instance is valid (e.g. More...
|
|
void | digitize (StoreArray< TOPRawDigit > &rawDigits, StoreArray< TOPDigit > &digits, int threshold=0, int thresholdCount=0, double timeJitter=0) const |
| Do time digitization using simplified pile-up and double-hit-resolution model. More...
|
|
void | digitize (StoreArray< TOPRawWaveform > &waveforms, StoreArray< TOPRawDigit > &rawDigits, StoreArray< TOPDigit > &digits, int threshold, int hysteresis=0, int thresholdCount=0) const |
| Do full waveform time digitization. More...
|
|
|
double | gauss (double x, double mean, double sigma) const |
| Gauss function (pulse shape approximation) More...
|
|
std::vector< short > | generateWaveform (int startSample, const std::vector< double > &baselines, const std::vector< double > &rmsNoises, const std::vector< double > &pedestals, int ADCRange) const |
| Generate waveform. More...
|
|
double | generateTimeWalk (double hitTime, double peakTime) const |
| Generate time walk by taking into account pile-up of hits. More...
|
|
Time digitization of simulated hits in a single electronic channel.
Definition at line 33 of file TimeDigitizer.h.
◆ TimeDigitizer()
TimeDigitizer |
( |
int |
moduleID, |
|
|
int |
pixelID, |
|
|
double |
timeOffset, |
|
|
double |
calErrorsSq, |
|
|
int |
shift, |
|
|
double |
rmsNoise, |
|
|
const TOPSampleTimes & |
sampleTimes |
|
) |
| |
Constructor.
- Parameters
-
moduleID | TOP module ID |
pixelID | pixel ID |
timeOffset | time offset [ns] |
calErrorsSq | calibration uncertainies squared |
shift | shift of waveform window due to asic mis-alignment [num of windows] |
rmsNoise | r.m.s of noise [ADC counts] |
sampleTimes | sample times |
Definition at line 31 of file TimeDigitizer.cc.
39 m_channel = channelMapper.getChannel(pixelID);
40 if (!channelMapper.isChannelValid(
m_channel)) {
41 B2ERROR(
"TimeDigitizer::TimeDigitizer: invalid channel");
51 B2ERROR(
"TimeDigitizer::TimeDigitizer: no valid frontend map found");
const TOPFrontEndMap * getMap(int moduleID, int bs) const
Return map from TOP module side.
const FrontEndMapper & getFrontEndMapper() const
Returns front-end mapper (mapping of SCROD's to positions within TOP modules)
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)
unsigned m_asic
ASIC number.
int m_windowShift
additional wf window shift due to asic mis-alignment
unsigned m_scrodID
SCROD ID.
double m_rmsNoise
r.m.s of noise [ADC counts]
unsigned m_channel
hardware channel number (0-based)
double m_calErrorsSq
calibration uncertainties squared
const TOPSampleTimes * m_sampleTimes
sample times
int m_moduleID
module ID (1-based)
bool m_valid
true, if module/pixel is mapped to hardware
double m_timeOffset
time offset [ns]
unsigned m_carrier
carrier board number
unsigned m_chan
ASIC channel number.
◆ addTimeOfHit()
void addTimeOfHit |
( |
double |
t, |
|
|
double |
pulseHeight, |
|
|
EType |
type, |
|
|
const TOPSimHit * |
simHit = 0 |
|
) |
| |
Add time of simulated hit.
- Parameters
-
t | time of simulated hit |
pulseHeight | simulated pulse height |
type | hit type |
simHit | pointer to simulated hit |
Definition at line 60 of file TimeDigitizer.cc.
◆ digitize() [1/2]
Do time digitization using simplified pile-up and double-hit-resolution model.
As a result, the digitized hits are appended to TOPRawDigits, then they are converted to TOPDigits and the relations to TOPSimHits and MCParticles are set with proper weights.
- Parameters
-
rawDigits | array of TOPRawDigits |
digits | array of TOPDigits |
threshold | pulse height threshold [ADC counts] |
thresholdCount | minimal number of samples above threshold |
timeJitter | a r.m.s. of an additional time jitter due to electronics |
Definition at line 93 of file TimeDigitizer.cc.
◆ digitize() [2/2]
Do full waveform time digitization.
As a result, the digitized hits are appended to TOPRawDigits, then they are converted to TOPDigits and the relations to TOPSimHits and MCParticles are set with proper weights.
- Parameters
-
waveforms | generated waveforms |
rawDigits | array of TOPRawDigits |
digits | array of TOPDigits |
threshold | pulse height threshold [ADC counts] |
hysteresis | pulse height threshold hysteresis [ADC counts] |
thresholdCount | minimal number of samples above threshold |
Definition at line 251 of file TimeDigitizer.cc.
◆ gauss()
double gauss |
( |
double |
x, |
|
|
double |
mean, |
|
|
double |
sigma |
|
) |
| const |
|
inlineprivate |
Gauss function (pulse shape approximation)
- Parameters
-
x | argument |
mean | mean |
sigma | sigma |
- Returns
- value
Definition at line 241 of file TimeDigitizer.h.
243 double xx = (x - mean) / sigma;
244 return exp(-0.5 * xx * xx);
◆ generateTimeWalk()
double generateTimeWalk |
( |
double |
hitTime, |
|
|
double |
peakTime |
|
) |
| const |
|
private |
Generate time walk by taking into account pile-up of hits.
- Parameters
-
hitTime | time of the hit |
peakTime | peaking time of signal |
- Returns
- time walk
Definition at line 516 of file TimeDigitizer.cc.
◆ generateWaveform()
vector< short > generateWaveform |
( |
int |
startSample, |
|
|
const std::vector< double > & |
baselines, |
|
|
const std::vector< double > & |
rmsNoises, |
|
|
const std::vector< double > & |
pedestals, |
|
|
int |
ADCRange |
|
) |
| const |
|
private |
Generate waveform.
The size (number of ASIC windows) is given by the size of first argument. The size of second argument must be the same as the first one.
- Parameters
-
startSample | starting sample w.r.t first window number |
baselines | possible baseline shifts of ASIC windows |
rmsNoises | noise levels (r.m.s) per ASIC window |
pedestals | average pedestals per ASIC window |
ADCRange | ADC range (2^NumBits) |
- Returns
- generated waveform
Definition at line 421 of file TimeDigitizer.cc.
◆ getASICChannel()
unsigned getASICChannel |
( |
| ) |
const |
|
inline |
Returns ASIC channel number.
- Returns
- ASIC channel number
Definition at line 186 of file TimeDigitizer.h.
◆ getASICNumber()
unsigned getASICNumber |
( |
| ) |
const |
|
inline |
◆ getASICWindow()
unsigned getASICWindow |
( |
| ) |
const |
|
inline |
Returns ASIC storage window number.
- Returns
- window number
Definition at line 156 of file TimeDigitizer.h.
◆ getCarrierNumber()
unsigned getCarrierNumber |
( |
| ) |
const |
|
inline |
Returns carrier board number.
- Returns
- carrier board number
Definition at line 174 of file TimeDigitizer.h.
◆ getChannel()
unsigned int getChannel |
( |
| ) |
const |
|
inline |
Returns hardware channel number.
- Returns
- hardware channel number
Definition at line 162 of file TimeDigitizer.h.
◆ getModuleID()
int getModuleID |
( |
| ) |
const |
|
inline |
◆ getPixelID()
Return pixel ID.
- Returns
- pixel ID (e.g. software channel)
Definition at line 144 of file TimeDigitizer.h.
◆ getScrodID()
unsigned getScrodID |
( |
| ) |
const |
|
inline |
◆ getUniqueID()
unsigned getUniqueID |
( |
| ) |
const |
|
inline |
Return unique pixel ID.
- Returns
- unique pixel ID
Definition at line 150 of file TimeDigitizer.h.
◆ isValid()
Check if digitizer instance is valid (e.g.
module/pixel is mapped to hardware)
- Returns
- true if valid
Definition at line 192 of file TimeDigitizer.h.
◆ maskSamples()
static void maskSamples |
( |
bool |
maskThem | ) |
|
|
inlinestatic |
Mask samples at the end of a window to emulate phase-2 data.
- Parameters
-
maskThem | mask (true) or not mask (false) |
Definition at line 98 of file TimeDigitizer.h.
◆ setFirstWindow()
static void setFirstWindow |
( |
unsigned |
window | ) |
|
|
inlinestatic |
Sets first ASIC window.
- Parameters
-
window | storage window number |
Definition at line 92 of file TimeDigitizer.h.
◆ setNoise()
void setNoise |
( |
double |
rmsNoise | ) |
|
|
inline |
Sets noise level.
- Parameters
-
rmsNoise | r.m.s. of noise [ADC counts] |
Definition at line 122 of file TimeDigitizer.h.
◆ setOffsetWindows()
static void setOffsetWindows |
( |
int |
offsetWin | ) |
|
|
inlinestatic |
Sets the number of windows before the first ASIC window.
- Parameters
-
offsetWin | number of offset windows |
Definition at line 86 of file TimeDigitizer.h.
◆ setReadoutWindows()
static void setReadoutWindows |
( |
unsigned |
numWin | ) |
|
|
inlinestatic |
Sets the number of readout windows.
- Parameters
-
numWin | number of readout windows |
Definition at line 80 of file TimeDigitizer.h.
◆ setSampleTimes()
◆ setStorageDepth()
static void setStorageDepth |
( |
unsigned |
storageDepth | ) |
|
|
inlinestatic |
Sets storage depth.
- Parameters
-
storageDepth | analog storage depth |
Definition at line 74 of file TimeDigitizer.h.
◆ m_pixelID
pixel (e.g.
software channel) ID (1-based)
Definition at line 280 of file TimeDigitizer.h.
The documentation for this class was generated from the following files: