CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
TTUConfigurator Class Reference

#include <TTUConfigurator.h>

Public Member Functions

RBCBoardSpecsgetRbcSpecs ()
 
TTUBoardSpecsgetTtuSpecs ()
 
void process ()
 
 TTUConfigurator (const std::string &)
 
 ~TTUConfigurator ()
 Destructor. More...
 

Public Attributes

bool m_hasConfig
 

Private Member Functions

void addData (RBCBoardSpecs &)
 
void addData (TTUBoardSpecs &)
 

Private Attributes

std::ifstream m_in
 
RBCBoardSpecs m_rbcspecs
 
TTUBoardSpecs m_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 30 of file TTUConfigurator.h.

Constructor & Destructor Documentation

TTUConfigurator::TTUConfigurator ( const std::string &  infile)

Definition at line 18 of file TTUConfigurator.cc.

References m_hasConfig, m_in, m_rbcspecs, and m_ttuspecs.

18  :
19  m_in{},
20  m_rbcspecs{},
21  m_ttuspecs{}
22 {
23 
24  m_in.open( infile.c_str() );
25 
26  if(!m_in.is_open()) {
27  edm::LogError("TTUConfigurator") << "TTUConfigurator cannot open file";
28  m_hasConfig = false;
29  } else {
30  m_hasConfig = true;
31  }
32 }
TTUBoardSpecs m_ttuspecs
RBCBoardSpecs m_rbcspecs
std::ifstream m_in
TTUConfigurator::~TTUConfigurator ( )

Destructor.

Definition at line 36 of file TTUConfigurator.cc.

References m_in.

36  {
37  m_in.close();
38 }
std::ifstream m_in

Member Function Documentation

void TTUConfigurator::addData ( RBCBoardSpecs specs)
private

Definition at line 50 of file TTUConfigurator.cc.

References mps_fire::i, m_in, and RBCBoardSpecs::v_boardspecs.

Referenced by process().

51 {
52  specs.v_boardspecs.reserve(30);
53  for( int i=0; i < 30; i++) {
54  auto& board = specs.v_boardspecs.emplace_back();
55  m_in >> board;
56  }
57 
58 }
std::ifstream m_in
std::vector< RBCBoardConfig > v_boardspecs
Definition: RBCBoardSpecs.h:43
void TTUConfigurator::addData ( TTUBoardSpecs specs)
private

Definition at line 60 of file TTUConfigurator.cc.

References mps_fire::i, TTUBoardSpecs::m_boardspecs, and m_in.

61 {
62  specs.m_boardspecs.reserve(3);
63  for(int i=0; i < 3; i++){
64  auto& board = specs.m_boardspecs.emplace_back();
65 
66  m_in >> board;
67  }
68 }
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:47
std::ifstream m_in
RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( )
inline

Definition at line 36 of file TTUConfigurator.h.

References m_rbcspecs.

36 { return &m_rbcspecs; };
RBCBoardSpecs m_rbcspecs
TTUBoardSpecs* TTUConfigurator::getTtuSpecs ( )
inline

Definition at line 38 of file TTUConfigurator.h.

References m_ttuspecs, and process().

38 { return &m_ttuspecs; };
TTUBoardSpecs m_ttuspecs
void TTUConfigurator::process ( )

Definition at line 42 of file TTUConfigurator.cc.

References addData(), m_rbcspecs, and m_ttuspecs.

Referenced by getTtuSpecs().

43 {
44 
47 
48 }
TTUBoardSpecs m_ttuspecs
RBCBoardSpecs m_rbcspecs
void addData(RBCBoardSpecs &)

Member Data Documentation

bool TTUConfigurator::m_hasConfig

Definition at line 42 of file TTUConfigurator.h.

Referenced by TTUConfigurator().

std::ifstream TTUConfigurator::m_in
private

Definition at line 48 of file TTUConfigurator.h.

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

RBCBoardSpecs TTUConfigurator::m_rbcspecs
private

Definition at line 53 of file TTUConfigurator.h.

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

TTUBoardSpecs TTUConfigurator::m_ttuspecs
private

Definition at line 54 of file TTUConfigurator.h.

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