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 43 of file RPCTriggerConfig.cc.

Member Typedef Documentation

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

Definition at line 48 of file RPCTriggerConfig.cc.

Constructor & Destructor Documentation

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

Definition at line 69 of file RPCTriggerConfig.cc.

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

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

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

Member Function Documentation

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

Definition at line 106 of file RPCTriggerConfig.cc.

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

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

Referenced by produce(), and RPCTriggerConfig().

int RPCTriggerConfig::m_ppt
private

Definition at line 54 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().