25 _mapDetIdNoise.clear();
28 _mapDetClsMap.clear();
35 std::vector<float> vnoise;
40 std::vector<std::string> words;
42 while (getline(_infile1, buff,
'\n')) {
49 ss >> chname >> rpcdetid;
53 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
54 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
57 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
59 for (
unsigned int i = 2;
i < words.size(); ++
i) {
60 float value = atof(((words)[
i]).c_str());
61 vnoise.push_back(
value);
64 _mapDetIdNoise.insert(make_pair(static_cast<uint32_t>(rpcdetid), vnoise));
73 std::vector<float> veff;
76 while (getline(_infile2, buff,
'\n')) {
83 ss >> chname >> rpcdetid;
86 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
87 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
90 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
92 for (
unsigned int i = 2;
i < words.size(); ++
i) {
93 float value = atof(((words)[
i]).c_str());
94 veff.push_back(
value);
96 _mapDetIdEff.insert(make_pair(static_cast<uint32_t>(rpcdetid), veff));
105 uint32_t detUnit = 0;
107 while (!_infile3.eof()) {
108 _infile3 >> detUnit >>
timing;
121 unsigned int row = 1;
122 std::vector<double> sum_clsize;
124 while (_infile4 >>
buffer) {
125 const char *buffer1 =
buffer.c_str();
126 double dato = atof(buffer1);
128 sum_clsize.push_back(sum);
131 _clsMap[row] = sum_clsize;
145 std::vector<double> vClsDistrib;
148 while (getline(_infile5, buff,
'\n')) {
157 while ((
pos = buff.find(
" ",
pos)) != string::npos) {
158 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
161 words.push_back(buff.substr(prev_pos,
pos - prev_pos));
163 float clusterSizeSumData(0.);
165 for (
unsigned int i = 1;
i < words.size(); ++
i) {
166 float value = atof(((words)[
i]).c_str());
168 clusterSizeSumData +=
value;
169 vClsDistrib.push_back(clusterSizeSumData);
171 clusterSizeSumData = 0.;
174 if (vClsDistrib.size() != 100) {
175 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong " 179 _mapDetClsMap.insert(make_pair(static_cast<uint32_t>(rpcdetid), vClsDistrib));
180 std::cout <<
"_mapDetClsMap.size()\t" << _mapDetClsMap.size() << std::endl;
187 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdNoise.find(
id);
188 if (iter == _mapDetIdNoise.end()) {
189 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no noise information for " 193 return (iter->second);
197 map<uint32_t, std::vector<float>>::iterator iter = _mapDetIdEff.find(
id);
198 if (iter == _mapDetIdEff.end()) {
199 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no efficiency information " 203 if ((iter->second).size() != 96) {
204 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - efficiency information in a " 205 "wrong format for DetId\t" 214 std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
215 if (iter == _bxmap.end()) {
216 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no timing information for " 218 << rpcid.
rawId() << std::endl;
224 if (_clsMap.size() != 5) {
225 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong " 233 std::map<uint32_t, std::vector<double>>::iterator iter = _mapDetClsMap.find(
id);
234 if (iter == _mapDetClsMap.end()) {
235 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - no cluster size information " 239 if ((iter->second).size() != 100) {
240 throw cms::Exception(
"DataCorrupt") <<
"Exception comming from RPCCalibSetUp - cluster size information in " 241 "a wrong format for DetId\t"
T getParameter(std::string const &) const
std::vector< double > getCls(uint32_t id)
std::string fullPath() const
std::vector< float > getEff(uint32_t id)
std::map< int, std::vector< double > > getClsMap()
float getTime(uint32_t id)
constexpr uint32_t rawId() const
get the raw id
RPCCalibSetUp(const edm::ParameterSet &ps)
std::vector< float > getNoise(uint32_t id)