10 const char*
name[12] = {
"registersSP1",
23 for (
int sp = 0; sp < 12; sp++) {
24 std::vector<std::string> regs = pset.
getParameter<std::vector<std::string> >(name[sp]);
25 for (std::vector<std::string>::const_iterator
line = regs.begin();
line != regs.end();
line++)
38 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer") <<
"Producing " 39 <<
" L1MuCSCTFConfiguration from PSET";
41 std::unique_ptr<L1MuCSCTFConfiguration>
config =
48 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer") <<
"Producing " 49 <<
" L1MuCSCTFAlignment from PSET";
56 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer") <<
"Producing " 57 <<
" L1MuCSCPtLut from PSET";
59 std::unique_ptr<L1MuCSCPtLut> pt_lut = std::unique_ptr<L1MuCSCPtLut>(
new L1MuCSCPtLut());
65 <<
"CSCTFConfigProducer is unable to generate LUTs on the fly.\n" 66 "Specify full LUT file names or just avoid using CSCTFConfigProducer by uncommenting PTLUT " 67 "parameter sets in L1Trigger/CSCTrackFinder configuration." 75 if (path.find(
".bin") != std::string::npos) {
76 std::ifstream
file(path.c_str(), std::ios::binary);
77 file.read((
char*)lut, length *
sizeof(
unsigned short));
79 throw cms::Exception(
"Reading error") <<
"CSCTFConfigProducer cannot read " << length <<
" words from " << path
80 <<
" (errno=" << errno <<
")" << std::endl;
81 if ((
unsigned int)
file.gcount() != length *
sizeof(
unsigned short))
83 <<
"CSCTFConfigProducer read " << (
file.gcount() /
sizeof(
unsigned short)) <<
" words from " << path
84 <<
" instead of " << length <<
" (errno=" << errno <<
")" << std::endl;
87 std::ifstream
file(path.c_str());
90 <<
"CSCTFConfigProducer cannot open " << path <<
" (errno=" << errno <<
")" << std::endl;
91 unsigned int address = 0;
92 for (address = 0; !
file.eof() && address < length; address++)
94 if (address != length)
96 <<
"CSCTFConfigProducer read " << address <<
" words from " << path <<
" instead of " << length << std::endl;
99 LogDebug(
"CSCTFConfigProducer::readLUT") <<
" read from " << path <<
" " << length <<
" words" << std::endl;
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::string registers[12]
std::unique_ptr< L1MuCSCTFAlignment > produceL1MuCSCTFAlignmentRcd(const L1MuCSCTFAlignmentRcd &iRecord)
std::unique_ptr< L1MuCSCTFConfiguration > produceL1MuCSCTFConfigurationRcd(const L1MuCSCTFConfigurationRcd &iRecord)
std::unique_ptr< L1MuCSCPtLut > produceL1MuCSCPtLutRcd(const L1MuCSCPtLutRcd &iRecord)
void readLUT(std::string path, unsigned short *lut, unsigned long length)
CSCTFConfigProducer(const edm::ParameterSet &pset)