CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
RPCSimSetUp Class Reference

#include <RPCSimSetUp.h>

Public Member Functions

const std::vector< double > & getAsymmetricClsDistribution (uint32_t id, uint32_t slice)
 
const std::vector< double > & getAsymmetryForCls (uint32_t id, uint32_t slice, uint32_t cls)
 
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::vector< double > _DetAsymmetryForCls
 
std::vector< double > _DetClsAsymmetric
 
std::map< uint32_t, std::vector< double > > _mapDetClsMap
 
std::map< uint32_t, std::vector< double > > _mapDetClsMapLegacy
 
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::RPCSimSetUp ( const edm::ParameterSet ps)
explicit

Definition at line 35 of file RPCSimSetUp.cc.

35  {
36  _mapDetIdNoise.clear();
37  _mapDetIdEff.clear();
38  _bxmap.clear();
39  _clsMap.clear();
40 }

◆ ~RPCSimSetUp()

RPCSimSetUp::~RPCSimSetUp ( )
virtual

Definition at line 617 of file RPCSimSetUp.cc.

617 {}

Member Function Documentation

◆ getAsymmetricClsDistribution()

const std::vector< double > & RPCSimSetUp::getAsymmetricClsDistribution ( uint32_t  id,
uint32_t  slice 
)

Definition at line 477 of file RPCSimSetUp.cc.

477  {
478  LogDebug("RPCSimSetupChecks") << "RPCSimSetUp::getAsymmetricClsDistribution" << std::endl;
479 
480  map<uint32_t, std::vector<double> >::const_iterator iter = _mapDetClsMap.find(id);
481  if (iter == _mapDetClsMap.end()) {
482  throw cms::Exception("DataCorrupt")
483  << "Exception from RPCSimSetUp - _mapDetClsMap - no cluster size information for DetId\t" << id << std::endl;
484  }
485  if ((iter->second).size() != 120) {
486  throw cms::Exception("DataCorrupt")
487  << "Exception from RPCSimSetUp - _mapDetClsMap - cluster size information in a wrong format for DetId\t" << id
488  << std::endl;
489  }
490  // return iter->second;
491 
492  std::vector<double> dataForAsymmCls = iter->second;
493  if (slice > 4) {
494  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - slice variable not in the range" << std::endl;
495  }
496 
497  _DetClsAsymmetric.clear();
498 
499  vector<double> clsFewStripsDistribution;
500  vector<double> clsDistribution;
501  vector<double> clsAccumulativeDistribution;
502 
503  std::map<int, std::vector<double> > mapSliceVsDistribution;
504 
505  const int slices = 5;
506  const int distributionFewStrips = 24;
507 
508  double sliceVsFewStripsDistribution[slices][distributionFewStrips];
509 
510  for (int j = 0; j < distributionFewStrips; j++) {
511  for (int i = 0; i < slices; i++) {
512  sliceVsFewStripsDistribution[i][j] = dataForAsymmCls[j * slices + i];
513  }
514  }
515 
516  double control = 0;
517  for (int j = 0; j < distributionFewStrips; j++) {
518  control += sliceVsFewStripsDistribution[0][j];
519  }
520 
521  double control1 = 0;
522  for (int j = 0; j < distributionFewStrips; j++) {
523  for (int i = 0; i < slices; i++) {
524  control1 += dataForAsymmCls[j * slices + i];
525  }
526  }
527 
528  int i = slice;
529  double sum = 0;
530  int counter = 0;
531  for (int j = 0; j < distributionFewStrips; j++) {
532  counter++;
533  sum += sliceVsFewStripsDistribution[i][j];
534  if (counter % 4 == 0) {
535  _DetClsAsymmetric.push_back(sum);
536  }
537  }
538  return _DetClsAsymmetric;
539 }

References Exception, mps_fire::i, dqmiolumiharvest::j, LogDebug, and mergeAndRegister::slice.

Referenced by RPCSimAsymmetricCls::getClSize().

◆ getAsymmetryForCls()

const std::vector< double > & RPCSimSetUp::getAsymmetryForCls ( uint32_t  id,
uint32_t  slice,
uint32_t  cls 
)

