CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CondFormats/RPCObjects/src/L1RPCHwConfig.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     RPCObjects
00004 // Class  :     L1RPCHwConfig
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  
00010 //         Created:  Wed Apr  9 13:48:10 CEST 2008
00011 // $Id: L1RPCHwConfig.cc,v 1.1 2008/04/09 15:16:53 fruboes Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "CondFormats/RPCObjects/interface/L1RPCHwConfig.h"
00018 
00019 #include <iostream>
00020 //
00021 // constants, enums and typedefs
00022 //
00023 
00024 //
00025 // static data member definitions
00026 //
00027 
00028 //
00029 // constructors and destructor
00030 //
00031 L1RPCHwConfig::L1RPCHwConfig()  
00032 {
00033 }
00034 
00035 // L1RPCHwConfig::L1RPCHwConfig(const L1RPCHwConfig& rhs)
00036 // {
00037 //    // do actual copying here;
00038 // }
00039 
00040 L1RPCHwConfig::~L1RPCHwConfig()
00041 {
00042 }
00043 
00044 
00045 void  L1RPCHwConfig::enablePAC(int tower, int sector, int segment, bool enable) 
00046 {
00047 
00048  if (enable){
00049 //  std::cout << "+";
00050   m_disabledDevices.erase(L1RPCDevCoords(tower, sector, segment)) ; 
00051  }
00052  else{
00053  // std::cout << "-";
00054   m_disabledDevices.insert(L1RPCDevCoords(tower, sector, segment)) ; 
00055  }
00056 
00057 }
00058 
00059 void L1RPCHwConfig::enableTower(int tower, bool enable) {
00060 
00061 
00062   for (int sec = 0; sec <12 ; ++sec  ){
00063     for (int seg = 0; seg<12; ++seg ) {
00064      enablePAC(tower,sec,seg,enable);
00065 
00066     }
00067 
00068   }
00069 
00070 
00071 }
00072 
00073 void L1RPCHwConfig::enableTowerInCrate(int tower, int crate, bool enable){
00074     for (int seg = 0; seg<12; ++seg ) {
00075       enablePAC(tower,crate,seg,enable);
00076     }
00077 }
00078 
00079 void L1RPCHwConfig::enableCrate(int crate, bool enable) {
00080 
00081   for (int tower = -16; tower < 17; ++tower){
00082      for (int seg = 0; seg<12; ++seg ) {
00083          enablePAC(tower, crate, seg, enable);
00084      }
00085   }
00086 
00087 
00088 }
00089 
00090 
00091 void L1RPCHwConfig::enableAll(bool enable){
00092 
00093    for (int seg = 0; seg<12; ++seg ) {
00094   //     std::cout <<  seg << " ";
00095        enableCrate(seg,enable);
00096   //     std::cout << std::endl; 
00097    }
00098 
00099 
00100 }