CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::PhysicsToBitConverter Class Reference

#include <PhysicsToBitConverter.h>

Public Member Functions

int BuildDecimalValue (int firstbit, int bitlength, int linkid)
 
void Convert ()
 
void Extract32bitwords ()
 
int Get32bitWordLinkEven (int index)
 
int Get32bitWordLinkOdd (int index)
 
int GetHFEt (int region)
 
int GetHFFg (int region)
 
int GetIECard (int cand)
 
int GetIEEt (int cand)
 
int GetIEReg (int cand)
 
int GetNECard (int cand)
 
int GetNEEt (int cand)
 
int GetNEReg (int cand)
 
int GetObject (rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
 
int GetRCEt (int card, int region)
 
int GetRCHad (int card, int region)
 
int GetRCOf (int card, int region)
 
int GetRCTau (int card, int region)
 
 PhysicsToBitConverter ()
 
int ReadBitInInt (int bit, int value)
 
void Set32bitWordLinkEven (int index, uint32_t value)
 
void Set32bitWordLinkOdd (int index, uint32_t value)
 
void SetHFEt (int value, int region)
 
void SetHFFg (int value, int region)
 
void SetIECard (int value, int cand)
 
void SetIEEt (int value, int cand)
 
void SetIEReg (int value, int cand)
 
void SetNECard (int value, int cand)
 
void SetNEEt (int value, int cand)
 
void SetNEReg (int value, int cand)
 
void SetObject (rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)
 
void SetRCEt (int value, int card, int region)
 
void SetRCHad (int value, int card, int region)
 
void SetRCOf (int value, int card, int region)
 
void SetRCTau (int value, int card, int region)
 
 ~PhysicsToBitConverter ()
 

Private Attributes

int bitsLink [2][192]
 
rctDataBase databaseobject
 
int words32bitLink [2][6]
 

Detailed Description

Definition at line 21 of file PhysicsToBitConverter.h.

Constructor & Destructor Documentation

◆ PhysicsToBitConverter()

l1t::PhysicsToBitConverter::PhysicsToBitConverter ( )

Definition at line 4 of file PhysicsToBitConverter.cc.

4  {
5  for (int m = 0; m < 2; m++) {
6  for (int n = 0; n < 6; n++) {
7  words32bitLink[m][n] = 0;
8  }
9  }
10  for (int m = 0; m < 2; m++) {
11  for (int n = 0; n < 192; n++) {
12  bitsLink[m][n] = 0;
13  }
14  }
15  }

References bitsLink, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, and words32bitLink.

◆ ~PhysicsToBitConverter()

l1t::PhysicsToBitConverter::~PhysicsToBitConverter ( )
inline

Definition at line 29 of file PhysicsToBitConverter.h.

29 {}

Member Function Documentation

◆ BuildDecimalValue()

int l1t::PhysicsToBitConverter::BuildDecimalValue ( int  firstbit,
int  bitlength,
int  linkid 
)

Definition at line 62 of file PhysicsToBitConverter.cc.

62  {
63  int myvalue = 0;
64  int counter = 0;
65 
66  for (int m = firstbit; m < firstbit + bitlength; m++) {
67  myvalue |= (bitsLink[linkid][m] & (0x1)) << counter;
68  counter++;
69  }
70  return myvalue;
71  }

References bitsLink, counter, and visualization-live-secondInstance_cfg::m.

Referenced by Extract32bitwords(), and GetObject().

◆ Convert()

void l1t::PhysicsToBitConverter::Convert ( )

Definition at line 17 of file PhysicsToBitConverter.cc.

17  {
18  for (int iword = 0; iword < 6; iword++) {
19  for (int ibit = 0; ibit < 32; ibit++) {
20  //bitsLink[0].push_back(ReadBitInInt(ibit,words32bitLink[0][iword]));
21  //bitsLink[1].push_back(ReadBitInInt(ibit,words32bitLink[1][iword]));
22  bitsLink[0][ibit + iword * 32] = ReadBitInInt(ibit, words32bitLink[0][iword]);
23  bitsLink[1][ibit + iword * 32] = ReadBitInInt(ibit, words32bitLink[1][iword]);
24  }
25  }
26  }

References bitsLink, ReadBitInInt(), and words32bitLink.

◆ Extract32bitwords()

void l1t::PhysicsToBitConverter::Extract32bitwords ( )

Definition at line 28 of file PhysicsToBitConverter.cc.

28  {
29  //link,words
30 
31  for (int ilink = 0; ilink < 2; ilink++) {
32  for (int iword = 0; iword < 6; iword++) {
33  words32bitLink[ilink][iword] = BuildDecimalValue(iword * 32, 32, ilink);
34  }
35  }
36  }

References BuildDecimalValue(), and words32bitLink.

◆ Get32bitWordLinkEven()

int l1t::PhysicsToBitConverter::Get32bitWordLinkEven ( int  index)
inline

Definition at line 33 of file PhysicsToBitConverter.h.

33 { return words32bitLink[0][index]; };

References words32bitLink.

◆ Get32bitWordLinkOdd()

int l1t::PhysicsToBitConverter::Get32bitWordLinkOdd ( int  index)
inline

Definition at line 34 of file PhysicsToBitConverter.h.

34 { return words32bitLink[1][index]; };

References words32bitLink.

◆ GetHFEt()

int l1t::PhysicsToBitConverter::GetHFEt ( int  region)
inline

◆ GetHFFg()

int l1t::PhysicsToBitConverter::GetHFFg ( int  region)
inline

◆ GetIECard()

int l1t::PhysicsToBitConverter::GetIECard ( int  cand)
inline

Definition at line 54 of file PhysicsToBitConverter.h.

References GetObject(), and l1t::rctDataBase::IECard.

◆ GetIEEt()

int l1t::PhysicsToBitConverter::GetIEEt ( int  cand)
inline

Definition at line 55 of file PhysicsToBitConverter.h.

55 { return GetObject(rctDataBase::IEEt, cand); }

References GetObject(), and l1t::rctDataBase::IEEt.

◆ GetIEReg()

int l1t::PhysicsToBitConverter::GetIEReg ( int  cand)
inline

Definition at line 53 of file PhysicsToBitConverter.h.

53 { return GetObject(rctDataBase::IEReg, cand); }

References GetObject(), and l1t::rctDataBase::IEReg.

◆ GetNECard()

int l1t::PhysicsToBitConverter::GetNECard ( int  cand)
inline

Definition at line 51 of file PhysicsToBitConverter.h.

References GetObject(), and l1t::rctDataBase::NECard.

◆ GetNEEt()

int l1t::PhysicsToBitConverter::GetNEEt ( int  cand)
inline

Definition at line 52 of file PhysicsToBitConverter.h.

52 { return GetObject(rctDataBase::NEEt, cand); }

References GetObject(), and l1t::rctDataBase::NEEt.

◆ GetNEReg()

int l1t::PhysicsToBitConverter::GetNEReg ( int  cand)
inline

Definition at line 50 of file PhysicsToBitConverter.h.

50 { return GetObject(rctDataBase::NEReg, cand); }

References GetObject(), and l1t::rctDataBase::NEReg.

◆ GetObject()

int l1t::PhysicsToBitConverter::GetObject ( rctDataBase::rctObjectType  t,
int  firstindex,
int  secondindex = -1 
)

◆ GetRCEt()

int l1t::PhysicsToBitConverter::GetRCEt ( int  card,
int  region 
)
inline

Definition at line 45 of file PhysicsToBitConverter.h.

45 { return GetObject(rctDataBase::RCEt, card, region); }

References GetObject(), l1t::rctDataBase::RCEt, and HLT_2018_cff::region.

◆ GetRCHad()

int l1t::PhysicsToBitConverter::GetRCHad ( int  card,
int  region 
)
inline

Definition at line 56 of file PhysicsToBitConverter.h.

56 { return GetObject(rctDataBase::RCHad, card, region); }

References GetObject(), l1t::rctDataBase::RCHad, and HLT_2018_cff::region.

◆ GetRCOf()

int l1t::PhysicsToBitConverter::GetRCOf ( int  card,
int  region 
)
inline

Definition at line 48 of file PhysicsToBitConverter.h.

48 { return GetObject(rctDataBase::RCOf, card, region); }

References GetObject(), l1t::rctDataBase::RCOf, and HLT_2018_cff::region.

◆ GetRCTau()

int l1t::PhysicsToBitConverter::GetRCTau ( int  card,
int  region 
)
inline

Definition at line 47 of file PhysicsToBitConverter.h.

47 { return GetObject(rctDataBase::RCTau, card, region); }

References GetObject(), l1t::rctDataBase::RCTau, and HLT_2018_cff::region.

◆ ReadBitInInt()

int l1t::PhysicsToBitConverter::ReadBitInInt ( int  bit,
int  value 
)

Definition at line 57 of file PhysicsToBitConverter.cc.

57  {
58  std::bitset<32> foo(value);
59  return foo[bit];
60  }

Referenced by Convert().

◆ Set32bitWordLinkEven()

void l1t::PhysicsToBitConverter::Set32bitWordLinkEven ( int  index,
uint32_t  value 
)
inline

Definition at line 30 of file PhysicsToBitConverter.h.

30 { words32bitLink[0][index] = value; };

References relativeConstraints::value, and words32bitLink.

◆ Set32bitWordLinkOdd()

void l1t::PhysicsToBitConverter::Set32bitWordLinkOdd ( int  index,
uint32_t  value 
)
inline

Definition at line 31 of file PhysicsToBitConverter.h.

31 { words32bitLink[1][index] = value; };

References relativeConstraints::value, and words32bitLink.

◆ SetHFEt()

void l1t::PhysicsToBitConverter::SetHFEt ( int  value,
int  region 
)
inline

◆ SetHFFg()

void l1t::PhysicsToBitConverter::SetHFFg ( int  value,
int  region 
)
inline

◆ SetIECard()

void l1t::PhysicsToBitConverter::SetIECard ( int  value,
int  cand 
)
inline

Definition at line 67 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::IECard, and SetObject().

◆ SetIEEt()

void l1t::PhysicsToBitConverter::SetIEEt ( int  value,
int  cand 
)
inline

Definition at line 68 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::IEEt, and SetObject().

◆ SetIEReg()

void l1t::PhysicsToBitConverter::SetIEReg ( int  value,
int  cand 
)
inline

Definition at line 66 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::IEReg, and SetObject().

◆ SetNECard()

void l1t::PhysicsToBitConverter::SetNECard ( int  value,
int  cand 
)
inline

Definition at line 64 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::NECard, and SetObject().

◆ SetNEEt()

void l1t::PhysicsToBitConverter::SetNEEt ( int  value,
int  cand 
)
inline

Definition at line 65 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::NEEt, and SetObject().

◆ SetNEReg()

void l1t::PhysicsToBitConverter::SetNEReg ( int  value,
int  cand 
)
inline

Definition at line 63 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::NEReg, and SetObject().

◆ SetObject()

void l1t::PhysicsToBitConverter::SetObject ( rctDataBase::rctObjectType  t,
int  value,
int  firstindex,
int  secondindex = -1 
)

Definition at line 46 of file PhysicsToBitConverter.cc.

46  {
47  int mystart = databaseobject.GetIndices(t, firstindex, secondindex);
48  int mylength = databaseobject.GetLength(t);
49  int mylink = databaseobject.GetLink(t);
50 
51  if (value > (pow(2, mylength) - 1))
52  std::cout << "The value you are trying to set has more bins than expected " << std::endl;
53  for (int i = 0; i < mylength; i++)
54  bitsLink[mylink][i + mystart] = (value >> i) & 0x1;
55  }

References bitsLink, gather_cfg::cout, databaseobject, dqmiodumpindices::firstindex, l1t::rctDataBase::GetIndices(), l1t::rctDataBase::GetLength(), l1t::rctDataBase::GetLink(), mps_fire::i, funct::pow(), and OrderedSet::t.

Referenced by SetHFEt(), SetHFFg(), SetIECard(), SetIEEt(), SetIEReg(), SetNECard(), SetNEEt(), SetNEReg(), SetRCEt(), SetRCHad(), SetRCOf(), and SetRCTau().

◆ SetRCEt()

void l1t::PhysicsToBitConverter::SetRCEt ( int  value,
int  card,
int  region 
)
inline

◆ SetRCHad()

void l1t::PhysicsToBitConverter::SetRCHad ( int  value,
int  card,
int  region 
)
inline

◆ SetRCOf()

void l1t::PhysicsToBitConverter::SetRCOf ( int  value,
int  card,
int  region 
)
inline

◆ SetRCTau()

void l1t::PhysicsToBitConverter::SetRCTau ( int  value,
int  card,
int  region 
)
inline

Member Data Documentation

◆ bitsLink

int l1t::PhysicsToBitConverter::bitsLink[2][192]
private

◆ databaseobject

rctDataBase l1t::PhysicsToBitConverter::databaseobject
private

Definition at line 25 of file PhysicsToBitConverter.h.

Referenced by GetObject(), and SetObject().

◆ words32bitLink

int l1t::PhysicsToBitConverter::words32bitLink[2][6]
private
l1t::rctDataBase::IECard
Definition: rctDataBase.h:12
counter
Definition: counter.py:1
l1t::rctDataBase::NEEt
Definition: rctDataBase.h:12
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
l1t::rctDataBase::IEEt
Definition: rctDataBase.h:12
dqmiodumpindices.firstindex
firstindex
Definition: dqmiodumpindices.py:25
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1t::PhysicsToBitConverter::ReadBitInInt
int ReadBitInInt(int bit, int value)
Definition: PhysicsToBitConverter.cc:57
l1t::rctDataBase::HFEt
Definition: rctDataBase.h:12
l1t::PhysicsToBitConverter::GetObject
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
Definition: PhysicsToBitConverter.cc:38
l1t::rctDataBase::RCEt
Definition: rctDataBase.h:12
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
OrderedSet.t
t
Definition: OrderedSet.py:90
l1t::rctDataBase::IEReg
Definition: rctDataBase.h:12
l1t::PhysicsToBitConverter::SetObject
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)
Definition: PhysicsToBitConverter.cc:46
l1t::PhysicsToBitConverter::databaseobject
rctDataBase databaseobject
Definition: PhysicsToBitConverter.h:25
l1t::rctDataBase::GetIndices
int GetIndices(rctObjectType t, int firstindex, int secondindex=-1)
Definition: rctDataBase.h:54
cand
Definition: decayParser.h:34
l1t::rctDataBase::HFFg
Definition: rctDataBase.h:12
l1t::rctDataBase::RCOf
Definition: rctDataBase.h:12
value
Definition: value.py:1
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
l1t::rctDataBase::GetLink
int GetLink(rctObjectType t)
Definition: rctDataBase.h:40
l1t::PhysicsToBitConverter::words32bitLink
int words32bitLink[2][6]
Definition: PhysicsToBitConverter.h:22
l1t::rctDataBase::RCTau
Definition: rctDataBase.h:12
relativeConstraints.value
value
Definition: relativeConstraints.py:53
l1t::rctDataBase::NECard
Definition: rctDataBase.h:12
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
l1t::PhysicsToBitConverter::bitsLink
int bitsLink[2][192]
Definition: PhysicsToBitConverter.h:24
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
l1t::rctDataBase::GetLength
int GetLength(rctObjectType t)
Definition: rctDataBase.h:38
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
l1t::rctDataBase::NEReg
Definition: rctDataBase.h:12
l1t::rctDataBase::RCHad
Definition: rctDataBase.h:12
l1t::PhysicsToBitConverter::BuildDecimalValue
int BuildDecimalValue(int firstbit, int bitlength, int linkid)
Definition: PhysicsToBitConverter.cc:62