Belle II Software development
SVDEventInfo Class Reference

Stores SVDModeByte object with Trigger time, DAQ mode, Run type & Event type! Also - the information of any inconsistencies of these variables within one event are stored. More...

#include <SVDEventInfo.h>

Inheritance diagram for SVDEventInfo:

Public Member Functions

 SVDEventInfo (SVDModeByte mode=SVDModeByte(), SVDTriggerType type=SVDTriggerType())
 Constructor.
 
 ~SVDEventInfo ()
 Destructor.
 
void setMatchTriggerType (bool triggermatch)
 Match TriggerType setter Sets the flag telling us if the SVDTriggerType object is the same for each FADCs in the event.
 
void setMatchModeByte (bool modematch)
 Match ModeByte setter Sets the flag telling us if the SVDModeByte object is the same for each FADCs in the event.
 
void setModeByte (SVDModeByte mode)
 SVDModeByte setter Sets the SVDModeByte data in the EventInfo object.
 
void setTriggerType (SVDTriggerType type)
 SVDTriggerType setter Sets the type of SVDTrigger in the EventInfo object.
 
void setCrossTalk (bool xtalk)
 x-Talk setter Sets the x-talk info in the EventInfo object
 
void setRelativeShift (int relativeShift)
 relative 3/6 shift Sets the relative shift in latency in data taken in 3/6 samples int between 0 and 15 (shift is 0*7.9 ....
 
void setNSamples (int nAPVsamples)
 nAPVsamples setter Sets the number of acquired samples (3 or 6) found in the raw data
 
bool getMatchTriggerType ()
 Match TriggerType getter Gets the flag telling us if the SVDTriggerType object is the same for each FADCs in the event.
 
bool getMatchModeByte ()
 MatchModeByte getter Gets the flag telling us if the SVDModeByte object is the same for each FADCs in the event.
 
SVDModeByte getModeByte () const
 SVDModeByte getter Gets the SVDModeByte info for the event.
 
float getSVD2FTSWTimeShift (int firstFrame) const
 returns the time shift between SVD reference (t = 0 at the FF) and the FTSW (Trigger) reference
 
int getNSamples () const
 returns the number of samples: 6, 3 or 1
 
float getSamplingDelayInNs () const
 getSamplingDelayInNs() returns the delay of the sampling with respect to the sampling of the 6-sample DAQ mode For 6-sample event it returns 0, for 3-sample events computes the delay using the relativeShift information
 
int getRelativeShift () const
 getRelativeShift returns the relative shift in data taken in 3/6 samples A number between 0 and 15 as written in the xml file
 
double getTimeInFTSWReference (double time_in_SVD, int firstFrame) const
 getTimeInFTSWReference it takes the cluster time in SVD reference (t = 0 at FF, in either 3- or 6-sample DAQ mode) and the firstFrame and provides the time in the FTWS reference.
 
bool setAPVClock (DBObjPtr< HardwareClockSettings > hwClock)
 sets the APV clock period.
 
double getTimeInSVDReference (double time_in_FTSW, int firstFrame) const
 getTimeInSVDReference it takes the cluster time in FTSW reference and provides the time in the SVD reference (t = 0 at FF) for that event.
 
SVDTriggerType getTriggerType () const
 SVDTriggerType getter Gets the type of SVDTrigger for the event.
 
bool isCrossTalkEvent ()
 X-talk info getter Gets the X-talk info for the event.
 
std::string toString () const
 Display main parameters in this object.
 

Private Member Functions

 ClassDef (SVDEventInfo, 3)
 class def needed by root
 

Private Attributes

SVDModeByte::baseType m_modeByte = SVDModeByte::c_DefaultID
 SVDModeByte object (runType + eventType + DAQmode + TriggerBin)
 
SVDTriggerType::baseType m_triggerType
 information on the Trigger type
 
bool m_ModeByteMatch
 flag telling if the SVDModeByte object is the same for each FADCs in the event
 
bool m_TriggerTypeMatch
 flag telling if the SVDTriggerType object is the same for each FADCs in the event
 
bool m_Xtalk = false
 information on the x-talk
 
int m_relativeTimeShift = 0
 relative shift in units of APV-clock/4 between 3- and 6-sample acquired events
 
int m_nAPVsamples = 0
 number of acquired samples
 
double m_apvClockPeriod = 16000. / 509.
 APV clock period.
 

Detailed Description

Stores SVDModeByte object with Trigger time, DAQ mode, Run type & Event type! Also - the information of any inconsistencies of these variables within one event are stored.

For data this object will be filled by the SVDUnpacker once per event

For simulation there is the SVDEventInfoSetter module to set the parameters

Definition at line 31 of file SVDEventInfo.h.

Constructor & Destructor Documentation

◆ SVDEventInfo()

SVDEventInfo ( SVDModeByte  mode = SVDModeByte(),
SVDTriggerType  type = SVDTriggerType() 
)
inlineexplicit

Constructor.

Definition at line 35 of file SVDEventInfo.h.

35 :
36 m_modeByte(mode.getID()), m_triggerType(type.getType())
37 {
39 }
SVDTriggerType::baseType m_triggerType
information on the Trigger type
Definition: SVDEventInfo.h:214
bool m_ModeByteMatch
flag telling if the SVDModeByte object is the same for each FADCs in the event
Definition: SVDEventInfo.h:215
bool m_Xtalk
information on the x-talk
Definition: SVDEventInfo.h:217
SVDModeByte::baseType m_modeByte
SVDModeByte object (runType + eventType + DAQmode + TriggerBin)
Definition: SVDEventInfo.h:213
bool m_TriggerTypeMatch
flag telling if the SVDTriggerType object is the same for each FADCs in the event
Definition: SVDEventInfo.h:216
int m_relativeTimeShift
relative shift in units of APV-clock/4 between 3- and 6-sample acquired events
Definition: SVDEventInfo.h:218

◆ ~SVDEventInfo()

~SVDEventInfo ( )
inline

Destructor.

Definition at line 42 of file SVDEventInfo.h.

42{}

Member Function Documentation

◆ getMatchModeByte()

bool getMatchModeByte ( )
inline

MatchModeByte getter Gets the flag telling us if the SVDModeByte object is the same for each FADCs in the event.

Definition at line 88 of file SVDEventInfo.h.

88{return m_ModeByteMatch;}

◆ getMatchTriggerType()

bool getMatchTriggerType ( )
inline

Match TriggerType getter Gets the flag telling us if the SVDTriggerType object is the same for each FADCs in the event.

Definition at line 83 of file SVDEventInfo.h.

83{return m_TriggerTypeMatch;}

◆ getModeByte()

SVDModeByte getModeByte ( ) const
inline

SVDModeByte getter Gets the SVDModeByte info for the event.

Definition at line 93 of file SVDEventInfo.h.

94 { return m_modeByte; }

◆ getNSamples()

int getNSamples ( ) const
inline

returns the number of samples: 6, 3 or 1

Definition at line 105 of file SVDEventInfo.h.

106 { return m_nAPVsamples; }
int m_nAPVsamples
number of acquired samples
Definition: SVDEventInfo.h:219

◆ getRelativeShift()

int getRelativeShift ( ) const
inline

getRelativeShift returns the relative shift in data taken in 3/6 samples A number between 0 and 15 as written in the xml file

Definition at line 130 of file SVDEventInfo.h.

131 {
132 return m_relativeTimeShift;
133 }

◆ getSamplingDelayInNs()

float getSamplingDelayInNs ( ) const
inline

getSamplingDelayInNs() returns the delay of the sampling with respect to the sampling of the 6-sample DAQ mode For 6-sample event it returns 0, for 3-sample events computes the delay using the relativeShift information

Definition at line 114 of file SVDEventInfo.h.

115 {
116 if (m_nAPVsamples == 3) {
117
118 int nTriggerClocks = SVDModeByte(m_modeByte).getTriggerBin() + m_relativeTimeShift;
119
120 return floor(nTriggerClocks / 4) * m_apvClockPeriod;
121 }
122
123 return 0;
124 }
double m_apvClockPeriod
APV clock period.
Definition: SVDEventInfo.h:222

◆ getSVD2FTSWTimeShift()

float getSVD2FTSWTimeShift ( int  firstFrame) const
inline

returns the time shift between SVD reference (t = 0 at the FF) and the FTSW (Trigger) reference

Definition at line 99 of file SVDEventInfo.h.

100 { return m_apvClockPeriod / 4 * (3 - SVDModeByte(m_modeByte).getTriggerBin() + 4 * firstFrame); }

◆ getTimeInFTSWReference()

double getTimeInFTSWReference ( double  time_in_SVD,
int  firstFrame 
) const
inline

getTimeInFTSWReference it takes the cluster time in SVD reference (t = 0 at FF, in either 3- or 6-sample DAQ mode) and the firstFrame and provides the time in the FTWS reference.

DO NOT USE WITH EventT0! In the SVD reference t=0 is the time of the first sample, regardless if the event is acquired in 3- or 6-sample DAQ mode

Definition at line 141 of file SVDEventInfo.h.

142 {
143 return time_in_SVD + getSamplingDelayInNs() + getSVD2FTSWTimeShift(firstFrame);
144 }
float getSVD2FTSWTimeShift(int firstFrame) const
returns the time shift between SVD reference (t = 0 at the FF) and the FTSW (Trigger) reference
Definition: SVDEventInfo.h:99
float getSamplingDelayInNs() const
getSamplingDelayInNs() returns the delay of the sampling with respect to the sampling of the 6-sample...
Definition: SVDEventInfo.h:114

◆ getTimeInSVDReference()

double getTimeInSVDReference ( double  time_in_FTSW,
int  firstFrame 
) const
inline

getTimeInSVDReference it takes the cluster time in FTSW reference and provides the time in the SVD reference (t = 0 at FF) for that event.

If used with EventT0, it returns EventT0 synchronized to the SVD reference. In the SVD reference t=0 is the time of the first sample, regardless if the event is acquired in 3- or 6-sample DAQ mode

Definition at line 167 of file SVDEventInfo.h.

168 {
169 return time_in_FTSW - getSamplingDelayInNs() - getSVD2FTSWTimeShift(firstFrame);
170 }

◆ getTriggerType()

SVDTriggerType getTriggerType ( ) const
inline

SVDTriggerType getter Gets the type of SVDTrigger for the event.

Definition at line 175 of file SVDEventInfo.h.

176 { return SVDTriggerType(m_triggerType); }

◆ isCrossTalkEvent()

bool isCrossTalkEvent ( )
inline

X-talk info getter Gets the X-talk info for the event.

Definition at line 181 of file SVDEventInfo.h.

181{ return m_Xtalk; }

◆ setAPVClock()

bool setAPVClock ( DBObjPtr< HardwareClockSettings hwClock)
inline

sets the APV clock period.

This operation can be done only in an event(). return false if the HardwareClockSettings DBObject is not valid, in this case the APV clock period is set to be 16000. / 509.; returns true when the operation is successfull.

Definition at line 151 of file SVDEventInfo.h.

152 {
153 if (hwClock.isValid())
154 m_apvClockPeriod = 1. / hwClock->getClockFrequency(Const::EDetector::SVD, "sampling");
155 else
156 return false;
157
158 return true;
159 }

◆ setCrossTalk()

void setCrossTalk ( bool  xtalk)
inline

x-Talk setter Sets the x-talk info in the EventInfo object

Definition at line 67 of file SVDEventInfo.h.

67{m_Xtalk = xtalk;}

◆ setMatchModeByte()

void setMatchModeByte ( bool  modematch)
inline

Match ModeByte setter Sets the flag telling us if the SVDModeByte object is the same for each FADCs in the event.

Definition at line 52 of file SVDEventInfo.h.

52{m_ModeByteMatch = modematch;}

◆ setMatchTriggerType()

void setMatchTriggerType ( bool  triggermatch)
inline

Match TriggerType setter Sets the flag telling us if the SVDTriggerType object is the same for each FADCs in the event.

Definition at line 47 of file SVDEventInfo.h.

47{m_TriggerTypeMatch = triggermatch;}

◆ setModeByte()

void setModeByte ( SVDModeByte  mode)
inline

SVDModeByte setter Sets the SVDModeByte data in the EventInfo object.

Definition at line 57 of file SVDEventInfo.h.

57{m_modeByte = mode.getID();}

◆ setNSamples()

void setNSamples ( int  nAPVsamples)
inline

nAPVsamples setter Sets the number of acquired samples (3 or 6) found in the raw data

Definition at line 78 of file SVDEventInfo.h.

78{m_nAPVsamples = nAPVsamples;}

◆ setRelativeShift()

void setRelativeShift ( int  relativeShift)
inline

relative 3/6 shift Sets the relative shift in latency in data taken in 3/6 samples int between 0 and 15 (shift is 0*7.9 ....

15*7.9 in ns)

Definition at line 73 of file SVDEventInfo.h.

73{m_relativeTimeShift = relativeShift;}

◆ setTriggerType()

void setTriggerType ( SVDTriggerType  type)
inline

SVDTriggerType setter Sets the type of SVDTrigger in the EventInfo object.

Definition at line 62 of file SVDEventInfo.h.

62{m_triggerType = type.getType();}

◆ toString()

std::string toString ( ) const
inline

Display main parameters in this object.

Definition at line 185 of file SVDEventInfo.h.

186 {
187 SVDModeByte thisMode(m_modeByte);
188 SVDTriggerType thisType(m_triggerType);
189
190 bool thisModeMatch(m_ModeByteMatch);
191 bool thisTriggerMatch(m_TriggerTypeMatch);
192 bool thisXtalk(m_Xtalk);
193 int thisRelativeShift(m_relativeTimeShift);
194 int thisNsamples(m_nAPVsamples);
195
196 std::ostringstream os;
197
198 os << " Full SVDModeByte: " << (unsigned int)thisMode << std::endl;
199 os << " Triggerbin: " << (unsigned int) thisMode.getTriggerBin() << std::endl;
200 os << "RunType: " << (unsigned int)thisMode.getRunType() << ", EventType: " << (unsigned int) thisMode.getEventType() <<
201 ", DAQMode: " << (unsigned int) thisMode.getDAQMode() << std::endl;
202 os << " ModeByte Match: " << thisModeMatch << std::endl;
203 os << " Trigger Type: " << (unsigned int)thisType.getType() << std::endl;
204 os << " TriggerType Match: " << thisTriggerMatch << std::endl;
205 os << " Cross Talk: " << (thisXtalk ? "true" : "false") << std::endl;
206 os << " Relative Shift 3/6: " << (unsigned int)thisRelativeShift << std::endl;
207 os << " Number of APV samples: " << (unsigned int)thisNsamples << std::endl;
208 return os.str();
209 }

Member Data Documentation

◆ m_apvClockPeriod

double m_apvClockPeriod = 16000. / 509.
private

APV clock period.

Definition at line 222 of file SVDEventInfo.h.

◆ m_modeByte

SVDModeByte object (runType + eventType + DAQmode + TriggerBin)

Definition at line 213 of file SVDEventInfo.h.

◆ m_ModeByteMatch

bool m_ModeByteMatch
private

flag telling if the SVDModeByte object is the same for each FADCs in the event

Definition at line 215 of file SVDEventInfo.h.

◆ m_nAPVsamples

int m_nAPVsamples = 0
private

number of acquired samples

Definition at line 219 of file SVDEventInfo.h.

◆ m_relativeTimeShift

int m_relativeTimeShift = 0
private

relative shift in units of APV-clock/4 between 3- and 6-sample acquired events

Definition at line 218 of file SVDEventInfo.h.

◆ m_triggerType

SVDTriggerType::baseType m_triggerType
private

information on the Trigger type

Definition at line 214 of file SVDEventInfo.h.

◆ m_TriggerTypeMatch

bool m_TriggerTypeMatch
private

flag telling if the SVDTriggerType object is the same for each FADCs in the event

Definition at line 216 of file SVDEventInfo.h.

◆ m_Xtalk

bool m_Xtalk = false
private

information on the x-talk

Definition at line 217 of file SVDEventInfo.h.


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