CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 14 of file RPCPac.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file RPCPac.cc.

References m_pacData.

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

Member Function Documentation

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 20 of file RPCPac.cc.

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

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

Definition at line 120 of file RPCPac.cc.

References funct::abs(), RPCLogCone::getHitsCnt(), RPCLogCone::getLogPlane(), RPCLogCone::getLogStripDigisIdxs(), RPCLogCone::getLogStripState(), RPCPattern::getStripFrom(), RPCPattern::getStripTo(), 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, chain::pattern, HLT_25ns14e33_v1_cff::quality, RPCPacMuon::setAll(), and RPCMuon::setDigiIdxVec().

Referenced by run().

121 {
122  RPCPacMuon bestMuon;
123  unsigned short firedPlanes = 0;
124  int firedPlanesCount = 0;
125  RPCPacData::TEPatternsGroupList::const_iterator iEGroup =
127  for(; iEGroup != m_pacData->m_EnergeticPatternsGroupList.end(); iEGroup++)
128  {
129  firedPlanes = 0;
130  firedPlanesCount = 0;
131  unsigned short one = 1;
132  for(int logPlane = RPCConst::m_FIRST_PLANE;
134  logPlane++)
135  { //or po paskach ze stozka
136 
137  if (cone.getHitsCnt(logPlane)>0 ) {
138  RPCLogCone::TLogPlane lp = cone.getLogPlane(logPlane);
139  RPCLogCone::TLogPlane::const_iterator itLP = lp.begin();
140  RPCLogCone::TLogPlane::const_iterator itLPE = lp.end();
141  for(; itLP!=itLPE; ++itLP){
142  int strip=itLP->first;
143  if(iEGroup->m_GroupShape.getLogStripState(logPlane, strip)){
144  firedPlanes = firedPlanes | one;
145  firedPlanesCount++;
146  break;
147  }
148  }
149 
150  }
151  /*
152  for(unsigned int bitNum = 0;
153  bitNum <
154  RPCConst::
155  m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)][logPlane];
156  bitNum++)
157  {
158  if(iEGroup->m_GroupShape.getLogStripState(logPlane, bitNum)
159  && cone.getLogStripState(logPlane, bitNum))
160  {
161  firedPlanes = firedPlanes | one;
162  firedPlanesCount++;
163  break;
164  }
165  }
166  */
167  one = one << 1;
168  }
169 
170  short quality =
171  m_pacData->m_QualityTabsVec[iEGroup->m_QualityTabNumber][firedPlanes];
172  if(quality == -1)
173  continue;
174 
175  RPCPacMuon bufMuon;
176  for(unsigned int vecNum = 0; vecNum < iEGroup->m_PatternsItVec.size();
177  vecNum++)
178  {
179  RPCMuon::TDigiLinkVec digiIdx;
180  const RPCPattern::RPCPatVec::const_iterator patternIt =
181  iEGroup->m_PatternsItVec[vecNum];
182  const RPCPattern & pattern = *patternIt;
183  bool wasHit = false;
184  unsigned short one1 = 1;
185  for(int logPlane = RPCConst::m_FIRST_PLANE;
186  logPlane < RPCConst::m_USED_PLANES_COUNT[std::abs(m_ConeCrdnts.m_Tower)];
187  logPlane++, one1 = one1 << 1)
188  {
189  if(pattern.getStripFrom(logPlane) == RPCConst::m_NOT_CONECTED)
190  {
191 // firedPlanes[logPlane] = false; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
192  continue;
193  }
194  if((firedPlanes & one1) != 0)
195  {
196  int fromBit = pattern.getStripFrom(logPlane);
197  int toBit = pattern.getStripTo(logPlane);
198  wasHit = false;
199  for(int bitNumber = fromBit; bitNumber < toBit;
200  bitNumber++)
201  {
202  wasHit = wasHit || cone.getLogStripState(logPlane, bitNumber);
203  if (wasHit) { // no sense to check more
204  std::vector<int> dIVec = cone.getLogStripDigisIdxs(logPlane, bitNumber);
205  if (!dIVec.empty()) digiIdx.push_back( RPCMuon::TDigiLink(logPlane, *dIVec.begin()) );
206  break;
207  }
208  }
209 
210  if(!wasHit){
211  break;
212  }
213  }
214  }
215  if(wasHit)
216  {
217  bufMuon.setAll(pattern, quality, firedPlanes);
218  bufMuon.setDigiIdxVec(digiIdx);
219  break; //if one pattern fits, thers no point to check other patterns from group
220  }
221  } //end of patterns loop
222  if(bufMuon > bestMuon){
223  bestMuon = bufMuon;
224  }
225  //if(bestMuon.getQuality() == m_pacData->m_MaxQuality)
226  // return bestMuon;
227  } //end of EGroup loop
228  return bestMuon;
229 }
void setDigiIdxVec(const TDigiLinkVec &d)
Definition: RPCMuon.h:80
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:88
int getStripTo(int logPlane) const
Next-to-last strip in range.
Definition: RPCPattern.cc:57
std::map< int, std::vector< int > > TLogPlane
Definition: RPCLogCone.h:34
bool getLogStripState(int logPlane, unsigned int logStripNum) const
Definition: RPCLogCone.cc:211
list pattern
Definition: chain.py:104
void setAll(const RPCPattern &pattern, int quality, unsigned short firedPlanes)
Definition: RPCPacMuon.cc:17
int getStripFrom(int logPlane) const
First strip in range.
Definition: RPCPattern.cc:52
TLogPlane getLogPlane(int logPlane) const
Definition: RPCLogCone.cc:169
RPCConst::TQualityTabsVec m_QualityTabsVec
Definition: RPCPacData.h:84
int getHitsCnt(int logPlane) const
Gets fired strips count in given logPlane.
Definition: RPCLogCone.cc:174
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:56
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
const RPCPacData * m_pacData
Definition: RPCPac.h:27
std::vector< TDigiLink > TDigiLinkVec
Definition: RPCMuon.h:77
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:29
std::vector< int > getLogStripDigisIdxs(int logPlane, unsigned int logStripNum) const
Definition: RPCLogCone.cc:235
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:95
RPCPacMuon RPCPac::runTrackPatternsGroup ( const RPCLogCone cone) const
private

