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 Types | Private Member Functions | Private Attributes | Friends
RPCPacData Class Reference

#include <RPCPacData.h>

Public Member Functions

bool getEPatternsGroupShape (int groupNum, int logPlane, int logStripNum)
 
RPCPattern getPattern (int patNum) const
 
int getPatternsCount ()
 
int getPatternsGroupCount ()
 
std::string getPatternsGroupDescription (int patternGroupNum)
 
bool getTPatternsGroupShape (int logPlane, int logStripNum)
 
void init (const RPCPatternsParser &parser, const RPCConst::l1RpcConeCrdnts &coneCrdnts)
 
 RPCPacData (std::string patFilesDir, int m_tower, int logSector, int logSegment)
 
 RPCPacData (const RPCPattern::RPCPatVec &patVec, const RPCPattern::TQualityVec &qualVec)
 
 RPCPacData (const L1RPCConfig *patConf, const int tower, const int sector, const int segment)
 

Private Types

typedef std::list
< TEPatternsGroup
TEPatternsGroupList
 

Private Member Functions

void insertPatterns (const RPCPattern::RPCPatVec &pattern, const int tower=99, const int sector=99, const int segment=99)
 
void insertQualityRecord (unsigned int qualityTabNumber, unsigned short firedPlanes, short quality)
 

Private Attributes

TEPatternsGroupList m_EnergeticPatternsGroupList
 
short m_MaxQuality
 
RPCPattern::RPCPatVec m_PatternsVec
 
RPCConst::TQualityTabsVec m_QualityTabsVec
 
short m_RefGroupCount
 From pac file - TT_REF_GROUP_NUMBERS. More...
 
TTPatternsGroup m_TrackPatternsGroup
 Here patters used in "baseline" algorith are stored. More...
 

Friends

class RPCPac
 

Detailed Description

Performes Pattern Comparator algorithm for one LogCone. Returns one muon candidate. The algorithm details i.e. patterns list, algorthm type for each pattern, qaulity definition, are set from m_PAC definition file.

Author
Karol Bunkowski (Warsaw),
Tomasz Fruboes (Warsaw) - porting to CMSSW

Definition at line 33 of file RPCPacData.h.

Member Typedef Documentation

Definition at line 64 of file RPCPacData.h.

Constructor & Destructor Documentation

RPCPacData::RPCPacData ( std::string  patFilesDir,
int  tower,
int  logSector,
int  logSegment 
)

Constructor required by RPCPacManager.

Parameters
patFilesDir- the directory conataing m_PAC definition file. It should containe file for this m_PAC, defined by tower, logSector, logSegment, named pacPat_t<tower>sc<logSector>sg<logSegment>.vhd Containers: m_EnergeticPatternsGroupList and m_TrackPatternsGroup are filled with patterns from file (the method ParsePatternFile() is called).

Definition at line 30 of file RPCPacData.cc.

References init(), RPCConst::intToString(), RPCConst::l1RpcConeCrdnts::m_LogSector, RPCConst::l1RpcConeCrdnts::m_LogSegment, m_MaxQuality, RPCConst::l1RpcConeCrdnts::m_Tower, m_TrackPatternsGroup, RPCPatternsParser::parse(), geometryXMLtoCSV::parser, and TPatternsGroup::setGroupDescription().

30  {
31 
32  //: RPCPacBase(tower, logSector, logSegment) {
33  m_MaxQuality=0;
34  std::string patFileName;
35 
36  RPCConst rpcconst;
37 
38 
39  patFileName = patFilesDir
40  + "pacPat_t" + rpcconst.intToString(tower)
41  + "sc" + rpcconst.intToString(logSector)
42  + "sg" + rpcconst.intToString(logSegment)
43  + ".xml";
44 
46  coneCrds.m_Tower=tower;
47  coneCrds.m_LogSector=logSector;
48  coneCrds.m_LogSegment=logSegment;
49 
51  parser.parse(patFileName);
52  init(parser, coneCrds);
53 
54  m_TrackPatternsGroup.setGroupDescription("Track PatternsGroup");
55 
56 }
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:119
TTPatternsGroup m_TrackPatternsGroup
Here patters used in &quot;baseline&quot; algorith are stored.
Definition: RPCPacData.h:91
void setGroupDescription(std::string groupDescription)
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:252
short m_MaxQuality
Definition: RPCPacData.h:69
void parse(std::string fileName)
void init(const RPCPatternsParser &parser, const RPCConst::l1RpcConeCrdnts &coneCrdnts)
Definition: RPCPacData.cc:264
RPCPacData::RPCPacData ( const RPCPattern::RPCPatVec patVec,
const RPCPattern::TQualityVec qualVec 
)

