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.

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

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  }

◆ ~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.

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

Referenced by Extract32bitwords(), and GetObject().

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  }
static std::atomic< unsigned int > counter

◆ Convert()

void l1t::PhysicsToBitConverter::Convert ( )

Definition at line 17 of file PhysicsToBitConverter.cc.

References bitsLink, ReadBitInInt(), and words32bitLink.

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  }
int ReadBitInInt(int bit, int value)

◆ Extract32bitwords()

void l1t::PhysicsToBitConverter::Extract32bitwords ( )

Definition at line 28 of file PhysicsToBitConverter.cc.

References BuildDecimalValue(), and words32bitLink.

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  }
int BuildDecimalValue(int firstbit, int bitlength, int linkid)

◆ Get32bitWordLinkEven()

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

Definition at line 33 of file PhysicsToBitConverter.h.

References words32bitLink.

◆ Get32bitWordLinkOdd()

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

Definition at line 34 of file PhysicsToBitConverter.h.

References words32bitLink.

◆ GetHFEt()

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

Definition at line 46 of file PhysicsToBitConverter.h.

References GetObject(), l1t::rctDataBase::HFEt, and HLT_2022v11_cff::region.

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

◆ GetHFFg()

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

Definition at line 49 of file PhysicsToBitConverter.h.

References GetObject(), l1t::rctDataBase::HFFg, and HLT_2022v11_cff::region.

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

◆ GetIECard()

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

Definition at line 54 of file PhysicsToBitConverter.h.

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

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

◆ GetIEEt()

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

Definition at line 55 of file PhysicsToBitConverter.h.

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

55 { return GetObject(rctDataBase::IEEt, cand); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetIEReg()

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

Definition at line 53 of file PhysicsToBitConverter.h.

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

53 { return GetObject(rctDataBase::IEReg, cand); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetNECard()

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

Definition at line 51 of file PhysicsToBitConverter.h.

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

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

◆ GetNEEt()

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

Definition at line 52 of file PhysicsToBitConverter.h.

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

52 { return GetObject(rctDataBase::NEEt, cand); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetNEReg()

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

Definition at line 50 of file PhysicsToBitConverter.h.

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

50 { return GetObject(rctDataBase::NEReg, cand); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetObject()

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

Definition at line 38 of file PhysicsToBitConverter.cc.

References BuildDecimalValue(), databaseobject, dqmiodumpindices::firstindex, l1t::rctDataBase::GetIndices(), l1t::rctDataBase::GetLength(), l1t::rctDataBase::GetLink(), and submitPVValidationJobs::t.

Referenced by GetHFEt(), GetHFFg(), GetIECard(), GetIEEt(), GetIEReg(), GetNECard(), GetNEEt(), GetNEReg(), GetRCEt(), GetRCHad(), GetRCOf(), and GetRCTau().

38  {
39  int mystart = databaseobject.GetIndices(t, firstindex, secondindex);
40  int mylength = databaseobject.GetLength(t);
41  int mylink = databaseobject.GetLink(t);
42 
43  return BuildDecimalValue(mystart, mylength, mylink);
44  }
int GetLength(rctObjectType t)
Definition: rctDataBase.h:38
int GetLink(rctObjectType t)
Definition: rctDataBase.h:40
int BuildDecimalValue(int firstbit, int bitlength, int linkid)
int GetIndices(rctObjectType t, int firstindex, int secondindex=-1)
Definition: rctDataBase.h:54

◆ GetRCEt()

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

Definition at line 45 of file PhysicsToBitConverter.h.

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

45 { return GetObject(rctDataBase::RCEt, card, region); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetRCHad()

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

Definition at line 56 of file PhysicsToBitConverter.h.

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

56 { return GetObject(rctDataBase::RCHad, card, region); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetRCOf()

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

Definition at line 48 of file PhysicsToBitConverter.h.

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

48 { return GetObject(rctDataBase::RCOf, card, region); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ GetRCTau()

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

Definition at line 47 of file PhysicsToBitConverter.h.

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

47 { return GetObject(rctDataBase::RCTau, card, region); }
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)

◆ ReadBitInInt()

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

Definition at line 57 of file PhysicsToBitConverter.cc.

Referenced by Convert().

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

◆ Set32bitWordLinkEven()

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

◆ Set32bitWordLinkOdd()

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

◆ SetHFEt()

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

Definition at line 59 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::HFEt, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetHFFg()

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

Definition at line 62 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::HFFg, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetIECard()

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

Definition at line 67 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetIEEt()

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

Definition at line 68 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetIEReg()

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

Definition at line 66 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetNECard()

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

Definition at line 64 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetNEEt()

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

Definition at line 65 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetNEReg()

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

Definition at line 63 of file PhysicsToBitConverter.h.

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

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetObject()

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

Definition at line 46 of file PhysicsToBitConverter.cc.

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

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

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  }
int GetLength(rctObjectType t)
Definition: rctDataBase.h:38
int GetLink(rctObjectType t)
Definition: rctDataBase.h:40
Definition: value.py:1
int GetIndices(rctObjectType t, int firstindex, int secondindex=-1)
Definition: rctDataBase.h:54
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ SetRCEt()

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

Definition at line 58 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::RCEt, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetRCHad()

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

Definition at line 69 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::RCHad, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetRCOf()

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

Definition at line 61 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::RCOf, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

◆ SetRCTau()

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

Definition at line 60 of file PhysicsToBitConverter.h.

References l1t::rctDataBase::RCTau, HLT_2022v11_cff::region, and SetObject().

Definition: value.py:1
void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex=-1)

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