CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Private Member Functions | Private Attributes
CSCALCTDigi Class Reference

#include <CSCALCTDigi.h>

Public Types

enum  Version { Version::Legacy = 0, Version::Run3 }
 
typedef std::vector< std::vector< uint16_t > > WireContainer
 

Public Member Functions

void clear ()
 clear this ALCT More...
 
 CSCALCTDigi (const uint16_t valid, const uint16_t quality, const uint16_t accel, const uint16_t patternb, const uint16_t keywire, const uint16_t bx, const uint16_t trknmb=0, const uint16_t hmt=0, const Version version=Version::Legacy)
 Constructors. More...
 
 CSCALCTDigi ()
 default More...
 
uint16_t getAccelerator () const
 
uint16_t getBX () const
 return BX - five low bits of BXN counter tagged by the ALCT More...
 
uint16_t getCollisionB () const
 
uint16_t getFullBX () const
 return 12-bit full BX. More...
 
const WireContainergetHits () const
 
uint16_t getHMT () const
 return the high multiplicity bits More...
 
uint16_t getKeyWG () const
 return key wire group More...
 
uint16_t getQuality () const
 return quality of a pattern More...
 
uint16_t getTrknmb () const
 return track number (1,2) More...
 
bool isRun3 () const
 Distinguish Run-1/2 from Run-3. More...
 
bool isValid () const
 check ALCT validity (1 - valid ALCT) More...
 
bool operator!= (const CSCALCTDigi &) const
 True if the preceding one is false. More...
 
bool operator== (const CSCALCTDigi &) const
 True if all members (except the number) of both ALCTs are equal. More...
 
bool operator> (const CSCALCTDigi &) const
 
void print () const
 Print content of digi. More...
 
void setAccelerator (const uint16_t accelerator)
 set accelerator bit More...
 
void setBX (const uint16_t BX)
 set BX More...
 
void setCollisionB (const uint16_t collision)
 set Collision Pattern B bit More...
 
void setFullBX (const uint16_t fullbx)
 Set 12-bit full BX. More...
 
void setHits (const WireContainer &hits)
 
void setHMT (const uint16_t hmt)
 set the high multiplicity bits More...
 
void setKeyWG (const uint16_t keyWG)
 set key wire group More...
 
void setQuality (const uint16_t quality)
 set quality More...
 
void setRun3 (const bool isRun3)
 
void setTrknmb (const uint16_t number)
 Set track number (1,2) after sorting ALCTs. More...
 
void setValid (const uint16_t valid)
 set valid More...
 
void setWireGroup (uint16_t wiregroup)
 set wiregroup number More...
 

Static Private Member Functions

static const WireContaineremptyContainer ()
 

Private Attributes

uint16_t accel_
 
uint16_t bx_
 
uint16_t fullbx_
 
WireContainer hits_
 
uint16_t hmt_
 
uint16_t keywire_
 
uint16_t patternb_
 
uint16_t quality_
 
uint16_t trknmb_
 
uint16_t valid_
 
Version version_
 

Detailed Description

Digi for ALCT trigger primitives.

Author
N. Terentiev, CMU

Definition at line 17 of file CSCALCTDigi.h.

Member Typedef Documentation

◆ WireContainer

typedef std::vector<std::vector<uint16_t> > CSCALCTDigi::WireContainer

Definition at line 21 of file CSCALCTDigi.h.

Member Enumeration Documentation

◆ Version

enum CSCALCTDigi::Version
strong
Enumerator
Legacy 
Run3 

Definition at line 19 of file CSCALCTDigi.h.

19 { Legacy = 0, Run3 };

Constructor & Destructor Documentation

◆ CSCALCTDigi() [1/2]

CSCALCTDigi::CSCALCTDigi ( const uint16_t  valid,
const uint16_t  quality,
const uint16_t  accel,
const uint16_t  patternb,
const uint16_t  keywire,
const uint16_t  bx,
const uint16_t  trknmb = 0,
const uint16_t  hmt = 0,
const Version  version = Version::Legacy 
)

Constructors.

Definition at line 35 of file CSCALCTDigi.cc.

44  : valid_(valid),
46  accel_(accel),
47  patternb_(patternb),
48  keywire_(keywire),
49  bx_(bx),
50  trknmb_(trknmb),
51  hmt_(hmt),
52  version_(version) {}
Version version_
Definition: CSCALCTDigi.h:138
uint16_t bx_
Definition: CSCALCTDigi.h:129
uint16_t trknmb_
Definition: CSCALCTDigi.h:130
uint16_t patternb_
Definition: CSCALCTDigi.h:127
uint16_t keywire_
Definition: CSCALCTDigi.h:128
uint16_t valid_
Definition: CSCALCTDigi.h:124
uint16_t accel_
Definition: CSCALCTDigi.h:126
uint16_t hmt_
Definition: CSCALCTDigi.h:136
uint16_t quality_
Definition: CSCALCTDigi.h:125
string quality

