CMS 3D CMS Logo

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