30 _mapDetIdNoise.clear();
33 _mapDetClsMap.clear();
40 std::vector<float> vnoise;
45 std::vector< std::string > words;
48 while( getline(_infile1, buff,
'\n') ){
60 while ( (pos = buff.find(
" ",pos)) != string::npos){
62 words.push_back(buff.substr(prev_pos, pos - prev_pos));
65 words.push_back(buff.substr(prev_pos, pos - prev_pos));
67 for(
unsigned int i = 2;
i < words.size(); ++
i){
68 float value = atof( ((words)[
i]).c_str() );
69 vnoise.push_back(value);
72 _mapDetIdNoise.insert(make_pair(static_cast<uint32_t>(rpcdetid),vnoise));
83 std::vector<float> veff ;
86 while( getline(_infile2, buff,
'\n') ){
97 while ( (pos = buff.find(
" ",pos)) != string::npos){
99 words.push_back(buff.substr(prev_pos, pos - prev_pos));
102 words.push_back(buff.substr(prev_pos, pos - prev_pos));
104 for(
unsigned int i = 2;
i < words.size(); ++
i){
105 float value = atof(((words)[
i]).c_str());
106 veff.push_back(value);
108 _mapDetIdEff.insert(make_pair(static_cast<uint32_t>(rpcdetid),veff));
117 uint32_t detUnit = 0;
119 while(!_infile3.eof()){
120 _infile3>>detUnit>>timing;
132 unsigned int counter = 1;
133 unsigned int row = 1;
134 std::vector<double> sum_clsize;
136 while ( _infile4 >> buffer ) {
137 const char *buffer1 = buffer.c_str();
138 double dato = atof(buffer1);
140 sum_clsize.push_back(sum);
142 if(counter == row*20) {
143 _clsMap[row] = sum_clsize;
157 std::vector<double> vClsDistrib ;
160 while( getline(_infile5, buff,
'\n') ){
170 while ( (pos = buff.find(
" ",pos)) != string::npos){
172 words.push_back(buff.substr(prev_pos, pos - prev_pos));
175 words.push_back(buff.substr(prev_pos, pos - prev_pos));
177 float clusterSizeSumData(0.);
179 for(
unsigned int i = 1;
i < words.size(); ++
i){
180 float value = atof(((words)[
i]).c_str());
182 clusterSizeSumData+=
value;
183 vClsDistrib.push_back(clusterSizeSumData);
185 clusterSizeSumData=0.;
188 if(vClsDistrib.size()!=100){
190 <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong format "<< std::endl;
192 _mapDetClsMap.insert(make_pair(static_cast<uint32_t>(rpcdetid),vClsDistrib));
193 std::cout<<
"_mapDetClsMap.size()\t"<<_mapDetClsMap.size()<<std::endl;
203 map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdNoise.find(
id);
204 if(iter == _mapDetIdNoise.end()){
206 <<
"Exception comming from RPCCalibSetUp - no noise information for DetId\t"<<
id<< std::endl;
208 return (iter->second);
213 map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdEff.find(
id);
214 if(iter == _mapDetIdEff.end()){
216 <<
"Exception comming from RPCCalibSetUp - no efficiency information for DetId\t"<<
id<< std::endl;
218 if((iter->second).size() != 96){
220 <<
"Exception comming from RPCCalibSetUp - efficiency information in a wrong format for DetId\t"<<
id<< std::endl;
229 std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
230 if(iter == _bxmap.end()){
232 <<
"Exception comming from RPCCalibSetUp - no timing information for rpcid.rawId()\t"<<rpcid.
rawId()<< std::endl;
239 if(_clsMap.size()!=5){
241 <<
"Exception comming from RPCCalibSetUp - cluster size - a wrong format "<< std::endl;
247 std::map<uint32_t,std::vector<double> >::iterator iter = _mapDetClsMap.find(
id);
248 if(iter == _mapDetClsMap.end()){
250 <<
"Exception comming from RPCCalibSetUp - no cluster size information for DetId\t"<<
id<< std::endl;
252 if((iter->second).size() != 100){
254 <<
"Exception comming from RPCCalibSetUp - cluster size information in a wrong format for DetId\t"<<
id<< std::endl;
T getParameter(std::string const &) const
std::vector< double > getCls(uint32_t id)
std::vector< float > getEff(uint32_t id)
uint32_t rawId() const
get the raw id
std::map< int, std::vector< double > > getClsMap()
float getTime(uint32_t id)
RPCCalibSetUp(const edm::ParameterSet &ps)
std::string fullPath() const
std::vector< float > getNoise(uint32_t id)