CMS 3D CMS Logo

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 (const L1RPCConfig *patConf, const int tower, const int sector, const int segment)
 
 RPCPacData (const RPCPattern::RPCPatVec &patVec, const RPCPattern::TQualityVec &qualVec)
 
 RPCPacData (std::string patFilesDir, int m_tower, int logSector, int logSegment)
 

Private Types

typedef std::list< TEPatternsGroupTEPatternsGroupList
 

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

◆ TEPatternsGroupList

Definition at line 63 of file RPCPacData.h.

Constructor & Destructor Documentation

◆ RPCPacData() [1/3]

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 28 of file RPCPacData.cc.

29  {
30  //: RPCPacBase(tower, logSector, logSegment) {
31  m_MaxQuality = 0;
32  std::string patFileName;
33 
34  RPCConst rpcconst;
35 
36  patFileName = patFilesDir + "pacPat_t" + rpcconst.intToString(tower) + "sc" + rpcconst.intToString(logSector) + "sg" +
37  rpcconst.intToString(logSegment) + ".xml";
38 
40  coneCrds.m_Tower = tower;
41  coneCrds.m_LogSector = logSector;
42  coneCrds.m_LogSegment = logSegment;
43 
45  parser.parse(patFileName);
46  init(parser, coneCrds);
47 
48  m_TrackPatternsGroup.setGroupDescription("Track PatternsGroup");

◆ RPCPacData() [2/3]

RPCPacData::RPCPacData ( const RPCPattern::RPCPatVec patVec,
const RPCPattern::TQualityVec qualVec 
)

Construct from given qualities and patterns

Definition at line 54 of file RPCPacData.cc.

55  : m_MaxQuality(0) {
56  for (unsigned int i = 0; i < qualVec.size(); ++i) {
57  RPCPattern::TQuality quality = qualVec[i];
58  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
59  unsigned short firedPlanes = qualBits.to_ulong();
60 
61  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
62  }
63 
64  insertPatterns(patVec);

◆ RPCPacData() [3/3]

RPCPacData::RPCPacData ( const L1RPCConfig patConf,
const int  tower,
const int  sector,
const int  segment 
)

Definition at line 66 of file RPCPacData.cc.

68  : m_MaxQuality(0) {
69  for (unsigned int iqual = 0; iqual < rpcconf->m_quals.size(); iqual++) {
70  if (rpcconf->m_quals[iqual].m_tower != tower || rpcconf->m_quals[iqual].m_logsector != sector ||
71  rpcconf->m_quals[iqual].m_logsegment != segment)
72  continue;
73 
74  RPCPattern::TQuality quality = rpcconf->m_quals[iqual];
75  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
76  unsigned short firedPlanes = qualBits.to_ulong();
77  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
78  }
79 
80  insertPatterns(rpcconf->m_pats, tower, sector, segment);

References insertPatterns(), insertQualityRecord(), qcdUeDQM_cfi::quality, L1RPCConfig_cff::rpcconf, and hgcalTowerProducer_cfi::tower.

Member Function Documentation

◆ getEPatternsGroupShape()

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 124 of file RPCPacData.cc.

125  {
126  TEPatternsGroupList::const_iterator iEGroup = m_EnergeticPatternsGroupList.begin();
127  int i = 0;
128  for (; iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++, i++) {
129  if (i == groupNum)
130  return iEGroup->m_GroupShape.getLogStripState(logPlane, bitNum);
131  }
132  throw RPCException("getEPatternsGroupShape(): groupNum to big!");
133  //edm::LogError("RPCTrigger")<< "getEPatternsGroupShape(): groupNum to big!";
134  return false; // XXX - TMF

◆ getPattern()

RPCPattern RPCPacData::getPattern ( int  patNum) const
Returns
pattern stored in m_PatternsVec. Needed for patterns explorer.

Definition at line 96 of file RPCPacData.cc.

97  {
98  if (m_PatternsVec.empty()) {
99  throw RPCException("GetPattren(): Patterns vec is empty, mayby it was not filled!");
100  //edm::LogError("RPCTrigger") << "GetPattren(): Patterns vec is empty, mayby it was not filled!";
101  }
102  return m_PatternsVec[patNum];

◆ getPatternsCount()

int RPCPacData::getPatternsCount ( )
Returns
the count of patterns stored in m_PatternsVec.

Definition at line 108 of file RPCPacData.cc.

◆ getPatternsGroupCount()

int RPCPacData::getPatternsGroupCount ( )
Returns
the count af all patterns gropu, i.e. 1 + m_EnergeticPatternsGroupList.size().

Definition at line 87 of file RPCPacData.cc.

88  {
89  return (1 + m_EnergeticPatternsGroupList.size()); //1 = track pattrens group

◆ getPatternsGroupDescription()

std::string RPCPacData::getPatternsGroupDescription ( int  patternGroupNum)

Definition at line 136 of file RPCPacData.cc.

137  {
138  RPCConst rpcconst;
139 
141  if (patternGroupNum == -1)
143  else {
144  TEPatternsGroupList::iterator iEGroup = m_EnergeticPatternsGroupList.begin();
145  int i = 0;
146  for (; iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++, i++) {
147  if (i == patternGroupNum)
148  ret = "EGroup #" + rpcconst.intToString(i) + iEGroup->getGroupDescription();
149  }
150  }
151 
152  if (ret.empty()) {
153  throw RPCException("getEPatternsGroupShape(): groupNum to big!");
154  //edm::LogError("RPCTrigger")<< "getEPatternsGroupShape(): groupNum to big!";
155  }
156 
157  return ret;

References TPatternsGroup::getGroupDescription(), mps_fire::i, RPCConst::intToString(), m_EnergeticPatternsGroupList, m_TrackPatternsGroup, runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ getTPatternsGroupShape()

bool RPCPacData::getTPatternsGroupShape ( int  logPlane,
int  logStripNum 
)
Returns
true, if logStrip defined by logStripNum and logPlane belongs to the m_TrackPatternsGroup.

Definition at line 115 of file RPCPacData.cc.

116  {
117  return m_TrackPatternsGroup.m_GroupShape.getLogStripState(logPlane, logStripNum);

◆ init()

void RPCPacData::init ( const RPCPatternsParser parser,
const RPCConst::l1RpcConeCrdnts coneCrdnts 
)

Definition at line 221 of file RPCPacData.cc.

222  {
223  for (unsigned int i = 0; i < parser.getQualityVec().size(); i++) {
224  RPCPattern::TQuality quality = parser.getQualityVec()[i];
225  std::bitset<RPCConst::m_LOGPLANES_COUNT> qualBits(quality.m_FiredPlanes);
226  unsigned short firedPlanes = qualBits.to_ulong();
227 
228  insertQualityRecord(quality.m_QualityTabNumber, firedPlanes, quality.m_QualityValue);
229  }
230 
231  m_PatternsVec = parser.getPatternsVec(coneCrdnts);

References mps_fire::i, insertPatterns(), insertQualityRecord(), m_PatternsVec, writedatasetfile::parser, and qcdUeDQM_cfi::quality.

◆ insertPatterns()

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 176 of file RPCPacData.cc.

180  {
181  bool ignorePos = false;
182  if (tower == 99 || sector == 99 || segment == 99)
183  ignorePos = true;
184 
185  RPCConst rpcconst;
186 
187  for (RPCPattern::RPCPatVec::const_iterator patIt = patternsVec.begin(); patIt != patternsVec.end(); patIt++) {
188  if (!ignorePos &&
189  (patIt->getTower() != tower || patIt->getLogSector() != sector || patIt->getLogSegment() != segment))
190  continue;
191 
192  if (patIt->getPatternType() == RPCPattern::PAT_TYPE_T)
194  else if (patIt->getPatternType() == RPCPattern::PAT_TYPE_E) {
195  TEPatternsGroupList::iterator iEGroup;
196  for (iEGroup = m_EnergeticPatternsGroupList.begin(); iEGroup != m_EnergeticPatternsGroupList.end(); iEGroup++)
197  if (iEGroup->check(patIt))
198  break;
199  if (iEGroup == m_EnergeticPatternsGroupList.end()) {
200  TEPatternsGroup newEGroup(patIt);
201  newEGroup.setGroupDescription(
202  //"EGroup #"+ rpcconst.intToString(m_EnergeticPatternsGroupList.size())+
203  ", code: " + rpcconst.intToString(patIt->getCode()) + ", dir: " + rpcconst.intToString(patIt->getSign()) +
204  ", refGroup: " + rpcconst.intToString(patIt->getRefGroup()) +
205  ", qualityTabNumber: " + rpcconst.intToString(patIt->getQualityTabNumber()));
206  m_EnergeticPatternsGroupList.push_back(newEGroup);
207  } else
208  iEGroup->addPattern(patIt);
209  } else
210  throw RPCException("InsertPattern(): unsupported pattern type");
211  //edm::LogError("RPCTrigger") << "InsertPattern(): unsupported pattern type";
212  }
213 
214  if (!m_EnergeticPatternsGroupList.empty()) {
215  m_EnergeticPatternsGroupList.sort(); //to jest potrzebne, bo w run() przechodzi
216  //pierwszy paettern, ktory ma Maxymalna quality, wiec
217  //grupy musza byc
219  }

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

Referenced by init(), and RPCPacData().

◆ insertQualityRecord()

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 159 of file RPCPacData.cc.

160  {
161  if (quality > m_MaxQuality)
163  if (qualityTabNumber < m_QualityTabsVec.size()) {
164  m_QualityTabsVec[qualityTabNumber][firedPlanes] = quality;
165  } else if (qualityTabNumber == m_QualityTabsVec.size()) {
166  // XXX - added cast(int)
167 
168  //= new TQualityTab();
170  m_QualityTabsVec.push_back(qualityTab);
171  m_QualityTabsVec[qualityTabNumber][firedPlanes] = quality;
172  } else
173  throw RPCException("insertQualityRecord(): wrong qualityTabNumber");
174  //edm::LogError("RPCTrigger") << "insertQualityRecord(): wrong qualityTabNumber";

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

Referenced by init(), and RPCPacData().

Friends And Related Function Documentation

◆ RPCPac

friend class RPCPac
friend

Definition at line 34 of file RPCPacData.h.

Member Data Documentation

◆ m_EnergeticPatternsGroupList

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 getPatternsGroupDescription(), insertPatterns(), RPCPac::run(), and RPCPac::runEnergeticPatternsGroups().

◆ m_MaxQuality

short RPCPacData::m_MaxQuality
private

Definition at line 69 of file RPCPacData.h.

Referenced by insertQualityRecord().

◆ m_PatternsVec

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 init().

◆ m_QualityTabsVec

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().

◆ m_RefGroupCount

short RPCPacData::m_RefGroupCount
private

From pac file - TT_REF_GROUP_NUMBERS.

Definition at line 67 of file RPCPacData.h.

◆ m_TrackPatternsGroup

TTPatternsGroup RPCPacData::m_TrackPatternsGroup
private

Here patters used in "baseline" algorith are stored.

Definition at line 91 of file RPCPacData.h.

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

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
RPCLogCone::getLogStripState
bool getLogStripState(int logPlane, unsigned int logStripNum) const
Definition: RPCLogCone.cc:183
L1RPCConfig_cff.rpcconf
rpcconf
Definition: L1RPCConfig_cff.py:3
RPCConst::intToString
std::string intToString(int number)
Converts inteager number to string.
Definition: RPCConst.cc:264
RPCPacData::insertQualityRecord
void insertQualityRecord(unsigned int qualityTabNumber, unsigned short firedPlanes, short quality)
Definition: RPCPacData.cc:159
mps_fire.i
i
Definition: mps_fire.py:355
RPCPacData::m_EnergeticPatternsGroupList
TEPatternsGroupList m_EnergeticPatternsGroupList
Definition: RPCPacData.h:88
RPCConst::l1RpcConeCrdnts::m_Tower
int m_Tower
Definition: RPCConst.h:119
TPatternsGroup::addPattern
void addPattern(const RPCPattern::RPCPatVec::const_iterator &pattern)
Definition: TPatternsGroup.cc:19
RPCPacData::m_MaxQuality
short m_MaxQuality
Definition: RPCPacData.h:69
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
RPCPattern::PAT_TYPE_E
static const TPatternType PAT_TYPE_E
Definition: RPCPattern.h:56
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
TPatternsGroup::setGroupDescription
void setGroupDescription(std::string groupDescription)
Definition: TPatternsGroup.cc:29
RPCPattern::TQuality
Definition: RPCPattern.h:38
TPatternsGroup::getGroupDescription
std::string getGroupDescription() const
Definition: TPatternsGroup.cc:31
RPCConst::l1RpcConeCrdnts
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:118
RPCPacData::insertPatterns
void insertPatterns(const RPCPattern::RPCPatVec &pattern, const int tower=99, const int sector=99, const int segment=99)
Definition: RPCPacData.cc:176
RPCConst::TQualityTab
std::vector< short > TQualityTab
Definition: RPCConst.h:113
TPatternsGroup::m_GroupShape
RPCLogCone m_GroupShape
Definition: TPatternsGroup.h:48
RPCPatternsParser
Definition: RPCPatternsParser.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCConst::l1RpcConeCrdnts::m_LogSegment
int m_LogSegment
Definition: RPCConst.h:121
RPCException
Definition: RPCException.h:21
RPCPacData::init
void init(const RPCPatternsParser &parser, const RPCConst::l1RpcConeCrdnts &coneCrdnts)
Definition: RPCPacData.cc:221
RPCPacData::m_TrackPatternsGroup
TTPatternsGroup m_TrackPatternsGroup
Here patters used in "baseline" algorith are stored.
Definition: RPCPacData.h:91
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
RPCPacData::m_QualityTabsVec
RPCConst::TQualityTabsVec m_QualityTabsVec
Definition: RPCPacData.h:84
RPCPattern::PAT_TYPE_T
static const TPatternType PAT_TYPE_T
Definition: RPCPattern.h:55
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
RPCConst::m_LOGPLANES_COUNT
static const int m_LOGPLANES_COUNT
Max Logic Planes Count in trigger towers.
Definition: RPCConst.h:45
RPCConst::l1RpcConeCrdnts::m_LogSector
int m_LogSector
Definition: RPCConst.h:120
RPCConst
Definition: RPCConst.h:23
TEPatternsGroup
Group of paterns for "improved"("energetic") algorithm. In current implementation all patterns in giv...
Definition: TEPatternsGroup.h:23
RPCPacData::m_PatternsVec
RPCPattern::RPCPatVec m_PatternsVec
Definition: RPCPacData.h:74