CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Friends
L1TUtmTriggerMenu Class Reference

#include <L1TUtmTriggerMenu.h>

Public Member Functions

const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap () const
 
const std::string & getComment () const
 
const std::map< std::string, L1TUtmCondition > & getConditionMap () const
 
const std::string & getDatetime () const
 
const std::string & getFirmwareUuid () const
 
const unsigned long getFirmwareUuidHashed () const
 
const std::string & getName () const
 
const unsigned int getNmodules () const
 
const std::map< std::string, L1TUtmScale > & getScaleMap () const
 
const std::string & getScaleSetName () const
 
const std::string & getVersion () const
 
 L1TUtmTriggerMenu ()
 
 L1TUtmTriggerMenu (std::map< std::string, L1TUtmAlgorithm > algorithm_map, std::map< std::string, L1TUtmCondition > condition_map, std::map< std::string, L1TUtmScale > scale_map, std::string name, std::string ver_s, std::string comment, std::string datetime, std::string uuid_firmware, std::string scale_set_name, unsigned int n_modules, unsigned int ver_i)
 
 L1TUtmTriggerMenu (const tmeventsetup::esTriggerMenu &esMenu)
 
void setComment (const std::string &value)
 
void setDatetime (const std::string &value)
 
void setFirmwareUuid (const std::string &value)
 
void setName (const std::string &value)
 
void setNmodules (const unsigned int value)
 
void setScaleSetName (const std::string &value)
 
void setVersion (const std::string &value)
 
virtual ~L1TUtmTriggerMenu ()=default
 

Static Public Member Functions

static unsigned long murmurHashNeutral2 (const void *key, int len, unsigned int seed)
 

Protected Attributes

std::map< std::string, L1TUtmAlgorithmalgorithm_map_
 
std::string comment_
 
std::map< std::string, L1TUtmConditioncondition_map_
 
std::string datetime_
 
std::map< std::string, unsigned int > external_map_
 
unsigned int n_modules_
 
std::string name_
 
std::map< std::string, L1TUtmScalescale_map_
 
std::string scale_set_name_
 
std::map< std::string, std::string > token_to_condition_
 
std::string uuid_firmware_
 
unsigned int version
 
std::string version_
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Author
Bernhard Arnold Takashi Matsushita
Date
: 2015-03-12 This class implements data structure for TriggerMenu

Definition at line 27 of file L1TUtmTriggerMenu.h.

Constructor & Destructor Documentation

◆ L1TUtmTriggerMenu() [1/3]

L1TUtmTriggerMenu::L1TUtmTriggerMenu ( )
inline

Definition at line 29 of file L1TUtmTriggerMenu.h.

30  : algorithm_map_(),
32  scale_map_(),
33  external_map_(),
35  name_(),
36  version_(),
37  comment_(),
38  datetime_(),
41  n_modules_(),
42  version(0){};
std::map< std::string, L1TUtmAlgorithm > algorithm_map_
std::string uuid_firmware_
std::map< std::string, std::string > token_to_condition_
std::string scale_set_name_
std::map< std::string, unsigned int > external_map_
std::map< std::string, L1TUtmCondition > condition_map_
unsigned int n_modules_
std::map< std::string, L1TUtmScale > scale_map_

◆ L1TUtmTriggerMenu() [2/3]

L1TUtmTriggerMenu::L1TUtmTriggerMenu ( std::map< std::string, L1TUtmAlgorithm algorithm_map,
std::map< std::string, L1TUtmCondition condition_map,
std::map< std::string, L1TUtmScale scale_map,
std::string  name,
std::string  ver_s,
std::string  comment,
std::string  datetime,
std::string  uuid_firmware,
std::string  scale_set_name,
unsigned int  n_modules,
unsigned int  ver_i 
)
inline

Definition at line 43 of file L1TUtmTriggerMenu.h.

54  : algorithm_map_(algorithm_map),
55  condition_map_(condition_map),
56  scale_map_(scale_map),
57  external_map_(),
59  name_(name),
60  version_(ver_s),
61  comment_(comment),
62  datetime_(datetime),
63  uuid_firmware_(uuid_firmware),
64  scale_set_name_(scale_set_name),
65  n_modules_(n_modules),
66  version(ver_i){};
std::map< std::string, L1TUtmAlgorithm > algorithm_map_
std::string uuid_firmware_
std::map< std::string, std::string > token_to_condition_
std::string scale_set_name_
std::map< std::string, unsigned int > external_map_
std::map< std::string, L1TUtmCondition > condition_map_
unsigned int n_modules_
std::map< std::string, L1TUtmScale > scale_map_

◆ L1TUtmTriggerMenu() [3/3]

