CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
RPCTriggerConfig Class Reference
Inheritance diagram for RPCTriggerConfig:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr< L1RPCConfigReturnType
 
- 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 L1RPCConfigRcd &)
 
 RPCTriggerConfig (const edm::ParameterSet &)
 
 ~RPCTriggerConfig () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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

std::string m_patternsDir
 
int m_ppt
 

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 >
ESConsumesCollectorT< TRecord > 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 42 of file RPCTriggerConfig.cc.

Member Typedef Documentation

typedef std::unique_ptr<L1RPCConfig> RPCTriggerConfig::ReturnType

Definition at line 47 of file RPCTriggerConfig.cc.

Constructor & Destructor Documentation

RPCTriggerConfig::RPCTriggerConfig ( const edm::ParameterSet iConfig)

Definition at line 68 of file RPCTriggerConfig.cc.

References edm::ParameterSet::getUntrackedParameter(), m_patternsDir, m_ppt, edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

69 {
70  //the following line is needed to tell the framework what
71  // data is being produced
72  setWhatProduced(this);
73 
74  //now do what ever other initialization is needed
75 
76 
77  m_ppt = iConfig.getUntrackedParameter<int>("PACsPerTower");
78  std::string dataDir = iConfig.getUntrackedParameter<std::string>("filedir");
79 
80  edm::FileInPath fp(dataDir+"pacPat_t0sc0sg0.xml");
81  std::string patternsDirNameUnstriped = fp.fullPath();
82  m_patternsDir = patternsDirNameUnstriped.substr(0,patternsDirNameUnstriped.find_last_of("/")+1);
83 
84 
85 
86 
87 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
std::string m_patternsDir
RPCTriggerConfig::~RPCTriggerConfig ( )
override

Definition at line 90 of file RPCTriggerConfig.cc.

91 {
92 
93  // do anything here that needs to be done at desctruction time
94  // (e.g. close files, deallocate resources etc.)
95 
96 }

Member Function Documentation

RPCTriggerConfig::ReturnType RPCTriggerConfig::produce ( const L1RPCConfigRcd iRecord)

Definition at line 105 of file RPCTriggerConfig.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, Exception, alignmentValidation::fname, RPCPatternsParser::getPatternsVec(), RPCPatternsParser::getQualityVec(), LogDebug, m_patternsDir, m_ppt, RPCConst::m_TOWER_COUNT, RPCPatternsParser::parse(), and writedatasetfile::parser.

106 {
107  auto pL1RPCConfig = std::make_unique<L1RPCConfig>();
108 
109  pL1RPCConfig->setPPT(m_ppt);
110 
111  // parse and isert patterns
112  int scCnt = 0, sgCnt = 0;
113  if(m_ppt == 1) {
114  scCnt = 1;
115  sgCnt = 1;
116  }
117  else if(m_ppt == 12) {
118  scCnt = 1;
119  sgCnt = 12;
120  }
121  else if(m_ppt == 144) {
122  scCnt = 12;
123  sgCnt = 12;
124  }
125  else {
126  throw cms::Exception("BadConfig") << "Bad number of ppt requested: " << m_ppt << "\n";
127  }
128 
129 
130  for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; ++tower) {
131  for (int logSector = 0; logSector < scCnt; ++logSector) {
132  for (int logSegment = 0; logSegment < sgCnt; ++logSegment) {
133 
134  std::stringstream fname;
135  fname << m_patternsDir
136  << "pacPat_t" << tower
137  << "sc" << logSector
138  << "sg" <<logSegment
139  << ".xml";
140 
141  // TODO: this should go to logSth
142  LogDebug("RPCTriggerConfig") << "Parsing: " << fname.str() <<std::endl;
143 
145  parser.parse(fname.str());
146 
147  RPCPattern::RPCPatVec npats = parser.getPatternsVec(tower, logSector, logSegment);
148  for (unsigned int ip=0; ip<npats.size(); ip++) {
149  npats[ip].setCoords(tower,logSector,logSegment);
150  pL1RPCConfig->m_pats.push_back(npats[ip]);
151  }
152 
153  RPCPattern::TQualityVec nquals = parser.getQualityVec();
154  for (unsigned int iq=0; iq<nquals.size(); iq++) {
155  nquals[iq].m_tower=tower;
156  nquals[iq].m_logsector=logSector;
157  nquals[iq].m_logsegment=logSegment;
158  pL1RPCConfig->m_quals.push_back(nquals[iq]);
159  }
160 
161  LogDebug("RPCTriggerConfig")
162  << " RPCPatterns: " << npats.size()
163  << " qualities: "<< nquals.size()
164  << std::endl;
165 
166 
167  } // segments
168  } // sectors
169  } // towers
170 
171 
172 
173  return pL1RPCConfig ;
174 }
#define LogDebug(id)
std::vector< RPCPattern > RPCPatVec
Definition: RPCPattern.h:36
const RPCPattern::RPCPatVec & getPatternsVec(const RPCConst::l1RpcConeCrdnts &coneCrds) const
static const int m_TOWER_COUNT
Only half of the detector.
Definition: RPCConst.h:43
std::vector< TQuality > TQualityVec
Definition: RPCPattern.h:49
std::string m_patternsDir
const RPCPattern::TQualityVec & getQualityVec() const
string fname
main script
void parse(std::string fileName)

Member Data Documentation

std::string RPCTriggerConfig::m_patternsDir
private

Definition at line 54 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().

int RPCTriggerConfig::m_ppt
private

Definition at line 53 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().