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 ()
 
- 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

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
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 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 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::string m_patternsDir
RPCTriggerConfig::~RPCTriggerConfig ( )

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 createfilelist::parser.

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