CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CSCTMBMiniScope Class Reference

#include <CSCTMBMiniScope.h>

List of all members.

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

Private Attributes

std::vector< int > miniScopeAdress
std::vector< int > miniScopeData
 stores all mini scope adresses
int miniScopeTbinCount
 stores all mini scope data
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_.

{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().

                                                                              {

  size_ = UnpackMiniScope(buf,Line6b07,Line6E07);

} 

Member Function Documentation

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

Definition at line 22 of file CSCTMBMiniScope.h.

References miniScopeAdress.

Referenced by print().

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

UnpackScope.

Definition at line 48 of file CSCTMBMiniScope.cc.

References gen::k.

Referenced by print().

                                                                {
                 std::vector<int> channelInTbin;
                 channelInTbin.clear();
                 for(int k=0; k<14; k++){
                              int chBit=0;
                              chBit = (data >> k) & 0x1;
                              if(chBit !=0)
                              channelInTbin.push_back(k);
        }
        return channelInTbin;
}
std::vector<int> CSCTMBMiniScope::getData ( void  ) const [inline]

Definition at line 23 of file CSCTMBMiniScope.h.

References miniScopeData.

Referenced by print().

{return miniScopeData;}
int CSCTMBMiniScope::getSize ( ) const [inline]

Definition at line 19 of file CSCTMBMiniScope.h.

References size_.

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

Definition at line 20 of file CSCTMBMiniScope.h.

References miniScopeTbinCount.

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.

                                  {
     for(unsigned int k=0; k<getAdr().size();++k){
           if(k==0){
             std::cout << " Adr = " << getAdr()[k] << " | Data: " 
                                     << std::hex <<  getData()[k] << std::dec << std::endl;
           }
           else{
           std::cout << " Adr = " << getAdr()[k] << " | Data: " 
                                     << std::hex <<  getData()[k] << std::dec << " ==>| Ch# ";
                                      for(unsigned int j=0; j<getChannelsInTbin(getData()[k]).size(); j++){
                                         std::cout << " " << getChannelsInTbin(getData()[k])[j];
                                      }
                                     std::cout << std::endl;
           }
           }
}
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().

                                                                                  {


  if((Line6E07-Line6b07) != 0) {

    miniScopeTbinCount = buf[Line6b07+1] & 0x00FF;
    miniScopeTbinPreTrigger = (buf[Line6b07+1] >> 8) & 0x000F;
    
    LogTrace("CSCTMBMiniScope") << " MiniScope Found | Tbin: " << miniScopeTbinCount <<
                 " | Tbin Pretrigger: " << miniScopeTbinPreTrigger << std::endl;
        
     miniScopeAdress.clear();
     miniScopeData.clear();

     for(int i=0; i<miniScopeTbinCount; i++){
        miniScopeAdress.push_back(284+i);
        miniScopeData.push_back(buf[Line6b07 + 1+i]);
     }
     
     //print();
  } 


  return (Line6E07-Line6b07 + 1);

} 

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().

stores all mini scope data

Definition at line 34 of file CSCTMBMiniScope.h.

Referenced by getTbinCount(), and UnpackMiniScope().

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().