CMS 3D CMS Logo

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

#include <EcalEBTriggerPrimitiveDigi.h>

Public Types

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

Public Member Functions

 EcalEBTriggerPrimitiveDigi ()
 
 EcalEBTriggerPrimitiveDigi (const EBDetId &id)
 
int encodedEt () const
 get the 10 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 EcalEBTriggerPrimitiveSampleoperator[] (int i) const
 
const EcalEBTriggerPrimitiveSamplesample (int i) const
 
int sampleOfInterest () const
 Gets the interesting sample. More...
 
void setSample (int i, const EcalEBTriggerPrimitiveSample &sam)
 
void setSampleValue (int i, uint16_t value)
 
void setSize (int size)
 
int size () const
 
void swap (EcalEBTriggerPrimitiveDigi &rh)
 
int time () const
 Time info. More...
 

Static Public Attributes

static const int MAXSAMPLES = 20
 

Private Attributes

std::vector< EcalEBTriggerPrimitiveSampledata_
 
EBDetId id_
 
int size_
 

Detailed Description

Author
N. Marinelli - Univ. of Notre Dame

Definition at line 15 of file EcalEBTriggerPrimitiveDigi.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 17 of file EcalEBTriggerPrimitiveDigi.h.

Constructor & Destructor Documentation

◆ EcalEBTriggerPrimitiveDigi() [1/2]

EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi ( )

Definition at line 4 of file EcalEBTriggerPrimitiveDigi.cc.

4 : size_(0), data_(MAXSAMPLES) {}

◆ EcalEBTriggerPrimitiveDigi() [2/2]

EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi ( const EBDetId id)

Definition at line 9 of file EcalEBTriggerPrimitiveDigi.cc.

9 : id_(id), size_(0), data_(MAXSAMPLES) {}

Member Function Documentation

◆ encodedEt()

int EcalEBTriggerPrimitiveDigi::encodedEt ( ) const

get the 10 bits Et of interesting sample

get the encoded/compressed Et of interesting sample

Definition at line 27 of file EcalEBTriggerPrimitiveDigi.cc.

27  {
28  int sample = sampleOfInterest();
29  if (sample != -1)
30  return data_[sample].encodedEt();
31  else
32  return -1;
33 }

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

◆ id()

const EBDetId& EcalEBTriggerPrimitiveDigi::id ( ) const
inline

Definition at line 28 of file EcalEBTriggerPrimitiveDigi.h.

28 { return id_; }

References id_.

Referenced by operator<<().

◆ isDebug()

bool EcalEBTriggerPrimitiveDigi::isDebug ( ) const

