11#include <framework/datastore/RelationsObject.h>
460 double correctTime(
double time,
unsigned short storageDepth = 508)
const;
490 if (slope == 0)
return sample;
491 return (
int(
m_VPeak) - 2 * value) / (2 * slope) + sample;
507 return (vp > 0 and v1 < v2 and 2 * v1 <= vp and v2 <= vp)
508 or (vp < 0 and v1 > v2 and 2 * v1 >= vp and v2 >= vp);
Defines interface for accessing relations of objects in StoreArray.
Class to store unpacked raw data (hits in feature-extraction format) It provides also calculation of ...
void setASICChannel(unsigned short channel)
Sets ASIC channel number.
EDataTypes
Enum for data types needed to steer time conversion in TOPRawDigitConverter.
@ c_Interim
from interim feature extraction
@ c_ProductionDebug
from production debugging format
@ c_Production
from the future production format
@ c_MC
from MC digitization
int getValueRise0() const
Returns ADC value at leading edge (at m_sampleRise)
double getCFDLeadingTime() const
Returns leading edge CFD time.
double getCFDFallingTimeError(double rmsNoise) const
Returns falling edge CFD time uncertainty (assuming uncorrelated noise)
EDataTypes getDataType() const
Returns data type.
unsigned short m_scrodID
SCROD ID.
@ c_WindowSize
number of samples per window
unsigned short m_carrier
carrier board number
void setIntegral(int integral)
Sets integral of a pulse (e.g.
unsigned getASICNumber() const
Returns ASIC number.
unsigned getCarrierNumber() const
Returns carrier board number.
double getCFDLeadingTimeError(double rmsNoise) const
Returns leading edge CFD time uncertainty (assuming uncorrelated noise)
void setCarrierNumber(unsigned short carrier)
Sets carrier board number.
void setRevo9Counter(unsigned short revo9Counter)
Sets number of global clock tics since last revo9 flag (production firmware only)
void setSampleRise(unsigned short sample)
Sets sample number just before 50% CFD crossing at leading edge.
double getLeadingSlope() const
Returns leading edge slope.
int getValueFall1() const
Returns ADC value at falling edge (at m_sampleRise + m_dSampleFall + 1)
std::vector< unsigned short > m_windows
storage windows of waveform segments
double getFallingSlope() const
Returns falling edge slope.
int m_integral
integral of a pulse (proportional to charge)
bool isLeadingEdgeValid() const
Checks if leading edge is consistently defined.
TOPRawDigit()
Default constructor.
unsigned short getRevo9Counter() const
Returns 127 MHz clock ticks since last revo9 marker.
double timeCFDCrossing(int sample, int value, double slope) const
calculates time of 50% CFD crossing
unsigned short m_revo9Counter
number of clock ticks since last revo9 flag
double getCFDFallingTime() const
Returns falling edge CFD time.
bool m_offline
feature extraction flag: by firmware or software
void setLookBackWindows(unsigned short lookBack)
Sets number of look-back windows.
const std::vector< unsigned short > & getStorageWindows() const
Returns storage window numbers of waveform segments (not always available!)
unsigned short getErrorFlags() const
Returns error flags.
short m_VFall1
ADC value at m_sampleRise + m_dSampleFall + 1.
unsigned short m_channel
ASIC channel number.
unsigned getSampleFall() const
Returns sample number at falling edge just before 50% CFD crossing.
unsigned short m_dSampleFall
same for falling edge, rel.
double getFWHM() const
Returns signal full width half maximum.
bool isMadeOffline() const
Returns offline flag.
TOPRawDigit(unsigned short scrodID, EDataTypes dataType)
Usefull constructor.
unsigned getDeltaSampleFall() const
Returns sample number at falling edge just before 50% CFD relative to m_sampleRise.
void setErrorFlags(unsigned short flags)
Sets error flags.
unsigned getDeltaSamplePeak() const
Returns peak position relative to m_sampleRise.
unsigned short m_asic
ASIC number.
unsigned short m_lookBackWindows
number of look-back windows
unsigned getSampleRise() const
Returns sample number at leading edge just before 50% CFD crossing.
int getValueRise1() const
Returns ADC value at leading edge (at m_sampleRise + 1)
short m_VPeak
ADC value at m_sampleRise + m_dSamplePeak.
void setTFine(unsigned short tfine)
Sets fine timing for 50% CFD at rising edge (within two samples)
void setValueRise0(short adc)
Sets ADC value at m_sampleRise.
void setDeltaSamplePeak(unsigned short dsample)
Sets peak position relative to m_sampleRise.
unsigned short m_lastWriteAddr
current (reference) window number
ClassDef(TOPRawDigit, 6)
ClassDef.
void setASICWindow(unsigned short window)
Sets first storage window number (logical window number)
unsigned short m_sampleRise
sample number just before 50% CFD crossing
unsigned getTFine() const
Returns fine timing for 50% CFD (within two samples)
void setValuePeak(short adc)
Sets ADC value at m_sampleRise + m_dSamplePeak (e.g.
void setOfflineFlag()
Sets offline flag: telling that this digit was extracted offline in basf2.
unsigned getASICWindow() const
Returns ASIC storage window number.
void setDeltaSampleFall(unsigned short dsample)
Sets falling edge sample number just before 50% CFD crossing relative to m_sampleRise.
unsigned getASICChannel() const
Returns ASIC channel number.
short m_VFall0
ADC value at m_sampleRise + m_dSampleFall.
void setStorageWindows(const std::vector< unsigned short > &windows)
Sets storage windows of waveform segments.
bool checkEdge(int v1, int v2, int vp) const
Checks if values v1, v2 and vp are consistent.
void setValueFall1(short adc)
Sets ADC value at m_sampleRise + m_dSampleFall + 1.
void setValueFall0(short adc)
Sets ADC value at m_sampleRise + m_dSampleFall.
short m_VRise0
ADC value at m_sampleRise.
int getIntegral() const
Returns integral of a pulse (e.g.
bool isFallingEdgeValid() const
Checks if falling edge is consistently defined.
void setPhase(unsigned short phase)
Sets beam orbit synchronisation phase (production firmware only) 9-state count: valid values are 0 - ...
unsigned short m_errorFlags
feature extraction error flags (see enum)
int getValueFall0() const
Returns ADC value at falling edge (at m_sampleRise + m_dSampleFall)
void setLastWriteAddr(unsigned short window)
Sets current (reference) window number.
unsigned getScrodID() const
Returns SCROD ID.
unsigned short getLookBackWindows() const
Returns number of look-back windows.
unsigned short m_window
first ASIC storage window number
ErrorFlags
Enum for error flags; bits set if corresponding data not consistent.
@ c_HitMagic
if magic number not 0xB
@ c_TailMagic
if magic bits not '101' = 0x5
@ c_HitChecksum
if sum of 16-bit words not zero
@ c_HeadMagic
if magic number not 0xA
unsigned short m_TFine
fine timing for 50% CFD (within two samples)
unsigned short m_phase
carrier phase
bool isWindowConsistent() const
Checks if the first window number is the same as the first one in m_windows Note: returns true if m_w...
int getValuePeak() const
Returns ADC value at peak (e.g.
unsigned short getPhase() const
Returns beam orbit synchronisation phase (9-state count: valid values are 0 - 8)
unsigned short m_dSamplePeak
peak position relative to m_sampleRise
bool isFEValid() const
Checks if feature extraction points make sense.
void setValueRise1(short adc)
Sets ADC value at m_sampleRise + 1.
unsigned getLastWriteAddr() const
Returns current (reference) ASIC window number.
short m_VRise1
ADC value at m_sampleRise + 1.
unsigned getScrodChannel() const
Returns channel number within SCROD (in the range 0 - 127)
unsigned getSamplePeak() const
Returns peak position.
void setASICNumber(unsigned short asic)
Sets ASIC number.
EDataTypes m_dataType
data type
double correctTime(double time, unsigned short storageDepth=508) const
Corrects time after window discontinuity by adding missing samples.
bool isAtWindowDiscontinuity(unsigned short storageDepth=508) const
Checks if feature extraction points are at window discontinuity (e.g.
double timeErrorCoefficient(double y1, double y2) const
Calculate the coefficient of time error.
bool isPedestalJump() const
Checks if feature extraction finds a pedestal jump.
bool areWindowsInOrder(unsigned short storageDepth=508) const
Checks if storage windows come in the consecutive order before the last sample (no gaps before the la...
Abstract base class for different kinds of events.