Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:28

0001 // -*- C++ -*-
0002 //
0003 // Package:     RPCObjects
0004 // Class  :     L1RPCHwConfig
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:
0010 //         Created:  Wed Apr  9 13:48:10 CEST 2008
0011 // $Id$
0012 //
0013 
0014 // system include files
0015 
0016 // user include files
0017 #include "CondFormats/RPCObjects/interface/L1RPCHwConfig.h"
0018 
0019 #include <iostream>
0020 //
0021 // constants, enums and typedefs
0022 //
0023 
0024 //
0025 // static data member definitions
0026 //
0027 
0028 //
0029 // constructors and destructor
0030 //
0031 L1RPCHwConfig::L1RPCHwConfig() {}
0032 
0033 // L1RPCHwConfig::L1RPCHwConfig(const L1RPCHwConfig& rhs)
0034 // {
0035 //    // do actual copying here;
0036 // }
0037 
0038 L1RPCHwConfig::~L1RPCHwConfig() {}
0039 
0040 void L1RPCHwConfig::enablePAC(int tower, int sector, int segment, bool enable) {
0041   if (enable) {
0042     //  std::cout << "+";
0043     m_disabledDevices.erase(L1RPCDevCoords(tower, sector, segment));
0044   } else {
0045     // std::cout << "-";
0046     m_disabledDevices.insert(L1RPCDevCoords(tower, sector, segment));
0047   }
0048 }
0049 
0050 void L1RPCHwConfig::enableTower(int tower, bool enable) {
0051   for (int sec = 0; sec < 12; ++sec) {
0052     for (int seg = 0; seg < 12; ++seg) {
0053       enablePAC(tower, sec, seg, enable);
0054     }
0055   }
0056 }
0057 
0058 void L1RPCHwConfig::enableTowerInCrate(int tower, int crate, bool enable) {
0059   for (int seg = 0; seg < 12; ++seg) {
0060     enablePAC(tower, crate, seg, enable);
0061   }
0062 }
0063 
0064 void L1RPCHwConfig::enableCrate(int crate, bool enable) {
0065   for (int tower = -16; tower < 17; ++tower) {
0066     for (int seg = 0; seg < 12; ++seg) {
0067       enablePAC(tower, crate, seg, enable);
0068     }
0069   }
0070 }
0071 
0072 void L1RPCHwConfig::enableAll(bool enable) {
0073   for (int seg = 0; seg < 12; ++seg) {
0074     //     std::cout <<  seg << " ";
0075     enableCrate(seg, enable);
0076     //     std::cout << std::endl;
0077   }
0078 }