10 const char *
name[12] = {
"registersSP1",
"registersSP2",
"registersSP3",
"registersSP4",
11 "registersSP5",
"registersSP6",
"registersSP7",
"registersSP8",
12 "registersSP9",
"registersSP10",
"registersSP11",
"registersSP12"};
14 for(
int sp=0; sp<12; sp++){
15 std::vector<std::string> regs = pset.
getParameter<std::vector<std::string> >(name[sp]);
16 for(std::vector<std::string>::const_iterator
line=regs.begin();
line!=regs.end();
line++)
30 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer" ) <<
"Producing "
31 <<
" L1MuCSCTFConfiguration from PSET";
38 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer" ) <<
"Producing "
39 <<
" L1MuCSCTFAlignment from PSET";
47 edm::LogInfo(
"L1-O2O: CSCTFConfigProducer" ) <<
"Producing "
48 <<
" L1MuCSCPtLut from PSET";
52 std::auto_ptr<L1MuCSCPtLut> pt_lut = std::auto_ptr<L1MuCSCPtLut>(
new L1MuCSCPtLut() );
57 throw cms::Exception(
"Undefined pT LUT")<<
"CSCTFConfigProducer is unable to generate LUTs on the fly.\n"
58 "Specify full LUT file names or just avoid using CSCTFConfigProducer by uncommenting PTLUT "
59 "parameter sets in L1Trigger/CSCTrackFinder configuration."<<std::endl;
66 if( path.find(
".bin") != std::string::npos ) {
67 std::ifstream
file(path.c_str(), std::ios::binary);
68 file.read((
char*)lut,length*
sizeof(
unsigned short));
70 throw cms::Exception(
"Reading error")<<
"CSCTFConfigProducer cannot read "<<length<<
" words from "<<path<<
" (errno="<<errno<<
")"<<std::endl;
71 if( (
unsigned int)
file.gcount() != length*
sizeof(
unsigned short) )
72 throw cms::Exception(
"Incorrect LUT size")<<
"CSCTFConfigProducer read "<<(
file.gcount()/
sizeof(
unsigned short))<<
" words from "<<path<<
" instead of "<<length<<
" (errno="<<errno<<
")"<<std::endl;
75 std::ifstream
file(path.c_str());
77 throw cms::Exception(
"Cannot open file")<<
"CSCTFConfigProducer cannot open "<<path<<
" (errno="<<errno<<
")"<<std::endl;
78 unsigned int address=0;
79 for(address=0; !
file.eof() && address<length; address++)
81 if( address!=length )
throw cms::Exception(
"Incorrect LUT size")<<
"CSCTFConfigProducer read "<<address<<
" words from "<<path<<
" instead of "<<length<<std::endl;
84 LogDebug(
"CSCTFConfigProducer::readLUT")<<
" read from "<<path<<
" "<<length<<
" words"<<std::endl;
T getParameter(std::string const &) const
std::string registers[12]
std::auto_ptr< L1MuCSCTFConfiguration > produceL1MuCSCTFConfigurationRcd(const L1MuCSCTFConfigurationRcd &iRecord)
std::auto_ptr< L1MuCSCPtLut > produceL1MuCSCPtLutRcd(const L1MuCSCPtLutRcd &iRecord)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
std::vector< double > alignment
void readLUT(std::string path, unsigned short *lut, unsigned long length)
std::auto_ptr< L1MuCSCTFAlignment > produceL1MuCSCTFAlignmentRcd(const L1MuCSCTFAlignmentRcd &iRecord)
CSCTFConfigProducer(const edm::ParameterSet &pset)