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 Member Functions | Private Attributes
CSCTMBMiniScope Class Reference

#include <CSCTMBMiniScope.h>

Public Member Functions

 CSCTMBMiniScope ()
 
 CSCTMBMiniScope (unsigned short *buf, int Line6b07, int Line6E07)
 
std::vector< int > getAdr () const
 
std::vector< int > getChannelsInTbin (int data) const
 UnpackScope. More...
 
std::vector< int > getData () const
 
int getSize () const
 
int getTbinCount () const
 
int getTbinPreTrigger () const
 
void print () const
 

Private Member Functions

int UnpackMiniScope (unsigned short *buf, int Line6b07, int Line6E07)
 Print the maped content of the miniscope. More...
 

Private Attributes

std::vector< int > miniScopeAdress
 
std::vector< int > miniScopeData
 stores all mini scope adresses More...
 
int miniScopeTbinCount
 stores all mini scope data More...
 
int miniScopeTbinPreTrigger
 
unsigned size_
 

Detailed Description

Definition at line 13 of file CSCTMBMiniScope.h.

Constructor & Destructor Documentation

CSCTMBMiniScope::CSCTMBMiniScope ( )
inline

Definition at line 17 of file CSCTMBMiniScope.h.

References size_.

17 {size_ = 0;} //default constructor
CSCTMBMiniScope::CSCTMBMiniScope ( unsigned short *  buf,
int  Line6b07,
int  Line6E07 
)

Definition at line 13 of file CSCTMBMiniScope.cc.

References size_, and UnpackMiniScope().

13  {
14 
15  size_ = UnpackMiniScope(buf,Line6b07,Line6E07);
16 
17 }
int UnpackMiniScope(unsigned short *buf, int Line6b07, int Line6E07)
Print the maped content of the miniscope.

Member Function Documentation

std::vector<int> CSCTMBMiniScope::getAdr ( ) const
inline

Definition at line 22 of file CSCTMBMiniScope.h.

References miniScopeAdress.

Referenced by print().

22 {return miniScopeAdress;}
std::vector< int > miniScopeAdress
std::vector< int > CSCTMBMiniScope::getChannelsInTbin ( int  data) const

UnpackScope.

Definition at line 48 of file CSCTMBMiniScope.cc.

References gen::k.

Referenced by print().

48  {
49  std::vector<int> channelInTbin;
50  channelInTbin.clear();
51  for(int k=0; k<14; k++){
52  int chBit=0;
53  chBit = (data >> k) & 0x1;
54  if(chBit !=0)
55  channelInTbin.push_back(k);
56  }
57  return channelInTbin;
58 }
int k[5][pyjets_maxn]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector<int> CSCTMBMiniScope::getData ( void  ) const
inline

Definition at line 23 of file CSCTMBMiniScope.h.

References miniScopeData.

Referenced by print().

23 {return miniScopeData;}
std::vector< int > miniScopeData
stores all mini scope adresses
int CSCTMBMiniScope::getSize ( ) const
inline

Definition at line 19 of file CSCTMBMiniScope.h.

References size_.

19 {return size_;}
int CSCTMBMiniScope::getTbinCount ( ) const
inline

Definition at line 20 of file CSCTMBMiniScope.h.

References miniScopeTbinCount.

20 {return miniScopeTbinCount;}
int miniScopeTbinCount
stores all mini scope data
int CSCTMBMiniScope::getTbinPreTrigger ( ) const
inline

Definition at line 21 of file CSCTMBMiniScope.h.

References miniScopeTbinPreTrigger.

void CSCTMBMiniScope::print ( void  ) const

Definition at line 61 of file CSCTMBMiniScope.cc.

References gather_cfg::cout, getAdr(), getChannelsInTbin(), getData(), j, and gen::k.

61  {
62  for(unsigned int k=0; k<getAdr().size();++k){
63  if(k==0){
64  std::cout << " Adr = " << getAdr()[k] << " | Data: "
65  << std::hex << getData()[k] << std::dec << std::endl;
66  }
67  else{
68  std::cout << " Adr = " << getAdr()[k] << " | Data: "
69  << std::hex << getData()[k] << std::dec << " ==>| Ch# ";
70  for(unsigned int j=0; j<getChannelsInTbin(getData()[k]).size(); j++){
71  std::cout << " " << getChannelsInTbin(getData()[k])[j];
72  }
73  std::cout << std::endl;
74  }
75  }
76 }
std::vector< int > getData() const
std::vector< int > getAdr() const
std::vector< int > getChannelsInTbin(int data) const
UnpackScope.
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
tuple cout
Definition: gather_cfg.py:121
int CSCTMBMiniScope::UnpackMiniScope ( unsigned short *  buf,
int  Line6b07,
int  Line6E07 
)
private

Print the maped content of the miniscope.

CSCTMBMiniScope.

Get tbin and tbin before pre-trigger

end if((Line6E07-Line6b07)

Definition at line 20 of file CSCTMBMiniScope.cc.

References i, LogTrace, miniScopeAdress, miniScopeData, miniScopeTbinCount, and miniScopeTbinPreTrigger.

Referenced by CSCTMBMiniScope().

20  {
21 
22 
23  if((Line6E07-Line6b07) != 0) {
24 
26  miniScopeTbinCount = buf[Line6b07+1] & 0x00FF;
27  miniScopeTbinPreTrigger = (buf[Line6b07+1] >> 8) & 0x000F;
28 
29  LogTrace("CSCTMBMiniScope") << " MiniScope Found | Tbin: " << miniScopeTbinCount <<
30  " | Tbin Pretrigger: " << miniScopeTbinPreTrigger << std::endl;
31 
32  miniScopeAdress.clear();
33  miniScopeData.clear();
34 
35  for(int i=0; i<miniScopeTbinCount; i++){
36  miniScopeAdress.push_back(284+i);
37  miniScopeData.push_back(buf[Line6b07 + 1+i]);
38  }
39 
40  //print();
41  }
42 
43 
44  return (Line6E07-Line6b07 + 1);
45 
46 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > miniScopeAdress
std::vector< int > miniScopeData
stores all mini scope adresses
int miniScopeTbinCount
stores all mini scope data
#define LogTrace(id)

Member Data Documentation

std::vector<int> CSCTMBMiniScope::miniScopeAdress
private

Definition at line 32 of file CSCTMBMiniScope.h.

Referenced by getAdr(), and UnpackMiniScope().

std::vector<int> CSCTMBMiniScope::miniScopeData
private

stores all mini scope adresses

Definition at line 33 of file CSCTMBMiniScope.h.

Referenced by getData(), and UnpackMiniScope().

int CSCTMBMiniScope::miniScopeTbinCount
private

stores all mini scope data

Definition at line 34 of file CSCTMBMiniScope.h.

Referenced by getTbinCount(), and UnpackMiniScope().

int CSCTMBMiniScope::miniScopeTbinPreTrigger
private

Definition at line 35 of file CSCTMBMiniScope.h.

Referenced by getTbinPreTrigger(), and UnpackMiniScope().

unsigned CSCTMBMiniScope::size_
private

Definition at line 36 of file CSCTMBMiniScope.h.

Referenced by CSCTMBMiniScope(), and getSize().