CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
RPCPac Class Reference

#include <RPCPac.h>

Inheritance diagram for RPCPac:
RPCPacBase

Public Member Functions

 RPCPac (const RPCPacData *, int tower, int logSector, int logSegment)
 
RPCPacMuon run (const RPCLogCone &cone) const
 
- Public Member Functions inherited from RPCPacBase
 RPCPacBase (int m_tower, int logSector, int logSegment)
 
 RPCPacBase (RPCConst::l1RpcConeCrdnts coneCrdnts)
 
void setCurrentPosition (int m_tower, int logSector, int logSegment)
 
void setCurrentPosition (RPCConst::l1RpcConeCrdnts coneCrdnts)
 

Private Member Functions

RPCPacMuon runEnergeticPatternsGroups (const RPCLogCone &cone) const
 
RPCPacMuon runTrackPatternsGroup (const RPCLogCone &cone) const
 

Private Attributes

const RPCPacDatam_pacData
 

Additional Inherited Members

- Protected Attributes inherited from RPCPacBase
RPCConst::l1RpcConeCrdnts m_ConeCrdnts
 Coordinates of LogCone.The coordinates, with which m_PAC is created - the same as in pac file name. More...
 
RPCConst::l1RpcConeCrdnts m_CurrConeCrdnts
 

Detailed Description

Definition at line 13 of file RPCPac.h.

Constructor & Destructor Documentation

◆ RPCPac()

RPCPac::RPCPac ( const RPCPacData pacData,
int  tower,
int  logSector,
int  logSegment 
)

Definition at line 4 of file RPCPac.cc.

References m_pacData.

5  : RPCPacBase(tower, logSector, logSegment) {
6  m_pacData = pacData;
7 }
const RPCPacData * m_pacData
Definition: RPCPac.h:24
RPCPacBase(int m_tower, int logSector, int logSegment)
Definition: RPCPacBase.cc:13

Member Function Documentation

◆ run()

RPCPacMuon RPCPac::run ( const RPCLogCone cone) const

Runs Pattern Comparator algorithm for hits from the cone. Calls the runTrackPatternsGroup() and runEnergeticPatternsGroups().

Returns
found track candidate (empty if hits does not fit to eny pattern)

Definition at line 16 of file RPCPac.cc.

References hltPFPuppi_cfi::cone, RPCPacBase::m_CurrConeCrdnts, RPCPacData::m_EnergeticPatternsGroupList, m_pacData, TPatternsGroup::m_PatternsItVec, RPCPacData::m_TrackPatternsGroup, runEnergeticPatternsGroups(), runTrackPatternsGroup(), RPCMuon::setConeCrdnts(), and RPCMuon::setLogConeIdx().

16  { //symualcja
17 
18  RPCPacMuon bestMuon;
19  //track
21  bestMuon = runTrackPatternsGroup(cone);
22 
23  //energetic
26  if (bufMuon > bestMuon)
27  bestMuon = bufMuon;
28  }
29 
31 
32  //bestMuon.setConeCrdnts(cone.);
33  bestMuon.setLogConeIdx(cone.getIdx());
34  /*
35  int refStripNum = m_pacData->getPattern(bestMuon.getPatternNum())
36  .getStripFrom(RPCConst::m_REF_PLANE[abs(m_CurrConeCrdnts.m_Tower)])
37  + m_CurrConeCrdnts.m_LogSector * 96
38  + m_CurrConeCrdnts.m_LogSegment * 8;
39  bestMuon.setRefStripNum(refStripNum);*/
40  return bestMuon;
41 }
TTPatternsGroup m_TrackPatternsGroup
Here patters used in "baseline" algorith are stored.
Definition: RPCPacData.h:91
std::vector< RPCPattern::RPCPatVec::const_iterator > m_PatternsItVec
< Vector of itereator on m_PatternsVec in Pac.
RPCPacMuon runTrackPatternsGroup(const RPCLogCone &cone) const
Definition: RPCPac.cc:43
RPCConst::l1RpcConeCrdnts m_CurrConeCrdnts
Definition: RPCPacBase.h:32
void setConeCrdnts(const RPCConst::l1RpcConeCrdnts &coneCrdnts)
Definition: RPCMuon.cc:55
void setLogConeIdx(int logConeIdx)
Definition: RPCMuon.cc:79
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
const RPCPacData * m_pacData
Definition: RPCPac.h:24
RPCPacMuon runEnergeticPatternsGroups(const RPCLogCone &cone) const
Definition: RPCPac.cc:96

◆ runEnergeticPatternsGroups()

RPCPacMuon RPCPac::runEnergeticPatternsGroups ( const RPCLogCone cone) const
private

Definition at line 96 of file RPCPac.cc.

