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 Attributes
l1t::PhysicsToBitConverter Class Reference

#include <PhysicsToBitConverter.h>

Public Member Functions

int BuildPhysicsValue (int firstbit, int bitlength, int linkid)
 
void Convert ()
 
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)
 
 ~PhysicsToBitConverter ()
 

Private Attributes

std::vector< int > bitsLink [2]
 
rctDataBase databaseobject
 
int words32bitLink [2][6]
 

Detailed Description

Definition at line 20 of file PhysicsToBitConverter.h.

Constructor & Destructor Documentation

l1t::PhysicsToBitConverter::PhysicsToBitConverter ( )

Definition at line 5 of file PhysicsToBitConverter.cc.

5  {
6 
7  }
l1t::PhysicsToBitConverter::~PhysicsToBitConverter ( )
inline

Definition at line 32 of file PhysicsToBitConverter.h.

32 { }

Member Function Documentation

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

Definition at line 35 of file PhysicsToBitConverter.cc.

References bitsLink, counter, and contentValuesFiles::m.

Referenced by GetObject().

35  {
36 
37  int myvalue=0;
38  int counter=0;
39 
40  for (int m=firstbit;m<firstbit+bitlength;m++){
41  myvalue|=(bitsLink[linkid][m]&(0x1)) << counter;
42  counter++;
43  }
44  return myvalue;
45  }
static std::atomic< unsigned int > counter
std::vector< int > bitsLink[2]
void l1t::PhysicsToBitConverter::Convert ( )

Definition at line 9 of file PhysicsToBitConverter.cc.

References bitsLink, ReadBitInInt(), and words32bitLink.

Referenced by l1t::stage1::RCTEmUnpacker::unpack(), and l1t::stage1::RCTRegionUnpacker::unpack().

9  {
10 
11  for (int iword=0;iword<6;iword++){
12  for (int ibit=0;ibit<32;ibit++){
13  bitsLink[0].push_back(ReadBitInInt(ibit,words32bitLink[0][iword]));
14  bitsLink[1].push_back(ReadBitInInt(ibit,words32bitLink[1][iword]));
15  }
16  }
17  }
int ReadBitInInt(int bit, int value)
std::vector< int > bitsLink[2]
int l1t::PhysicsToBitConverter::GetHFEt ( int  region)
inline

Definition at line 43 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTRegionUnpacker::unpack().

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

Definition at line 46 of file PhysicsToBitConverter.h.

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

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

Definition at line 51 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

51 {return GetObject(rctDataBase::IECard,cand);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetIEEt ( int  cand)
inline

Definition at line 52 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

52 {return GetObject(rctDataBase::IEEt,cand);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetIEReg ( int  cand)
inline

Definition at line 50 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

50 {return GetObject(rctDataBase::IEReg,cand);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetNECard ( int  cand)
inline

Definition at line 48 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

48 {return GetObject(rctDataBase::NECard,cand);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetNEEt ( int  cand)
inline

Definition at line 49 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

49 {return GetObject(rctDataBase::NEEt,cand);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetNEReg ( int  cand)
inline

Definition at line 47 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTEmUnpacker::unpack().

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

Definition at line 19 of file PhysicsToBitConverter.cc.

References BuildPhysicsValue(), databaseobject, l1t::rctDataBase::GetIndices(), l1t::rctDataBase::GetLength(), and l1t::rctDataBase::GetLink().

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

20  {
21  int mystart = databaseobject.GetIndices(t,firstindex,secondindex);
22  int mylength = databaseobject.GetLength(t);
23  int mylink = databaseobject.GetLink(t);
24 
25  return BuildPhysicsValue(mystart, mylength, mylink);
26  }
int GetLength(rctObjectType t)
Definition: rctDataBase.h:51
int GetLink(rctObjectType t)
Definition: rctDataBase.h:56
int BuildPhysicsValue(int firstbit, int bitlength, int linkid)
int GetIndices(rctObjectType t, int firstindex, int secondindex=-1)
Definition: rctDataBase.h:69
int l1t::PhysicsToBitConverter::GetRCEt ( int  card,
int  region 
)
inline

Definition at line 42 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTRegionUnpacker::unpack().

42 {return GetObject(rctDataBase::RCEt,card,region);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetRCHad ( int  card,
int  region 
)
inline

Definition at line 53 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTRegionUnpacker::unpack().

53 {return GetObject(rctDataBase::RCHad,card,region);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetRCOf ( int  card,
int  region 
)
inline

Definition at line 45 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTRegionUnpacker::unpack().

45 {return GetObject(rctDataBase::RCOf,card,region);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::GetRCTau ( int  card,
int  region 
)
inline

Definition at line 44 of file PhysicsToBitConverter.h.

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

Referenced by l1t::stage1::RCTRegionUnpacker::unpack().

44 {return GetObject(rctDataBase::RCTau,card,region);}
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
int l1t::PhysicsToBitConverter::ReadBitInInt ( int  bit,
int  value 
)

Definition at line 28 of file PhysicsToBitConverter.cc.

Referenced by Convert().

28  {
29 
30  std::bitset<32> foo(value);
31  return foo[bit];
32 
33  }
void l1t::PhysicsToBitConverter::Set32bitWordLinkEven ( int  index,
uint32_t  value 
)
inline
void l1t::PhysicsToBitConverter::Set32bitWordLinkOdd ( int  index,
uint32_t  value 
)
inline

Member Data Documentation

std::vector<int> l1t::PhysicsToBitConverter::bitsLink[2]
private

Definition at line 25 of file PhysicsToBitConverter.h.

Referenced by BuildPhysicsValue(), and Convert().

rctDataBase l1t::PhysicsToBitConverter::databaseobject
private

Definition at line 26 of file PhysicsToBitConverter.h.

Referenced by GetObject().

int l1t::PhysicsToBitConverter::words32bitLink[2][6]
private

Definition at line 23 of file PhysicsToBitConverter.h.

Referenced by Convert(), Set32bitWordLinkEven(), and Set32bitWordLinkOdd().