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.

◆ EcalEBTriggerPrimitiveDigi() [2/2]

EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi ( const EBDetId id)

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.

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

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

◆ id()

const EBDetId& EcalEBTriggerPrimitiveDigi::id ( ) const
inline

Definition at line 28 of file EcalEBTriggerPrimitiveDigi.h.

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.

References size_.

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

◆ l1aSpike()

bool EcalEBTriggerPrimitiveDigi::l1aSpike ( ) const

Spike flag.

Definition at line 35 of file EcalEBTriggerPrimitiveDigi.cc.

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

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

◆ operator[]()

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

Definition at line 31 of file EcalEBTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

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

◆ sample()

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

Definition at line 32 of file EcalEBTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

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

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

◆ sampleOfInterest()

int EcalEBTriggerPrimitiveDigi::sampleOfInterest ( ) const

Gets the interesting sample.

Definition at line 17 of file EcalEBTriggerPrimitiveDigi.cc.

References size_.

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

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

◆ setSample()

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

Definition at line 11 of file EcalEBTriggerPrimitiveDigi.cc.

References data_, and mps_fire::i.

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 }
std::vector< EcalEBTriggerPrimitiveSample > data_

◆ setSampleValue()

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

Definition at line 36 of file EcalEBTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

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

◆ setSize()

void EcalEBTriggerPrimitiveDigi::setSize ( int  size)

Definition at line 59 of file EcalEBTriggerPrimitiveDigi.cc.

References MAXSAMPLES, size(), and size_.

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

◆ size()

int EcalEBTriggerPrimitiveDigi::size ( void  ) const
inline

◆ swap()

void EcalEBTriggerPrimitiveDigi::swap ( EcalEBTriggerPrimitiveDigi rh)
inline

Definition at line 22 of file EcalEBTriggerPrimitiveDigi.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  }
std::vector< EcalEBTriggerPrimitiveSample > data_
void swap(EcalEBTriggerPrimitiveDigi &lh, EcalEBTriggerPrimitiveDigi &rh)

◆ time()

int EcalEBTriggerPrimitiveDigi::time ( ) const

Time info.

Definition at line 43 of file EcalEBTriggerPrimitiveDigi.cc.

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

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

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().