CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PhysicsToBitConverter.cc
Go to the documentation of this file.
2 
3 
4 namespace l1t{
6 
7  }
8 
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  }
18 
19  int PhysicsToBitConverter::GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex)
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  }
27 
29 
30  std::bitset<32> foo(value);
31  return foo[bit];
32 
33  }
34 
35  int PhysicsToBitConverter::BuildPhysicsValue(int firstbit,int bitlength,int linkid){
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  }
46 }
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 ReadBitInInt(int bit, int value)
int GetIndices(rctObjectType t, int firstindex, int secondindex=-1)
Definition: rctDataBase.h:69
static std::atomic< unsigned int > counter
int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex=-1)
std::vector< int > bitsLink[2]