 |
Belle II Software
release-05-02-19
|
14 #ifndef TRGSignal_FLAG_
15 #define TRGSignal_FLAG_
18 #include "trg/trg/Clock.h"
19 #include "trg/trg/Time.h"
33 TRGSignal(
const TRGClock& = Belle2_GDL::GDLSystemClock);
36 TRGSignal(
const TRGTime& t0,
const TRGTime& t1);
39 TRGSignal(
const TRGClock& c,
int t0,
int t1);
43 TRGSignal(
const TRGClock& c,
double t0,
double t1);
47 const TRGClock& = Belle2_GDL::GDLSystemClock);
61 const std::string&
name(
void)
const;
64 const TRGClock&
clock(
void)
const;
70 unsigned nEdges(
void)
const;
73 unsigned width(
unsigned i = 0)
const;
79 bool active(
int clk0,
int clk1)
const;
82 bool state(
int clockPosition)
const;
86 bool riseEdge(
int clockPosition)
const;
93 void dump(
const std::string& message =
"",
94 const std::string& pre =
"")
const;
99 const std::string&
name(
const std::string& newName);
105 const TRGClock&
clock(
const TRGClock&);
166 static std::vector<TRGTime>
orOperation(
const std::vector<TRGTime>&);
199 return _name = newName;
221 return (*
this) &= left;
248 return (*
this) |= left;
292 for (
unsigned i = 0; i <
_history.size(); i++) {
310 for (
unsigned i = 0; i <
_history.size(); i++) {
313 }
else if (
_history[i].time() == a) {
315 }
else if (
_history[i].time() > a) {
342 return (!
operator==(a));
349 for (
unsigned i = 0; i <
_history.size(); i++) {
351 const int t0 =
_history[i - 1].time();
354 if ((c1 > t0) && (c0 < t1))
356 if ((c1 < t0) && (c1 < t1))
A class to represent a digitized signal. Unit is nano second.
unsigned width(unsigned i=0) const
returns width of i'th signal (i=0,1,2,...).
std::vector< int > stateChanges(void) const
returns a list of clock position of state change.
const TRGTime * operator[](unsigned i) const
returns timing of i'th edge.
TRGSignal operator&(const TRGSignal &) const
returns AND result.
TRGSignal & operator|=(const TRGSignal &)
returns OR result.
const TRGSignal & unset(int t0, int t1)
clear(or unset) with leading edge at clock t0 and with trailing edge at clock t1.
bool consistencyCheck(void) const
Self-consitency check. True is return if something wrong.
bool state(int clockPosition) const
returns true if signal is active in given clock position.
const std::string & name(void) const
returns name.
bool active(void) const
returns true if there is a signal.
std::vector< TRGTime > _history
Timing history.
void dump(const std::string &message="", const std::string &pre="") const
dumps contents.
const TRGClock * _clock
Clock.
const TRGClock & clock(void) const
returns clock.
void sort(void)
Sort operation.
bool riseEdge(int clockPosition) const
returns true if signal is active and rising edge in give clock position.
Abstract base class for different kinds of events.
unsigned nEdges(void) const
returns # of edges.
unsigned nSignals(void) const
returns # of signals.
TRGSignal operator|(const TRGSignal &) const
returns OR result.
const TRGSignal & set(double t0, double t1)
makes a pulse with leading edge at t0 and with trailing edge at t1.
bool operator==(const TRGSignal &) const
returns true if two are the same.
void clear(void)
clears contents.
TRGSignal(const TRGClock &=Belle2_GDL::GDLSystemClock)
Constructor.
const TRGSignal & invert(void)
makes signal inverted.
A class to represent a signal timing in the trigger system.
virtual ~TRGSignal()
Destructor.
static std::vector< TRGTime > orOperation(const std::vector< TRGTime > &)
Or operation.
A class to represent a digitized signal. Unit is nano second.
TRGSignal & operator&=(const TRGSignal &)
returns AND result.
TRGSignal & widen(unsigned width)
returns widen signals. Signals wider than "width" will be untouched.
bool operator!=(const TRGSignal &) const
returns true if two are the same.