CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
RPCSimSetUp Class Reference

#include <RPCSimSetUp.h>

Public Member Functions

const std::vector< double > & getCls (uint32_t id)
 
const std::map< int,
std::vector< double > > & 
getClsMap ()
 
const std::vector< float > & getEff (uint32_t id)
 
const RPCGeometrygetGeometry ()
 
const std::vector< float > & getNoise (uint32_t id)
 
float getTime (uint32_t id)
 
 RPCSimSetUp (const edm::ParameterSet &ps)
 
void setGeometry (const RPCGeometry *geom)
 sets geometry More...
 
void setRPCSetUp (const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
 
void setRPCSetUp (const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< RPCClusterSize::ClusterSizeItem > &vClusterSize)
 
virtual ~RPCSimSetUp ()
 

Public Attributes

std::map< RPCDetId, float > _bxmap
 
std::map< int, std::vector
< double > > 
_clsMap
 
std::map< uint32_t,
std::vector< double > > 
_mapDetClsMap
 
std::map< uint32_t,
std::vector< float > > 
_mapDetIdEff
 
std::map< uint32_t,
std::vector< float > > 
_mapDetIdNoise
 
const RPCGeometrytheGeometry
 

Detailed Description

Definition at line 28 of file RPCSimSetUp.h.

Constructor & Destructor Documentation

RPCSimSetUp::RPCSimSetUp ( const edm::ParameterSet ps)
explicit

Definition at line 37 of file RPCSimSetUp.cc.

37  {
38 
39  _mapDetIdNoise.clear();
40  _mapDetIdEff.clear();
41  _bxmap.clear();
42  _clsMap.clear();
43 
44 }
std::map< RPCDetId, float > _bxmap
Definition: RPCSimSetUp.h:54
std::map< int, std::vector< double > > _clsMap
Definition: RPCSimSetUp.h:55
std::map< uint32_t, std::vector< float > > _mapDetIdEff
Definition: RPCSimSetUp.h:53
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition: RPCSimSetUp.h:52
RPCSimSetUp::~RPCSimSetUp ( )
virtual

Definition at line 221 of file RPCSimSetUp.cc.

221 {}

Member Function Documentation

const std::vector< double > & RPCSimSetUp::getCls ( uint32_t  id)

Definition at line 206 of file RPCSimSetUp.cc.

References edm::hlt::Exception.

Referenced by RPCSimAverageNoiseEffCls::getClSize().

207 {
208 
209  map<uint32_t,std::vector<double> >::iterator iter = _mapDetClsMap.find(id);
210  if(iter == _mapDetClsMap.end()){
211  throw cms::Exception("DataCorrupt")
212  << "Exception comming from RPCSimSetUp - no cluster size information for DetId\t"<<id<< std::endl;
213  }
214  if((iter->second).size() != 100){
215  throw cms::Exception("DataCorrupt")
216  << "Exception comming from RPCSimSetUp - cluster size information in a wrong format for DetId\t"<<id<< std::endl;
217  }
218  return iter->second;
219 }
std::map< uint32_t, std::vector< double > > _mapDetClsMap
Definition: RPCSimSetUp.h:56
const std::map< int, std::vector< double > > & RPCSimSetUp::getClsMap ( )

Definition at line 195 of file RPCSimSetUp.cc.

References edm::hlt::Exception.

Referenced by RPCSimAverage::getClSize(), RPCSimAverageNoiseEffCls::getClSize(), RPCSimAverageNoiseEff::getClSize(), and RPCSimAverageNoise::getClSize().

196 {
197  if(_clsMap.size()!=5){
198  throw cms::Exception("DataCorrupt")
199  << "Exception comming from RPCSimSetUp - cluster size - a wrong format "<< std::endl;
200  }
201  return _clsMap;
202 }
std::map< int, std::vector< double > > _clsMap
Definition: RPCSimSetUp.h:55
const std::vector< float > & RPCSimSetUp::getEff ( uint32_t  id)

Definition at line 170 of file RPCSimSetUp.cc.

References edm::hlt::Exception.

171 {
172  map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdEff.find(id);
173  if(iter == _mapDetIdEff.end()){
174  throw cms::Exception("DataCorrupt")
175  << "Exception comming from RPCSimSetUp - no efficiency information for DetId\t"<<id<< std::endl;
176  }
177  if((iter->second).size() != 96){
178  throw cms::Exception("DataCorrupt")
179  << "Exception comming from RPCSimSetUp - efficiency information in a wrong format for DetId\t"<<id<< std::endl;
180  }
181  return iter->second;
182 }
std::map< uint32_t, std::vector< float > > _mapDetIdEff
Definition: RPCSimSetUp.h:53
const RPCGeometry* RPCSimSetUp::getGeometry ( )
inline

Definition at line 48 of file RPCSimSetUp.h.

References theGeometry.

Referenced by RPCSynchronizer::getSimHitBx().

48 { return theGeometry; }
const RPCGeometry * theGeometry
Definition: RPCSimSetUp.h:50
const std::vector< float > & RPCSimSetUp::getNoise ( uint32_t  id)

Definition at line 160 of file RPCSimSetUp.cc.

References edm::hlt::Exception.

161 {
162  map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdNoise.find(id);
163  if(iter == _mapDetIdNoise.end()){
164  throw cms::Exception("DataCorrupt")
165  << "Exception comming from RPCSimSetUp - no noise information for DetId\t"<<id<< std::endl;
166  }
167  return iter->second;
168 }
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition: RPCSimSetUp.h:52
float RPCSimSetUp::getTime ( uint32_t  id)

Definition at line 184 of file RPCSimSetUp.cc.

References edm::hlt::Exception, and DetId::rawId().

Referenced by RPCSynchronizer::getSimHitBx().

185 {
186  RPCDetId rpcid(id);
187  std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
188  if(iter == _bxmap.end()){
189  throw cms::Exception("DataCorrupt")
190  << "Exception comming from RPCSimSetUp - no timing information for rpcid.rawId()\t"<<rpcid.rawId()<< std::endl;
191  }
192  return iter->second;
193 }
std::map< RPCDetId, float > _bxmap
Definition: RPCSimSetUp.h:54
void RPCSimSetUp::setGeometry ( const RPCGeometry geom)
inline

sets geometry

Definition at line 46 of file RPCSimSetUp.h.

References relativeConstraints::geom, and theGeometry.

Referenced by RPCDigiProducer::beginRun().

46 {theGeometry = geom;}
const RPCGeometry * theGeometry
Definition: RPCSimSetUp.h:50
void RPCSimSetUp::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  vnoise,
const std::vector< float > &  vcls 
)

