CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
RPCStripsRing Class Reference

#include <L1Trigger/RPCTrigger/interface/RPCStripsRing.h>

Inheritance diagram for RPCStripsRing:

Classes

struct  TOtherConnStruct
 

Public Types

typedef std::map< int, RPCStripsRingTIdToRindMap
 
typedef std::vector< TOtherConnStructTOtherConnStructVec
 

Public Member Functions

void addRoll (const RPCRoll *roll)
 
void compressConnections ()
 
void createOtherConnections (int tower, int PACno, int logplane, int logplanesize, float angle)
 
void createRefConnections (TOtherConnStructVec &otherRings, int logplane, int logplaneSize)
 
void fillWithVirtualStrips ()
 
void filterOverlapingChambers ()
 
std::shared_ptr< L1RPCConeBuilder::TCompressedConMapgetCompressedConnectionsMap ()
 
std::shared_ptr< L1RPCConeBuilder::TConMapgetConnectionsMap ()
 
int getEtaPartition ()
 
int getHwPlane ()
 
int getRingId ()
 
int getTowerForRefRing ()
 
bool isReferenceRing ()
 
 RPCStripsRing (const RPCRoll *roll, std::shared_ptr< L1RPCConeBuilder::TConMap > cmap)
 
 RPCStripsRing ()
 
virtual ~RPCStripsRing ()
 

Static Public Member Functions

static int calculateHwPlane (const RPCRoll *roll)
 Calculate ringId for any given RPCRoll. More...
 
static int getRingId (int etaPart, int hwPlane)
 
static int getRingId (const RPCRoll *roll)
 Calculate ringId for this ring. More...
 

Private Attributes

std::shared_ptr< L1RPCConeBuilder::TCompressedConMapm_compressedConnectionMap
 
std::shared_ptr< L1RPCConeBuilder::TConMapm_connectionsMap
 
bool m_didFiltering
 
bool m_didVirtuals
 
int m_etaPartition
 
int m_hwPlane
 
bool m_isReferenceRing
 
int m_region
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 36 of file RPCStripsRing.h.

Member Typedef Documentation

◆ TIdToRindMap

Definition at line 39 of file RPCStripsRing.h.

◆ TOtherConnStructVec

Definition at line 48 of file RPCStripsRing.h.

Constructor & Destructor Documentation

◆ RPCStripsRing() [1/2]

RPCStripsRing::RPCStripsRing ( const RPCRoll roll,
std::shared_ptr< L1RPCConeBuilder::TConMap cmap 
)

Definition at line 31 of file RPCStripsRing.cc.

References funct::abs(), addRoll(), calculateHwPlane(), hcalRecHitTable_cff::detId, RPCGeomServ::eta_partition(), getRingId(), m_etaPartition, m_hwPlane, m_isReferenceRing, m_region, relativeConstraints::ring, and nano_mu_digi_cff::roll.

32  : m_didVirtuals(false), m_didFiltering(false), m_connectionsMap(cmap) {
33  RPCDetId detId = roll->id();
34  RPCGeomServ grs(detId);
35 
36  m_etaPartition = grs.eta_partition();
38 
39  m_isReferenceRing = false;
40 
41  m_region = detId.region();
42 
43  int ring = detId.ring();
44 
45  if (m_region == 0 && std::abs(ring) < 2 && m_hwPlane == 2) // for barell wheel -1,0,1 refplane is hwPlane=2
46  m_isReferenceRing = true;
47  else if (m_region == 0 && std::abs(ring) == 2 && m_hwPlane == 6) // for barell wheel -2,2 refplane is hwPlane=6
48  m_isReferenceRing = true;
49  else if (m_region != 0 && m_hwPlane == 2) // for endcaps
50  m_isReferenceRing = true;
51 
52  if (getRingId() == 2008 || getRingId() == 2108) //exception: endcaps;hwplane 2;farest roll from beam
53  m_isReferenceRing = false;
54 
55  addRoll(roll);
56 }
std::shared_ptr< L1RPCConeBuilder::TConMap > m_connectionsMap
Definition: RPCStripsRing.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool m_isReferenceRing
Definition: RPCStripsRing.h:88
void addRoll(const RPCRoll *roll)
static int calculateHwPlane(const RPCRoll *roll)
Calculate ringId for any given RPCRoll.

