CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

TTUConfigurator Class Reference

#include <TTUConfigurator.h>

List of all members.

Public Member Functions

RBCBoardSpecsgetRbcSpecs ()
TTUBoardSpecsgetTtuSpecs ()
void process ()
 TTUConfigurator (const std::string &)
 TTUConfigurator ()
 Standard constructor.
virtual ~TTUConfigurator ()
 Destructor.

Public Attributes

bool m_hasConfig

Private Member Functions

void addData (RBCBoardSpecs *)
void addData (TTUBoardSpecs *)

Private Attributes

std::ifstream * m_in
RBCBoardSpecsm_rbcspecs
TTUBoardSpecsm_ttuspecs

Detailed Description

This is an auxiliary class to read an ascii or xml configuration file for the RPC Technical Trigger - to by pass reading configuration from database via EventSetup

Author:
Andres Felipe Osorio Oliveros
Date:
2009-06-02

Definition at line 31 of file TTUConfigurator.h.


Constructor & Destructor Documentation

TTUConfigurator::TTUConfigurator ( ) [inline]

Standard constructor.

Definition at line 34 of file TTUConfigurator.h.

{ };
TTUConfigurator::TTUConfigurator ( const std::string &  infile)

Definition at line 19 of file TTUConfigurator.cc.

References m_hasConfig, m_in, m_rbcspecs, and m_ttuspecs.

                                                          {
  
  m_in = new std::ifstream();
  m_in->open( infile.c_str() );
  
  if(!m_in->is_open()) {
    edm::LogError("TTUConfigurator") << "TTUConfigurator cannot open file";
    m_hasConfig = false;
  } else {
    m_hasConfig = true;
  }
  
  m_rbcspecs = new RBCBoardSpecs();
  m_ttuspecs = new TTUBoardSpecs();
  
}
TTUConfigurator::~TTUConfigurator ( ) [virtual]

Destructor.

Definition at line 38 of file TTUConfigurator.cc.

References m_in, m_rbcspecs, and m_ttuspecs.

                                  {
  
  if ( m_in ) {
    m_in->close();
    delete m_in;
  }
  
  if ( m_rbcspecs ) delete m_rbcspecs;
  if ( m_ttuspecs ) delete m_ttuspecs;
  
} 

Member Function Documentation

void TTUConfigurator::addData ( RBCBoardSpecs specs) [private]

Definition at line 60 of file TTUConfigurator.cc.

References i, and RBCBoardSpecs::v_boardspecs.

Referenced by process().

{
  
  RBCBoardSpecs::RBCBoardConfig * board;
  
  for( int i=0; i < 30; i++) {
    
    board = new RBCBoardSpecs::RBCBoardConfig();
    
    (*m_in) >> (*board);
    
    specs->v_boardspecs.push_back( *board );
    
  }
  
}
void TTUConfigurator::addData ( TTUBoardSpecs specs) [private]

Definition at line 77 of file TTUConfigurator.cc.

References i, and TTUBoardSpecs::m_boardspecs.

{
  
  TTUBoardSpecs::TTUBoardConfig * board;
  
  for(int i=0; i < 3; i++){
    
    board= new TTUBoardSpecs::TTUBoardConfig();
    
    (*m_in) >> (*board);
    
    specs->m_boardspecs.push_back( *board );
    
  }
  
}
RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( ) [inline]

Definition at line 40 of file TTUConfigurator.h.

References m_rbcspecs.

Referenced by RPCTechnicalTrigger::beginRun().

{ return m_rbcspecs; };
TTUBoardSpecs* TTUConfigurator::getTtuSpecs ( ) [inline]

Definition at line 42 of file TTUConfigurator.h.

References m_ttuspecs.

Referenced by RPCTechnicalTrigger::beginRun().

{ return m_ttuspecs; };
void TTUConfigurator::process ( )

Definition at line 52 of file TTUConfigurator.cc.

References addData(), m_rbcspecs, and m_ttuspecs.

Referenced by RPCTechnicalTrigger::beginRun().


Member Data Documentation

Definition at line 46 of file TTUConfigurator.h.

Referenced by RPCTechnicalTrigger::beginRun(), and TTUConfigurator().

std::ifstream* TTUConfigurator::m_in [private]

Definition at line 52 of file TTUConfigurator.h.

Referenced by TTUConfigurator(), and ~TTUConfigurator().

Definition at line 57 of file TTUConfigurator.h.

Referenced by getRbcSpecs(), process(), TTUConfigurator(), and ~TTUConfigurator().

Definition at line 58 of file TTUConfigurator.h.

Referenced by getTtuSpecs(), process(), TTUConfigurator(), and ~TTUConfigurator().