◆ CSCALCTDigi() [2/2]

CSCALCTDigi::CSCALCTDigi ( )

default

Default.

Definition at line 55 of file CSCALCTDigi.cc.

References clear().

55  {
56  clear(); // set contents to zero
57 }
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60

Member Function Documentation

◆ clear()

void CSCALCTDigi::clear ( void  )

clear this ALCT

Clears this ALCT.

Definition at line 60 of file CSCALCTDigi.cc.

References accel_, bx_, fullbx_, hits_, hmt_, keywire_, Legacy, patternb_, quality_, trknmb_, valid_, and version_.

Referenced by CSCCorrelatedLCTDigi::clear(), CSCAnodeLCTProcessor::clear(), and CSCALCTDigi().

60  {
61  valid_ = 0;
62  quality_ = 0;
63  accel_ = 0;
64  patternb_ = 0;
65  keywire_ = 0;
66  bx_ = 0;
67  trknmb_ = 0;
68  fullbx_ = 0;
69  hmt_ = 0;
70  hits_.clear();
72 }
Version version_
Definition: CSCALCTDigi.h:138
uint16_t bx_
Definition: CSCALCTDigi.h:129
uint16_t trknmb_
Definition: CSCALCTDigi.h:130
uint16_t patternb_
Definition: CSCALCTDigi.h:127
uint16_t keywire_
Definition: CSCALCTDigi.h:128
uint16_t valid_
Definition: CSCALCTDigi.h:124
uint16_t fullbx_
Definition: CSCALCTDigi.h:131
uint16_t accel_
Definition: CSCALCTDigi.h:126
WireContainer hits_
Definition: CSCALCTDigi.h:140
uint16_t hmt_
Definition: CSCALCTDigi.h:136
uint16_t quality_
Definition: CSCALCTDigi.h:125

◆ emptyContainer()

CSCALCTDigi::WireContainer const & CSCALCTDigi::emptyContainer ( )
staticprivate

Definition at line 29 of file CSCALCTDigi.cc.

Referenced by getHits().

29  {
30  static WireContainer const s_container = makeEmptyContainer();
31  return s_container;
32 }
std::vector< std::vector< uint16_t > > WireContainer
Definition: CSCALCTDigi.h:21

◆ getAccelerator()

uint16_t CSCALCTDigi::getAccelerator ( ) const
inline

return Accelerator bit 1-Accelerator pattern, 0-CollisionA or CollisionB pattern

Definition at line 53 of file CSCALCTDigi.h.

References accel_.

Referenced by CSCALCTs2006::addALCT0(), CSCALCTs2006::addALCT1(), LCTQualityAssignment::findQualityGEMv1(), LCTQualityAssignment::findQualityRun2(), CSCAnodeLCTProcessor::isBetterALCT(), operator<<(), operator==(), and print().

53 { return accel_; }
uint16_t accel_
Definition: CSCALCTDigi.h:126

◆ getBX()

uint16_t CSCALCTDigi::getBX ( ) const
inline

◆ getCollisionB()

uint16_t CSCALCTDigi::getCollisionB ( ) const
inline

return Collision Pattern B bit 1-CollisionB pattern (accel_ = 0), 0-CollisionA pattern (accel_ = 0)

Definition at line 61 of file CSCALCTDigi.h.

References patternb_.

Referenced by CSCALCTs2006::addALCT0(), CSCALCTs2006::addALCT1(), LCTQualityControl::checkValid(), operator<<(), operator==(), and print().

61 { return patternb_; }
uint16_t patternb_
Definition: CSCALCTDigi.h:127

◆ getFullBX()

uint16_t CSCALCTDigi::getFullBX ( ) const
inline

return 12-bit full BX.

Definition at line 85 of file CSCALCTDigi.h.

References fullbx_.

Referenced by CSCAnodeLCTProcessor::lctSearch(), and print().

85 { return fullbx_; }
uint16_t fullbx_
Definition: CSCALCTDigi.h:131

◆ getHits()

const WireContainer& CSCALCTDigi::getHits ( ) const
inline

Definition at line 118 of file CSCALCTDigi.h.

References emptyContainer(), and hits_.

118 { return hits_.empty() ? emptyContainer() : hits_; }
static const WireContainer & emptyContainer()
Definition: CSCALCTDigi.cc:29
WireContainer hits_
Definition: CSCALCTDigi.h:140

◆ getHMT()

uint16_t CSCALCTDigi::getHMT ( ) const

return the high multiplicity bits

Definition at line 74 of file CSCALCTDigi.cc.

References hmt_, isRun3(), and SiStripPI::max.