References funct::abs(), L1TBPTX_cfi::bitNumber, hltPFPuppi_cfi::cone, RPCPacBase::m_ConeCrdnts, RPCPacData::m_EnergeticPatternsGroupList, RPCConst::m_FIRST_PLANE, RPCConst::m_NOT_CONECTED, m_pacData, RPCPacData::m_QualityTabsVec, RPCConst::l1RpcConeCrdnts::m_Tower, RPCConst::m_USED_PLANES_COUNT, SiPixelPI::one, topSingleLeptonDQM_PU_cfi::pattern, quality, RPCPacMuon::setAll(), RPCMuon::setDigiIdxVec(), and digitizers_cfi::strip.

Referenced by run().

96  {
97  RPCPacMuon bestMuon;
98  unsigned short firedPlanes = 0;
99  int firedPlanesCount = 0;
100  RPCPacData::TEPatternsGroupList::const_iterator iEGroup = m_pacData->m_EnergeticPatternsGroupList.begin();
101  for (; iEGroup != m_pacData->m_EnergeticPatternsGroupList.end(); iEGroup++) {
102  firedPlanes = 0;
103  firedPlanesCount = 0;
104  unsigned short one = 1;
105  for (int logPlane = RPCConst::m_FIRST_PLANE;
107  logPlane++) { //or po paskach ze stozka
108 
109  if (cone.getHitsCnt(logPlane) > 0) {
110  RPCLogCone::TLogPlane lp = cone.getLogPlane(logPlane);
111  RPCLogCone::TLogPlane::const_iterator itLP = lp.begin();
112  RPCLogCone::TLogPlane::const_iterator itLPE = lp.end();
113  for (; itLP != itLPE; ++itLP) {
114  int strip = itLP->first;
115  if (iEGroup->m_GroupShape.getLogStripState(logPlane, strip)) {
116  firedPlanes = firedPlanes | one;
117  firedPlanesCount++;
118  break;
119  }
120  }
121  }
122  /*
123  for(unsigned int bitNum = 0;
124  bitNum <
125  RPCConst::
126  m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)][logPlane];
127  bitNum++)
128  {
129  if(iEGroup->m_GroupShape.getLogStripState(logPlane, bitNum)
130  && cone.getLogStripState(logPlane, bitNum))
131  {
132  firedPlanes = firedPlanes | one;
133  firedPlanesCount++;
134  break;
135  }
136  }
137  */
138  one = one << 1;
139  }
140 
141  short quality = m_pacData->m_QualityTabsVec[iEGroup->m_QualityTabNumber][firedPlanes];
142  if (quality == -1)
143  continue;
144 
145  RPCPacMuon bufMuon;
146  for (unsigned int vecNum = 0; vecNum < iEGroup->m_PatternsItVec.size(); vecNum++) {
147  RPCMuon::TDigiLinkVec digiIdx;
148  const RPCPattern::RPCPatVec::const_iterator patternIt = iEGroup->m_PatternsItVec[vecNum];
149  const RPCPattern& pattern = *patternIt;
150  bool wasHit = false;
151  unsigned short one1 = 1;
152  for (int logPlane = RPCConst::m_FIRST_PLANE;
154  logPlane++, one1 = one1 << 1) {
155  if (pattern.getStripFrom(logPlane) == RPCConst::m_NOT_CONECTED) {
156  // firedPlanes[logPlane] = false; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
157  continue;
158  }
159  if ((firedPlanes & one1) != 0) {
160  int fromBit = pattern.getStripFrom(logPlane);
161  int toBit = pattern.getStripTo(logPlane);
162  wasHit = false;
163  for (int bitNumber = fromBit; bitNumber < toBit; bitNumber++) {
164  wasHit = wasHit || cone.getLogStripState(logPlane, bitNumber);
165  if (wasHit) { // no sense to check more
166  std::vector<int> dIVec = cone.getLogStripDigisIdxs(logPlane, bitNumber);
167  if (!dIVec.empty())
168  digiIdx.push_back(RPCMuon::TDigiLink(logPlane, *dIVec.begin()));
169  break;
170  }
171  }
172 
173  if (!wasHit) {
174  break;
175  }
176  }
177  }
178  if (wasHit) {
179  bufMuon.setAll(pattern, quality, firedPlanes);
180  bufMuon.setDigiIdxVec(digiIdx);
181  break; //if one pattern fits, thers no point to check other patterns from group
182  }
183  } //end of patterns loop
184  if (bufMuon > bestMuon) {
185  bestMuon = bufMuon;
186  }
187  //if(bestMuon.getQuality() == m_pacData->m_MaxQuality)
188  // return bestMuon;
189  } //end of EGroup loop
190  return bestMuon;
191 }
void setDigiIdxVec(const TDigiLinkVec &d)
Definition: RPCMuon.h:83
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:87
std::map< int, std::vector< int > > TLogPlane
Definition: RPCLogCone.h:30
void setAll(const RPCPattern &pattern, int quality, unsigned short firedPlanes)
Definition: RPCPacMuon.cc:16
RPCConst::TQualityTabsVec m_QualityTabsVec
Definition: RPCPacData.h:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int m_FIRST_PLANE
Use ase a first index in loops.
Definition: RPCConst.h:55
std::vector< TDigiLink > TDigiLinkVec
Definition: RPCMuon.h:80
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
const RPCPacData * m_pacData
Definition: RPCPac.h:24
RPCConst::l1RpcConeCrdnts m_ConeCrdnts
Coordinates of LogCone.The coordinates, with which m_PAC is created - the same as in pac file name...
Definition: RPCPacBase.h:28
string quality
static const int m_NOT_CONECTED
Denotes Logic m_Strips that is not valid (f.e. in Patterns denotes, that in given plane the pattern i...
Definition: RPCConst.h:94

◆ runTrackPatternsGroup()

RPCPacMuon RPCPac::runTrackPatternsGroup ( const RPCLogCone cone) const
private

Definition at line 43 of file RPCPac.cc.

References funct::abs(), L1TBPTX_cfi::bitNumber, hltPFPuppi_cfi::cone, RPCMuon::getQuality(), RPCPacBase::m_ConeCrdnts, RPCConst::m_FIRST_PLANE, RPCConst::m_NOT_CONECTED, m_pacData, TPatternsGroup::m_PatternsItVec, RPCPacData::m_QualityTabsVec, RPCConst::l1RpcConeCrdnts::m_Tower, RPCPacData::m_TrackPatternsGroup, RPCConst::m_USED_PLANES_COUNT, SiPixelPI::one, topSingleLeptonDQM_PU_cfi::pattern, quality, and RPCMuon::setDigiIdxVec().

Referenced by run().

43  {
44  RPCPacMuon bestMuon;
45 
46  for (unsigned int vecNum = 0; vecNum < m_pacData->m_TrackPatternsGroup.m_PatternsItVec.size(); vecNum++) {
47  RPCMuon::TDigiLinkVec digiIdx;
48  unsigned short firedPlanes = 0;
49  int firedPlanesCount = 0;
50  unsigned short one = 1;
52  for (int logPlane = RPCConst::m_FIRST_PLANE;
54  logPlane++) {
55  if (pattern.getStripFrom(logPlane) == RPCConst::m_NOT_CONECTED) {
56  //firedPlanes[logPlane] = false; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
57  continue;
58  }
59  int fromBit = pattern.getStripFrom(logPlane);
60  int toBit = pattern.getStripTo(logPlane);
61  for (int bitNumber = fromBit; bitNumber < toBit; bitNumber++) {
62  if (cone.getLogStripState(logPlane, bitNumber) == true) {
63  firedPlanes = firedPlanes | one;
64  firedPlanesCount++;
65  std::vector<int> dIVec = cone.getLogStripDigisIdxs(logPlane, bitNumber);
66  if (!dIVec.empty())
67  digiIdx.push_back(RPCMuon::TDigiLink(logPlane, *dIVec.begin()));
68 
69  break;
70  }
71  }
72 
74  if (firedPlanesCount == 0)
75  break;
76 
77  one = one << 1;
78  }
79 
80  if (firedPlanesCount >= 3) {
81  short quality = m_pacData->m_QualityTabsVec[pattern.getQualityTabNumber()][firedPlanes];
82  if (quality != -1) {
83  if (quality >= bestMuon.getQuality()) {
84  RPCPacMuon bufMuon(pattern, quality, firedPlanes);
85  if (bufMuon > bestMuon) {
86  bestMuon = bufMuon;
87  bestMuon.setDigiIdxVec(digiIdx);
88  }
89  }
90  }
91  }
92  }
93  return bestMuon;
94 }
void setDigiIdxVec(const TDigiLinkVec &d)
Definition: RPCMuon.h:83
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:87
TTPatternsGroup m_TrackPatternsGroup
Here patters used in "baseline" algorith are stored.
Definition: RPCPacData.h:91
std::vector< RPCPattern::RPCPatVec::const_iterator > m_PatternsItVec
< Vector of itereator on m_PatternsVec in Pac.
RPCConst::TQualityTabsVec m_QualityTabsVec
Definition: RPCPacData.h:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int m_FIRST_PLANE
Use ase a first index in loops.
Definition: RPCConst.h:55
std::vector< TDigiLink > TDigiLinkVec
Definition: RPCMuon.h:80
const RPCPacData * m_pacData
Definition: RPCPac.h:24
int getQuality() const
Definition: RPCMuon.cc:69
RPCConst::l1RpcConeCrdnts m_ConeCrdnts
Coordinates of LogCone.The coordinates, with which m_PAC is created - the same as in pac file name...
Definition: RPCPacBase.h:28
string quality
static const int m_NOT_CONECTED
Denotes Logic m_Strips that is not valid (f.e. in Patterns denotes, that in given plane the pattern i...
Definition: RPCConst.h:94

Member Data Documentation

◆ m_pacData

const RPCPacData* RPCPac::m_pacData
private

Definition at line 24 of file RPCPac.h.

Referenced by RPCPac(), run(), runEnergeticPatternsGroups(), and runTrackPatternsGroup().