L1TUtmTriggerMenu::L1TUtmTriggerMenu ( const tmeventsetup::esTriggerMenu &  esMenu)
inline

Definition at line 68 of file L1TUtmTriggerMenu.h.

References algorithm_map_, condition_map_, and scale_map_.

69  : external_map_(), //These are null to my best knowledge
70  token_to_condition_(), //These are null to my best knowledge
71  name_(esMenu.getName()),
72  version_(esMenu.getVersion()),
73  comment_(esMenu.getComment()),
74  datetime_(esMenu.getDatetime()),
75  uuid_firmware_(esMenu.getFirmwareUuid()),
76  scale_set_name_(esMenu.getScaleSetName()),
77  n_modules_(esMenu.getNmodules()),
78  version(0) {
79  for (const auto& it : esMenu.getAlgorithmMap())
80  algorithm_map_.emplace(std::make_pair(it.first, L1TUtmAlgorithm(it.second)));
81  for (const auto& it : esMenu.getConditionMap())
82  condition_map_.emplace(std::make_pair(it.first, L1TUtmCondition(it.second)));
83  for (const auto& it : esMenu.getScaleMap())
84  scale_map_.emplace(std::make_pair(it.first, L1TUtmScale(it.second)));
85  };
std::map< std::string, L1TUtmAlgorithm > algorithm_map_
std::string uuid_firmware_
std::map< std::string, std::string > token_to_condition_
std::string scale_set_name_
std::map< std::string, unsigned int > external_map_
std::map< std::string, L1TUtmCondition > condition_map_
unsigned int n_modules_
std::map< std::string, L1TUtmScale > scale_map_

◆ ~L1TUtmTriggerMenu()

virtual L1TUtmTriggerMenu::~L1TUtmTriggerMenu ( )
virtualdefault

Member Function Documentation

◆ getAlgorithmMap()

const std::map<std::string, L1TUtmAlgorithm>& L1TUtmTriggerMenu::getAlgorithmMap ( ) const
inline

get algorithm_map_

Returns
reference of algorithm_map_

Definition at line 93 of file L1TUtmTriggerMenu.h.

References algorithm_map_.

Referenced by L1TUtmTriggerMenuDumper::beginRun(), and l1t::TriggerMenuParser::parseCondFormats().

93 { return algorithm_map_; };
std::map< std::string, L1TUtmAlgorithm > algorithm_map_

◆ getComment()

const std::string& L1TUtmTriggerMenu::getComment ( ) const
inline

get comment on the menu

Returns
comment

Definition at line 123 of file L1TUtmTriggerMenu.h.

References comment_.

Referenced by l1t::L1TGlobalUtil::gtTriggerMenuComment(), and l1t::TriggerMenuParser::parseCondFormats().

123 { return comment_; };

◆ getConditionMap()

const std::map<std::string, L1TUtmCondition>& L1TUtmTriggerMenu::getConditionMap ( ) const
inline

get condition_map_

Returns
reference of condition_map_

Definition at line 99 of file L1TUtmTriggerMenu.h.

References condition_map_.

Referenced by L1TUtmTriggerMenuDumper::beginRun(), l1t::TriggerMenuParser::getExternalSignals(), and l1t::TriggerMenuParser::parseCondFormats().

99 { return condition_map_; };
std::map< std::string, L1TUtmCondition > condition_map_

◆ getDatetime()

const std::string& L1TUtmTriggerMenu::getDatetime ( ) const
inline

get datetime of the menu

Returns
datetime

Definition at line 129 of file L1TUtmTriggerMenu.h.

References datetime_.

Referenced by l1t::TriggerMenuParser::parseCondFormats().

129 { return datetime_; };

◆ getFirmwareUuid()

const std::string& L1TUtmTriggerMenu::getFirmwareUuid ( ) const
inline

get UUID of firmware generated by VHDL producer

Returns
UUID

Definition at line 135 of file L1TUtmTriggerMenu.h.

References uuid_firmware_.

Referenced by getFirmwareUuidHashed(), and l1t::TriggerMenuParser::parseCondFormats().

135 { return uuid_firmware_; };
std::string uuid_firmware_

◆ getFirmwareUuidHashed()

const unsigned long L1TUtmTriggerMenu::getFirmwareUuidHashed ( ) const

gets the hash of the L1 firmware

Returns
the hash identifying the L1 firmware

Definition at line 5 of file L1TUtmTriggerMenu.cc.

References getFirmwareUuid(), crabWrapper::key, murmurHashNeutral2(), and fileCollector::seed.

Referenced by L1TGlobalProducer::produce().

