CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
RPCTriggerHwConfig Class Reference
Inheritance diagram for RPCTriggerHwConfig:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr
< L1RPCHwConfig
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

ReturnType produce (const L1RPCHwConfigRcd &)
 
 RPCTriggerHwConfig (const edm::ParameterSet &)
 
 ~RPCTriggerHwConfig ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

bool m_disableAll
 
std::vector< int > m_disableCrates
 
std::vector< int > m_disableTowers
 
std::vector< int > m_disableTowersInCrates
 
std::vector< int > m_enableCrates
 
std::vector< int > m_enableTowers
 
std::vector< int > m_enableTowersInCrates
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 38 of file RPCTriggerHwConfig.cc.

Member Typedef Documentation

Definition at line 43 of file RPCTriggerHwConfig.cc.

Constructor & Destructor Documentation

RPCTriggerHwConfig::RPCTriggerHwConfig ( const edm::ParameterSet iConfig)

Definition at line 71 of file RPCTriggerHwConfig.cc.

References edm::ParameterSet::getParameter(), m_disableAll, m_disableCrates, m_disableTowers, m_disableTowersInCrates, m_enableCrates, m_enableTowers, m_enableTowersInCrates, and edm::ESProducer::setWhatProduced().

72 {
73  //the following line is needed to tell the framework what
74  // data is being produced
75  setWhatProduced(this);
76 
77  //now do what ever other initialization is needed
78  m_disableTowers = iConfig.getParameter<std::vector<int> >("disableTowers");
79  m_disableCrates = iConfig.getParameter<std::vector<int> >("disableCrates");
80  m_disableTowersInCrates = iConfig.getParameter<std::vector<int> >("disableTowersInCrates");
81 
82  m_disableAll = iConfig.getParameter<bool>("disableAll");
83 
84  m_enableTowers = iConfig.getParameter<std::vector<int> >("enableTowers");
85  m_enableCrates = iConfig.getParameter<std::vector<int> >("enableCrates");
86  m_enableTowersInCrates = iConfig.getParameter<std::vector<int> >("enableTowersInCrates");
87 
88  if (m_disableAll) {
89  m_disableTowers.clear();
90  m_disableCrates.clear();
91  m_disableTowersInCrates.clear();
92  // check if m_enableTowers & m_enableCrates are not empty?
93  }
94 
95 
96 
97 }
T getParameter(std::string const &) const
std::vector< int > m_disableCrates
std::vector< int > m_enableCrates
std::vector< int > m_disableTowers
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< int > m_enableTowersInCrates
std::vector< int > m_enableTowers
std::vector< int > m_disableTowersInCrates
RPCTriggerHwConfig::~RPCTriggerHwConfig ( )

Definition at line 100 of file RPCTriggerHwConfig.cc.

101 {
102 
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 
106 }

Member Function Documentation

RPCTriggerHwConfig::ReturnType RPCTriggerHwConfig::produce ( const L1RPCHwConfigRcd iRecord)

Definition at line 115 of file RPCTriggerHwConfig.cc.

References m_disableAll, m_disableCrates, m_disableTowers, m_disableTowersInCrates, m_enableCrates, m_enableTowers, and m_enableTowersInCrates.

116 {
117  using namespace edm::es;
118  auto pL1RPCHwConfig = std::make_unique<L1RPCHwConfig>();
119 
120  if (m_disableAll) {
121  pL1RPCHwConfig->enableAll(false);
122  std::vector<int>::iterator crIt = m_enableCrates.begin();
123  std::vector<int>::iterator twIt = m_enableTowers.begin();
124  for (; crIt!=m_enableCrates.end(); ++crIt){
125  pL1RPCHwConfig->enableCrate(*crIt,true);
126  }
127  for (; twIt!=m_enableTowers.end(); ++twIt){
128  pL1RPCHwConfig->enableTower(*twIt,true);
129  }
130  for (unsigned int It=0; It<m_enableTowersInCrates.size(); It++) {
131  if (It%2 == 0)
132  pL1RPCHwConfig->enableTowerInCrate(m_enableTowersInCrates[It+1], m_enableTowersInCrates[It], true);
133  }
134  } else {
135  std::vector<int>::iterator crIt = m_disableCrates.begin();
136  std::vector<int>::iterator twIt = m_disableTowers.begin();
137  for (; crIt!=m_disableCrates.end(); ++crIt){
138  pL1RPCHwConfig->enableCrate(*crIt,false);
139  }
140  for (; twIt!=m_disableTowers.end(); ++twIt){
141  pL1RPCHwConfig->enableTower(*twIt,false);
142  }
143  for (unsigned int It=0; It<m_disableTowersInCrates.size(); It++) {
144  if (It%2 == 0)
145  pL1RPCHwConfig->enableTowerInCrate(m_disableTowersInCrates[It+1], m_disableTowersInCrates[It], false);
146  }
147 
148  }
149 
150  return pL1RPCHwConfig ;
151 }
std::vector< int > m_disableCrates
std::vector< int > m_enableCrates
std::vector< int > m_disableTowers
std::vector< int > m_enableTowersInCrates
std::vector< int > m_enableTowers
std::vector< int > m_disableTowersInCrates

Member Data Documentation

bool RPCTriggerHwConfig::m_disableAll
private

Definition at line 56 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_disableCrates
private

Definition at line 49 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_disableTowers
private

Definition at line 48 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_disableTowersInCrates
private

Definition at line 50 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_enableCrates
private

Definition at line 53 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_enableTowers
private

Definition at line 52 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().

std::vector<int> RPCTriggerHwConfig::m_enableTowersInCrates
private

Definition at line 54 of file RPCTriggerHwConfig.cc.

Referenced by produce(), and RPCTriggerHwConfig().