CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCWireDigi Class Reference

#include <CSCWireDigi.h>

List of all members.

Public Member Functions

 CSCWireDigi (int wire, unsigned int tbinb)
 Constructors.
 CSCWireDigi ()
 wiregroup#, tbin bit word
int getBeamCrossingTag () const
 return tbin number, (obsolete, use getTimeBin() instead)
int getBXandWireGroup () const
int getTimeBin () const
 return first tbin ON number
std::vector< int > getTimeBinsOn () const
 return vector of time bins ON
unsigned int getTimeBinWord () const
 return the word with time bins bits
int getWireGroup () const
 default
int getWireGroupBX () const
 return BX assigned for the wire group (16 upper bits from the wire group number)
void print () const
 Print content of digi.
void setWireGroup (unsigned int wiregroup)
 set wiregroup number

Private Attributes

uint32_t tbinb_
int wire_
int wireBX_
int wireBXandWires_
 BX in the wire digis (16 upper bits from the wire group number)

Detailed Description

Digi for CSC anode wires.

Digi for CSC anode wires.

Date:
2010/07/15 22:58:01
Revision:
1.12

Definition at line 14 of file CSCWireDigi.h.


Constructor & Destructor Documentation

CSCWireDigi::CSCWireDigi ( int  wire,
unsigned int  tbinb 
)

Constructors.

Wire group number in the digi (16 lower bits from the wire group number)

BX in the wire digis (16 upper bits from the wire group number)

BX wire group combination

Definition at line 16 of file CSCWireDigi.cc.

References tbinb_, wire_, wireBX_, and wireBXandWires_.

                                                     {
  wire_  = wire & 0x0000FFFF;
  tbinb_ = tbinb;
  wireBX_= (wire >> 16) & 0x0000FFFF;
  wireBXandWires_=wire;
}
CSCWireDigi::CSCWireDigi ( )

wiregroup#, tbin bit word

Default.

Definition at line 27 of file CSCWireDigi.cc.

References tbinb_, wire_, wireBX_, and wireBXandWires_.

                         {
  wire_ = 0;
  tbinb_ = 0;
  wireBX_=0;
  wireBXandWires_=0;
}

Member Function Documentation

int CSCWireDigi::getBeamCrossingTag ( ) const

return tbin number, (obsolete, use getTimeBin() instead)

return tbin number (obsolete, use getTimeBin() instead)

Definition at line 35 of file CSCWireDigi.cc.

References getTimeBin().

Referenced by CSCAnodeData2006::add().

                                          {
  return getTimeBin();
}
int CSCWireDigi::getBXandWireGroup ( ) const [inline]

return BX-wiregroup number combined (16 upper bits - BX + 16 lower bits - wire group number)

Definition at line 29 of file CSCWireDigi.h.

References wireBXandWires_.

Referenced by CSCHitFromWireOnly::findWireHitPosition(), and print().

{return wireBXandWires_;}
int CSCWireDigi::getTimeBin ( ) const

return first tbin ON number

Definition at line 39 of file CSCWireDigi.cc.

References i, and tbinb_.

Referenced by CSCHitFromWireOnly::addToCluster(), getBeamCrossingTag(), CSCHitFromWireOnly::makeWireCluster(), operator<<(), and print().

                                  {
  uint32_t tbit=1;
  int tbin=-1;
  for(int i=0;i<32;i++) {
    if(tbit & tbinb_) tbin=i;
    if(tbin>-1) break;
    tbit=tbit<<1;
  }
  return tbin;
}
std::vector< int > CSCWireDigi::getTimeBinsOn ( ) const

return vector of time bins ON

Definition at line 50 of file CSCWireDigi.cc.

References i, and tbinb_.

Referenced by CSCAnodeData2007::add(), operator<<(), and print().

                                                {
  std::vector<int> tbins;
  uint32_t tbit=tbinb_;
  uint32_t one=1;
  for(int i=0;i<32;i++) {
    if(tbit & one) tbins.push_back(i);
    tbit=tbit>>1;
    if(tbit==0) break;
  }
  return tbins;
}
unsigned int CSCWireDigi::getTimeBinWord ( ) const [inline]

return the word with time bins bits

Definition at line 31 of file CSCWireDigi.h.

References tbinb_.

{return tbinb_;}
int CSCWireDigi::getWireGroup ( ) const [inline]
int CSCWireDigi::getWireGroupBX ( ) const [inline]

return BX assigned for the wire group (16 upper bits from the wire group number)

Definition at line 26 of file CSCWireDigi.h.

References wireBX_.

Referenced by print().

{return wireBX_;}
void CSCWireDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 64 of file CSCWireDigi.cc.

References gather_cfg::cout, getBXandWireGroup(), getTimeBin(), getTimeBinsOn(), getWireGroup(), getWireGroupBX(), and i.

                              {
  std::cout << " CSC Wire " << getWireGroup() << " | "
            << " CSC Wire BX # " << getWireGroupBX() << " | " 
            << " CSC BX + Wire " << std::hex << getBXandWireGroup() << " | " << std::dec
            << " CSC Wire First Time Bin On " << getTimeBin()  
            << std::endl;
  std::cout << " CSC Time Bins On ";
  std::vector<int> tbins=getTimeBinsOn();
  for(unsigned int i=0; i<tbins.size();i++) std::cout<<tbins[i]<<" ";
  std::cout<<std::endl; 
}
void CSCWireDigi::setWireGroup ( unsigned int  wiregroup) [inline]

set wiregroup number

Definition at line 43 of file CSCWireDigi.h.

References wire_.

{wire_= wiregroup;}

Member Data Documentation

uint32_t CSCWireDigi::tbinb_ [private]

Definition at line 49 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), getTimeBin(), getTimeBinsOn(), and getTimeBinWord().

int CSCWireDigi::wire_ [private]

Definition at line 48 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), getWireGroup(), and setWireGroup().

int CSCWireDigi::wireBX_ [private]

Definition at line 52 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), and getWireGroupBX().

BX in the wire digis (16 upper bits from the wire group number)

Definition at line 51 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), and getBXandWireGroup().