◆ RPCStripsRing() [2/2]

RPCStripsRing::RPCStripsRing ( )

Definition at line 23 of file RPCStripsRing.cc.

24  : m_hwPlane(-1),
25  m_etaPartition(99),
26  m_region(-2),
27  m_isReferenceRing(false),
28  m_didVirtuals(false),
29  m_didFiltering(false) {}
bool m_isReferenceRing
Definition: RPCStripsRing.h:88

◆ ~RPCStripsRing()

virtual RPCStripsRing::~RPCStripsRing ( )
inlinevirtual

Definition at line 53 of file RPCStripsRing.h.

53 {};

Member Function Documentation

◆ addRoll()

void RPCStripsRing::addRoll ( const RPCRoll roll)

Definition at line 58 of file RPCStripsRing.cc.

References Exception, getRingId(), mps_fire::i, PV3DBase< T, PVType, FrameType >::phi(), and nano_mu_digi_cff::roll.

Referenced by RPCStripsRing().

58  {
59  // RPCDetId detId = roll->id();
60 
61  if (getRingId() != getRingId(roll)) {
62  throw cms::Exception("RPCInternal") << "RPCStripsRing::addRoll ringsIds dont match \n";
63  }
64 
65  //iterate over the strips of this roll
66  for (int i = 1; i <= roll->nstrips(); i++) {
67  LocalPoint lStripCentre = roll->centreOfStrip(i);
68  GlobalPoint gStripCentre = roll->toGlobal(lStripCentre);
69  float phiRaw = gStripCentre.phi();
70 
71  TStrip newStrip(roll->id().rawId(), i);
72  (*this)[phiRaw] = newStrip;
73  }
74 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66

◆ calculateHwPlane()

int RPCStripsRing::calculateHwPlane ( const RPCRoll roll)
static

Calculate ringId for any given RPCRoll.

Definition at line 100 of file RPCStripsRing.cc.

References hcalRecHitTable_cff::detId, Exception, nano_mu_digi_cff::layer, nano_mu_digi_cff::region, nano_mu_digi_cff::roll, and relativeConstraints::station.

Referenced by getRingId(), and RPCStripsRing().

100  {
101  int hwPlane = -1;
102  RPCDetId detId = roll->id();
103  int station = detId.station();
104  int layer = detId.layer();
105  int region = detId.region();
106 
107  if (region != 0) { // endcaps
108  hwPlane = station;
109  }
110  // Now comes the barell
111  else if (station > 2) {
112  hwPlane = station;
113  } else if (station == 1 && layer == 1) {
114  hwPlane = 1;
115  } else if (station == 1 && layer == 2) {
116  hwPlane = 5;
117  } else if (station == 2 && layer == 1) {
118  hwPlane = 2;
119  } else if (station == 2 && layer == 2) {
120  hwPlane = 6;
121  }
122 
123  /*if (hwPlane < 1)
124  std::cout << "prb: " << hwPlane << " "
125  << region << " "
126  << station << " "
127  << layer << std::endl;*/
128  if (hwPlane < 0) {
129  throw cms::Exception("RPCInternal") << "Calculated negative hwplane \n";
130  }
131 
132  return hwPlane;
133 }

◆ compressConnections()

void RPCStripsRing::compressConnections ( )

Definition at line 440 of file RPCStripsRing.cc.

References L1RPCConeBuilder::TCompressedCon::addStrip(), hcalRecHitTable_cff::detId, createfilelist::int, m_compressedConnectionMap, m_connectionsMap, L1RPCConeBuilder::TCompressedCon::m_logplane, L1RPCConeBuilder::TCompressedCon::m_mul, L1RPCConeBuilder::TCompressedCon::m_offset, L1RPCConeBuilder::TCompressedCon::m_PAC, and L1RPCConeBuilder::TCompressedCon::m_tower.

440  {
441  L1RPCConeBuilder::TConMap::iterator itChamber = m_connectionsMap->begin();
442 
443  auto uncompressedConsLeft = std::make_shared<L1RPCConeBuilder::TConMap>();
444 
445  m_compressedConnectionMap = std::make_shared<L1RPCConeBuilder::TCompressedConMap>();
446 
447  int compressedCons = 0, uncompressedConsBefore = 0, uncompressedConsAfter = 0;
448 
449  // int offsetMin =0, offsetMax =0;
450 
451  for (; itChamber != m_connectionsMap->end(); ++itChamber) {
452  uint32_t detId = itChamber->first;
453 
454  for (L1RPCConeBuilder::TStrip2ConVec::iterator itStrip = itChamber->second.begin();
455  itStrip != itChamber->second.end();
456  ++itStrip) {
457  // Iterate over strip Connections
458  for (L1RPCConeBuilder::TStripConVec::iterator itConn = itStrip->second.begin(); itConn != itStrip->second.end();
459  ++itConn) {
460  // Check if this connection isn't allready present in the compressed map
461  ++uncompressedConsBefore;
462  bool alreadyDone = false;
464  // iterate over the vec, check element by element
465  for (L1RPCConeBuilder::TCompressedConVec::iterator itCompConn = (*m_compressedConnectionMap)[detId].begin();
466  itCompConn != (*m_compressedConnectionMap)[detId].end();
467  ++itCompConn) {
468  if (itCompConn->m_tower == itConn->m_tower && itCompConn->m_PAC == itConn->m_PAC &&
469  itCompConn->m_logplane == itConn->m_logplane) // connection allready compressed
470  {
471  alreadyDone = true;
472 
473  int logStrip = itCompConn->m_mul * itStrip->first + itCompConn->m_offset;
474  if (logStrip != itConn->m_logstrip) {
475  //copy the problematic connection to the "safe" map
476  (*uncompressedConsLeft)[detId][itStrip->first].push_back(*itConn);
477  ++uncompressedConsAfter;
478  edm::LogWarning("RPCTriggerConfig")
479  << " Compression failed for det " << detId << " strip " << (int)itStrip->first << " . Got "
480  << (int)logStrip << " expected " << (int)itConn->m_logstrip << std::endl;
481  } else {
482  itCompConn->addStrip(itStrip->first);
483  }
484  }
485  } // compressed connection iteration end
486  }
487  //if (detId==637569977) std::cout << " Buld cons for strip " << (int)itStrip->first << std::endl;
488 
489  if (!alreadyDone) {
490  // find another strip contributing to the same PAC,tower,logplane
491  L1RPCConeBuilder::TStrip2ConVec::iterator itStripOther = itStrip;
492  ++itStripOther;
493  bool otherStripFound = false;
494  signed char mul = 1;
495  for (; itStripOther != itChamber->second.end() && !otherStripFound; ++itStripOther) {
496  for (L1RPCConeBuilder::TStripConVec::iterator itConnOther = itStripOther->second.begin();
497  itConnOther != itStripOther->second.end();
498  ++itConnOther) {
499  if (itConnOther->m_tower == itConn->m_tower && itConnOther->m_PAC == itConn->m_PAC &&
500  itConnOther->m_logplane == itConn->m_logplane) // connection to same PAC,logplane
501  {
502  otherStripFound = true;
503  if ((itStripOther->first - itStrip->first) * (itConnOther->m_logstrip - itConn->m_logstrip) < 0) {
504  mul = -1;
505  }
506  break;
507  }
508  } // otherConnections iter ends
509  } // otherStrip iter ends
510 
511  /*
512  if (itConn->m_tower==3 && itConn->m_PAC==73 && itConn->m_logplane==4 && detId==637569977){
513  std::cout << " Buld cons for strip " << (int)itStrip->first;
514  if (otherStripFound)
515  std::cout << " other strip " << itStrip->first;
516  else
517  std::cout << " no other strip ";
518 
519  std::cout << std::endl;
520 
521  }*/
522 
524  nCompConn.m_tower = itConn->m_tower;
525  nCompConn.m_PAC = itConn->m_PAC;
526  nCompConn.m_logplane = itConn->m_logplane;
527  nCompConn.m_mul = mul;
528  nCompConn.m_offset = itConn->m_logstrip - mul * (signed short)(itStrip->first);
529  nCompConn.addStrip(itStrip->first);
530 
531  if (otherStripFound) {
532  } else {
533  // uncompressedConsLeft[detId][itStrip->first].push_back(*itConn);
534  // ++uncompressedConsAfter;
535  }
536  (*m_compressedConnectionMap)[detId].push_back(nCompConn);
537  ++compressedCons;
538 
539  } // if(!allreadyDone)
540  } // iterate on connections
541  } // iterate on strips
542  } // iterate on chambers
543 
544  // 159 -87
545  //std::cout << offsetMax << " TT " << offsetMin << std::endl;
546 
547  edm::LogInfo("RPCTriggerConfig") << " Compressed: " << compressedCons << " "
549  << " Uncompressed before: " << uncompressedConsBefore << " "
550  << sizeof(L1RPCConeBuilder::TStripCon)
551  << " Uncompressed after: " << uncompressedConsAfter << " "
552  << sizeof(L1RPCConeBuilder::TStripCon);
553  m_connectionsMap = uncompressedConsLeft;
554 }
std::shared_ptr< L1RPCConeBuilder::TConMap > m_connectionsMap
Definition: RPCStripsRing.h:92
void addStrip(unsigned char strip)
Log< level::Info, false > LogInfo
std::shared_ptr< L1RPCConeBuilder::TCompressedConMap > m_compressedConnectionMap
Definition: RPCStripsRing.h:93
Log< level::Warning, false > LogWarning