True if debug mode (# of samples > 1)

Definition at line 51 of file EcalEBTriggerPrimitiveDigi.cc.

51  {
52  if (size_ == 1)
53  return false;
54  else if (size_ > 1)
55  return true;
56  return false;
57 }

References size_.

◆ l1aSpike()

bool EcalEBTriggerPrimitiveDigi::l1aSpike ( ) const

Spike flag.

Definition at line 35 of file EcalEBTriggerPrimitiveDigi.cc.

35  {
36  int sample = sampleOfInterest();
37  if (sample != -1)
38  return data_[sample].l1aSpike();
39  else
40  return -1;
41 }

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

◆ operator[]()

const EcalEBTriggerPrimitiveSample& EcalEBTriggerPrimitiveDigi::operator[] ( int  i) const
inline

Definition at line 31 of file EcalEBTriggerPrimitiveDigi.h.

31 { return data_[i]; }

References data_, and mps_fire::i.

◆ sample()

const EcalEBTriggerPrimitiveSample& EcalEBTriggerPrimitiveDigi::sample ( int  i) const
inline

Definition at line 32 of file EcalEBTriggerPrimitiveDigi.h.

32 { return data_[i]; }

References data_, and mps_fire::i.

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

◆ sampleOfInterest()

int EcalEBTriggerPrimitiveDigi::sampleOfInterest ( ) const

Gets the interesting sample.

Definition at line 17 of file EcalEBTriggerPrimitiveDigi.cc.

17  {
18  if (size_ == 1)
19  return 0;
20  else if (size_ == 5)
21  return 2;
22  else
23  return -1;
24 }

References size_.

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

◆ setSample()

void EcalEBTriggerPrimitiveDigi::setSample ( int  i,
const EcalEBTriggerPrimitiveSample sam 
)

Definition at line 11 of file EcalEBTriggerPrimitiveDigi.cc.

11  {
12  // std::cout << " In setSample i " << i << " sam " << sam << std::endl;
13  data_[i] = sam;
14  // std::cout << " In setSample data_[i] " << data_[i] << std::endl;
15 }

References data_, and mps_fire::i.

◆ setSampleValue()

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

Definition at line 36 of file EcalEBTriggerPrimitiveDigi.h.

36 { data_[i].setValue(value); }

References data_, and mps_fire::i.

◆ setSize()

void EcalEBTriggerPrimitiveDigi::setSize ( int  size)

Definition at line 59 of file EcalEBTriggerPrimitiveDigi.cc.

59  {
60  if (size < 0)
61  size_ = 0;
62  else if (size > MAXSAMPLES)
63  size_ = MAXSAMPLES;
64  else
65  size_ = size;
66 }

References MAXSAMPLES, size(), and size_.

◆ size()

int EcalEBTriggerPrimitiveDigi::size ( void  ) const
inline

◆ swap()

void EcalEBTriggerPrimitiveDigi::swap ( EcalEBTriggerPrimitiveDigi rh)
inline

Definition at line 22 of file EcalEBTriggerPrimitiveDigi.h.

22  {
23  std::swap(id_, rh.id_);
24  std::swap(size_, rh.size_);
25  std::swap(data_, rh.data_);
26  }

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

◆ time()

int EcalEBTriggerPrimitiveDigi::time ( ) const

Time info.

Definition at line 43 of file EcalEBTriggerPrimitiveDigi.cc.

43  {
44  int sample = sampleOfInterest();
45  if (sample != -1)
46  return data_[sample].time();
47  else
48  return -1;
49 }

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

Member Data Documentation

◆ data_

std::vector<EcalEBTriggerPrimitiveSample> EcalEBTriggerPrimitiveDigi::data_
private

◆ id_

EBDetId EcalEBTriggerPrimitiveDigi::id_
private

Definition at line 56 of file EcalEBTriggerPrimitiveDigi.h.

Referenced by id(), and swap().

◆ MAXSAMPLES

const int EcalEBTriggerPrimitiveDigi::MAXSAMPLES = 20
static

Definition at line 38 of file EcalEBTriggerPrimitiveDigi.h.

Referenced by setSize().

◆ size_

int EcalEBTriggerPrimitiveDigi::size_
private

Definition at line 57 of file EcalEBTriggerPrimitiveDigi.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
EcalEBTriggerPrimitiveDigi::size_
int size_
Definition: EcalEBTriggerPrimitiveDigi.h:57
EcalEBTriggerPrimitiveDigi::id_
EBDetId id_
Definition: EcalEBTriggerPrimitiveDigi.h:56
EcalEBTriggerPrimitiveDigi::size
int size() const
Definition: EcalEBTriggerPrimitiveDigi.h:29
EcalEBTriggerPrimitiveDigi::sample
const EcalEBTriggerPrimitiveSample & sample(int i) const
Definition: EcalEBTriggerPrimitiveDigi.h:32
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
EcalEBTriggerPrimitiveDigi::MAXSAMPLES
static const int MAXSAMPLES
Definition: EcalEBTriggerPrimitiveDigi.h:38
value
Definition: value.py:1
EcalEBTriggerPrimitiveDigi::data_
std::vector< EcalEBTriggerPrimitiveSample > data_
Definition: EcalEBTriggerPrimitiveDigi.h:58
EcalEBTriggerPrimitiveDigi::sampleOfInterest
int sampleOfInterest() const
Gets the interesting sample.
Definition: EcalEBTriggerPrimitiveDigi.cc:17