26 _mapDetIdNoise.clear();
29 _mapDetClsMap.clear();
36 std::vector<float> vnoise;
41 std::vector<std::string> words;
44 while (getline(_infile1, buff,
'\n')) {
51 ss >> chname >> rpcdetid;
55 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
56 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
59 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
61 for (
unsigned int i = 2;
i < words.size(); ++
i) {
62 float value = atof(((words)[
i]).c_str());
63 vnoise.push_back(
value);
66 _mapDetIdNoise.insert(make_pair(static_cast<uint32_t>(rpcdetid), vnoise));
77 std::vector<float> veff;
80 while (getline(_infile2, buff,
'\n')) {
87 ss >> chname >> rpcdetid;
90 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
91 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
94 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
96 for (
unsigned int i = 2;
i < words.size(); ++
i) {
97 float value = atof(((words)[
i]).c_str());
98 veff.push_back(
value);
100 _mapDetIdEff.insert(make_pair(static_cast<uint32_t>(rpcdetid), veff));
109 uint32_t detUnit = 0;
111 while (!_infile3.eof()) {
112 _infile3 >> detUnit >>
timing;
125 unsigned int row = 1;
126 std::vector<double> sum_clsize;
128 while (_infile4 >>
buffer) {
129 const char *buffer1 =
buffer.c_str();
130 double dato = atof(buffer1);
132 sum_clsize.push_back(sum);
135 _clsMap[row] = sum_clsize;
149 std::vector<double> vClsDistrib;
152 while (getline(_infile5, buff,
'\n')) {
161 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
162 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
165 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
167 float clusterSizeSumData(0.);
169 for (
unsigned int i = 1;
i < words.size(); ++
i) {
170 float value = atof(((words)[
i]).c_str());
172 clusterSizeSumData +=
value;
173 vClsDistrib.push_back(clusterSizeSumData);
175 clusterSizeSumData = 0.;
178 if (vClsDistrib.size() != 100) {
179 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong "
183 _mapDetClsMap.insert(make_pair(static_cast<uint32_t>(rpcdetid), vClsDistrib));
184 std::cout <<
"_mapDetClsMap.size()\t" << _mapDetClsMap.size() << std::endl;
191 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdNoise.find(
id);
192 if (iter == _mapDetIdNoise.end()) {
193 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no noise information for "
197 return (iter->second);
201 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdEff.find(
id);
202 if (iter == _mapDetIdEff.end()) {
203 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no efficiency information "
207 if ((iter->second).size() != 96) {
208 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - efficiency information in a "
209 "wrong format for DetId\t"
218 std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
219 if (iter == _bxmap.end()) {
220 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no timing information for "
222 << rpcid.
rawId() << std::endl;
228 if (_clsMap.size() != 5) {
229 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong "
237 std::map<uint32_t, std::vector<double>>::iterator iter = _mapDetClsMap.find(
id);
238 if (iter == _mapDetClsMap.end()) {
239 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no cluster size information "
243 if ((iter->second).size() != 100) {
244 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size information in "
245 "a wrong format for DetId\t"