Definition at line 46 of file RPCSimSetUp.cc.

References counter, n, RPCDetId, and groupFilesInBlocks::temp.

Referenced by RPCDigiProducer::beginRun().

46  {
47 
48  unsigned int counter = 1;
49  unsigned int row = 1;
50  std::vector<double> sum_clsize;
51 
52  for(unsigned int n = 0; n < vcls.size(); ++n){
53 
54  sum_clsize.push_back(vcls[n]);
55 
56  if(counter == row*20) {
57 
58  _clsMap[row] = sum_clsize;
59  row++;
60  sum_clsize.clear();
61  }
62  counter++;
63  }
64 
65  unsigned int n = 0;
66  uint32_t temp = 0;
67  std::vector<float> veff, vvnoise;
68  veff.clear();
69  vvnoise.clear();
70 
71  for(std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end(); ++it){
72  if(n%96 == 0) {
73  if(n > 0 ){
74  _mapDetIdNoise[temp]= vvnoise;
75  _mapDetIdEff[temp] = veff;
76  _bxmap[RPCDetId(it->dpid)] = it->time;
77 
78  veff.clear();
79  vvnoise.clear();
80  vvnoise.push_back((it->noise));
81  veff.push_back((it->eff));
82  }
83  else if(n == 0 ){
84  vvnoise.push_back((it->noise));
85  veff.push_back((it->eff));
86  _bxmap[RPCDetId(it->dpid)] = it->time;
87  }
88  } else if (n == vnoise.size()-1 ){
89  temp = it->dpid;
90  vvnoise.push_back((it->noise));
91  veff.push_back((it->eff));
92  _mapDetIdNoise[temp]= vvnoise;
93  _mapDetIdEff[temp] = veff;
94  } else {
95  temp = it->dpid;
96  vvnoise.push_back((it->noise));
97  veff.push_back((it->eff));
98  }
99  n++;
100  }
101 }
std::map< RPCDetId, float > _bxmap
Definition: RPCSimSetUp.h:54
std::map< int, std::vector< double > > _clsMap
Definition: RPCSimSetUp.h:55
std::map< uint32_t, std::vector< float > > _mapDetIdEff
Definition: RPCSimSetUp.h:53
static std::atomic< unsigned int > counter
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition: RPCSimSetUp.h:52
void RPCSimSetUp::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  vnoise,
const std::vector< RPCClusterSize::ClusterSizeItem > &  vClusterSize 
)

