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
RPCTriggerConfig Class Reference
Inheritance diagram for RPCTriggerConfig:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

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

Public Member Functions

ReturnType produce (const L1RPCConfigRcd &)
 
 RPCTriggerConfig (const edm::ParameterSet &)
 
 ~RPCTriggerConfig ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 44 of file RPCTriggerConfig.cc.

Member Typedef Documentation

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

Definition at line 49 of file RPCTriggerConfig.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file RPCTriggerConfig.cc.

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

71 {
72  //the following line is needed to tell the framework what
73  // data is being produced
74  setWhatProduced(this);
75 
76  //now do what ever other initialization is needed
77 
78 
79  m_ppt = iConfig.getUntrackedParameter<int>("PACsPerTower");
80  std::string dataDir = iConfig.getUntrackedParameter<std::string>("filedir");
81 
82  edm::FileInPath fp(dataDir+"pacPat_t0sc0sg0.xml");
83  std::string patternsDirNameUnstriped = fp.fullPath();
84  m_patternsDir = patternsDirNameUnstriped.substr(0,patternsDirNameUnstriped.find_last_of("/")+1);
85 
86 
87 
88 
89 }
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 92 of file RPCTriggerConfig.cc.

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

Member Function Documentation

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

Definition at line 107 of file RPCTriggerConfig.cc.

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

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

Referenced by produce(), and RPCTriggerConfig().

int RPCTriggerConfig::m_ppt
private

Definition at line 55 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().