5  {
6  const void* key = getFirmwareUuid().c_str();
7  int len = getFirmwareUuid().size();
8  unsigned int seed = 3735927486;
9  return murmurHashNeutral2(key, len, seed);
10 }
static unsigned long murmurHashNeutral2(const void *key, int len, unsigned int seed)
const std::string & getFirmwareUuid() const

◆ getName()

const std::string& L1TUtmTriggerMenu::getName ( ) const
inline

get menu name

Returns
name of the menu

Definition at line 111 of file L1TUtmTriggerMenu.h.

References name_.

Referenced by plotting.Plot::draw(), l1t::L1TGlobalUtil::gtTriggerMenuName(), and l1t::TriggerMenuParser::parseCondFormats().

111 { return name_; };

◆ getNmodules()

const unsigned int L1TUtmTriggerMenu::getNmodules ( ) const
inline

get number of uGT boards for the menu

Returns
number of uGT boards

Definition at line 153 of file L1TUtmTriggerMenu.h.

References n_modules_.

153 { return n_modules_; };
unsigned int n_modules_

◆ getScaleMap()

const std::map<std::string, L1TUtmScale>& L1TUtmTriggerMenu::getScaleMap ( ) const
inline

get scale_map_

Returns
reference of scale_map_

Definition at line 105 of file L1TUtmTriggerMenu.h.

References scale_map_.

Referenced by L1TUtmTriggerMenuDumper::beginRun(), and l1t::TriggerMenuParser::parseCondFormats().

105 { return scale_map_; };
std::map< std::string, L1TUtmScale > scale_map_

◆ getScaleSetName()

const std::string& L1TUtmTriggerMenu::getScaleSetName ( ) const
inline

get scale set name

Returns
scale set name

Definition at line 147 of file L1TUtmTriggerMenu.h.

References scale_set_name_.

Referenced by l1t::TriggerMenuParser::parseCondFormats().

147 { return scale_set_name_; };
std::string scale_set_name_

◆ getVersion()

const std::string& L1TUtmTriggerMenu::getVersion ( ) const
inline

get grammar version

Returns
grammar version

Definition at line 117 of file L1TUtmTriggerMenu.h.

References version_.

Referenced by l1t::L1TGlobalUtil::gtTriggerMenuVersion(), and l1t::TriggerMenuParser::parseCondFormats().

117 { return version_; };

◆ murmurHashNeutral2()

unsigned long L1TUtmTriggerMenu::murmurHashNeutral2 ( const void *  key,
int  len,
unsigned int  seed 
)
static

hash computation function

Returns
computed hash

Definition at line 13 of file L1TUtmTriggerMenu.cc.

References data, h, dqmdumpme::k, crabWrapper::key, visualization-live-secondInstance_cfg::m, alignCSCRings::r, and fileCollector::seed.

Referenced by getFirmwareUuidHashed().