Construct from given qualities and patterns

Definition at line 62 of file RPCPacData.cc.

References i, insertPatterns(), insertQualityRecord(), RPCPattern::TQuality::m_FiredPlanes, RPCPattern::TQuality::m_QualityTabNumber, and RPCPattern::TQuality::m_QualityValue.

63  :
64  m_MaxQuality(0)
65 {
66  for(unsigned int i = 0; i < qualVec.size(); ++i) {
67  RPCPattern::TQuality quality = qualVec[i];
68  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
69  unsigned short firedPlanes = qualBits.to_ulong();
70 
71  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
72  }
73 
74 
75  insertPatterns(patVec);
76 
77 
78 }
int i
Definition: DBlmapReader.cc:9
void insertPatterns(const RPCPattern::RPCPatVec &pattern, const int tower=99, const int sector=99, const int segment=99)
Definition: RPCPacData.cc:213
unsigned char m_FiredPlanes
Definition: RPCPattern.h:35
void insertQualityRecord(unsigned int qualityTabNumber, unsigned short firedPlanes, short quality)
Definition: RPCPacData.cc:191
short m_MaxQuality
Definition: RPCPacData.h:69
RPCPacData::RPCPacData ( const L1RPCConfig patConf,
const int  tower,
const int  sector,
const int  segment 
)

Definition at line 82 of file RPCPacData.cc.

References insertPatterns(), insertQualityRecord(), RPCPattern::TQuality::m_FiredPlanes, L1RPCConfig::m_pats, RPCPattern::TQuality::m_QualityTabNumber, RPCPattern::TQuality::m_QualityValue, and L1RPCConfig::m_quals.

82  :
83  m_MaxQuality(0)
84 {
85 
86  for (unsigned int iqual=0; iqual<rpcconf->m_quals.size(); iqual++){
87 
88  if (rpcconf->m_quals[iqual].m_tower != tower ||
89  rpcconf->m_quals[iqual].m_logsector != sector ||
90  rpcconf->m_quals[iqual].m_logsegment != segment ) continue;
91 
92  RPCPattern::TQuality quality =rpcconf->m_quals[iqual];
93  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
94  unsigned short firedPlanes = qualBits.to_ulong();
95  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
96 
97  }
98 
99  insertPatterns(rpcconf->m_pats,tower,sector,segment);
100 
101 }
void insertPatterns(const RPCPattern::RPCPatVec &pattern, const int tower=99, const int sector=99, const int segment=99)
Definition: RPCPacData.cc:213
unsigned char m_FiredPlanes
Definition: RPCPattern.h:35
void insertQualityRecord(unsigned int qualityTabNumber, unsigned short firedPlanes, short quality)
Definition: RPCPacData.cc:191
short m_MaxQuality
Definition: RPCPacData.h:69

Member Function Documentation

bool RPCPacData::getEPatternsGroupShape ( int  groupNum,
int  logPlane,
int  bitNum 
)
Returns
true, if logStrip defined by logStripNum and logPlane belongs to the EPatternsGroup from m_EnergeticPatternsGroupList defined by groupNum.

Definition at line 154 of file RPCPacData.cc.

References i, and m_EnergeticPatternsGroupList.

154  {
155  TEPatternsGroupList::const_iterator iEGroup = m_EnergeticPatternsGroupList.begin();
156  int i = 0;
157  for(; iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++, i++) {
158  if(i == groupNum)
159  return iEGroup->m_GroupShape.getLogStripState(logPlane, bitNum);
160  }
161  throw RPCException("getEPatternsGroupShape(): groupNum to big!");
162  //edm::LogError("RPCTrigger")<< "getEPatternsGroupShape(): groupNum to big!";
163  return false; // XXX - TMF
164 }
int i
Definition: DBlmapReader.cc:9
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
RPCPattern RPCPacData::getPattern ( int  patNum) const
Returns
pattern stored in m_PatternsVec. Needed for patterns explorer.

