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 Attributes
L1GtPatternLine Class Reference

#include <L1GtPatternLine.h>

Public Member Functions

boost::uint32_t get (const std::string &name) const
 
bool has (const std::string &colname) const
 
std::string name (const std::string &prefix, unsigned int i) const
 
std::string nextName (const std::string &prefix)
 
void print (std::ostream &out) const
 
void push (const std::string &prefix, boost::uint32_t value)
 
void set (const std::string &name, boost::uint32_t value)
 

Private Types

typedef std::map< std::string,
boost::uint32_t > 
ColumnMap
 

Private Attributes

ColumnMap m_columns
 

Detailed Description

A class representing the contents of one line in a pattern file. The contents are represented as (name, value) pairs. Column ids are also enumerated so that multiple columns with identical names end up with consecutive names ("muon" becomes "muon1", "muon2" etc).

Description: A representation of a of pattern file line for L1 GT hardware testing.

Implementation: <TODO: enter implementation details>

Author
: Thomas Themel - HEPHY Vienna

Description: see header file.

Implementation: <TODO: enter implementation details>

Author
: Thomas Themel - HEPHY Vienna

Definition at line 28 of file L1GtPatternLine.h.

Member Typedef Documentation

typedef std::map<std::string, boost::uint32_t> L1GtPatternLine::ColumnMap
private

Definition at line 63 of file L1GtPatternLine.h.

Member Function Documentation

uint32_t L1GtPatternLine::get ( const std::string &  name) const

Accessor.

See Also
has

Definition at line 77 of file L1GtPatternLine.cc.

References m_columns.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), and L1GtPatternWriter::writePatternLine().

77  {
78  ColumnMap::const_iterator it = m_columns.find(name);
79  if(it != m_columns.end()) {
80  return it->second;
81  }
82  return 0;
83 }
std::string name(const std::string &prefix, unsigned int i) const
ColumnMap m_columns
bool L1GtPatternLine::has ( const std::string &  colname) const

Returns true iff a column of the given name exists.

Parameters
colnameColumn name to look for. Beware: This has to include the number appended by push!

Definition at line 56 of file L1GtPatternLine.cc.

References m_columns.

Referenced by nextName(), and L1GtPatternWriter::writePatternLine().

56  {
57  return m_columns.find(colname) != m_columns.end();
58 }
ColumnMap m_columns
std::string L1GtPatternLine::name ( const std::string &  prefix,
unsigned int  i 
) const

Forms a column name from a prefix and a number.

Definition at line 71 of file L1GtPatternLine.cc.

References i, and contentValuesCheck::ss.

Referenced by cuy.divideElement::__init__(), cuy.plotElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), config.CFG::__str__(), and nextName().

71  {
72  std::ostringstream ss;
73  ss << prefix << i;
74  return ss.str();
75 }
int i
Definition: DBlmapReader.cc:9
std::string L1GtPatternLine::nextName ( const std::string &  prefix)

Returns the next free column name for a given prefix.

Definition at line 60 of file L1GtPatternLine.cc.

References has(), i, name(), query::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by push().

60  {
61  int i = 1 ;
63  do
64  {
65  result = name(prefix, i++);
66  } while(has(result));
67 
68  return result;
69 }
int i
Definition: DBlmapReader.cc:9
bool has(const std::string &colname) const
tuple result
Definition: query.py:137
std::string name(const std::string &prefix, unsigned int i) const
void L1GtPatternLine::print ( std::ostream &  out) const

Debug dump of contents

Definition at line 47 of file L1GtPatternLine.cc.

References m_columns.

47  {
48  out << "BEGIN Columns: " << std::endl ;
49  for(L1GtPatternLine::ColumnMap::const_iterator it = m_columns.begin();
50  it != m_columns.end() ; ++it) {
51  out << it->first << ": " << std::hex << it->second << std::endl;
52  }
53  out << "END Columns." << std::endl ;
54 }
tuple out
Definition: dbtoconf.py:99
ColumnMap m_columns
void L1GtPatternLine::push ( const std::string &  prefix,
boost::uint32_t  value 
)

Add a new column with the specified name prefix and value.

Parameters
prefixThe name prefix of the new column. The final column name consists of prefix + the lowest free number (starting at 1)
valueThe actual data content of the column.

Definition at line 25 of file L1GtPatternLine.cc.

References m_columns, nextName(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by L1GtPatternGenerator::extractGlobalTriggerData(), extractGlobalTriggerWord(), and extractRecordData().

25  {
26  std::string colName = nextName(prefix);
27  // add three values for each column - the full 32bit value,
28  // one for the lower 16 bits and one for the higher 16 bits.
29  m_columns[colName] = value;
30  m_columns[colName + "_h"] = value >> 16;
31  m_columns[colName + "_l"] = value & 0xFFFF;
32 }
std::string nextName(const std::string &prefix)
ColumnMap m_columns
void L1GtPatternLine::set ( const std::string &  name,
boost::uint32_t  value 
)

Manipulate an existing value.

Parameters
namethe name (prefix + no) of the column to set. Do not use _h or _l values here!
valuethe new value for the column.

Definition at line 34 of file L1GtPatternLine.cc.

References edm::hlt::Exception, m_columns, and relativeConstraints::value.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

34  {
35  ColumnMap::iterator it = m_columns.find(name);
36  if(it == m_columns.end()) {
37  throw cms::Exception(__func__) << "Can't set field "
38  << name << " to " << std::hex << value
39  << ": not found";
40  }
41 
42  it->second = value;
43  m_columns[name + "_h"] = value >> 16;
44  m_columns[name + "_l"] = value & 0xFFFF;
45 }
std::string name(const std::string &prefix, unsigned int i) const
ColumnMap m_columns

Member Data Documentation

ColumnMap L1GtPatternLine::m_columns
private

Definition at line 64 of file L1GtPatternLine.h.

Referenced by get(), has(), print(), push(), and set().