Belle II Software  release-05-01-25
Board.cc
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : TRGBoard.cc
5 // Section : TRG
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to represent a trigger board
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #include <iostream>
15 #include "trg/trg/Clock.h"
16 #include "trg/trg/Board.h"
17 #include "trg/trg/Channel.h"
18 
19 using namespace std;
20 
21 namespace Belle2 {
27  TRGBoard::TRGBoard(const std::string& name,
28  const TRGClock& systemClock,
29  const TRGClock& dataClock,
30  const TRGClock& userClockInput,
31  const TRGClock& userClockOutput)
32  : _name(name),
33  _clockSystem(& systemClock),
34  _clockData(& dataClock),
35  _clockUserInput(& userClockInput),
36  _clockUserOutput(& userClockOutput),
37  _inputChannels(0),
38  _outputChannels(0)
39  {
40  }
41 
43  {
44  }
45 
46  void
47  TRGBoard::dump(const string& msg, const string& pre) const
48  {
49  cout << pre << _name;
50  const string tab = pre + " ";
51  if (msg.find("detail") != string::npos) {
52  cout << endl;
53  cout << pre << "System clock:" << _clockSystem->name() << endl;
54  cout << pre << "Data clock:" << _clockData->name() << endl;
55  cout << pre << "Input user clock:" << _clockUserInput->name() << endl;
56  cout << pre << "Output user clock:" << _clockUserOutput->name()
57  << endl;
58  cout << pre << "Input channels" << endl;
59  for (unsigned i = 0; i < _inputChannels.size(); i++) {
60  cout << tab << _inputChannels[i]->name() << endl;
61  }
62  cout << pre << "Output channels" << endl;
63  for (unsigned i = 0; i < _outputChannels.size(); i++) {
64  cout << tab << _outputChannels[i]->name() << endl;
65  }
66  }
67  cout << endl;
68  }
69 
71 } // namespace Belle2
Belle2::TRGBoard::_name
const std::string _name
Name of a board.
Definition: Board.h:89
Belle2::TRGBoard::_outputChannels
std::vector< TRGChannel * > _outputChannels
Output Aurora channel.
Definition: Board.h:107
Belle2::TRGBoard::_clockUserOutput
const TRGClock * _clockUserOutput
User clock.
Definition: Board.h:101
Belle2::TRGBoard::_clockData
const TRGClock * _clockData
Data clock.
Definition: Board.h:95
Belle2::TRGClock::name
const std::string & name(void) const
returns name.
Definition: Clock.h:162
Belle2::TRGBoard::dump
void dump(const std::string &message="", const std::string &pre="") const
dumps contents.
Definition: Board.cc:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGBoard::~TRGBoard
virtual ~TRGBoard()
Destructor.
Definition: Board.cc:42
Belle2::TRGBoard::_inputChannels
std::vector< const TRGChannel * > _inputChannels
Input Aurora channel.
Definition: Board.h:104
Belle2::TRGBoard::_clockUserInput
const TRGClock * _clockUserInput
User clock.
Definition: Board.h:98
Belle2::TRGBoard::_clockSystem
const TRGClock * _clockSystem
System clock.
Definition: Board.h:92
Belle2::TRGClock
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:43