CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TTUBasicConfig.cc
Go to the documentation of this file.
1 // $Id: TTUBasicConfig.cc,v 1.6 2009/08/09 11:11:37 aosorio Exp $
2 // Include files
3 
4 
5 
6 // local
8 
9 //-----------------------------------------------------------------------------
10 // Implementation file for class : TTUBasicConfig
11 //
12 // 2008-10-31 : Andres Osorio
13 //-----------------------------------------------------------------------------
14 
15 //=============================================================================
16 // Standard constructor, initializes variables
17 //=============================================================================
19 
20  m_ttuboardspecs = ttuspecs;
21 
22  m_ttulogic = new TTULogicUnit();
23 
24  m_debug = false;
25 
26 }
27 
28 TTUBasicConfig::TTUBasicConfig( const char * logic ) {
29 
30  m_ttulogic = new TTULogicUnit( logic );
31 
32  m_debug = false;
33 
34 }
35 
36 //=============================================================================
37 // Destructor
38 //=============================================================================
40 
41  if (m_ttulogic) delete m_ttulogic;
42 
43  m_vecmask.clear();
44  m_vecforce.clear();
45 
46 }
47 
48 //=============================================================================
49 bool TTUBasicConfig::initialise( int line , int ttuid )
50 {
51 
52  bool status(false);
53 
54  //. read specifications and set it to the corresponding TTU board
55 
56  std::vector<TTUBoardSpecs::TTUBoardConfig>::const_iterator itr;
57  itr = m_ttuboardspecs->m_boardspecs.begin();
58 
59  int pos(0);
60  int maxboards = m_ttuboardspecs->m_boardspecs.size();
61 
62  for( pos=0; pos < maxboards; ++pos) {
63  if ( m_debug ) std::cout << "TTUBasicConfig::initialise> "
64  << m_ttuboardspecs->m_boardspecs[pos].m_Wheel1Id
65  << std::endl;
66  if ( m_ttuboardspecs->m_boardspecs[pos].m_runId == ttuid ) break;
67 
68  }
69 
70  // initialise logic unit
71 
72  if ( line == 2 ) {
73  m_ttulogic->setlogic( "WedgeORLogic" );
74  } else {
75  m_ttulogic->setlogic( (*itr).m_LogicType.c_str() );
76  }
77 
78  status = m_ttulogic->initialise();
79 
80  //itr = m_ttuboardspecs->m_boardspecs.begin();
81 
83 
84  // get mask and force vectors
85 
86  m_vecmask.assign( (*itr).m_MaskedSectors.begin(), (*itr).m_MaskedSectors.end() );
87 
88  m_vecforce.assign( (*itr).m_ForcedSectors.begin(), (*itr).m_ForcedSectors.end() );
89 
90  if ( !status ) {
91  if( m_debug ) std::cout << "TTUConfiguration> Problem initialising the logic unit\n";
92  return 0; };
93 
94  return status;
95 
96 }
97 
99 {
100 
101  if( m_debug ) std::cout << "TTUBasicConfig::preprocess> starts here" << std::endl;
102 
103  input.mask( m_vecmask );
104  //input.force( m_vecforce );
105 
106  if( m_debug ) std::cout << "TTUBasicConfig::preprocess> done" << std::endl;
107 
108 }
void preprocess(TTUInput &)
void mask(const std::vector< int > &)
Definition: TTUInput.cc:58
std::vector< int > m_vecforce
const TTUBoardSpecs * m_ttuboardspecs
virtual ~TTUBasicConfig()
Destructor.
std::vector< int > m_vecmask
bool initialise()
Definition: TTULogicUnit.cc:45
void setlogic(const char *)
Definition: TTULogicUnit.cc:65
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:43
tuple input
Definition: collect_tpl.py:10
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:72
TTUBasicConfig()
Standard constructor.
TTULogicUnit * m_ttulogic
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245
bool initialise(int, int)