CMS 3D CMS Logo

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

#include <EcalEBPhase2TriggerPrimitiveDigi.h>

Public Types

typedef EBDetId key_type
 For the sorted collection. More...
 

Public Member Functions

 EcalEBPhase2TriggerPrimitiveDigi ()
 
 EcalEBPhase2TriggerPrimitiveDigi (const EBDetId &id)
 
int encodedEt () const
 get the 12 bits Et of interesting sample More...
 
const EBDetIdid () const
 
bool isDebug () const
 True if debug mode (# of samples > 1) More...
 
bool l1aSpike () const
 Spike flag. More...
 
const EcalEBPhase2TriggerPrimitiveSampleoperator[] (int i) const
 
const EcalEBPhase2TriggerPrimitiveSamplesample (int i) const
 
int sampleOfInterest () const
 Gets the interesting sample. More...
 
void setSample (int i, const EcalEBPhase2TriggerPrimitiveSample &sam)
 
void setSampleValue (int i, uint16_t value)
 
void setSize (int size)
 
int size () const
 
void swap (EcalEBPhase2TriggerPrimitiveDigi &rh)
 
int time () const
 Time info. More...
 

Private Attributes

std::vector< EcalEBPhase2TriggerPrimitiveSampledata_
 
EBDetId id_
 
int size_
 

Detailed Description

Author
N. Marinelli - Univ. of Notre Dame

Definition at line 15 of file EcalEBPhase2TriggerPrimitiveDigi.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 17 of file EcalEBPhase2TriggerPrimitiveDigi.h.

Constructor & Destructor Documentation

◆ EcalEBPhase2TriggerPrimitiveDigi() [1/2]

EcalEBPhase2TriggerPrimitiveDigi::EcalEBPhase2TriggerPrimitiveDigi ( )

Definition at line 8 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

8 : size_(0), data_(MAXSAMPLES) {}
static constexpr int MAXSAMPLES
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ EcalEBPhase2TriggerPrimitiveDigi() [2/2]

EcalEBPhase2TriggerPrimitiveDigi::EcalEBPhase2TriggerPrimitiveDigi ( const EBDetId id)

Member Function Documentation

◆ encodedEt()

int EcalEBPhase2TriggerPrimitiveDigi::encodedEt ( ) const

get the 12 bits Et of interesting sample

get the encoded/compressed Et of interesting sample

Definition at line 28 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References data_, sample(), and sampleOfInterest().

28  {
29  int sample = sampleOfInterest();
30  if (sample != -1)
31  return data_[sample].encodedEt();
32  else
33  return -1;
34 }
int sampleOfInterest() const
Gets the interesting sample.
const EcalEBPhase2TriggerPrimitiveSample & sample(int i) const
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ id()

const EBDetId& EcalEBPhase2TriggerPrimitiveDigi::id ( ) const
inline

Definition at line 28 of file EcalEBPhase2TriggerPrimitiveDigi.h.

References id_.

Referenced by operator<<().

◆ isDebug()

bool EcalEBPhase2TriggerPrimitiveDigi::isDebug ( ) const

True if debug mode (# of samples > 1)

Definition at line 52 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References size_.

◆ l1aSpike()

bool EcalEBPhase2TriggerPrimitiveDigi::l1aSpike ( ) const

Spike flag.

Definition at line 36 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References data_, sample(), and sampleOfInterest().

36  {
37  int sample = sampleOfInterest();
38  if (sample != -1)
39  return data_[sample].l1aSpike();
40  else
41  return -1;
42 }
int sampleOfInterest() const
Gets the interesting sample.
const EcalEBPhase2TriggerPrimitiveSample & sample(int i) const
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ operator[]()

const EcalEBPhase2TriggerPrimitiveSample& EcalEBPhase2TriggerPrimitiveDigi::operator[] ( int  i) const
inline

Definition at line 31 of file EcalEBPhase2TriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

31 { return data_[i]; }
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ sample()

const EcalEBPhase2TriggerPrimitiveSample& EcalEBPhase2TriggerPrimitiveDigi::sample ( int  i) const
inline

Definition at line 32 of file EcalEBPhase2TriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

Referenced by encodedEt(), l1aSpike(), operator<<(), and time().

32 { return data_[i]; }
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ sampleOfInterest()

int EcalEBPhase2TriggerPrimitiveDigi::sampleOfInterest ( ) const

Gets the interesting sample.

Definition at line 17 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References size_.

Referenced by encodedEt(), l1aSpike(), and time().

17  {
18  // sample of interest to be save in the TP digis
19  if (size_ == 1)
20  return 0;
21  else if (size_ == 5)
22  return 2;
23  else
24  return -1;
25 }

◆ setSample()

void EcalEBPhase2TriggerPrimitiveDigi::setSample ( int  i,
const EcalEBPhase2TriggerPrimitiveSample sam 
)

Definition at line 13 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References data_, and mps_fire::i.

13  {
14  data_[i] = sam;
15 }
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ setSampleValue()

void EcalEBPhase2TriggerPrimitiveDigi::setSampleValue ( int  i,
uint16_t  value 
)
inline

Definition at line 36 of file EcalEBPhase2TriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

36 { data_[i].setValue(value); }
Definition: value.py:1
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ setSize()

void EcalEBPhase2TriggerPrimitiveDigi::setSize ( int  size)

Definition at line 54 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References MAXSAMPLES, and size_.

54 { size_ = std::clamp(size_, 0, MAXSAMPLES); }
static constexpr int MAXSAMPLES

◆ size()

int EcalEBPhase2TriggerPrimitiveDigi::size ( void  ) const
inline

◆ swap()

void EcalEBPhase2TriggerPrimitiveDigi::swap ( EcalEBPhase2TriggerPrimitiveDigi rh)
inline

Definition at line 22 of file EcalEBPhase2TriggerPrimitiveDigi.h.

References data_, id_, size_, and swap().

22  {
23  std::swap(id_, rh.id_);
24  std::swap(size_, rh.size_);
25  std::swap(data_, rh.data_);
26  }
void swap(EcalEBPhase2TriggerPrimitiveDigi &lh, EcalEBPhase2TriggerPrimitiveDigi &rh)
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

◆ time()

int EcalEBPhase2TriggerPrimitiveDigi::time ( ) const

Time info.

Definition at line 44 of file EcalEBPhase2TriggerPrimitiveDigi.cc.

References data_, sample(), and sampleOfInterest().

44  {
45  int sample = sampleOfInterest();
46  if (sample != -1)
47  return data_[sample].time();
48  else
49  return -1;
50 }
int sampleOfInterest() const
Gets the interesting sample.
const EcalEBPhase2TriggerPrimitiveSample & sample(int i) const
std::vector< EcalEBPhase2TriggerPrimitiveSample > data_

Member Data Documentation

◆ data_

std::vector<EcalEBPhase2TriggerPrimitiveSample> EcalEBPhase2TriggerPrimitiveDigi::data_
private

◆ id_

EBDetId EcalEBPhase2TriggerPrimitiveDigi::id_
private

Definition at line 54 of file EcalEBPhase2TriggerPrimitiveDigi.h.

Referenced by id(), and swap().

◆ size_

int EcalEBPhase2TriggerPrimitiveDigi::size_
private

Definition at line 55 of file EcalEBPhase2TriggerPrimitiveDigi.h.

Referenced by isDebug(), sampleOfInterest(), setSize(), size(), and swap().