Definition at line 541 of file RPCSimSetUp.cc.

541  {
542  LogDebug("RPCSimSetupChecks") << "RPCSimSetUp::getAsymmetryForCls" << std::endl;
543 
544  map<uint32_t, std::vector<double> >::const_iterator iter = _mapDetClsMap.find(id);
545  if (iter == _mapDetClsMap.end()) {
546  throw cms::Exception("DataCorrupt")
547  << "Exception from RPCSimSetUp - _mapDetClsMap - no cluster size information for DetId\t" << id << std::endl;
548  }
549  if ((iter->second).size() != 120) {
550  throw cms::Exception("DataCorrupt")
551  << "Exception from RPCSimSetUp - _mapDetClsMap - cluster size information in a wrong format for DetId\t" << id
552  << '\t' << (iter->second).size() << std::endl;
553  }
554 
555  std::vector<double> dataForAsymmCls = iter->second;
556 
557  if (slice > 4) {
558  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - slice variable not in the range" << std::endl;
559  }
560 
561  _DetAsymmetryForCls.clear();
562 
563  vector<double> clsFewStripsDistribution;
564  vector<double> clsDistribution;
565  vector<double> clsAccumulativeDistribution;
566  vector<double> clsDetAsymmetryForCls;
567  clsDetAsymmetryForCls.clear();
568 
569  std::map<int, std::vector<double> > mapSliceVsDistribution;
570 
571  const int slices = 5;
572  const int distributionFewStrips = 24;
573 
574  double sliceVsFewStripsDistribution[slices][distributionFewStrips];
575 
576  for (int j = 0; j < distributionFewStrips; j++) {
577  for (int i = 0; i < slices; i++) {
578  sliceVsFewStripsDistribution[i][j] = dataForAsymmCls[j * slices + i];
579  }
580  }
581 
582  int vector_lenght;
583  switch (cls) {
584  case 1:
585  case 3:
586  case 5:
587  vector_lenght = 3;
588  break;
589  case 2:
590  case 4:
591  vector_lenght = 4;
592  break;
593  case 6:
594  default:
595  vector_lenght = 1;
596  break;
597  }
598 
599  float sum = 0;
600  float value;
601  for (int i = 0; i < vector_lenght; i++) {
602  value = sliceVsFewStripsDistribution[slice][(cls - 1) * 4 + i];
603  clsDetAsymmetryForCls.push_back(value);
604  sum += value;
605  // LogDebug ("RPCSimSetup")<<"value\t"<<value<<std::endl;
606  // LogDebug ("RPCSimSetup")<<"sum\t"<<sum<<std::endl;
607  }
608 
609  float accum = 0;
610  for (int i = clsDetAsymmetryForCls.size() - 1; i > -1; i--) {
611  accum += clsDetAsymmetryForCls[i];
612  _DetAsymmetryForCls.push_back(accum / sum);
613  }
614  return _DetAsymmetryForCls;
615 }

References Exception, mps_fire::i, dqmiolumiharvest::j, LogDebug, findQualityFiles::size, mergeAndRegister::slice, and relativeConstraints::value.

Referenced by RPCSimAsymmetricCls::simulate().

◆ getCls()

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

Definition at line 458 of file RPCSimSetUp.cc.

459 {
460  LogDebug("RPCSimSetupChecks") << "RPCSimSetUp::getCls" << std::endl;
461 
462  map<uint32_t, std::vector<double> >::iterator iter = _mapDetClsMapLegacy.find(id);
463  if (iter == _mapDetClsMapLegacy.end()) {
464  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - no cluster size information for DetId\t" << id
465  << std::endl;
466  }
467  if ((iter->second).size() != 100) {
468  throw cms::Exception("DataCorrupt")
469  << "Exception from RPCSimSetUp - _mapDetClsMapLegacy - cluster size information in a wrong format for DetId\t"
470  << id << std::endl;
471  }
472  LogDebug("RPCSimSetupChecks")
473  << "All OK from RPCSimSetUp - _mapDetClsMapLegacy - cluster size information for DetId\t" << id << std::endl;
474  return iter->second;
475 }

