CMS 3D CMS Logo

TTUBasicConfig.cc
Go to the documentation of this file.
1 // Include files
2 
3 // local
5 
6 //-----------------------------------------------------------------------------
7 // Implementation file for class : TTUBasicConfig
8 //
9 // 2008-10-31 : Andres Osorio
10 //-----------------------------------------------------------------------------
11 
12 //=============================================================================
13 // Standard constructor, initializes variables
14 //=============================================================================
15 TTUBasicConfig::TTUBasicConfig(const TTUBoardSpecs* ttuspecs) : TTUConfiguration(ttuspecs), m_debug{false} {}
16 
17 TTUBasicConfig::TTUBasicConfig(const char* logic) : TTUConfiguration(logic), m_debug{false} {}
18 
19 //=============================================================================
20 // Destructor
21 //=============================================================================
23 
24 //=============================================================================
25 bool TTUBasicConfig::initialise(int line, int ttuid) {
26  bool status(false);
27 
28  //. read specifications and set it to the corresponding TTU board
29 
30  std::vector<TTUBoardSpecs::TTUBoardConfig>::const_iterator itr;
31  itr = m_ttuboardspecs->m_boardspecs.begin();
32 
33  int pos(0);
34  int maxboards = m_ttuboardspecs->m_boardspecs.size();
35 
36  for (pos = 0; pos < maxboards; ++pos) {
37  if (m_debug)
38  std::cout << "TTUBasicConfig::initialise> " << m_ttuboardspecs->m_boardspecs[pos].m_Wheel1Id << std::endl;
39  if (m_ttuboardspecs->m_boardspecs[pos].m_runId == ttuid)
40  break;
41  }
42 
43  // initialise logic unit
44 
45  if (line == 2) {
46  ttulogic()->setlogic("WedgeORLogic");
47  } else {
48  ttulogic()->setlogic((*itr).m_LogicType.c_str());
49  }
50 
51  status = ttulogic()->initialise();
52 
53  //itr = m_ttuboardspecs->m_boardspecs.begin();
54 
56 
57  // get mask and force vectors
58 
59  m_vecmask.assign((*itr).m_MaskedSectors.begin(), (*itr).m_MaskedSectors.end());
60 
61  m_vecforce.assign((*itr).m_ForcedSectors.begin(), (*itr).m_ForcedSectors.end());
62 
63  if (!status) {
64  if (m_debug)
65  std::cout << "TTUConfiguration> Problem initialising the logic unit\n";
66  return false;
67  };
68 
69  return status;
70 }
71 
73  if (m_debug)
74  std::cout << "TTUBasicConfig::preprocess> starts here" << std::endl;
75 
76  input.mask(m_vecmask);
77  //input.force( m_vecforce );
78 
79  if (m_debug)
80  std::cout << "TTUBasicConfig::preprocess> done" << std::endl;
81 }
std::vector< int > m_vecforce
void preprocess(TTUInput &) override
const TTUBoardSpecs * m_ttuboardspecs
~TTUBasicConfig() override
Destructor.
std::vector< int > m_vecmask
static std::string const input
Definition: EdmProvDump.cc:47
TTUBasicConfig(const char *)
bool initialise(int, int) override
bool initialise()
Definition: TTULogicUnit.cc:23
void setlogic(const char *)
Definition: TTULogicUnit.cc:36
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:46
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:38
TTULogicUnit * ttulogic()