25 _mapDetIdNoise.clear();
28 _mapDetClsMap.clear();
35 std::vector<float> vnoise;
40 std::vector<std::string> words;
43 while (getline(_infile1, buff,
'\n')) {
50 ss >> chname >> rpcdetid;
54 while ((pos = buff.find(
" ", pos)) != string::npos) {
55 words.push_back(buff.substr(prev_pos, pos - prev_pos));
58 words.push_back(buff.substr(prev_pos, pos - prev_pos));
60 for (
unsigned int i = 2;
i < words.size(); ++
i) {
61 float value = atof(((words)[
i]).c_str());
62 vnoise.push_back(value);
65 _mapDetIdNoise.insert(make_pair(static_cast<uint32_t>(rpcdetid), vnoise));
76 std::vector<float> veff;
79 while (getline(_infile2, buff,
'\n')) {
86 ss >> chname >> rpcdetid;
89 while ((pos = buff.find(
" ", pos)) != string::npos) {
90 words.push_back(buff.substr(prev_pos, pos - prev_pos));
93 words.push_back(buff.substr(prev_pos, pos - prev_pos));
95 for (
unsigned int i = 2;
i < words.size(); ++
i) {
96 float value = atof(((words)[
i]).c_str());
97 veff.push_back(value);
99 _mapDetIdEff.insert(make_pair(static_cast<uint32_t>(rpcdetid), veff));
108 uint32_t detUnit = 0;
110 while (!_infile3.eof()) {
111 _infile3 >> detUnit >> timing;
124 unsigned int row = 1;
125 std::vector<double> sum_clsize;
127 while (_infile4 >> buffer) {
128 const char *buffer1 = buffer.c_str();
129 double dato = atof(buffer1);
131 sum_clsize.push_back(sum);
133 if (counter == row * 20) {
134 _clsMap[row] = sum_clsize;
148 std::vector<double> vClsDistrib;
151 while (getline(_infile5, buff,
'\n')) {
160 while ((pos = buff.find(
" ", pos)) != string::npos) {
161 words.push_back(buff.substr(prev_pos, pos - prev_pos));
164 words.push_back(buff.substr(prev_pos, pos - prev_pos));
166 float clusterSizeSumData(0.);
168 for (
unsigned int i = 1;
i < words.size(); ++
i) {
169 float value = atof(((words)[
i]).c_str());
171 clusterSizeSumData +=
value;
172 vClsDistrib.push_back(clusterSizeSumData);
174 clusterSizeSumData = 0.;
177 if (vClsDistrib.size() != 100) {
178 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong "
182 _mapDetClsMap.insert(make_pair(static_cast<uint32_t>(rpcdetid), vClsDistrib));
183 std::cout <<
"_mapDetClsMap.size()\t" << _mapDetClsMap.size() << std::endl;
190 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdNoise.find(
id);
191 if (iter == _mapDetIdNoise.end()) {
192 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no noise information for "
196 return (iter->second);
200 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdEff.find(
id);
201 if (iter == _mapDetIdEff.end()) {
202 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no efficiency information "
206 if ((iter->second).size() != 96) {
207 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - efficiency information in a "
208 "wrong format for DetId\t"
217 std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
218 if (iter == _bxmap.end()) {
219 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no timing information for "
221 << rpcid.
rawId() << std::endl;
227 if (_clsMap.size() != 5) {
228 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong "
236 std::map<uint32_t, std::vector<double>>::iterator iter = _mapDetClsMap.find(
id);
237 if (iter == _mapDetClsMap.end()) {
238 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no cluster size information "
242 if ((iter->second).size() != 100) {
243 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size information in "
244 "a wrong format for DetId\t"
std::vector< double > getCls(uint32_t id)
constexpr uint32_t rawId() const
get the raw id
std::vector< float > getEff(uint32_t id)
std::map< int, std::vector< double > > getClsMap()
float getTime(uint32_t id)
T getParameter(std::string const &) const
static std::atomic< unsigned int > counter
std::string fullPath() const
RPCCalibSetUp(const edm::ParameterSet &ps)
std::vector< float > getNoise(uint32_t id)