CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCWireDigi Class Reference

#include <CSCWireDigi.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

Digi for CSC anode wires.

Definition at line 14 of file CSCWireDigi.h.

Constructor & Destructor Documentation

◆ CSCWireDigi() [1/2]

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 14 of file CSCWireDigi.cc.

14  {
16  wire_ = wire & 0x0000FFFF;
17  tbinb_ = tbinb;
19  wireBX_ = (wire >> 16) & 0x0000FFFF;
21  wireBXandWires_ = wire;
22 }

References tbinb_, wire_, wireBX_, and wireBXandWires_.

◆ CSCWireDigi() [2/2]

CSCWireDigi::CSCWireDigi ( )

wiregroup#, tbin bit word

Default.

Definition at line 25 of file CSCWireDigi.cc.

25  {
26  wire_ = 0;
27  tbinb_ = 0;
28  wireBX_ = 0;
29  wireBXandWires_ = 0;
30 }

References tbinb_, wire_, wireBX_, and wireBXandWires_.

Member Function Documentation

◆ getBeamCrossingTag()

int CSCWireDigi::getBeamCrossingTag ( ) const

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

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

Definition at line 33 of file CSCWireDigi.cc.

33 { return getTimeBin(); }

References getTimeBin().

Referenced by CSCAnodeData2006::add().

◆ getBXandWireGroup()

int CSCWireDigi::getBXandWireGroup ( ) const
inline

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

Definition at line 27 of file CSCWireDigi.h.

27 { return wireBXandWires_; }

References wireBXandWires_.

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

◆ getTimeBin()

int CSCWireDigi::getTimeBin ( ) const

return first tbin ON number

Definition at line 35 of file CSCWireDigi.cc.

35  {
36  uint32_t tbit = 1;
37  int tbin = -1;
38  for (int i = 0; i < 32; i++) {
39  if (tbit & tbinb_)
40  tbin = i;
41  if (tbin > -1)
42  break;
43  tbit = tbit << 1;
44  }
45  return tbin;
46 }

References mps_fire::i, and tbinb_.

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

◆ getTimeBinsOn()

std::vector< int > CSCWireDigi::getTimeBinsOn ( ) const

return vector of time bins ON

Definition at line 48 of file CSCWireDigi.cc.

48  {
49  std::vector<int> tbins;
50  uint32_t tbit = tbinb_;
51  uint32_t one = 1;
52  for (int i = 0; i < 32; i++) {
53  if (tbit & one)
54  tbins.push_back(i);
55  tbit = tbit >> 1;
56  if (tbit == 0)
57  break;
58  }
59  return tbins;
60 }

References mps_fire::i, and tbinb_.

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

◆ getTimeBinWord()

unsigned int CSCWireDigi::getTimeBinWord ( ) const
inline

return the word with time bins bits

Definition at line 29 of file CSCWireDigi.h.

29 { return tbinb_; }

References tbinb_.

◆ getWireGroup()

int CSCWireDigi::getWireGroup ( ) const
inline

◆ getWireGroupBX()

int CSCWireDigi::getWireGroupBX ( ) const
inline

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

Definition at line 24 of file CSCWireDigi.h.

24 { return wireBX_; }

References wireBX_.

Referenced by CSCEventData::add(), and print().

◆ print()

void CSCWireDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 64 of file CSCWireDigi.cc.

64  {
65  std::ostringstream ost;
66  ost << "CSCWireDigi | wg " << getWireGroup() << " | "
67  << " BX # " << getWireGroupBX() << " | "
68  << " BX + Wire " << std::hex << getBXandWireGroup() << " | " << std::dec << " First Time Bin On " << getTimeBin()
69  << " | Time Bins On ";
70  std::vector<int> tbins = getTimeBinsOn();
71  for (unsigned int i = 0; i < tbins.size(); i++) {
72  ost << tbins[i] << " ";
73  }
74  edm::LogVerbatim("CSCDigi") << ost.str();
75 }

References TauDecayModes::dec, getBXandWireGroup(), getTimeBin(), getTimeBinsOn(), getWireGroup(), getWireGroupBX(), and mps_fire::i.

◆ setWireGroup()

void CSCWireDigi::setWireGroup ( unsigned int  wiregroup)
inline

set wiregroup number

Definition at line 41 of file CSCWireDigi.h.

41 { wire_ = wiregroup; }

References wire_.

Member Data Documentation

◆ tbinb_

uint32_t CSCWireDigi::tbinb_
private

Definition at line 45 of file CSCWireDigi.h.

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

◆ wire_

int CSCWireDigi::wire_
private

Definition at line 44 of file CSCWireDigi.h.

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

◆ wireBX_

int CSCWireDigi::wireBX_
private

Definition at line 48 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), and getWireGroupBX().

◆ wireBXandWires_

int CSCWireDigi::wireBXandWires_
private

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

Definition at line 47 of file CSCWireDigi.h.

Referenced by CSCWireDigi(), and getBXandWireGroup().

mps_fire.i
i
Definition: mps_fire.py:355
CSCWireDigi::tbinb_
uint32_t tbinb_
Definition: CSCWireDigi.h:45
CSCWireDigi::wireBX_
int wireBX_
Definition: CSCWireDigi.h:48
CSCWireDigi::getWireGroup
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
CSCWireDigi::getWireGroupBX
int getWireGroupBX() const
return BX assigned for the wire group (16 upper bits from the wire group number)
Definition: CSCWireDigi.h:24
CSCWireDigi::wireBXandWires_
int wireBXandWires_
BX in the wire digis (16 upper bits from the wire group number)
Definition: CSCWireDigi.h:47
CSCWireDigi::getTimeBinsOn
std::vector< int > getTimeBinsOn() const
return vector of time bins ON
Definition: CSCWireDigi.cc:48
CSCWireDigi::getTimeBin
int getTimeBin() const
return first tbin ON number
Definition: CSCWireDigi.cc:35
edm::LogVerbatim
Definition: MessageLogger.h:297
CSCWireDigi::wire_
int wire_
Definition: CSCWireDigi.h:44
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCWireDigi::getBXandWireGroup
int getBXandWireGroup() const
Definition: CSCWireDigi.h:27