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 ()
 
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 25 of file L1TUtmTriggerMenu.h.

Constructor & Destructor Documentation

◆ L1TUtmTriggerMenu()

L1TUtmTriggerMenu::L1TUtmTriggerMenu ( )
inline

Definition at line 27 of file L1TUtmTriggerMenu.h.

28  : algorithm_map_(),
30  scale_map_(),
31  external_map_(),
33  name_(),
34  version_(),
35  comment_(),
36  datetime_(),
39  n_modules_(),
40  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()

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 48 of file L1TUtmTriggerMenu.h.

References algorithm_map_.

48 { 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 78 of file L1TUtmTriggerMenu.h.

References comment_.

Referenced by l1t::L1TGlobalUtil::gtTriggerMenuComment().

78 { return comment_; };

◆ getConditionMap()

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

get condition_map_

Returns
reference of condition_map_

Definition at line 54 of file L1TUtmTriggerMenu.h.

References condition_map_.

54 { 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 84 of file L1TUtmTriggerMenu.h.

References datetime_.

84 { return datetime_; };

◆ getFirmwareUuid()

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

get UUID of firmware generated by VHDL producer

Returns
UUID

Definition at line 90 of file L1TUtmTriggerMenu.h.

References uuid_firmware_.

Referenced by getFirmwareUuidHashed().

90 { 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 66 of file L1TUtmTriggerMenu.h.

References name_.

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

66 { 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 108 of file L1TUtmTriggerMenu.h.

References n_modules_.

108 { 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 60 of file L1TUtmTriggerMenu.h.

References scale_map_.

60 { 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 102 of file L1TUtmTriggerMenu.h.

References scale_set_name_.

102 { 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 72 of file L1TUtmTriggerMenu.h.

References version_.

Referenced by l1t::L1TGlobalUtil::gtTriggerMenuVersion().

72 { 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:79
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 126 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 132 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 138 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 114 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 150 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 144 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 120 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 173 of file L1TUtmTriggerMenu.h.

◆ cond::serialization::access

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

Definition at line 173 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 159 of file L1TUtmTriggerMenu.h.

Referenced by getAlgorithmMap().

◆ comment_

std::string L1TUtmTriggerMenu::comment_
protected

comment on the menu

Definition at line 167 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 160 of file L1TUtmTriggerMenu.h.

Referenced by getConditionMap().

◆ datetime_

std::string L1TUtmTriggerMenu::datetime_
protected

datetime of the menu

Definition at line 168 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 162 of file L1TUtmTriggerMenu.h.

◆ n_modules_

unsigned int L1TUtmTriggerMenu::n_modules_
protected

number of uGT boards for the menu

Definition at line 171 of file L1TUtmTriggerMenu.h.

Referenced by getNmodules(), and setNmodules().

◆ name_

std::string L1TUtmTriggerMenu::name_
protected

name of the menu

Definition at line 165 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 161 of file L1TUtmTriggerMenu.h.

Referenced by getScaleMap().

◆ scale_set_name_

std::string L1TUtmTriggerMenu::scale_set_name_
protected

scale set name

Definition at line 170 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 164 of file L1TUtmTriggerMenu.h.

◆ uuid_firmware_

std::string L1TUtmTriggerMenu::uuid_firmware_
protected

uuid of firmware

Definition at line 169 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 166 of file L1TUtmTriggerMenu.h.

Referenced by getVersion(), and setVersion().