Belle II Software development
Board.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <iostream>
10#include "trg/trg/Clock.h"
11#include "trg/trg/Board.h"
12#include "trg/trg/Channel.h"
13
14using namespace std;
15
16namespace Belle2 {
22 TRGBoard::TRGBoard(const std::string& name,
23 const TRGClock& systemClock,
24 const TRGClock& dataClock,
25 const TRGClock& userClockInput,
26 const TRGClock& userClockOutput)
27 : _name(name),
28 _clockSystem(& systemClock),
29 _clockData(& dataClock),
30 _clockUserInput(& userClockInput),
31 _clockUserOutput(& userClockOutput),
32 _inputChannels(0),
33 _outputChannels(0)
34 {
35 }
36
38 {
39 }
40
41 void
42 TRGBoard::dump(const string& msg, const string& pre) const
43 {
44 cout << pre << _name;
45 const string tab = pre + " ";
46 if (msg.find("detail") != string::npos) {
47 cout << endl;
48 cout << pre << "System clock:" << _clockSystem->name() << endl;
49 cout << pre << "Data clock:" << _clockData->name() << endl;
50 cout << pre << "Input user clock:" << _clockUserInput->name() << endl;
51 cout << pre << "Output user clock:" << _clockUserOutput->name()
52 << endl;
53 cout << pre << "Input channels" << endl;
54 for (unsigned i = 0; i < _inputChannels.size(); i++) {
55 cout << tab << _inputChannels[i]->name() << endl;
56 }
57 cout << pre << "Output channels" << endl;
58 for (unsigned i = 0; i < _outputChannels.size(); i++) {
59 cout << tab << _outputChannels[i]->name() << endl;
60 }
61 }
62 cout << endl;
63 }
64
66} // namespace Belle2
const TRGClock * _clockData
Data clock.
Definition: Board.h:90
const TRGClock * _clockUserInput
User clock.
Definition: Board.h:93
const std::string _name
Name of a board.
Definition: Board.h:84
std::vector< const TRGChannel * > _inputChannels
Input Aurora channel.
Definition: Board.h:99
const TRGClock * _clockSystem
System clock.
Definition: Board.h:87
std::vector< TRGChannel * > _outputChannels
Output Aurora channel.
Definition: Board.h:102
const TRGClock * _clockUserOutput
User clock.
Definition: Board.h:96
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:38
virtual ~TRGBoard()
Destructor.
Definition: Board.cc:37
const std::string & name(void) const
returns name.
Definition: Clock.h:157
TRGBoard(const std::string &name, const TRGClock &systemClock, const TRGClock &dataClock, const TRGClock &userClockInput, const TRGClock &userClockOutput)
Constructor.
Definition: Board.cc:22
void dump(const std::string &message="", const std::string &pre="") const
dumps contents.
Definition: Board.cc:42
Abstract base class for different kinds of events.
STL namespace.