◆ createOtherConnections()

void RPCStripsRing::createOtherConnections ( int  tower,
int  PACno,
int  logplane,
int  logplanesize,
float  angle 
)

Definition at line 358 of file RPCStripsRing.cc.

References mps_fire::end, Exception, mps_fire::i, isReferenceRing(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, L1RPCConeBuilder::TStripCon::m_logplane, L1RPCConeBuilder::TStripCon::m_logstrip, L1RPCConeBuilder::TStripCon::m_PAC, L1RPCConeBuilder::TStripCon::m_tower, and l1tHGCalTowerProducer_cfi::tower.

358  {
359  //std::cout << " OtherCon for " << getRingId() << std::endl;
360 
361  if (this->isReferenceRing()) {
362  throw cms::Exception("RPCInternal") << " RPCStripsRing::createOtherConnections "
363  << " called for reference ring \n";
364  }
365 
366  RPCStripsRing::const_iterator it = this->lower_bound(angle);
367 
368  if (it == this->end())
369  it = this->begin();
370 
371  for (int i = 0; i < logplaneSize / 2; i++) {
372  if (it == this->begin())
373  it = this->end(); // (m_stripPhiMap.end()--) is ok.
374 
375  --it;
376  }
377 
378  for (int i = 0; i < logplaneSize; i++) {
379  if (!it->second.isVirtual()) {
381  newCon.m_tower = tower;
382  newCon.m_PAC = PACno;
383  newCon.m_logplane = logplane;
384  newCon.m_logstrip = i;
385  (*m_connectionsMap)[it->second.m_detRawId][it->second.m_strip].push_back(newCon);
386  //std::cout << " Adding other connection " << std::endl;
387  }
388 
389  ++it;
390  if (it == this->end())
391  it = this->begin();
392  }
393 }
bool isReferenceRing()
Definition: RPCStripsRing.h:73
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ createRefConnections()

void RPCStripsRing::createRefConnections ( TOtherConnStructVec otherRings,
int  logplane,
int  logplaneSize 
)

Definition at line 246 of file RPCStripsRing.cc.

References funct::abs(), angle(), mps_fire::end, Exception, dqmdumpme::first, getTowerForRefRing(), mps_fire::i, isReferenceRing(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, L1RPCConeBuilder::TStripCon::m_logplane, L1RPCConeBuilder::TStripCon::m_logstrip, L1RPCConeBuilder::TStripCon::m_PAC, L1RPCConeBuilder::TStripCon::m_tower, hltrates_dqm_sourceclient-live_cfg::offset, phi, and pi.

246  {
247  //*
248  /*std::cout << "RefCon for " << getRingId()
249  << " (" << getEtaPartition()<< ")"
250  << " tower: " << getTowerForRefRing()
251  << " ; connected: "
252  << otherRings.size()
253  << std::endl
254  << std::endl;
255  //*/
256 
257  // XXX - TODO: warning on wrong logplaneSize
258 
259  if (!this->isReferenceRing()) {
260  throw cms::Exception("RPCInternal") << " RPCStripsRing::createRefConnections "
261  << " called for non-reference ring \n";
262  }
263 
264  /*
265  if (logplaneSize!=8) {
266  throw cms::Exception("RPCInternal") << " RPCStripsRing::createRefConnections "
267  << " called for lpSize " << logplaneSize << " \n";
268 
269  }*/
270  const float pi = 3.141592654;
271  const float offset = (5. / 360.) * 2 * pi; // XXX
272 
273  //find first reference strip of first PAC (the strip with phi ~= 5deg)
274  RPCStripsRing::iterator starEndIt = this->begin();
275  while ((++starEndIt)->first < offset)
276  ;
277 
278  RPCStripsRing::iterator it = starEndIt;
279  //--starEndIt;
280 
281  float angle = 0;
282  int curPACno = -1;
283  int curStripNo = 0;
284  int curBegStripNo = 0;
285 
286  bool firstIter = true;
287 
288  while (it != starEndIt || firstIter) { // iterate over strips
289 
290  firstIter = false;
291  // New PAC
292  if (curStripNo % logplaneSize == 0) {
293  ++curPACno;
294  curBegStripNo = curStripNo;
295  RPCStripsRing::iterator plus8 = it;
296  bool skipOccured = false;
297  for (int i = 0; i < 7; ++i) {
298  ++plus8;
299  if (plus8 == this->end()) {
300  plus8 = this->begin();
301  skipOccured = true;
302  }
303  }
304 
305  // calculate angle
306  float phi = it->first;
307  float phiP8 = plus8->first;
308  if (skipOccured) {
309  // phiP8 is negative
310  // phi is positive
311  // xcheck
312  if (phi * phiP8 > 0) {
313  throw cms::Exception("RPCInternal") << " RPCStripsRing::createRefConnections phi/phi8 error \n";
314  }
315  angle = (2 * pi + phiP8 + phi) / 2;
316  if (angle > pi) { // should land on positive side
317  angle -= 2 * pi;
318  }
319 
320  if (std::abs(angle) > pi) {
321  throw cms::Exception("RPCInternal") << " RPCStripsRing::createRefConnections "
322  << " problem with angle calc \n";
323  }
324  } else {
325  angle = (phiP8 + phi) / 2;
326  }
327  //std::cout << curPACno << " " << phiP8 << " " << phi << " " << angle << std::endl;
328 
329  TOtherConnStructVec::iterator itOt = otherRings.begin();
330  for (; itOt != otherRings.end(); ++itOt) {
331  itOt->m_it->second.createOtherConnections(
332  getTowerForRefRing(), curPACno, itOt->m_logplane, itOt->m_logplaneSize, angle);
333  }
334  }
335 
336  if (!it->second.isVirtual()) {
338  newCon.m_tower = getTowerForRefRing();
339  newCon.m_PAC = curPACno;
340  newCon.m_logplane = logplane;
341  newCon.m_logstrip = curStripNo - curBegStripNo;
342  //std::cout << " Adding con for " << it->second.m_detRawId << std::endl;
343  (*m_connectionsMap)[it->second.m_detRawId][it->second.m_strip].push_back(newCon);
344  //std::cout << " Adding ref connection " << std::endl;
345  }
346  ++curStripNo;
347  ++it;
348  if (it == this->end()) {
349  it = this->begin();
350  }
351 
352  } // iteration over strips ends
353 
354  //std::cout << " refcon: " << curPACno << " PACs" << std::endl;
355  //std::cout << "After refCon: " << m_connectionsMap.size() << std::endl;
356 }
int getTowerForRefRing()
const Double_t pi
bool isReferenceRing()
Definition: RPCStripsRing.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ fillWithVirtualStrips()

void RPCStripsRing::fillWithVirtualStrips ( )

Definition at line 201 of file RPCStripsRing.cc.

References dumpMFGeometry_cfg::delta, mps_fire::end, mps_fire::i, edm::eventsetup::heterocontainer::insert(), createfilelist::int, isReferenceRing(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, m_didVirtuals, m_hwPlane, and pi.

201  {
202  if (m_didVirtuals)
203  return;
204  m_didVirtuals = true;
205 
206  const float pi = 3.141592654;
207  double dphi = 2.0 * pi / 1152; // defines angular granulation of strips.
208 
209  RPCStripsRing stripsToInsert;
210 
211  float delta = 0;
212  int stripsToAdd = 0;
213 
214  RPCStripsRing::iterator it = this->begin();
215  RPCStripsRing::iterator itLast = this->begin();
216  for (; it != this->end(); ++it) {
217  /*std::cout << it->first << " "
218  << it->second.m_detRawId << " "
219  << (int)it->second.m_strip << std::endl;
220  */
221 
222  delta = it->first - itLast->first;
223  if (it == itLast || // skip first loop iteration
224  itLast->second.m_detRawId == it->second.m_detRawId || // insert strips between two chambers only
225  delta < 0) {
226  itLast = it;
227  continue;
228  }
229 
230  stripsToAdd = (int)std::floor(delta / dphi) - 1;
231  //std::cout << delta << " " << stripsToAdd << std::endl;
232 
233  if (isReferenceRing() && m_hwPlane == 6)
234  ++stripsToAdd;
235 
236  for (int i = 0; i < stripsToAdd; ++i) {
237  stripsToInsert[itLast->first + dphi * (i + 1)] = TStrip();
238  }
239 
240  itLast = it;
241  }
242  // TODO: check delta between first and last strip in map
243 
244  this->insert(stripsToInsert.begin(), stripsToInsert.end());
245 }
const Double_t pi
bool isReferenceRing()
Definition: RPCStripsRing.h:73
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50

◆ filterOverlapingChambers()

void RPCStripsRing::filterOverlapingChambers ( )

Definition at line 135 of file RPCStripsRing.cc.

References mps_fire::end, Exception, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, m_didFiltering, m_hwPlane, and m_region.

135  {
136  if (m_didFiltering)
137  return;
138  m_didFiltering = true;
139 
140  if (m_region != 0 || m_hwPlane != 4)
141  return;
142 
143  typedef std::map<uint32_t, int> TDetId2StripNo;
144  TDetId2StripNo det2stripNo;
145 
146  // Note: we begin in middle of first chamber (ch1), we have to handle that
147  int ch1EndStrips = 0; // no of strips on the end of the map (first=last chamber of map)
148 
149  // How many strips has each chamber?
150  RPCStripsRing::iterator it = this->begin();
151  uint32_t ch1Det = it->second.m_detRawId;
152  for (; it != this->end(); ++it) {
153  if (det2stripNo.find(it->second.m_detRawId) == det2stripNo.end()) {
154  det2stripNo[it->second.m_detRawId] = 1; // Add new chamber to a map, set strip cnt to 1
155  } else {
156  ++det2stripNo[it->second.m_detRawId]; // Increase strip count of a chamber
157  }
158 
159  if (det2stripNo.size() != 1 && ch1Det == it->second.m_detRawId) {
160  ++ch1EndStrips;
161  }
162  }
163 
164  det2stripNo[ch1Det] -= ch1EndStrips;
165 
166  // std::cout << ch1BegStrips << " " << ch1EndStrips << std::endl;
167 
168  //TDetId2StripNo::iterator itIds = det2stripNo.begin();
169  //for(;itIds!=det2stripNo.end();++itIds){
170  // std::cout << itIds->first << " " << itIds->second << std::endl;
171  // }
172 
173  it = this->begin();
174  uint32_t lastDet = it->second.m_detRawId;
175  while (it != this->end()) {
176  if (det2stripNo[it->second.m_detRawId] < 0) {
177  throw cms::Exception("RPCInternal") << " RPCStripsRing::filterOverlapingChambers() - no strips left \n";
178  }
179  if (it->second.m_detRawId == lastDet) {
180  --det2stripNo[lastDet];
181  ++it;
182  } else if (det2stripNo[lastDet] == 0) { // no more strips left in lastDet, proceed to new det
183 
184  if (lastDet == ch1Det) {
185  det2stripNo[ch1Det] += ch1EndStrips;
186  }
187 
188  lastDet = it->second.m_detRawId;
189  --det2stripNo[lastDet];
190  ++it;
191  } else { // there are still strips in last det, delete current strip
192  --det2stripNo[it->second.m_detRawId];
193  RPCStripsRing::iterator itErase = it;
194  ++it;
195  //std::cout << "Removing strip " << it->second.m_detRawId << " " << (int)it->second.m_strip << std::endl;
196  this->erase(itErase);
197  }
198  }
199 }

◆ getCompressedConnectionsMap()

std::shared_ptr<L1RPCConeBuilder::TCompressedConMap> RPCStripsRing::getCompressedConnectionsMap ( )
inline

Definition at line 79 of file RPCStripsRing.h.

References m_compressedConnectionMap.

79  {
81  };
std::shared_ptr< L1RPCConeBuilder::TCompressedConMap > m_compressedConnectionMap
Definition: RPCStripsRing.h:93

◆ getConnectionsMap()

std::shared_ptr<L1RPCConeBuilder::TConMap> RPCStripsRing::getConnectionsMap ( )
inline

Definition at line 77 of file RPCStripsRing.h.

References m_connectionsMap.

77 { return m_connectionsMap; };
std::shared_ptr< L1RPCConeBuilder::TConMap > m_connectionsMap
Definition: RPCStripsRing.h:92

◆ getEtaPartition()

int RPCStripsRing::getEtaPartition ( )
inline

Definition at line 72 of file RPCStripsRing.h.

References m_etaPartition.

Referenced by getTowerForRefRing().

72 { return m_etaPartition; };

◆ getHwPlane()

int RPCStripsRing::getHwPlane ( )
inline

Definition at line 70 of file RPCStripsRing.h.

References m_hwPlane.

70 { return m_hwPlane; };

◆ getRingId() [1/3]

int RPCStripsRing::getRingId ( int  etaPart,
int  hwPlane 
)
static

Definition at line 76 of file RPCStripsRing.cc.

References funct::abs(), and Validation_hcalonly_cfi::sign.

76  {
77  int sign = 1; // positive
78  if (etaPart < 0) {
79  sign = 0;
80  }
81 
82  return 1000 * (hwPlane) + //1...6
83  100 * (sign) + //
84  1 * (std::abs(etaPart)); //-17...17
85 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ getRingId() [2/3]

int RPCStripsRing::getRingId ( )

Definition at line 87 of file RPCStripsRing.cc.

References m_etaPartition, and m_hwPlane.

Referenced by addRoll(), RPCConeBuilder::buildCones(), getRingId(), and RPCStripsRing().

◆ getRingId() [3/3]

int RPCStripsRing::getRingId ( const RPCRoll roll)
static

Calculate ringId for this ring.

Definition at line 89 of file RPCStripsRing.cc.

References calculateHwPlane(), hcalRecHitTable_cff::detId, RPCGeomServ::eta_partition(), getRingId(), and nano_mu_digi_cff::roll.

89  {
90  RPCDetId detId = roll->id();
91  RPCGeomServ grs(detId);
92  int etaPartition = grs.eta_partition();
93  int hwPlane = calculateHwPlane(roll);
94 
95  return getRingId(etaPartition, hwPlane);
96 }
static int calculateHwPlane(const RPCRoll *roll)
Calculate ringId for any given RPCRoll.

◆ getTowerForRefRing()

int RPCStripsRing::getTowerForRefRing ( )

Definition at line 396 of file RPCStripsRing.cc.

References funct::abs(), Exception, getEtaPartition(), isReferenceRing(), runTheMatrix::ret, and Validation_hcalonly_cfi::sign.

Referenced by createRefConnections().

396  {
397  int ret = 0;
398 
399  if (!this->isReferenceRing()) {
400  throw cms::Exception("RPCInternal") << " RPCStripsRing::getTowerForRefRing() "
401  << " called for non reference ring \n";
402  }
403 
404  int etaAbs = std::abs(getEtaPartition());
405  if (etaAbs < 8) {
406  ret = getEtaPartition();
407  } else if (etaAbs > 8) {
408  int sign = (getEtaPartition() > 0 ? 1 : -1);
409  ret = getEtaPartition() - sign;
410  } else {
411  throw cms::Exception("RPCInternal") << " RPCStripsRing::getTowerForRefRing() "
412  << " called for etaPartition 8 \n";
413  }
414 
415  return ret;
416 }
ret
prodAgent to be discontinued
bool isReferenceRing()
Definition: RPCStripsRing.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getEtaPartition()
Definition: RPCStripsRing.h:72

◆ isReferenceRing()

bool RPCStripsRing::isReferenceRing ( )
inline

Member Data Documentation

◆ m_compressedConnectionMap

std::shared_ptr<L1RPCConeBuilder::TCompressedConMap> RPCStripsRing::m_compressedConnectionMap
private

Definition at line 93 of file RPCStripsRing.h.

Referenced by compressConnections(), and getCompressedConnectionsMap().

◆ m_connectionsMap

std::shared_ptr<L1RPCConeBuilder::TConMap> RPCStripsRing::m_connectionsMap
private

Definition at line 92 of file RPCStripsRing.h.

Referenced by compressConnections(), and getConnectionsMap().

◆ m_didFiltering

bool RPCStripsRing::m_didFiltering
private

Definition at line 90 of file RPCStripsRing.h.

Referenced by filterOverlapingChambers().

◆ m_didVirtuals

bool RPCStripsRing::m_didVirtuals
private

Definition at line 89 of file RPCStripsRing.h.

Referenced by fillWithVirtualStrips().

◆ m_etaPartition

int RPCStripsRing::m_etaPartition
private

Definition at line 85 of file RPCStripsRing.h.

Referenced by getEtaPartition(), getRingId(), and RPCStripsRing().

◆ m_hwPlane

int RPCStripsRing::m_hwPlane
private

◆ m_isReferenceRing

bool RPCStripsRing::m_isReferenceRing
private

Definition at line 88 of file RPCStripsRing.h.

Referenced by isReferenceRing(), and RPCStripsRing().

◆ m_region

int RPCStripsRing::m_region
private

Definition at line 86 of file RPCStripsRing.h.

Referenced by filterOverlapingChambers(), and RPCStripsRing().