Definition at line 103 of file RPCSimSetUp.cc.

References n, RPCDetId, and groupFilesInBlocks::temp.

103  {
104 
105  std::vector<RPCClusterSize::ClusterSizeItem>::const_iterator itCls;
106  uint32_t detId;
107  int clsCounter(1);
108  std::vector<double> clsVect;
109 
110  for(itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls){
111  clsVect.push_back(((double)(itCls->clusterSize)));
112  if((!(clsCounter%100)) && (clsCounter!=0)){
113  detId=itCls->dpid;
114  _mapDetClsMap[detId]=clsVect;
115  clsVect.clear();
116  clsCounter=0;
117  }
118  ++clsCounter;
119  }
120 
121  unsigned int n = 0;
122  uint32_t temp = 0;
123  std::vector<float> veff, vvnoise;
124  veff.clear();
125  vvnoise.clear();
126 
127  for(std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end(); ++it){
128  if(n%96 == 0) {
129  if(n > 0 ){
130  _mapDetIdNoise[temp]= vvnoise;
131  _mapDetIdEff[temp] = veff;
132  _bxmap[RPCDetId(it->dpid)] = it->time;
133 
134  veff.clear();
135  vvnoise.clear();
136  vvnoise.push_back((it->noise));
137  veff.push_back((it->eff));
138  }
139  else if(n == 0 ){
140  vvnoise.push_back((it->noise));
141  veff.push_back((it->eff));
142  _bxmap[RPCDetId(it->dpid)] = it->time;
143  }
144  } else if (n == vnoise.size()-1 ){
145  temp = it->dpid;
146  vvnoise.push_back((it->noise));
147  veff.push_back((it->eff));
148  _mapDetIdNoise[temp]= vvnoise;
149  _mapDetIdEff[temp] = veff;
150  } else {
151  temp = it->dpid;
152  vvnoise.push_back((it->noise));
153  veff.push_back((it->eff));
154  }
155  n++;
156  }
157 }
std::map< RPCDetId, float > _bxmap
Definition: RPCSimSetUp.h:54
std::map< uint32_t, std::vector< float > > _mapDetIdEff
Definition: RPCSimSetUp.h:53
std::map< uint32_t, std::vector< double > > _mapDetClsMap
Definition: RPCSimSetUp.h:56
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition: RPCSimSetUp.h:52

Member Data Documentation

std::map<RPCDetId, float> RPCSimSetUp::_bxmap

Definition at line 54 of file RPCSimSetUp.h.

std::map< int, std::vector<double> > RPCSimSetUp::_clsMap

Definition at line 55 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<double> > RPCSimSetUp::_mapDetClsMap

Definition at line 56 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<float> > RPCSimSetUp::_mapDetIdEff

Definition at line 53 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<float> > RPCSimSetUp::_mapDetIdNoise

Definition at line 52 of file RPCSimSetUp.h.

const RPCGeometry* RPCSimSetUp::theGeometry

Definition at line 50 of file RPCSimSetUp.h.

Referenced by getGeometry(), and setGeometry().