uint16_t hmt_
Definition: CSCALCTDigi.h:136
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCALCTDigi.h:113

◆ getKeyWG()

uint16_t CSCALCTDigi::getKeyWG ( ) const
inline

◆ getQuality()

uint16_t CSCALCTDigi::getQuality ( ) const
inline

◆ getTrknmb()

uint16_t CSCALCTDigi::getTrknmb ( ) const
inline

return track number (1,2)

Definition at line 79 of file CSCALCTDigi.h.

References trknmb_.

Referenced by LCTQualityControl::checkValid(), operator<<(), and print().

79 { return trknmb_; }
uint16_t trknmb_
Definition: CSCALCTDigi.h:130

◆ isRun3()

bool CSCALCTDigi::isRun3 ( ) const
inline

Distinguish Run-1/2 from Run-3.

Definition at line 113 of file CSCALCTDigi.h.

References Run3, and version_.

Referenced by getHMT(), setHMT(), and setRun3().

◆ isValid()

bool CSCALCTDigi::isValid ( void  ) const
inline

◆ operator!=()

bool CSCALCTDigi::operator!= ( const CSCALCTDigi rhs) const

True if the preceding one is false.

Definition at line 114 of file CSCALCTDigi.cc.

114  {
115  // True if == is false.
116  bool returnValue = true;
117  if ((*this) == rhs)
118  returnValue = false;
119  return returnValue;
120 }

◆ operator==()

bool CSCALCTDigi::operator== ( const CSCALCTDigi rhs) const

True if all members (except the number) of both ALCTs are equal.

Definition at line 104 of file CSCALCTDigi.cc.

References getAccelerator(), getBX(), getCollisionB(), getKeyWG(), getQuality(), and isValid().

104  {
105  // Exact equality.
106  bool returnValue = false;
107  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getAccelerator() == rhs.getAccelerator() &&
108  getCollisionB() == rhs.getCollisionB() && getKeyWG() == rhs.getKeyWG() && getBX() == rhs.getBX()) {
109  returnValue = true;
110  }
111  return returnValue;
112 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:61
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53

◆ operator>()

bool CSCALCTDigi::operator> ( const CSCALCTDigi rhs) const

True if the first ALCT has a larger quality, or if it has the same quality but a larger wire group.

Definition at line 80 of file CSCALCTDigi.cc.

References getBX(), getKeyWG(), and getQuality().

80  {
81  bool returnValue = false;
82 
83  // Early ALCTs are always preferred to the ones found at later bx's.
84  if (getBX() < rhs.getBX()) {
85  returnValue = true;
86  }
87  if (getBX() != rhs.getBX()) {
88  return returnValue;
89  }
90 
91  // The > operator then checks the quality of ALCTs.
92  // If two qualities are equal, the ALCT furthest from the beam axis
93  // (lowest eta, highest wire group number) is selected.
94  uint16_t quality1 = getQuality();
95  uint16_t quality2 = rhs.getQuality();
96  if (quality1 > quality2) {
97  returnValue = true;
98  } else if (quality1 == quality2 && getKeyWG() > rhs.getKeyWG()) {
99  returnValue = true;
100  }
101  return returnValue;
102 }
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67

◆ print()

void CSCALCTDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 123 of file CSCALCTDigi.cc.

References getAccelerator(), getBX(), getCollisionB(), getFullBX(), getKeyWG(), getQuality(), getTrknmb(), and isValid().

123  {
124  if (isValid()) {
125  edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid()
126  << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1)
127  << getAccelerator() << " PatternB = " << setw(1) << getCollisionB()
128  << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX()
129  << " Full BX = " << std::setw(1) << getFullBX();
130  } else {
131  edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT.";
132  }
133 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
Log< level::Info, true > LogVerbatim
uint16_t getTrknmb() const
return track number (1,2)
Definition: CSCALCTDigi.h:79
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:61
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCALCTDigi.h:85
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53

◆ setAccelerator()

void CSCALCTDigi::setAccelerator ( const uint16_t  accelerator)
inline

set accelerator bit

Definition at line 56 of file CSCALCTDigi.h.

References accel_.

56 { accel_ = accelerator; }
uint16_t accel_
Definition: CSCALCTDigi.h:126

◆ setBX()

void CSCALCTDigi::setBX ( const uint16_t  BX)
inline

◆ setCollisionB()

void CSCALCTDigi::setCollisionB ( const uint16_t  collision)
inline

set Collision Pattern B bit

Definition at line 64 of file CSCALCTDigi.h.

References patternb_.

64 { patternb_ = collision; }
uint16_t patternb_
Definition: CSCALCTDigi.h:127

◆ setFullBX()

void CSCALCTDigi::setFullBX ( const uint16_t  fullbx)
inline

Set 12-bit full BX.

Definition at line 88 of file CSCALCTDigi.h.

