Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:39

0001 // Include files
0002 
0003 // local
0004 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUConfigurator.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 
0007 //-----------------------------------------------------------------------------
0008 // Implementation file for class : TTUConfigurator
0009 //
0010 // 2009-06-02 : Andres Felipe Osorio Oliveros
0011 //-----------------------------------------------------------------------------
0012 
0013 //=============================================================================
0014 // Standard constructor, initializes variables
0015 //=============================================================================
0016 TTUConfigurator::TTUConfigurator(const std::string& infile) : m_in{}, m_rbcspecs{}, m_ttuspecs{} {
0017   m_in.open(infile.c_str());
0018 
0019   if (!m_in.is_open()) {
0020     edm::LogError("TTUConfigurator") << "TTUConfigurator cannot open file";
0021     m_hasConfig = false;
0022   } else {
0023     m_hasConfig = true;
0024   }
0025 }
0026 //=============================================================================
0027 // Destructor
0028 //=============================================================================
0029 TTUConfigurator::~TTUConfigurator() { m_in.close(); }
0030 
0031 //=============================================================================
0032 
0033 void TTUConfigurator::process() {
0034   addData(m_rbcspecs);
0035   addData(m_ttuspecs);
0036 }
0037 
0038 void TTUConfigurator::addData(RBCBoardSpecs& specs) {
0039   specs.v_boardspecs.reserve(30);
0040   for (int i = 0; i < 30; i++) {
0041     auto& board = specs.v_boardspecs.emplace_back();
0042     m_in >> board;
0043   }
0044 }
0045 
0046 void TTUConfigurator::addData(TTUBoardSpecs& specs) {
0047   specs.m_boardspecs.reserve(3);
0048   for (int i = 0; i < 3; i++) {
0049     auto& board = specs.m_boardspecs.emplace_back();
0050 
0051     m_in >> board;
0052   }
0053 }