References Exception, and LogDebug.

Referenced by RPCSimModelTiming::getClSize(), and RPCSimAverageNoiseEffCls::getClSize().

◆ getClsMap()

const std::map< int, std::vector< double > > & RPCSimSetUp::getClsMap ( )

Definition at line 450 of file RPCSimSetUp.cc.

450  {
451  if (_clsMap.size() != 5) {
452  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - cluster size - a wrong format " << std::endl;
453  }
454  return _clsMap;
455 }

References Exception.

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

◆ getEff()

const std::vector< float > & RPCSimSetUp::getEff ( uint32_t  id)

Definition at line 417 of file RPCSimSetUp.cc.

417  {
418  map<uint32_t, std::vector<float> >::iterator iter = _mapDetIdEff.find(id);
419  if (iter == _mapDetIdEff.end()) {
420  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - no efficiency information for DetId\t" << id
421  << std::endl;
422  }
423 
424  RPCDetId rpcId = RPCDetId(id);
425  const RPCRoll* roll = theGeometry->roll(rpcId);
426  unsigned int numbStrips = roll->nstrips();
427 
428  if ((iter->second).size() < numbStrips) {
429  LogDebug("RPCSimSetup") << "Exception from RPCSimSetUp - efficiency information in a wrong format for DetId\t" << id
430  << " aka " << RPCDetId(id) << std::endl;
431  LogDebug("RPCSimSetup") << " number of strips in Conditions\t" << (iter->second).size()
432  << " number of strips in Geometry\t" << numbStrips << std::endl;
433  throw cms::Exception("DataCorrupt")
434  << "Exception from RPCSimSetUp - efficiency information in a wrong format for DetId\t" << id << std::endl;
435  }
436 
437  return iter->second;
438 }

References Exception, LogDebug, RPCRoll::nstrips(), and findQualityFiles::size.

◆ getGeometry()

const RPCGeometry* RPCSimSetUp::getGeometry ( )
inline

Definition at line 49 of file RPCSimSetUp.h.

49 { return theGeometry; }

References theGeometry.

Referenced by RPCSynchronizer::getSimHitBx(), and RPCSynchronizer::getSimHitBxAndTimingForIRPC().

◆ getNoise()

const std::vector< float > & RPCSimSetUp::getNoise ( uint32_t  id)

Definition at line 407 of file RPCSimSetUp.cc.

407  {
408  map<uint32_t, std::vector<float> >::iterator iter = _mapDetIdNoise.find(id);
409  if (iter == _mapDetIdNoise.end()) {
410  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - no noise information for DetId\t" << id
411  << std::endl;
412  }
413  LogDebug("RPCSimSetupChecks") << "All OK from RPCSimSetUp - noise information for DetId\t" << id << std::endl;
414  return iter->second;
415 }

References Exception, and LogDebug.

◆ getTime()

float RPCSimSetUp::getTime ( uint32_t  id)

Definition at line 440 of file RPCSimSetUp.cc.

440  {
441  RPCDetId rpcid(id);
442  std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
443  if (iter == _bxmap.end()) {
444  throw cms::Exception("DataCorrupt") << "Exception from RPCSimSetUp - no timing information for rpcid.rawId()\t"
445  << rpcid.rawId() << std::endl;
446  }
447  return iter->second;
448 }

References Exception, and DetId::rawId().

Referenced by RPCSynchronizer::getSimHitBx(), and RPCSynchronizer::getSimHitBxAndTimingForIRPC().

◆ setGeometry()

void RPCSimSetUp::setGeometry ( const RPCGeometry geom)
inline

sets geometry

Definition at line 47 of file RPCSimSetUp.h.

47 { theGeometry = geom; }

References relativeConstraints::geom, and theGeometry.

Referenced by RPCDigiProducer::beginRun(), and RPCandIRPCDigiProducer::beginRun().

◆ setRPCSetUp() [1/2]

void RPCSimSetUp::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  vnoise,
const std::vector< float > &  vcls 
)

Definition at line 42 of file RPCSimSetUp.cc.

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