Definition at line 51 of file RPCPac.cc.

References funct::abs(), RPCLogCone::getLogStripDigisIdxs(), RPCLogCone::getLogStripState(), RPCMuon::getQuality(), RPCPattern::getQualityTabNumber(), RPCPattern::getStripFrom(), RPCPattern::getStripTo(), 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, chain::pattern, HLT_25ns14e33_v1_cff::quality, and RPCMuon::setDigiIdxVec().

Referenced by run().

52 {
53  RPCPacMuon bestMuon;
54 
55  for(unsigned int vecNum = 0;
56  vecNum < m_pacData->m_TrackPatternsGroup.m_PatternsItVec.size(); vecNum++)
57  {
58  RPCMuon::TDigiLinkVec digiIdx;
59  unsigned short firedPlanes = 0;
60  int firedPlanesCount = 0;
61  unsigned short one = 1;
62  const RPCPattern & pattern =
64  for(int logPlane = RPCConst::m_FIRST_PLANE;
66  logPlane++)
67  {
68  if(pattern.getStripFrom(logPlane) == RPCConst::m_NOT_CONECTED)
69  {
70  //firedPlanes[logPlane] = false; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
71  continue;
72  }
73  int fromBit = pattern.getStripFrom(logPlane);
74  int toBit = pattern.getStripTo(logPlane);
75  for(int bitNumber = fromBit; bitNumber < toBit; bitNumber++)
76  {
77  if(cone.getLogStripState(logPlane, bitNumber) == true)
78  {
79  firedPlanes = firedPlanes | one;
80  firedPlanesCount++;
81  std::vector<int> dIVec = cone.getLogStripDigisIdxs(logPlane, bitNumber);
82  if (!dIVec.empty()) digiIdx.push_back( RPCMuon::TDigiLink(logPlane, *dIVec.begin()) );
83 
84  break;
85  }
86  }
87 
88  if((RPCConst::m_USED_PLANES_COUNT[std::abs(m_ConeCrdnts.m_Tower)] -
89  logPlane) == 3)
90  if(firedPlanesCount == 0)
91  break;
92 
93  one = one << 1;
94  }
95 
96  if(firedPlanesCount >= 3)
97  {
98  short quality =
99  m_pacData->m_QualityTabsVec[pattern.getQualityTabNumber()][firedPlanes];
100  if(quality != -1)
101  {
102  if(quality >= bestMuon.getQuality())
103  {
104  RPCPacMuon bufMuon(pattern, quality, firedPlanes);
105  if(bufMuon > bestMuon)
106  {
107  bestMuon = bufMuon;
108  bestMuon.setDigiIdxVec(digiIdx);
109  }
110  }
111  }
112  }
113  }
114  return bestMuon;
115 }
void setDigiIdxVec(const TDigiLinkVec &d)
Definition: RPCMuon.h:80
static const int m_USED_PLANES_COUNT[m_TOWER_COUNT]
m_Number of Logic Planes existing in each m_Tower.
Definition: RPCConst.h:88
int getStripTo(int logPlane) const
Next-to-last strip in range.
Definition: RPCPattern.cc:57
int getQuality() const
Definition: RPCMuon.cc:70
bool getLogStripState(int logPlane, unsigned int logStripNum) const
Definition: RPCLogCone.cc:211
TTPatternsGroup m_TrackPatternsGroup
Here patters used in &quot;baseline&quot; algorith are stored.
Definition: RPCPacData.h:91
list pattern
Definition: chain.py:104
std::vector< RPCPattern::RPCPatVec::const_iterator > m_PatternsItVec
&lt; Vector of itereator on m_PatternsVec in Pac.
int getStripFrom(int logPlane) const
First strip in range.
Definition: RPCPattern.cc:52
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:56
int getQualityTabNumber() const
Definition: RPCPattern.cc:75
const RPCPacData * m_pacData
Definition: RPCPac.h:27
std::vector< TDigiLink > TDigiLinkVec
Definition: RPCMuon.h:77
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:29
std::vector< int > getLogStripDigisIdxs(int logPlane, unsigned int logStripNum) const
Definition: RPCLogCone.cc:235
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:95

Member Data Documentation

const RPCPacData* RPCPac::m_pacData
private

Definition at line 27 of file RPCPac.h.

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