References fullbx_.

88 { fullbx_ = fullbx; }
uint16_t fullbx_
Definition: CSCALCTDigi.h:131

◆ setHits()

void CSCALCTDigi::setHits ( const WireContainer hits)
inline

Definition at line 120 of file CSCALCTDigi.h.

References hfClusterShapes_cfi::hits, and hits_.

Referenced by CSCAnodeLCTProcessor::setWireContainer().

120 { hits_ = hits; }
WireContainer hits_
Definition: CSCALCTDigi.h:140

◆ setHMT()

void CSCALCTDigi::setHMT ( const uint16_t  hmt)

set the high multiplicity bits

Definition at line 76 of file CSCALCTDigi.cc.

References h, hmt_, isRun3(), and SiStripPI::max.

uint16_t hmt_
Definition: CSCALCTDigi.h:136
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCALCTDigi.h:113
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ setKeyWG()

void CSCALCTDigi::setKeyWG ( const uint16_t  keyWG)
inline

set key wire group

Definition at line 70 of file CSCALCTDigi.h.

References keywire_.

70 { keywire_ = keyWG; }
uint16_t keywire_
Definition: CSCALCTDigi.h:128

◆ setQuality()

void CSCALCTDigi::setQuality ( const uint16_t  quality)
inline

set quality

Definition at line 49 of file CSCALCTDigi.h.

References quality, and quality_.

49 { quality_ = quality; }
uint16_t quality_
Definition: CSCALCTDigi.h:125
string quality

◆ setRun3()

void CSCALCTDigi::setRun3 ( const bool  isRun3)

Definition at line 78 of file CSCALCTDigi.cc.

References isRun3(), Legacy, Run3, and version_.

Version version_
Definition: CSCALCTDigi.h:138
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCALCTDigi.h:113

◆ setTrknmb()

void CSCALCTDigi::setTrknmb ( const uint16_t  number)
inline

Set track number (1,2) after sorting ALCTs.

Definition at line 82 of file CSCALCTDigi.h.

References contentValuesFiles::number, and trknmb_.

Referenced by CSCAnodeLCTProcessor::lctSearch().

◆ setValid()

void CSCALCTDigi::setValid ( const uint16_t  valid)
inline

set valid

Definition at line 43 of file CSCALCTDigi.h.

References validateGeometry_cfg::valid, and valid_.

◆ setWireGroup()

void CSCALCTDigi::setWireGroup ( uint16_t  wiregroup)
inline

set wiregroup number

Definition at line 110 of file CSCALCTDigi.h.

References keywire_.

110 { keywire_ = wiregroup; }
uint16_t keywire_
Definition: CSCALCTDigi.h:128

Member Data Documentation

◆ accel_

uint16_t CSCALCTDigi::accel_
private

Definition at line 126 of file CSCALCTDigi.h.

Referenced by clear(), getAccelerator(), and setAccelerator().

◆ bx_

uint16_t CSCALCTDigi::bx_
private

Definition at line 129 of file CSCALCTDigi.h.

Referenced by clear(), getBX(), and setBX().

◆ fullbx_

uint16_t CSCALCTDigi::fullbx_
private

Definition at line 131 of file CSCALCTDigi.h.

Referenced by clear(), getFullBX(), and setFullBX().

◆ hits_

WireContainer CSCALCTDigi::hits_
private

Definition at line 140 of file CSCALCTDigi.h.

Referenced by clear(), getHits(), and setHits().

◆ hmt_

uint16_t CSCALCTDigi::hmt_
private

Definition at line 136 of file CSCALCTDigi.h.

Referenced by clear(), getHMT(), and setHMT().

◆ keywire_

uint16_t CSCALCTDigi::keywire_
private

Definition at line 128 of file CSCALCTDigi.h.

Referenced by clear(), getKeyWG(), setKeyWG(), and setWireGroup().

◆ patternb_

uint16_t CSCALCTDigi::patternb_
private

Definition at line 127 of file CSCALCTDigi.h.

Referenced by clear(), getCollisionB(), and setCollisionB().

◆ quality_

uint16_t CSCALCTDigi::quality_
private

Definition at line 125 of file CSCALCTDigi.h.

Referenced by clear(), getQuality(), and setQuality().

◆ trknmb_

uint16_t CSCALCTDigi::trknmb_
private

Definition at line 130 of file CSCALCTDigi.h.

Referenced by clear(), getTrknmb(), and setTrknmb().

◆ valid_

uint16_t CSCALCTDigi::valid_
private

Definition at line 124 of file CSCALCTDigi.h.

Referenced by clear(), isValid(), and setValid().

◆ version_

Version CSCALCTDigi::version_
private

Definition at line 138 of file CSCALCTDigi.h.

Referenced by clear(), isRun3(), and setRun3().