References dqmiodumpmetadata::n, and groupFilesInBlocks::temp.

Referenced by RPCDigiProducer::beginRun(), and RPCandIRPCDigiProducer::beginRun().

◆ setRPCSetUp() [2/2]

void RPCSimSetUp::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  vnoise,
const std::vector< RPCClusterSize::ClusterSizeItem > &  vClusterSize 
)

Definition at line 95 of file RPCSimSetUp.cc.

96  {
97  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp(vector<NoiseItem>, vector<ClusterSizeItem>)" << std::endl;
98 
99  uint32_t detId = 0, current_detId, this_detId;
100  RPCDetId rpcId, current_rpcId, this_rpcId;
101  const RPCRoll* current_roll = nullptr;
102  const RPCRoll* this_roll = nullptr;
103  unsigned int current_nStrips;
104 
105  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp :: ClusterSizeItem :: begin" << std::endl;
106 #ifdef EDM_ML_DEBUG
107  std::stringstream sslogclsitem;
108 #endif
109  // ### ClusterSizeItem #######################################################
110  std::vector<RPCClusterSize::ClusterSizeItem>::const_iterator itCls;
111  int clsCounter(1);
112  std::vector<double> clsVect;
113  // ### loop for New Format (120 entries)
114  for (itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls) {
115  clsVect.push_back(((double)(itCls->clusterSize)));
116 #ifdef EDM_ML_DEBUG
117  sslogclsitem << " Push back clustersize = " << itCls->clusterSize << std::endl;
118  sslogclsitem << "Filling cls in _mapDetCls[detId,clsVect] :: detId = " << detId;
119  sslogclsitem << " --> will it be accepted? clsCounter = " << clsCounter << " accepted?";
120  sslogclsitem << " New Format ::" << ((!(clsCounter % 120)) && (clsCounter != 0)); // <<std::endl;
121  sslogclsitem << " Old Format ::" << ((!(clsCounter % 100)) && (clsCounter != 0)); // <<std::endl;
122  sslogclsitem << std::endl;
123 #endif
124  // New Format :: loop until 120
125  if ((!(clsCounter % 120)) && (clsCounter != 0)) {
126  detId = itCls->dpid;
127  _mapDetClsMap[detId] = clsVect;
128 #ifdef EDM_ML_DEBUG
129  std::stringstream LogDebugClsVectString;
130  LogDebugClsVectString << "[";
131  for (std::vector<double>::iterator itClsVect = clsVect.begin(); itClsVect != clsVect.end(); ++itClsVect) {
132  LogDebugClsVectString << *itClsVect << ",";
133  }
134  LogDebugClsVectString << "]";
135  std::string LogDebugClsVectStr = LogDebugClsVectString.str();
136  LogDebug("RPCSimSetup") << "Filling clsVect in _mapDetCls[detId,clsVect] :: detId = " << RPCDetId(detId) << " = "
137  << detId << " clsVec = " << LogDebugClsVectStr;
138 
139  sslogclsitem << " --> New Method ";
140  sslogclsitem << " --> saved in map " << std::endl;
141  sslogclsitem << "Filling cls in _mapDetClsMap[detId,clsVect] :: detId = " << detId;
142  sslogclsitem << " --> will it be accepted? clsCounter = " << clsCounter << " accepted? "
143  << ((!(clsCounter % 120)) && (clsCounter != 0)) << std::endl;
144 #endif
145  clsVect.clear();
146  clsCounter = 0;
147  } else {
148 #ifdef EDM_ML_DEBUG
149  sslogclsitem << " --> not saved in map " << std::endl;
150 #endif
151  }
152  ++clsCounter;
153  }
154  // ### loop for Old Format (100 entries)
155  for (itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls) {
156  clsVect.push_back(((double)(itCls->clusterSize)));
157 #ifdef EDM_ML_DEBUG
158  sslogclsitem << " Push back clustersize = " << itCls->clusterSize << std::endl;
159  sslogclsitem << "Filling cls in _mapDetClsMapLegacy[detId,clsVect] :: detId = " << detId;
160  sslogclsitem << " --> will it be accepted? clsCounter = " << clsCounter << " accepted?";
161  sslogclsitem << " New Format ::" << ((!(clsCounter % 120)) && (clsCounter != 0)); // <<std::endl;
162  sslogclsitem << " Old Format ::" << ((!(clsCounter % 100)) && (clsCounter != 0)); // <<std::endl;
163  sslogclsitem << std::endl;
164 #endif
165  // Old Format :: same until 100
166  if ((!(clsCounter % 100)) && (clsCounter != 0)) {
167  detId = itCls->dpid;
168  _mapDetClsMapLegacy[detId] = clsVect;
169 #ifdef EDM_ML_DEBUG
170  std::stringstream LogDebugClsVectString;
171  LogDebugClsVectString << "[";
172  for (std::vector<double>::iterator itClsVect = clsVect.begin(); itClsVect != clsVect.end(); ++itClsVect) {
173  LogDebugClsVectString << *itClsVect << ",";
174  }
175  LogDebugClsVectString << "]";
176  std::string LogDebugClsVectStr = LogDebugClsVectString.str();
177  LogDebug("RPCSimSetup") << "Filling clsVect in _mapDetClsLegacy[detId,clsVect] :: detId = " << RPCDetId(detId)
178  << " = " << detId << " clsVec = " << LogDebugClsVectStr;
179 
180  sslogclsitem << " --> Old Method ";
181  sslogclsitem << " --> saved in map " << std::endl;
182  sslogclsitem << "Filling cls in _mapDetClsMapLegacy[detId,clsVect] :: detId = " << detId;
183  sslogclsitem << " --> will it be accepted? clsCounter = " << clsCounter << " accepted? "
184  << ((!(clsCounter % 120)) && (clsCounter != 0)) << std::endl;
185 #endif
186  clsVect.clear();
187  clsCounter = 0;
188  } else {
189 #ifdef EDM_ML_DEBUG
190  sslogclsitem << " --> not saved in map " << std::endl;
191 #endif
192  }
193  ++clsCounter;
194  }
195  // ###########################################################################
196 #ifdef EDM_ML_DEBUG
197  std::string logclsitem = sslogclsitem.str();
198  sslogclsitem.clear();
199  LogDebug("RPCSimSetupClsLoopDetails") << logclsitem << std::endl;
200  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp :: ClusterSizeItem :: end" << std::endl;
201 
202  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp :: NoiseItem :: begin" << std::endl;
203  std::stringstream sslognoiseitem;
204 #endif
205  // ### NoiseItem #############################################################
206  unsigned int count_strips = 1;
207  unsigned int count_all = 1;
208  std::vector<float> vveff, vvnoise;
209 
210  // DetId to start with needs to be a DetId inside the Geometry used
211  // Therefore loop on the NoiseItems and search for the first valid roll in the Geometry
212  // Assign this as the DetId to start with (so called current_roll) and quit the loop
213  bool quitLoop = false;
214  current_detId = 0;
215  current_nStrips = 0; // current_rpcId = 0; current_roll = 0;
216  for (std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end() && !quitLoop;
217  ++it) {
218  // roll associated to the conditions of this strip (iterator)
219  current_detId = it->dpid;
220  current_rpcId = RPCDetId(current_detId);
221  // Test whether this roll (picked up from the conditions) is inside the RPC Geometry
222  const RPCRoll* roll = theGeometry->roll(current_rpcId);
223  if (roll == nullptr) {
224 #ifdef EDM_ML_DEBUG
225  sslognoiseitem << "Searching for first valid detid :: current_detId = " << current_detId;
226  sslognoiseitem << " aka " << current_rpcId << " is not in current Geometry --> Skip " << std::endl;
227 #endif
228  continue;
229  } else {
230 #ifdef EDM_ML_DEBUG
231  sslognoiseitem << "Searching for first valid detid :: current_detId = " << current_detId;
232  sslognoiseitem << " aka " << current_rpcId
233  << " is the first (valid) roll in the current Geometry --> Accept, Assign & Quit Loop"
234  << std::endl;
235 #endif
236  current_roll = theGeometry->roll(current_rpcId);
237  current_nStrips = current_roll->nstrips();
238  quitLoop = true;
239  }
240  }
241 
242 #ifdef EDM_ML_DEBUG
243  sslognoiseitem << "Start Position :: current_detId = " << current_detId << " aka " << current_rpcId;
244  sslognoiseitem << " is a valid roll with pointer " << current_roll << " and has "
245  << (current_roll ? current_roll->nstrips() : 0) << " strips" << std::endl;
246  sslognoiseitem << " -------------------------------------------------------------------------------------------------"
247  "------------------------------------ "
248  << std::endl;
249 #endif
250  for (std::vector<RPCStripNoises::NoiseItem>::const_iterator it = vnoise.begin(); it != vnoise.end(); ++it) {
251  // roll associated to the conditions of this strip (iterator)
252  this_detId = it->dpid;
253  this_rpcId = RPCDetId(this_detId);
254  // Test whether this roll (picked up from the conditions) is inside the RPC Geometry
255  const RPCRoll* roll = theGeometry->roll(this_rpcId);
256  if (roll == nullptr) {
257 #ifdef EDM_ML_DEBUG
258  sslognoiseitem << "Inside Loop :: [" << std::setw(6) << count_all << "][" << std::setw(3) << count_strips
259  << "] :: this_detId = " << this_detId << " aka " << this_rpcId
260  << " which is not in current Geometry --> Skip " << std::endl;
261 #endif
262  continue;
263  }
264 
265  // Case 1 :: FIRST ENTRY
266  // ---------------------
267  if (this_detId == current_detId && count_strips == 1) {
268  // fill bx in map
269  _bxmap[current_detId] = it->time;
270  // clear vectors
271  vveff.clear();
272  vvnoise.clear();
273  // fill the vectors
274  vvnoise.push_back((it->noise));
275  vveff.push_back((it->eff));
276 #ifdef EDM_ML_DEBUG
277  sslognoiseitem << "RPCSimSetUp::setRPCSetUp :: NoiseItem :: case 1" << std::endl;
278  sslognoiseitem << this_detId << " = " << this_rpcId << " with " << roll->nstrips() << " strips" << std::endl;
279  sslognoiseitem << "[NoiseItem :: n = " << count_all
280  << "] Filling time in _bxmap[detId] :: detId = " << RPCDetId(it->dpid) << " time = " << it->time
281  << std::endl;
282  sslognoiseitem << "First Value :: [" << std::setw(6) << count_all << "][" << std::setw(3) << count_strips
283  << "] :: this_detId = " << this_detId << " aka " << this_rpcId;
284  sslognoiseitem << " Strip " << std::setw(3) << count_strips << " Noise = " << it->noise << " Hz/cm2" << std::endl;
285 #endif
286  // update counter
287  ++count_strips;
288  ++count_all;
289  }
290  // Case 2 :: 2ND ENTRY --> LAST-1 ENTRY
291  // ------------------------------------
292  else if (this_detId == current_detId && count_strips > 1 && count_strips < current_nStrips) {
293 #ifdef EDM_ML_DEBUG
294  sslognoiseitem << "RPCSimSetUp::setRPCSetUp :: NoiseItem :: case 2" << std::endl;
295  sslognoiseitem << "Inside Loop :: [" << std::setw(6) << count_all << "][" << std::setw(3) << count_strips
296  << "] :: this_detId = " << this_detId << " aka " << this_rpcId;
297  sslognoiseitem << " Strip " << std::setw(3) << count_strips << " Noise = " << it->noise << " Hz/cm2" << std::endl;
298 #endif
299  // fill the vectors
300  vvnoise.push_back((it->noise));
301  vveff.push_back((it->eff));
302  // update counter
303  ++count_strips;
304  ++count_all;
305  }
306 
307  // Case 3 :: LAST ENTRY
308  // --------------------
309  else if (this_detId == current_detId && count_strips == current_nStrips) {
310 #ifdef EDM_ML_DEBUG
311  sslognoiseitem << "RPCSimSetUp::setRPCSetUp :: NoiseItem :: case 3" << std::endl;
312  sslognoiseitem << "Last Value :: [" << std::setw(6) << count_all << "][" << std::setw(3) << count_strips
313  << "] :: this_detId = " << this_detId << " aka " << this_rpcId;
314  sslognoiseitem << " Strip " << std::setw(3) << count_strips << " Noise = " << it->noise << " Hz/cm2" << std::endl;
315 #endif
316  // fill last value in the vector
317  vvnoise.push_back((it->noise));
318  vveff.push_back((it->eff));
319  // update counter
320  ++count_strips;
321  ++count_all;
322  // fill vectors into map
323  _mapDetIdNoise[current_detId] = vvnoise;
324  _mapDetIdEff[current_detId] = vveff;
325 
326 #ifdef EDM_ML_DEBUG
327  sslognoiseitem << " fill vectors into map" << std::endl;
328  std::stringstream LogDebugNoiVectString, LogDebugEffVectString;
329  LogDebugNoiVectString << "[";
330  for (std::vector<float>::iterator itNoiVect = vvnoise.begin(); itNoiVect != vvnoise.end(); ++itNoiVect) {
331  LogDebugNoiVectString << (*itNoiVect) << ",";
332  }
333  LogDebugNoiVectString << "]";
334  std::string LogDebugNoiVectStr = LogDebugNoiVectString.str();
335  LogDebugEffVectString << "[";
336  for (std::vector<float>::iterator itEffVect = vveff.begin(); itEffVect != vveff.end(); ++itEffVect) {
337  LogDebugEffVectString << (*itEffVect) << ",";
338  }
339  LogDebugEffVectString << "]";
340  std::string LogDebugEffVectStr = LogDebugEffVectString.str();
341  LogDebug("RPCSimSetup") << "Filling vvnoise in _mapDetIdNoise[detId] :: detId = " << RPCDetId(it->dpid) << " = "
342  << (RPCDetId(it->dpid)).rawId() << " vvnoise = " << LogDebugNoiVectStr;
343  LogDebug("RPCSimSetup") << "Filling veff in _mapDetIdEff[detId] :: detId = " << RPCDetId(it->dpid) << " = "
344  << (RPCDetId(it->dpid)).rawId() << " veff = " << LogDebugEffVectStr;
345 #endif
346  // look for next different detId and rename it to the current_detId
347  // at this point we skip all the conditions for the strips that are not in this roll
348  // and we will go to the conditions for the first strip of the next roll
349  bool next_detId_found = false;
350 #ifdef EDM_ML_DEBUG
351  sslognoiseitem << "look for next different detId" << std::endl;
352 #endif
353  while (next_detId_found == 0 && it != vnoise.end() - 1) {
354  ++it;
355  this_detId = it->dpid;
356  this_rpcId = RPCDetId(this_detId);
357  this_roll = theGeometry->roll(this_rpcId);
358  if (!this_roll)
359  continue;
360 #ifdef EDM_ML_DEBUG
361  sslognoiseitem << "Inside While:: [" << std::setw(6) << count_all << "][" << std::setw(3) << count_strips
362  << "] :: this_detId = " << this_detId << " aka " << this_rpcId << " Noise = " << it->noise
363  << " Hz/cm2" << std::endl;
364 #endif
365  ++count_strips;
366  // ++count_all;
367  if (this_detId != current_detId) {
368 #ifdef EDM_ML_DEBUG
369  sslognoiseitem << "Different detId is found :: " << this_detId << " aka " << this_rpcId
370  << " Noise = " << it->noise << " Hz/cm2";
371 #endif
372  // next roll is found. update current_detId to this newly found detId
373  // and update also the number of strips
374  current_detId = this_detId;
375  current_rpcId = RPCDetId(current_detId);
376  next_detId_found = true;
377  current_nStrips = (theGeometry->roll(current_rpcId))->nstrips();
378 #ifdef EDM_ML_DEBUG
379  sslognoiseitem << " with " << current_nStrips << " strips" << std::endl;
380 #endif
381  --it; // subtract one, because at the end of the loop the iterator will be increased with one
382  // in fact the treatment for roll N stops when we find the first occurence of roll N+1
383  // however we want to start the treatment for roll N+1 with the first occurence of roll N+1
384  // so the first entry of each new roll N+1 is manipulated twice in the loop (once as a stop, once as a start)
385  // therefore we have to manipulate the iterator here, subtracting one, to treat again this entry
386  }
387  }
388  // reset count_strips
389  count_strips = 1;
390  }
391  // There should be no Case 4
392  // -------------------------
393  else {
394  }
395  }
396  // ###########################################################################
397 #ifdef EDM_ML_DEBUG
398  std::string lognoiseitem = sslognoiseitem.str();
399  sslognoiseitem.clear();
400  LogDebug("RPCSimSetupNoiseLoopDetails") << lognoiseitem << std::endl;
401  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp :: NoiseItem :: end" << std::endl;
402 
403  LogDebug("RPCSimSetup") << "RPCSimSetUp::setRPCSetUp :: end" << std::endl;
404 #endif
405 }

