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 
19  m_ttuboardspecs = ttuspecs;
20 
21  m_ttulogic = new TTULogicUnit();
22 
23  m_debug = false;
24 
25 }
26 
27 TTUBasicConfig::TTUBasicConfig( const char * logic ) {
28 
29  m_ttulogic = new TTULogicUnit( logic );
30 
31  m_debug = false;
32 
33 }
34 
35 //=============================================================================
36 // Destructor
37 //=============================================================================
39 
40  if (m_ttulogic) delete m_ttulogic;
41 
42  m_vecmask.clear();
43  m_vecforce.clear();
44 
45 }
46 
47 //=============================================================================
48 bool TTUBasicConfig::initialise( int line , int ttuid )
49 {
50 
51  bool status(false);
52 
53  //. read specifications and set it to the corresponding TTU board
54 
55  std::vector<TTUBoardSpecs::TTUBoardConfig>::const_iterator itr;
56  itr = m_ttuboardspecs->m_boardspecs.begin();
57 
58  int pos(0);
59  int maxboards = m_ttuboardspecs->m_boardspecs.size();
60 
61  for( pos=0; pos < maxboards; ++pos) {
62  if ( m_debug ) std::cout << "TTUBasicConfig::initialise> "
63  << m_ttuboardspecs->m_boardspecs[pos].m_Wheel1Id
64  << std::endl;
65  if ( m_ttuboardspecs->m_boardspecs[pos].m_runId == ttuid ) break;
66 
67  }
68 
69  // initialise logic unit
70 
71  if ( line == 2 ) {
72  m_ttulogic->setlogic( "WedgeORLogic" );
73  } else {
74  m_ttulogic->setlogic( (*itr).m_LogicType.c_str() );
75  }
76 
77  status = m_ttulogic->initialise();
78 
79  //itr = m_ttuboardspecs->m_boardspecs.begin();
80 
82 
83  // get mask and force vectors
84 
85  m_vecmask.assign( (*itr).m_MaskedSectors.begin(), (*itr).m_MaskedSectors.end() );
86 
87  m_vecforce.assign( (*itr).m_ForcedSectors.begin(), (*itr).m_ForcedSectors.end() );
88 
89  if ( !status ) {
90  if( m_debug ) std::cout << "TTUConfiguration> Problem initialising the logic unit\n";
91  return false; };
92 
93  return status;
94 
95 }
96 
98 {
99 
100  if( m_debug ) std::cout << "TTUBasicConfig::preprocess> starts here" << std::endl;
101 
102  input.mask( m_vecmask );
103  //input.force( m_vecforce );
104 
105  if( m_debug ) std::cout << "TTUBasicConfig::preprocess> done" << std::endl;
106 
107 }
void mask(const std::vector< int > &)
Definition: TTUInput.cc:57
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:44
bool initialise(int, int) override
bool initialise()
Definition: TTULogicUnit.cc:44
void setlogic(const char *)
Definition: TTULogicUnit.cc:64
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:47
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:71
TTUBasicConfig()
Standard constructor.
TTULogicUnit * m_ttulogic