11#include <top/dataobjects/TOPSimHit.h>
12#include <top/dataobjects/TOPDigit.h>
13#include <top/dataobjects/TOPRawDigit.h>
14#include <top/dataobjects/TOPRawWaveform.h>
15#include <framework/datastore/StoreArray.h>
16#include <top/dbobjects/TOPSampleTimes.h>
17#include <top/dbobjects/TOPSignalShape.h>
18#include <top/dbobjects/TOPCalTimeWalk.h>
19#include <framework/database/DBObjPtr.h>
67 TimeDigitizer(
int moduleID,
int pixelID,
double timeOffset,
double calErrorsSq,
114 B2ERROR(
"TOP::TimeDigitizer::setSampleTimes: argument is NULL pointer");
209 int thresholdCount = 0,
210 double timeJitter = 0)
const;
230 int thresholdCount = 0)
const;
241 double gauss(
double x,
double mean,
double sigma)
const
243 double xx = (x - mean) / sigma;
244 return exp(-0.5 * xx * xx);
259 const std::vector<double>& baselines,
260 const std::vector<double>& rmsNoises,
261 const std::vector<double>& pedestals,
Class for accessing objects in the database.
Accessor to arrays stored in the data store.
Calibration constants of a singe ASIC channel: time axis (sample times)
Normalized shape of single photon pulse (waveform) Pulse must be positive.
Class to store simulated hits of Cherenkov photons on PMT's input for digitization module (TOPDigitiz...
Time digitization of simulated hits in a single electronic channel.
static void setReadoutWindows(unsigned numWin)
Sets the number of readout windows.
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.
unsigned getASICNumber() const
Returns ASIC number.
unsigned getCarrierNumber() const
Returns carrier board number.
static void maskSamples(bool maskThem)
Mask samples at the end of a window to emulate phase-2 data.
static void setStorageDepth(unsigned storageDepth)
Sets storage depth.
void setSampleTimes(const TOPSampleTimes *sampleTimes)
Sets sample times.
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]
static unsigned s_storageDepth
ASIC analog storage depth.
unsigned m_channel
hardware channel number (0-based)
static DBObjPtr< TOPCalTimeWalk > * s_timeWalk
pointer to DB object
double m_calErrorsSq
calibration uncertainties squared
const TOPSampleTimes * m_sampleTimes
sample times
bool isValid() const
Check if digitizer instance is valid (e.g.
int getPixelID() const
Return pixel ID.
unsigned int getChannel() const
Returns hardware channel number.
int m_moduleID
module ID (1-based)
int getModuleID() const
Return bar ID.
unsigned getASICWindow() const
Returns ASIC storage window number.
unsigned getASICChannel() const
Returns ASIC channel number.
bool m_valid
true, if module/pixel is mapped to hardware
static int s_offsetWindows
number of windows before first wf window
static void setTimeWalk(DBObjPtr< TOPCalTimeWalk > *timeWalk)
Stores pointer to time walk DB object defined in TOPDigitizerModule.
unsigned getUniqueID() const
Return unique pixel ID.
double generateTimeWalk(double hitTime, double peakTime) const
Generate time walk by taking into account pile-up of hits.
static unsigned s_window
first window number
double gauss(double x, double mean, double sigma) const
Gauss function (pulse shape approximation)
unsigned getScrodID() const
Returns SCROD ID.
static void setOffsetWindows(int offsetWin)
Sets the number of windows before the first ASIC window.
void addTimeOfHit(double t, double pulseHeight, EType type, const TOPSimHit *simHit=0)
Add time of simulated hit.
static bool s_maskSamples
mask samples at window boundary (phase-2)
void setNoise(double rmsNoise)
Sets noise level.
double m_timeOffset
time offset [ns]
std::multimap< double, const Hit > m_times
hits sorted by time
static unsigned s_readoutWindows
number of readout windows
static void setFirstWindow(unsigned window)
Sets first ASIC window.
unsigned m_carrier
carrier board number
EType
hit type enumerators
unsigned m_chan
ASIC channel number.
Abstract base class for different kinds of events.
double pulseHeight
generated pulse height
const TOPSimHit * simHit
pointer to simulated hit
const TOPSignalShape * shape
waveform shape of this hit