Public Types | |
typedef std::auto_ptr < L1RPCConfig > | ReturnType |
Public Member Functions | |
ReturnType | produce (const L1RPCConfigRcd &) |
RPCTriggerConfig (const edm::ParameterSet &) | |
~RPCTriggerConfig () | |
Private Attributes | |
std::string | m_patternsDir |
int | m_ppt |
Implementation: <Notes on="" implementation>="">
Definition at line 44 of file RPCTriggerConfig.cc.
typedef std::auto_ptr<L1RPCConfig> RPCTriggerConfig::ReturnType |
Definition at line 49 of file RPCTriggerConfig.cc.
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().
00071 { 00072 //the following line is needed to tell the framework what 00073 // data is being produced 00074 setWhatProduced(this); 00075 00076 //now do what ever other initialization is needed 00077 00078 00079 m_ppt = iConfig.getUntrackedParameter<int>("PACsPerTower"); 00080 std::string dataDir = iConfig.getUntrackedParameter<std::string>("filedir"); 00081 00082 edm::FileInPath fp(dataDir+"pacPat_t0sc0sg0.xml"); 00083 std::string patternsDirNameUnstriped = fp.fullPath(); 00084 m_patternsDir = patternsDirNameUnstriped.substr(0,patternsDirNameUnstriped.find_last_of("/")+1); 00085 00086 00087 00088 00089 }
RPCTriggerConfig::~RPCTriggerConfig | ( | ) |
Definition at line 92 of file RPCTriggerConfig.cc.
00093 { 00094 00095 // do anything here that needs to be done at desctruction time 00096 // (e.g. close files, deallocate resources etc.) 00097 00098 }
RPCTriggerConfig::ReturnType RPCTriggerConfig::produce | ( | const L1RPCConfigRcd & | iRecord | ) |
Definition at line 107 of file RPCTriggerConfig.cc.
References lat::endl(), Exception, mergeAndRegister_online::fname, RPCPatternsParser::getPatternsVec(), RPCPatternsParser::getQualityVec(), LogDebug, m_patternsDir, m_ppt, RPCConst::m_TOWER_COUNT, RPCPatternsParser::parse(), and indexGen::parser.
00108 { 00109 using namespace edm::es; 00110 std::auto_ptr<L1RPCConfig> pL1RPCConfig = std::auto_ptr<L1RPCConfig>( new L1RPCConfig() ); 00111 00112 pL1RPCConfig->setPPT(m_ppt); 00113 00114 // parse and isert patterns 00115 int scCnt = 0, sgCnt = 0; 00116 if(m_ppt == 1) { 00117 scCnt = 1; 00118 sgCnt = 1; 00119 } 00120 else if(m_ppt == 12) { 00121 scCnt = 1; 00122 sgCnt = 12; 00123 } 00124 else if(m_ppt == 144) { 00125 scCnt = 12; 00126 sgCnt = 12; 00127 } 00128 else { 00129 throw cms::Exception("BadConfig") << "Bad number of ppt requested: " << m_ppt << "\n"; 00130 } 00131 00132 00133 for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; ++tower) { 00134 for (int logSector = 0; logSector < scCnt; ++logSector) { 00135 for (int logSegment = 0; logSegment < sgCnt; ++logSegment) { 00136 00137 std::stringstream fname; 00138 fname << m_patternsDir 00139 << "pacPat_t" << tower 00140 << "sc" << logSector 00141 << "sg" <<logSegment 00142 << ".xml"; 00143 00144 // TODO: this should go to logSth 00145 LogDebug("RPCTriggerConfig") << "Parsing: " << fname.str() <<std::endl; 00146 00147 RPCPatternsParser parser; 00148 parser.parse(fname.str()); 00149 00150 RPCPattern::RPCPatVec npats = parser.getPatternsVec(tower, logSector, logSegment); 00151 for (int ip=0; ip<npats.size(); ip++) { 00152 npats[ip].setCoords(tower,logSector,logSegment); 00153 pL1RPCConfig->m_pats.push_back(npats[ip]); 00154 } 00155 00156 RPCPattern::TQualityVec nquals = parser.getQualityVec(); 00157 for (int iq=0; iq<nquals.size(); iq++) { 00158 nquals[iq].m_tower=tower; 00159 nquals[iq].m_logsector=logSector; 00160 nquals[iq].m_logsegment=logSegment; 00161 pL1RPCConfig->m_quals.push_back(nquals[iq]); 00162 } 00163 00164 LogDebug("RPCTriggerConfig") 00165 << " RPCPatterns: " << npats.size() 00166 << " qualities: "<< nquals.size() 00167 << std::endl; 00168 00169 00170 } // segments 00171 } // sectors 00172 } // towers 00173 00174 00175 00176 return pL1RPCConfig ; 00177 }
std::string RPCTriggerConfig::m_patternsDir [private] |
int RPCTriggerConfig::m_ppt [private] |