Definition at line 121 of file RPCPacData.cc.

References m_PatternsVec.

121  {
122  if(m_PatternsVec.size() == 0) {
123 
124  throw RPCException("GetPattren(): Patterns vec is empty, mayby it was not filled!");
125  //edm::LogError("RPCTrigger") << "GetPattren(): Patterns vec is empty, mayby it was not filled!";
126 
127  }
128  return m_PatternsVec[patNum];
129 
130 }
RPCPattern::RPCPatVec m_PatternsVec
Definition: RPCPacData.h:74
int RPCPacData::getPatternsCount ( )
Returns
the count of patterns stored in m_PatternsVec.

Definition at line 136 of file RPCPacData.cc.

References m_PatternsVec.

136  {
137  return m_PatternsVec.size();
138 }
RPCPattern::RPCPatVec m_PatternsVec
Definition: RPCPacData.h:74
int RPCPacData::getPatternsGroupCount ( )
Returns
the count af all patterns gropu, i.e. 1 + m_EnergeticPatternsGroupList.size().

Definition at line 112 of file RPCPacData.cc.

References m_EnergeticPatternsGroupList.

112  {
113  return(1 + m_EnergeticPatternsGroupList.size()); //1 = track pattrens group
114 }
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
std::string RPCPacData::getPatternsGroupDescription ( int  patternGroupNum)

Definition at line 166 of file RPCPacData.cc.

References TPatternsGroup::getGroupDescription(), i, RPCConst::intToString(), m_EnergeticPatternsGroupList, m_TrackPatternsGroup, and run_regression::ret.

166  {
167 
168  RPCConst rpcconst;
169 
170  std::string ret;
171  if(patternGroupNum == -1)
173  else {
174  TEPatternsGroupList::iterator iEGroup = m_EnergeticPatternsGroupList.begin();
175  int i = 0;
176  for(; iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++, i++) {
177  if(i == patternGroupNum)
178  ret = "EGroup #"+ rpcconst.intToString(i)+iEGroup->getGroupDescription();
179  }
180 
181  }
182 
183  if(ret.empty()){
184  throw RPCException("getEPatternsGroupShape(): groupNum to big!");
185  //edm::LogError("RPCTrigger")<< "getEPatternsGroupShape(): groupNum to big!";
186  }
187 
188  return ret;
189 }
int i
Definition: DBlmapReader.cc:9
std::string getGroupDescription() const
TTPatternsGroup m_TrackPatternsGroup
Here patters used in &quot;baseline&quot; algorith are stored.
Definition: RPCPacData.h:91
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:252
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
bool RPCPacData::getTPatternsGroupShape ( int  logPlane,
int  logStripNum 
)
Returns
true, if logStrip defined by logStripNum and logPlane belongs to the m_TrackPatternsGroup.

Definition at line 145 of file RPCPacData.cc.

References RPCLogCone::getLogStripState(), TPatternsGroup::m_GroupShape, and m_TrackPatternsGroup.

145  {
146  return m_TrackPatternsGroup.m_GroupShape.getLogStripState(logPlane, logStripNum);
147 }
RPCLogCone m_GroupShape
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
void RPCPacData::init ( const RPCPatternsParser parser,
const RPCConst::l1RpcConeCrdnts coneCrdnts 
)

Definition at line 264 of file RPCPacData.cc.

References RPCPatternsParser::getPatternsVec(), RPCPatternsParser::getQualityVec(), i, insertPatterns(), insertQualityRecord(), RPCPattern::TQuality::m_FiredPlanes, m_PatternsVec, RPCPattern::TQuality::m_QualityTabNumber, and RPCPattern::TQuality::m_QualityValue.

Referenced by RPCPacData().

