CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 Standard constructor. More...
 
 TTUConfigurator (const std::string &)
 
virtual ~TTUConfigurator ()
 Destructor. More...
 

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 30 of file TTUConfigurator.h.

Constructor & Destructor Documentation

TTUConfigurator::TTUConfigurator ( )
inline

Standard constructor.

Definition at line 33 of file TTUConfigurator.h.

33 { };
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 
20  m_in = new std::ifstream();
21  m_in->open( infile.c_str() );
22 
23  if(!m_in->is_open()) {
24  edm::LogError("TTUConfigurator") << "TTUConfigurator cannot open file";
25  m_hasConfig = false;
26  } else {
27  m_hasConfig = true;
28  }
29 
30  m_rbcspecs = new RBCBoardSpecs();
31  m_ttuspecs = new TTUBoardSpecs();
32 
33 }
RBCBoardSpecs * m_rbcspecs
list infile
Definition: EdgesToViz.py:90
std::ifstream * m_in
TTUBoardSpecs * m_ttuspecs
TTUConfigurator::~TTUConfigurator ( )
virtual

Destructor.

Definition at line 37 of file TTUConfigurator.cc.

References m_in, m_rbcspecs, and m_ttuspecs.

37  {
38 
39  if ( m_in ) {
40  m_in->close();
41  delete m_in;
42  }
43 
44  if ( m_rbcspecs ) delete m_rbcspecs;
45  if ( m_ttuspecs ) delete m_ttuspecs;
46 
47 }
RBCBoardSpecs * m_rbcspecs
std::ifstream * m_in
TTUBoardSpecs * m_ttuspecs

Member Function Documentation

void TTUConfigurator::addData ( RBCBoardSpecs specs)
private

Definition at line 59 of file TTUConfigurator.cc.

References i, and RBCBoardSpecs::v_boardspecs.

Referenced by process().

60 {
61 
63 
64  for( int i=0; i < 30; i++) {
65 
66  board = new RBCBoardSpecs::RBCBoardConfig();
67 
68  (*m_in) >> (*board);
69 
70  specs->v_boardspecs.push_back( *board );
71 
72  }
73 
74 }
int i
Definition: DBlmapReader.cc:9
std::vector< RBCBoardConfig > v_boardspecs
Definition: RBCBoardSpecs.h:43
void TTUConfigurator::addData ( TTUBoardSpecs specs)
private

Definition at line 76 of file TTUConfigurator.cc.

References i, and TTUBoardSpecs::m_boardspecs.

77 {
78 
80 
81  for(int i=0; i < 3; i++){
82 
83  board= new TTUBoardSpecs::TTUBoardConfig();
84 
85  (*m_in) >> (*board);
86 
87  specs->m_boardspecs.push_back( *board );
88 
89  }
90 
91 }
int i
Definition: DBlmapReader.cc:9
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:47
RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( )
inline

Definition at line 39 of file TTUConfigurator.h.

References m_rbcspecs.

Referenced by RPCTechnicalTrigger::beginRun().

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

Definition at line 41 of file TTUConfigurator.h.

References m_ttuspecs.

Referenced by RPCTechnicalTrigger::beginRun().

41 { return m_ttuspecs; };
TTUBoardSpecs * m_ttuspecs
void TTUConfigurator::process ( )

Member Data Documentation

bool TTUConfigurator::m_hasConfig

Definition at line 45 of file TTUConfigurator.h.

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

std::ifstream* TTUConfigurator::m_in
private

Definition at line 51 of file TTUConfigurator.h.

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

RBCBoardSpecs* TTUConfigurator::m_rbcspecs
private

Definition at line 56 of file TTUConfigurator.h.

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

TTUBoardSpecs* TTUConfigurator::m_ttuspecs
private

Definition at line 57 of file TTUConfigurator.h.

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