Belle II Software development
TRGSignal Class Reference

A class to represent a digitized signal. Unit is nano second. More...

#include <Signal.h>

Public Member Functions

 TRGSignal (const TRGClock &=Belle2_GDL::GDLSystemClock)
 Constructor.
 
 TRGSignal (const TRGTime &t0, const TRGTime &t1)
 Constructor with clock and timing(t0 leading, t1 trailing).
 
 TRGSignal (const TRGClock &c, int t0, int t1)
 Constructor with clock and timing(t0 leading, t1 trailing).
 
 TRGSignal (const TRGClock &c, double t0, double t1)
 Constructor with clock and timing(t0 leading, t1 trailing).
 
 TRGSignal (const std::string &name, const TRGClock &=Belle2_GDL::GDLSystemClock)
 Constructor with name.
 
 TRGSignal (const TRGSignal &)
 Copy constructor.
 
 TRGSignal (const TRGTime &)
 Constructor.
 
TRGSignaloperator= (const TRGSignal &)=default
 Default assignment operator.
 
virtual ~TRGSignal ()
 Destructor.
 
const std::string & name (void) const
 returns name.
 
const TRGClockclock (void) const
 returns clock.
 
unsigned nSignals (void) const
 returns # of signals.
 
unsigned nEdges (void) const
 returns # of edges.
 
unsigned width (unsigned i=0) const
 returns width of i'th signal (i=0,1,2,...).
 
bool active (void) const
 returns true if there is a signal.
 
bool active (int clk0, int clk1) const
 returns true if there is a signal.
 
bool state (int clockPosition) const
 returns true if signal is active in given clock position.
 
bool riseEdge (int clockPosition) const
 returns true if signal is active and rising edge in give clock position.
 
std::vector< int > stateChanges (void) const
 returns a list of clock position of state change.
 
void dump (const std::string &message="", const std::string &pre="") const
 dumps contents.
 
const std::string & name (const std::string &newName)
 sets and returns name.
 
void clear (void)
 clears contents.
 
const TRGClockclock (const TRGClock &)
 changes clock.
 
const TRGSignalset (double t0, double t1)
 makes a pulse with leading edge at t0 and with trailing edge at t1.
 
const TRGSignalset (int t0, int t1, bool state=true)
 makes a pulse with leading edge at clock t0 and with trailing edge at clock t1.
 
const TRGSignalunset (int t0, int t1)
 clear(or unset) with leading edge at clock t0 and with trailing edge at clock t1.
 
const TRGSignalinvert (void)
 makes signal inverted.
 
TRGSignal operator& (const TRGSignal &) const
 returns AND result.
 
TRGSignal operator& (const TRGTime &) const
 returns AND result.
 
TRGSignaloperator&= (const TRGSignal &)
 returns AND result.
 
TRGSignaloperator&= (const TRGTime &)
 returns AND result.
 
TRGSignal operator| (const TRGSignal &) const
 returns OR result.
 
TRGSignal operator| (const TRGTime &) const
 returns OR result.
 
TRGSignaloperator|= (const TRGSignal &)
 returns OR result.
 
TRGSignaloperator|= (const TRGTime &)
 returns OR result.
 
TRGSignalwiden (unsigned width)
 returns widen signals. Signals wider than "width" will be untouched.
 
const TRGTimeoperator[] (unsigned i) const
 returns timing of i'th edge.
 
bool operator== (const TRGSignal &) const
 returns true if two are the same.
 
bool operator!= (const TRGSignal &) const
 returns true if two are the same.
 

Private Member Functions

void sort (void)
 Sort operation.
 
bool consistencyCheck (void) const
 Self-consitency check. True is return if something wrong.
 

Static Private Member Functions

static std::vector< TRGTimeorOperation (const std::vector< TRGTime > &)
 Or operation.
 

Private Attributes

std::string _name
 Name.
 
const TRGClock_clock
 Clock.
 
std::vector< TRGTime_history
 Timing history.
 

Detailed Description

A class to represent a digitized signal. Unit is nano second.

Definition at line 23 of file Signal.h.

Member Function Documentation

◆ set()

const TRGSignal & set ( double  t0,
double  t1 
)

makes a pulse with leading edge at t0 and with trailing edge at t1.

t0 and t1 in absolute time.

Member Data Documentation

◆ _clock

const TRGClock* _clock
private

Clock.

Definition at line 178 of file Signal.h.

◆ _history

std::vector<TRGTime> _history
private

Timing history.

Definition at line 181 of file Signal.h.

◆ _name

std::string _name
private

Name.

Definition at line 175 of file Signal.h.


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