References LogDebug, RPCRoll::nstrips(), and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ _bxmap

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

Definition at line 55 of file RPCSimSetUp.h.

◆ _clsMap

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

Definition at line 56 of file RPCSimSetUp.h.

◆ _DetAsymmetryForCls

std::vector<double> RPCSimSetUp::_DetAsymmetryForCls

Definition at line 60 of file RPCSimSetUp.h.

◆ _DetClsAsymmetric

std::vector<double> RPCSimSetUp::_DetClsAsymmetric

Definition at line 59 of file RPCSimSetUp.h.

◆ _mapDetClsMap

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

Definition at line 57 of file RPCSimSetUp.h.

◆ _mapDetClsMapLegacy

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

Definition at line 58 of file RPCSimSetUp.h.

◆ _mapDetIdEff

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

Definition at line 54 of file RPCSimSetUp.h.

◆ _mapDetIdNoise

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

Definition at line 53 of file RPCSimSetUp.h.

◆ theGeometry

const RPCGeometry* RPCSimSetUp::theGeometry

Definition at line 51 of file RPCSimSetUp.h.

Referenced by getGeometry(), and setGeometry().

RPCRoll
Definition: RPCRoll.h:12
counter
Definition: counter.py:1
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
RPCSimSetUp::_mapDetClsMapLegacy
std::map< uint32_t, std::vector< double > > _mapDetClsMapLegacy
Definition: RPCSimSetUp.h:58
RPCSimSetUp::_mapDetIdNoise
std::map< uint32_t, std::vector< float > > _mapDetIdNoise
Definition: RPCSimSetUp.h:53
RPCDetId
Definition: RPCDetId.h:16
RPCSimSetUp::_DetClsAsymmetric
std::vector< double > _DetClsAsymmetric
Definition: RPCSimSetUp.h:59
RPCGeometry::roll
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
RPCSimSetUp::_DetAsymmetryForCls
std::vector< double > _DetAsymmetryForCls
Definition: RPCSimSetUp.h:60
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
RPCSimSetUp::theGeometry
const RPCGeometry * theGeometry
Definition: RPCSimSetUp.h:51
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
RPCRoll::nstrips
int nstrips() const
Definition: RPCRoll.cc:24
value
Definition: value.py:1
RPCSimSetUp::_mapDetIdEff
std::map< uint32_t, std::vector< float > > _mapDetIdEff
Definition: RPCSimSetUp.h:54
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
relativeConstraints.value
value
Definition: relativeConstraints.py:53
RPCSimSetUp::_mapDetClsMap
std::map< uint32_t, std::vector< double > > _mapDetClsMap
Definition: RPCSimSetUp.h:57
Exception
Definition: hltDiff.cc:245
RPCSimSetUp::_clsMap
std::map< int, std::vector< double > > _clsMap
Definition: RPCSimSetUp.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
mergeAndRegister.slice
slice
Definition: mergeAndRegister.py:120
RPCSimSetUp::_bxmap
std::map< RPCDetId, float > _bxmap
Definition: RPCSimSetUp.h:55
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443