CMS 3D CMS Logo

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< L1RPCHwConfigReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

ReturnType produce (const L1RPCHwConfigRcd &)
 
 RPCTriggerHwConfig (const edm::ParameterSet &)
 
 ~RPCTriggerHwConfig () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollector setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
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
RPCTriggerHwConfig::~RPCTriggerHwConfig ( )
override

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 DEFINE_FWK_EVENTSETUP_MODULE, m_disableAll, m_disableCrates, m_disableTowers, m_disableTowersInCrates, m_enableCrates, m_enableTowers, and m_enableTowersInCrates.

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