39 _mapDetIdNoise.clear();
49 std::vector<double> sum_clsize;
51 for(
unsigned int n = 0;
n < vcls.size(); ++
n){
53 sum_clsize.push_back(vcls[
n]);
55 if(counter == row*20) {
57 _clsMap[row] = sum_clsize;
66 std::vector<float> veff, vvnoise;
70 for(std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end(); ++it){
73 _mapDetIdNoise[
temp]= vvnoise;
74 _mapDetIdEff[
temp] = veff;
75 _bxmap[
RPCDetId(it->dpid)] = it->time;
79 vvnoise.push_back((it->noise));
80 veff.push_back((it->eff));
83 vvnoise.push_back((it->noise));
84 veff.push_back((it->eff));
85 _bxmap[
RPCDetId(it->dpid)] = it->time;
87 }
else if (n == vnoise.size()-1 ){
89 vvnoise.push_back((it->noise));
90 veff.push_back((it->eff));
91 _mapDetIdNoise[
temp]= vvnoise;
92 _mapDetIdEff[
temp] = veff;
95 vvnoise.push_back((it->noise));
96 veff.push_back((it->eff));
102 void RPCSimSetUp::setRPCSetUp(
const std::vector<RPCStripNoises::NoiseItem>& vnoise,
const std::vector<RPCClusterSize::ClusterSizeItem>& vClusterSize){
104 std::vector<RPCClusterSize::ClusterSizeItem>::const_iterator itCls;
107 std::vector<double> clsVect;
109 for(itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls){
110 clsVect.push_back(((
double)(itCls->clusterSize)));
111 if((!(clsCounter%120)) && (clsCounter!=0)){
113 _mapDetClsMap[detId]=clsVect;
121 for(itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls){
122 clsVect.push_back(((
double)(itCls->clusterSize)));
123 if((!(clsCounter%100)) && (clsCounter!=0)){
125 _mapDetClsMapLegacy[detId]=clsVect;
134 std::vector<float> veff, vvnoise;
138 for(std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end(); ++it){
141 _mapDetIdNoise[
temp]= vvnoise;
142 _mapDetIdEff[
temp] = veff;
143 _bxmap[
RPCDetId(it->dpid)] = it->time;
147 vvnoise.push_back((it->noise));
148 veff.push_back((it->eff));
151 vvnoise.push_back((it->noise));
152 veff.push_back((it->eff));
153 _bxmap[
RPCDetId(it->dpid)] = it->time;
155 }
else if (n == vnoise.size()-1 ){
157 vvnoise.push_back((it->noise));
158 veff.push_back((it->eff));
159 _mapDetIdNoise[
temp]= vvnoise;
160 _mapDetIdEff[
temp] = veff;
163 vvnoise.push_back((it->noise));
164 veff.push_back((it->eff));
172 map<uint32_t,std::vector<float> >::iterator
iter = _mapDetIdNoise.find(
id);
173 if(iter == _mapDetIdNoise.end()){
175 <<
"Exception comming from RPCSimSetUp - no noise information for DetId\t"<<
id<< std::endl;
182 map<uint32_t,std::vector<float> >::iterator
iter = _mapDetIdEff.find(
id);
183 if(iter == _mapDetIdEff.end()){
185 <<
"Exception comming from RPCSimSetUp - no efficiency information for DetId\t"<<
id<< std::endl;
187 if((iter->second).size() != 96){
189 <<
"Exception comming from RPCSimSetUp - efficiency information in a wrong format for DetId\t"<<
id<< std::endl;
197 std::map<RPCDetId, float>::iterator
iter = _bxmap.find(rpcid);
198 if(iter == _bxmap.end()){
200 <<
"Exception comming from RPCSimSetUp - no timing information for rpcid.rawId()\t"<<rpcid.
rawId()<< std::endl;
207 if(_clsMap.size()!=5){
209 <<
"Exception comming from RPCSimSetUp - cluster size - a wrong format "<< std::endl;
219 map<uint32_t,std::vector<double> >::iterator
iter = _mapDetClsMapLegacy.find(
id);
220 if(iter == _mapDetClsMapLegacy.end()){
222 <<
"Exception comming from RPCSimSetUp - no cluster size information for DetId\t"<<
id<< std::endl;
224 if((iter->second).size() != 100){
226 <<
"Exception comming from RPCSimSetUp - cluster size information in a wrong format for DetId\t"<<
id<< std::endl;
233 map<uint32_t,std::vector<double> >::const_iterator
iter = _mapDetClsMap.find(
id);
234 if(iter == _mapDetClsMap.end()){
236 <<
"Exception comming from RPCSimSetUp - no cluster size information for DetId\t"<<
id<< std::endl;
238 if((iter->second).size() != 120){
240 <<
"Exception comming from RPCSimSetUp - cluster size information in a wrong format for DetId\t"<<
id<< std::endl;
244 std::vector<double> dataForAsymmCls = iter->second;
247 <<
"Exception comming from RPCSimSetUp - slice variable not in the range"<< std::endl;
250 _DetClsAsymmetric.clear();
253 vector<double> clsFewStripsDistribution;
254 vector<double> clsDistribution;
255 vector<double> clsAccumulativeDistribution;
257 std::map< int, std::vector<double> > mapSliceVsDistribution;
260 const int distributionFewStrips=24;
262 double sliceVsFewStripsDistribution[slices][distributionFewStrips];
264 for(
int j = 0;
j < distributionFewStrips;
j++){
265 for(
int i = 0;
i < slices;
i++){
266 sliceVsFewStripsDistribution[
i][
j]=dataForAsymmCls[
j*slices+
i];
271 for(
int j = 0 ;
j < distributionFewStrips;
j++){
272 control+=sliceVsFewStripsDistribution[0][
j];
276 for(
int j = 0;
j < distributionFewStrips;
j++){
277 for(
int i = 0;
i < slices;
i++){
278 control1+=dataForAsymmCls[
j*slices+
i];
285 for(
int j = 0;
j < distributionFewStrips;
j++){
287 sum+=sliceVsFewStripsDistribution[
i][
j];
289 _DetClsAsymmetric.push_back(sum);
292 return _DetClsAsymmetric;
297 map<uint32_t,std::vector<double> >::const_iterator
iter = _mapDetClsMap.find(
id);
298 if(iter == _mapDetClsMap.end()){
300 <<
"Exception comming from RPCSimSetUp - no cluster size information for DetId\t"<<
id<< std::endl;
302 if((iter->second).size() != 120){
304 <<
"Exception comming from RPCSimSetUp - cluster size information in a wrong format for DetId\t"<<
id<<
'\t'<<(iter->second).
size()<< std::endl;
307 std::vector<double> dataForAsymmCls = iter->second;
311 <<
"Exception comming from RPCSimSetUp - slice variable not in the range"<< std::endl;
314 _DetAsymmetryForCls.clear();
316 vector<double> clsFewStripsDistribution;
317 vector<double> clsDistribution;
318 vector<double> clsAccumulativeDistribution;
319 vector<double> clsDetAsymmetryForCls;
320 clsDetAsymmetryForCls.clear();
322 std::map< int, std::vector<double> > mapSliceVsDistribution;
325 const int distributionFewStrips=24;
327 double sliceVsFewStripsDistribution[slices][distributionFewStrips];
329 for(
int j = 0;
j < distributionFewStrips;
j++){
330 for(
int i = 0;
i < slices;
i++){
331 sliceVsFewStripsDistribution[
i][
j]=dataForAsymmCls[
j*slices+
i];
337 case 1:
case 3:
case 5: vector_lenght =3;
break;
338 case 2:
case 4: vector_lenght =4;
break;
339 case 6:
default: vector_lenght = 1;
break;
344 for(
int i = 0;
i < vector_lenght ;
i ++){
345 value = sliceVsFewStripsDistribution[slice][(cls-1)*4+
i];
346 clsDetAsymmetryForCls.push_back(value);
353 for(
int i = clsDetAsymmetryForCls.size()-1;
i>-1;
i--){
354 accum += clsDetAsymmetryForCls[
i];
355 _DetAsymmetryForCls.push_back(accum/sum);
357 return _DetAsymmetryForCls;
float getTime(uint32_t id)
RPCSimSetUp(const edm::ParameterSet &ps)
const std::vector< double > & getAsymmetricClsDistribution(uint32_t id, uint32_t slice)
const std::vector< float > & getEff(uint32_t id)
uint32_t rawId() const
get the raw id
const std::vector< float > & getNoise(uint32_t id)
const std::vector< double > & getCls(uint32_t id)
const std::map< int, std::vector< double > > & getClsMap()
const std::vector< double > & getAsymmetryForCls(uint32_t id, uint32_t slice, uint32_t cls)
static std::atomic< unsigned int > counter
tuple size
Write out results.
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)