CMS 3D CMS Logo

RBCBasicConfig.cc
Go to the documentation of this file.
1 // Include files
2 
3 
4 
5 // local
7 
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : RBCBasicConfig
10 //
11 // 2008-10-31 : Andres Osorio
12 //-----------------------------------------------------------------------------
13 
14 //=============================================================================
15 // Standard constructor, initializes variables
16 //=============================================================================
18 {
19 
20  m_rbcboardspecs = rbcspecs;
21  m_rbclogic = new RBCLogicUnit();
22  m_rbcinfo = new RBCId( *info );
23 
24  m_debug = false;
25 
26 }
27 
28 RBCBasicConfig::RBCBasicConfig( const char * _logic ) {
29 
30  m_rbclogic = new RBCLogicUnit( _logic );
31 
32 }
33 //=============================================================================
34 // Destructor
35 //=============================================================================
37 
38  if ( m_rbcinfo ) delete m_rbcinfo;
39  if ( m_rbclogic ) delete m_rbclogic;
40 
41  m_vecmask.clear();
42  m_vecforce.clear();
43 
44 }
45 
46 //=============================================================================
48 {
49 
50  bool status(false);
51 
52  //. read specifications
53 
54  std::vector<RBCBoardSpecs::RBCBoardConfig>::const_iterator itr;
55  itr = m_rbcboardspecs->v_boardspecs.begin();
56 
57  // initialise logic unit
58  m_rbclogic->setlogic( (*itr).m_LogicType.c_str() );
59  status = m_rbclogic->initialise();
60 
61  m_rbclogic->setBoardSpecs( (*itr) );
62 
63  // get mask and force vectors
64 
65  m_vecmask.assign( (*itr).m_MaskedOrInput.begin(), (*itr).m_MaskedOrInput.end() );
66  m_vecforce.assign( (*itr).m_ForcedOrInput.begin(), (*itr).m_ForcedOrInput.end() );
67 
68  if ( !status ) {
69  if( m_debug ) std::cout << "RBCConfiguration> Problem initialising the logic unit\n";
70  return 0; };
71 
72  return 1;
73 
74 }
75 
77 {
78 
79  if( m_debug ) std::cout << "RBCBasicConfig::preprocess> starts here" << std::endl;
80 
81  input.mask( m_vecmask );
82  input.force( m_vecforce );
83 
84  if( m_debug ) std::cout << "RBCBasicConfig::preprocess> done" << std::endl;
85 
86 }
static const TGPicture * info(bool iBackgroundIsBlack)
void preprocess(RBCInput &)
void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)
Definition: RBCLogicUnit.cc:69
RBCBasicConfig()
Standard constructor.
std::vector< int > m_vecforce
void mask(const std::vector< int > &)
Definition: RBCInput.cc:37
static std::string const input
Definition: EdmProvDump.cc:44
void force(const std::vector< int > &)
Definition: RBCInput.cc:52
Definition: RBCId.h:16
void setlogic(const char *)
Definition: RBCLogicUnit.cc:64
bool initialise()
Definition: RBCLogicUnit.cc:44
RBCLogicUnit * m_rbclogic
std::vector< int > m_vecmask
std::vector< RBCBoardConfig > v_boardspecs
Definition: RBCBoardSpecs.h:43
virtual ~RBCBasicConfig()
Destructor.
const RBCBoardSpecs * m_rbcboardspecs