CMS 3D CMS Logo

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

#include <PulseArray.h>

Public Member Functions

unsigned bitsInPulse () const
 
void clear ()
 
void extend (const unsigned layer, const unsigned channel, const unsigned bx, const unsigned hit_persist)
 
void initialize (unsigned numberOfChannels)
 
bool isOneShotHighAtBX (const unsigned layer, const unsigned channel, const unsigned bx) const
 
unsigned numberOfLayersAtBX (const unsigned bx) const
 
bool oneShotAtBX (const unsigned layer, const unsigned channel, const unsigned bx) const
 
unsigned & operator() (const unsigned layer, const unsigned channel)
 
 PulseArray ()
 

Private Attributes

std::vector< std::vector< unsigned > > data_
 
unsigned numberOfChannels_
 

Detailed Description

Definition at line 11 of file PulseArray.h.

Constructor & Destructor Documentation

◆ PulseArray()

PulseArray::PulseArray ( )

Definition at line 3 of file PulseArray.cc.

3 {}

Member Function Documentation

◆ bitsInPulse()

unsigned PulseArray::bitsInPulse ( ) const

Definition at line 25 of file PulseArray.cc.

25 { return 8 * sizeof(data_[0][0]); }

References data_.

Referenced by CSCCathodeLCTProcessor::pulseExtension(), and CSCAnodeLCTProcessor::pulseExtension().

◆ clear()

void PulseArray::clear ( void  )

Definition at line 14 of file PulseArray.cc.

14  {
15  // set all elements in the 2D vector to 0
16  for (auto& p : data_) {
17  for (auto& q : p) {
18  q = 0;
19  }
20  }
21 }

References data_, AlCaHLTBitMon_ParallelJobs::p, and submitPVResolutionJobs::q.

Referenced by CSCCathodeLCTProcessor::pulseExtension(), and CSCAnodeLCTProcessor::pulseExtension().

◆ extend()

void PulseArray::extend ( const unsigned  layer,
const unsigned  channel,
const unsigned  bx,
const unsigned  hit_persist 
)

Definition at line 27 of file PulseArray.cc.

27  {
28  for (unsigned int ibx = bx; ibx < bx + hit_persist; ++ibx) {
29  data_[layer][channel] = data_[layer][channel] | (1 << ibx);
30  }
31 }

References l1GtPatternGenerator_cfi::bx, data_, and phase1PixelTopology::layer.

Referenced by MatrixUtil.WF::__init__(), CSCCathodeLCTProcessor::pulseExtension(), and CSCAnodeLCTProcessor::pulseExtension().

◆ initialize()

void PulseArray::initialize ( unsigned  numberOfChannels)

Definition at line 5 of file PulseArray.cc.

5  {
6  numberOfChannels_ = numberOfChannels;
7  data_.clear();
9  for (unsigned layer = 0; layer < CSCConstants::NUM_LAYERS; layer++) {
10  data_[layer].resize(numberOfChannels);
11  }
12 }

References data_, phase1PixelTopology::layer, CSCConstants::NUM_LAYERS, and numberOfChannels_.

Referenced by CSCCathodeLCTProcessor::run(), and CSCAnodeLCTProcessor::run().

◆ isOneShotHighAtBX()

bool PulseArray::isOneShotHighAtBX ( const unsigned  layer,
const unsigned  channel,
const unsigned  bx 
) const

◆ numberOfLayersAtBX()

unsigned PulseArray::numberOfLayersAtBX ( const unsigned  bx) const

Definition at line 41 of file PulseArray.cc.

41  {
42  unsigned layers_hit = 0;
43  for (unsigned layer = 0; layer < CSCConstants::NUM_LAYERS; layer++) {
44  for (unsigned channel = 0; channel < numberOfChannels_; channel++) {
45  if (isOneShotHighAtBX(layer, channel, bx)) {
46  layers_hit++;
47  break;
48  }
49  }
50  }
51  return layers_hit;
52 }

References l1GtPatternGenerator_cfi::bx, isOneShotHighAtBX(), phase1PixelTopology::layer, CSCConstants::NUM_LAYERS, and numberOfChannels_.

Referenced by CSCCathodeLCTProcessor::patternFinding().

◆ oneShotAtBX()

bool PulseArray::oneShotAtBX ( const unsigned  layer,
const unsigned  channel,
const unsigned  bx 
) const

Definition at line 33 of file PulseArray.cc.

33  {
34  return (data_[layer][channel] >> bx) & 1;
35 }

References l1GtPatternGenerator_cfi::bx, data_, and phase1PixelTopology::layer.

Referenced by isOneShotHighAtBX(), CSCAnodeLCTProcessor::pulseExtension(), and CSCAnodeLCTProcessor::showPatterns().

◆ operator()()

unsigned & PulseArray::operator() ( const unsigned  layer,
const unsigned  channel 
)

Definition at line 23 of file PulseArray.cc.

23 { return data_[layer][channel]; }

References data_, and phase1PixelTopology::layer.

Member Data Documentation

◆ data_

std::vector<std::vector<unsigned> > PulseArray::data_
private

Definition at line 41 of file PulseArray.h.

Referenced by bitsInPulse(), clear(), extend(), initialize(), oneShotAtBX(), and operator()().

◆ numberOfChannels_

unsigned PulseArray::numberOfChannels_
private

Definition at line 42 of file PulseArray.h.

Referenced by initialize(), and numberOfLayersAtBX().

l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:103
PulseArray::numberOfChannels_
unsigned numberOfChannels_
Definition: PulseArray.h:42
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PulseArray::isOneShotHighAtBX
bool isOneShotHighAtBX(const unsigned layer, const unsigned channel, const unsigned bx) const
Definition: PulseArray.cc:37
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
PulseArray::data_
std::vector< std::vector< unsigned > > data_
Definition: PulseArray.h:41
PulseArray::oneShotAtBX
bool oneShotAtBX(const unsigned layer, const unsigned channel, const unsigned bx) const
Definition: PulseArray.cc:33