264  {
265  for(unsigned int i = 0; i < parser.getQualityVec().size(); i++) {
266  RPCPattern::TQuality quality = parser.getQualityVec()[i];
267  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
268  unsigned short firedPlanes = qualBits.to_ulong();
269 
270  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
271  }
272 
273  m_PatternsVec = parser.getPatternsVec(coneCrdnts);
275 }
int i
Definition: DBlmapReader.cc:9
void insertPatterns(const RPCPattern::RPCPatVec &pattern, const int tower=99, const int sector=99, const int segment=99)
Definition: RPCPacData.cc:213
unsigned char m_FiredPlanes
Definition: RPCPattern.h:35
void insertQualityRecord(unsigned int qualityTabNumber, unsigned short firedPlanes, short quality)
Definition: RPCPacData.cc:191
RPCPattern::RPCPatVec m_PatternsVec
Definition: RPCPacData.h:74
const RPCPattern::RPCPatVec & getPatternsVec(const RPCConst::l1RpcConeCrdnts &coneCrds) const
const RPCPattern::TQualityVec & getQualityVec() const
void RPCPacData::insertPatterns ( const RPCPattern::RPCPatVec pattern,
const int  tower = 99,
const int  sector = 99,
const int  segment = 99 
)
private

Adds pattern to m_TrackPatternsGroup or appropriate group from m_EnergeticPatternsGroupList. If the appropriate TEPatternsGroup does not exist, it is created.

Definition at line 213 of file RPCPacData.cc.

References TPatternsGroup::addPattern(), RPCConst::intToString(), m_EnergeticPatternsGroupList, m_TrackPatternsGroup, RPCPattern::PAT_TYPE_E, RPCPattern::PAT_TYPE_T, and TPatternsGroup::setGroupDescription().

Referenced by init(), and RPCPacData().

213  {
214 
215  bool ignorePos = false;
216  if ( tower == 99 || sector == 99 || segment == 99) ignorePos = true;
217 
218  RPCConst rpcconst;
219 
220  for(RPCPattern::RPCPatVec::const_iterator patIt = patternsVec.begin();
221  patIt != patternsVec.end();
222  patIt++)
223  {
224  if (!ignorePos &&
225  (patIt->getTower() != tower
226  || patIt->getLogSector() != sector
227  || patIt->getLogSegment() != segment) ) continue;
228 
229  if(patIt->getPatternType() == RPCPattern::PAT_TYPE_T)
231  else if(patIt->getPatternType() == RPCPattern::PAT_TYPE_E) {
232  TEPatternsGroupList::iterator iEGroup;
233  for(iEGroup = m_EnergeticPatternsGroupList.begin();
234  iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++)
235  if(iEGroup->check(patIt))
236  break;
237  if(iEGroup == m_EnergeticPatternsGroupList.end()) {
238  TEPatternsGroup newEGroup(patIt);
239  newEGroup.setGroupDescription(
240  //"EGroup #"+ rpcconst.intToString(m_EnergeticPatternsGroupList.size())+
241  ", code: " + rpcconst.intToString(patIt->getCode()) +
242  ", dir: " + rpcconst.intToString(patIt->getSign()) +
243  ", refGroup: " + rpcconst.intToString(patIt->getRefGroup()) +
244  ", qualityTabNumber: " + rpcconst.intToString(patIt->getQualityTabNumber()));
245  m_EnergeticPatternsGroupList.push_back(newEGroup);
246  }
247  else
248  iEGroup->addPattern(patIt);
249  }
250  else
251  throw RPCException("InsertPattern(): unsupported pattern type");
252  //edm::LogError("RPCTrigger") << "InsertPattern(): unsupported pattern type";
253  }
254 
255  if(m_EnergeticPatternsGroupList.size() != 0) {
256 
257  m_EnergeticPatternsGroupList.sort(); //to jest potrzebne, bo w run() przechodzi
258  //pierwszy paettern, ktory ma Maxymalna quality, wiec
259  //grupy musza byc
261  }
262 }
void addPattern(const RPCPattern::RPCPatVec::const_iterator &pattern)
TTPatternsGroup m_TrackPatternsGroup
Here patters used in &quot;baseline&quot; algorith are stored.
Definition: RPCPacData.h:91
static const TPatternType PAT_TYPE_T
Definition: RPCPattern.h:51
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:252
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
static const TPatternType PAT_TYPE_E
Definition: RPCPattern.h:52
Group of paterns for &quot;improved&quot;(&quot;energetic&quot;) algorithm. In current implementation all patterns in giv...
void RPCPacData::insertQualityRecord ( unsigned int  qualityTabNumber,
unsigned short  firedPlanes,
short  quality 
)
private

