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 }
TTUBasicConfig::~TTUBasicConfig
~TTUBasicConfig() override
Destructor.
Definition: TTUBasicConfig.cc:22
TTUConfiguration::m_ttuboardspecs
const TTUBoardSpecs * m_ttuboardspecs
Definition: TTUConfiguration.h:32
input
static const std::string input
Definition: EdmProvDump.cc:48
mps_update.status
status
Definition: mps_update.py:69
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
TTUBasicConfig.h
TTUConfiguration
Definition: TTUConfiguration.h:21
TTUBasicConfig::m_vecmask
std::vector< int > m_vecmask
Definition: TTUBasicConfig.h:29
TTULogicUnit::setlogic
void setlogic(const char *)
Definition: TTULogicUnit.cc:36
TTUConfiguration::ttulogic
TTULogicUnit * ttulogic()
Definition: TTUConfiguration.h:30
TTUInput
Definition: TTUInput.h:18
TTULogicUnit::initialise
bool initialise()
Definition: TTULogicUnit.cc:23
TTUBasicConfig::initialise
bool initialise(int, int) override
Definition: TTUBasicConfig.cc:25
TTUBoardSpecs
Definition: TTUBoardSpecs.h:18
TTUBasicConfig::m_vecforce
std::vector< int > m_vecforce
Definition: TTUBasicConfig.h:30
TTUBoardSpecs::m_boardspecs
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:46
TTULogicUnit::setBoardSpecs
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:38
TTUBasicConfig::TTUBasicConfig
TTUBasicConfig(const char *)
Definition: TTUBasicConfig.cc:17
mps_splice.line
line
Definition: mps_splice.py:76
TTUBasicConfig::preprocess
void preprocess(TTUInput &) override
Definition: TTUBasicConfig.cc:72
TTUBasicConfig::m_debug
bool m_debug
Definition: TTUBasicConfig.h:32