13  {
14  // 'm' and 'r' are mixing constants generated offline.
15  // They're not really 'magic', they just happen to work well.
16 
17  const unsigned int m = 0x5bd1e995;
18  const int r = 24;
19 
20  // Initialize the hash to a 'random' value
21 
22  unsigned int h = seed ^ len;
23 
24  // Mix 4 bytes at a time into the hash
25 
26  const unsigned char* data = (const unsigned char*)key;
27 
28  while (len >= 4) {
29  unsigned int k;
30 
31  k = data[0];
32  k |= data[1] << 8;
33  k |= data[2] << 16;
34  k |= data[3] << 24;
35 
36  k *= m;
37  k ^= k >> r;
38  k *= m;
39 
40  h *= m;
41  h ^= k;
42 
43  data += 4;
44  len -= 4;
45  }
46 
47  // Handle the last few bytes of the input array
48 
49  switch (len) {
50  case 3:
51  h ^= data[2] << 16;
52  [[fallthrough]];
53  case 2:
54  h ^= data[1] << 8;
55  [[fallthrough]];
56  case 1:
57  h ^= data[0];
58  h *= m;
59  };
60 
61  // Do a few final mixes of the hash to ensure the last few
62  // bytes are well-incorporated.
63 
64  h ^= h >> 13;
65  h *= m;
66  h ^= h >> 15;
67 
68  return h;
69 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ serialize()

template<class Archive >
void L1TUtmTriggerMenu::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setComment()

void L1TUtmTriggerMenu::setComment ( const std::string &  value)
inline

set comment on the menu

Parameters
value[in] comment

Definition at line 171 of file L1TUtmTriggerMenu.h.

References comment_, and relativeConstraints::value.

Referenced by ConfigToolBase.ConfigToolBase::apply().

◆ setDatetime()

void L1TUtmTriggerMenu::setDatetime ( const std::string &  value)
inline

set datetime of the menu

Parameters
value[in] datetime

Definition at line 177 of file L1TUtmTriggerMenu.h.

References datetime_, and relativeConstraints::value.

◆ setFirmwareUuid()

void L1TUtmTriggerMenu::setFirmwareUuid ( const std::string &  value)
inline

set UUID of firmware generated by VHDL producer

Parameters
value[in] UUID

Definition at line 183 of file L1TUtmTriggerMenu.h.

References uuid_firmware_, and relativeConstraints::value.

◆ setName()

void L1TUtmTriggerMenu::setName ( const std::string &  value)
inline

set menu name

Parameters
value[in] name of the menu

Definition at line 159 of file L1TUtmTriggerMenu.h.

References name_, and relativeConstraints::value.

◆ setNmodules()

void L1TUtmTriggerMenu::setNmodules ( const unsigned int  value)
inline

set number of uGT boards for the menu

Parameters
value[in] number of uGT boards

Definition at line 195 of file L1TUtmTriggerMenu.h.

References n_modules_, and relativeConstraints::value.

◆ setScaleSetName()

void L1TUtmTriggerMenu::setScaleSetName ( const std::string &  value)
inline

set scale set name

Parameters
value[in] scale set name

Definition at line 189 of file L1TUtmTriggerMenu.h.

References scale_set_name_, and relativeConstraints::value.

◆ setVersion()

void L1TUtmTriggerMenu::setVersion ( const std::string &  value)
inline

set grammar version

Parameters
value[in] grammar version

Definition at line 165 of file L1TUtmTriggerMenu.h.

References relativeConstraints::value, and version_.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 218 of file L1TUtmTriggerMenu.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 218 of file L1TUtmTriggerMenu.h.

Member Data Documentation

◆ algorithm_map_

std::map<std::string, L1TUtmAlgorithm> L1TUtmTriggerMenu::algorithm_map_
protected

map of algorithm <algorithm name, L1TUtmAlgorithm>

Definition at line 204 of file L1TUtmTriggerMenu.h.

Referenced by getAlgorithmMap(), and L1TUtmTriggerMenu().

◆ comment_

std::string L1TUtmTriggerMenu::comment_
protected

comment on the menu

Definition at line 212 of file L1TUtmTriggerMenu.h.

Referenced by getComment(), and setComment().

◆ condition_map_

std::map<std::string, L1TUtmCondition> L1TUtmTriggerMenu::condition_map_
protected

map of condition <condition name, L1TUtmCondition>

Definition at line 205 of file L1TUtmTriggerMenu.h.

Referenced by getConditionMap(), and L1TUtmTriggerMenu().

◆ datetime_

std::string L1TUtmTriggerMenu::datetime_
protected

datetime of the menu

Definition at line 213 of file L1TUtmTriggerMenu.h.

Referenced by getDatetime(), and setDatetime().

◆ external_map_

std::map<std::string, unsigned int> L1TUtmTriggerMenu::external_map_
protected

map of external <external name, channel id>

Definition at line 207 of file L1TUtmTriggerMenu.h.

◆ n_modules_

unsigned int L1TUtmTriggerMenu::n_modules_
protected

number of uGT boards for the menu

Definition at line 216 of file L1TUtmTriggerMenu.h.

Referenced by getNmodules(), and setNmodules().

◆ name_

std::string L1TUtmTriggerMenu::name_
protected

name of the menu

Definition at line 210 of file L1TUtmTriggerMenu.h.

Referenced by getName(), and setName().

◆ scale_map_

std::map<std::string, L1TUtmScale> L1TUtmTriggerMenu::scale_map_
protected

map of scale <scale name, L1TUtmScale*>

Definition at line 206 of file L1TUtmTriggerMenu.h.

Referenced by getScaleMap(), and L1TUtmTriggerMenu().

◆ scale_set_name_

std::string L1TUtmTriggerMenu::scale_set_name_
protected

scale set name

Definition at line 215 of file L1TUtmTriggerMenu.h.

Referenced by getScaleSetName(), and setScaleSetName().

◆ token_to_condition_

std::map<std::string, std::string> L1TUtmTriggerMenu::token_to_condition_
protected

look-up table for translating expression in grammar to expression in condition

Definition at line 209 of file L1TUtmTriggerMenu.h.

◆ uuid_firmware_

std::string L1TUtmTriggerMenu::uuid_firmware_
protected

uuid of firmware

Definition at line 214 of file L1TUtmTriggerMenu.h.

Referenced by getFirmwareUuid(), and setFirmwareUuid().

◆ version

unsigned int L1TUtmTriggerMenu::version
protected

◆ version_

std::string L1TUtmTriggerMenu::version_
protected

menu grammar version

Definition at line 211 of file L1TUtmTriggerMenu.h.

Referenced by getVersion(), and setVersion().