Adds one qaulity record to m_QualityTabsVec.

Parameters
qualityTabNumber- index of QualityTab (index in m_QualityTabsVec), to which new record should be add.
qualityBitset- definition of plnaes in coincidance. (qualityBitset[0] == true means, that LogPlane1 should be fired).
quality- quality value assigned to given coincidance.

Definition at line 191 of file RPCPacData.cc.

References RPCConst::m_LOGPLANES_COUNT, m_MaxQuality, m_QualityTabsVec, and funct::pow().

Referenced by init(), and RPCPacData().

192  {
193 
194  if(quality > m_MaxQuality)
195  m_MaxQuality = quality;
196  if(qualityTabNumber < m_QualityTabsVec.size()) {
197  m_QualityTabsVec[qualityTabNumber][firedPlanes] = quality;
198  }
199  else if(qualityTabNumber == m_QualityTabsVec.size()) {
200  // XXX - added cast(int)
201 
202  //= new TQualityTab();
204  m_QualityTabsVec.push_back(qualityTab);
205  m_QualityTabsVec[qualityTabNumber][firedPlanes] = quality;
206  }
207  else
208  throw RPCException("insertQualityRecord(): wrong qualityTabNumber");
209  //edm::LogError("RPCTrigger") << "insertQualityRecord(): wrong qualityTabNumber";
210 }
RPCConst::TQualityTabsVec m_QualityTabsVec
Definition: RPCPacData.h:84
static const int m_LOGPLANES_COUNT
Max Logic Planes Count in trigger towers.
Definition: RPCConst.h:47
std::vector< short > TQualityTab
Definition: RPCConst.h:114
short m_MaxQuality
Definition: RPCPacData.h:69
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Friends And Related Function Documentation

friend class RPCPac
friend

Definition at line 34 of file RPCPacData.h.

Member Data Documentation

TEPatternsGroupList RPCPacData::m_EnergeticPatternsGroupList
private

Container containig EPatternsGroups. Is filled by InsertPattern() during parsing the pac file ParsePatternFile().

Definition at line 88 of file RPCPacData.h.

Referenced by getEPatternsGroupShape(), getPatternsGroupCount(), getPatternsGroupDescription(), insertPatterns(), RPCPac::run(), and RPCPac::runEnergeticPatternsGroups().

short RPCPacData::m_MaxQuality
private

Definition at line 69 of file RPCPacData.h.

Referenced by insertQualityRecord(), and RPCPacData().

RPCPattern::RPCPatVec RPCPacData::m_PatternsVec
private

filled only if in constructor RPCPacData() createPatternsVec == true. Contains all patterns from pac file. Needed for patterns expolorer, does not used in trigger algorithm.

Definition at line 74 of file RPCPacData.h.

Referenced by getPattern(), getPatternsCount(), and init().

RPCConst::TQualityTabsVec RPCPacData::m_QualityTabsVec
private

The definiton of allowed coincidence of hits in planes and quality values assigned to them. There can be few quality tables in one m_PAC, to every pattern one of those quality table is asigned. (In barrel usualy 2 quality tables are used: one for high pt (4/6) and one for low pt (3/4). One qaulity table is multimap<biteset, int>, bitset defines allowed coincidance, int defines the quality value. m_QualityTabsVec is a vector of these maps, the index in vector correspondes to the m_QualityTabNumber in pattern.

See Also
TQualityBitset, TQualityTab, TQualityTabsVec.

Definition at line 84 of file RPCPacData.h.

Referenced by insertQualityRecord(), RPCPac::runEnergeticPatternsGroups(), and RPCPac::runTrackPatternsGroup().

short RPCPacData::m_RefGroupCount
private

From pac file - TT_REF_GROUP_NUMBERS.

Definition at line 67 of file RPCPacData.h.

TTPatternsGroup RPCPacData::m_TrackPatternsGroup
private

Here patters used in "baseline" algorith are stored.

Definition at line 91 of file RPCPacData.h.

Referenced by getPatternsGroupDescription(), getTPatternsGroupShape(), insertPatterns(), RPCPacData(), RPCPac::run(), and RPCPac::runTrackPatternsGroup().