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 17 of file EcalEBTriggerPrimitiveDigi.h.

Member Typedef Documentation

For the sorted collection.

Definition at line 19 of file EcalEBTriggerPrimitiveDigi.h.

Constructor & Destructor Documentation

EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi ( )

Definition at line 5 of file EcalEBTriggerPrimitiveDigi.cc.

5  : size_(0), data_(MAXSAMPLES) {
6 }
std::vector< EcalEBTriggerPrimitiveSample > data_
EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi ( const EBDetId id)

Definition at line 11 of file EcalEBTriggerPrimitiveDigi.cc.

Member Function Documentation

int EcalEBTriggerPrimitiveDigi::encodedEt ( ) const

get the 10 bits Et of interesting sample

get the encoded/compressed Et of interesting sample

Definition at line 34 of file EcalEBTriggerPrimitiveDigi.cc.

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

Referenced by EcalEBTrigPrimAnalyzer::analyze().

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

Definition at line 31 of file EcalEBTriggerPrimitiveDigi.h.

References id_.

Referenced by EcalEBTrigPrimAnalyzer::analyze(), and operator<<().

bool EcalEBTriggerPrimitiveDigi::isDebug ( ) const

True if debug mode (# of samples > 1)

Definition at line 62 of file EcalEBTriggerPrimitiveDigi.cc.

References size_.

63 {
64  if (size_ == 1)
65  return false;
66  else if (size_ > 1)
67  return true;
68  return false;
69 }
bool EcalEBTriggerPrimitiveDigi::l1aSpike ( ) const

Spike flag.

Definition at line 44 of file EcalEBTriggerPrimitiveDigi.cc.

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

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

Definition at line 34 of file EcalEBTriggerPrimitiveDigi.h.

References data_, and i.

34 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< EcalEBTriggerPrimitiveSample > data_
const EcalEBTriggerPrimitiveSample& EcalEBTriggerPrimitiveDigi::sample ( int  i) const
inline

Definition at line 35 of file EcalEBTriggerPrimitiveDigi.h.

References data_, i, setSample(), setSize(), and size().

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

35 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< EcalEBTriggerPrimitiveSample > data_
int EcalEBTriggerPrimitiveDigi::sampleOfInterest ( ) const

Gets the interesting sample.

Definition at line 23 of file EcalEBTriggerPrimitiveDigi.cc.

References size_.

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

24 {
25  if (size_ == 1)
26  return 0;
27  else if (size_ == 5)
28  return 2;
29  else
30  return -1;
31 }
void EcalEBTriggerPrimitiveDigi::setSample ( int  i,
const EcalEBTriggerPrimitiveSample sam 
)

Definition at line 15 of file EcalEBTriggerPrimitiveDigi.cc.

References data_, and i.

Referenced by EcalEBTrigPrimTestAlgo::run(), and sample().

16 {
17 // std::cout << " In setSample i " << i << " sam " << sam << std::endl;
18  data_[i]=sam;
19 // std::cout << " In setSample data_[i] " << data_[i] << std::endl;
20 
21 }
int i
Definition: DBlmapReader.cc:9
std::vector< EcalEBTriggerPrimitiveSample > data_
void EcalEBTriggerPrimitiveDigi::setSampleValue ( int  i,
uint16_t  value 
)
inline

Definition at line 39 of file EcalEBTriggerPrimitiveDigi.h.

References data_, and i.

39 { data_[i].setValue(value); }
int i
Definition: DBlmapReader.cc:9
std::vector< EcalEBTriggerPrimitiveSample > data_
Definition: value.py:1
void EcalEBTriggerPrimitiveDigi::setSize ( int  size)

Definition at line 71 of file EcalEBTriggerPrimitiveDigi.cc.

References MAXSAMPLES, size(), and size_.

Referenced by EcalEBTrigPrimTestAlgo::run(), and sample().

int EcalEBTriggerPrimitiveDigi::size ( void  ) const
inline
void EcalEBTriggerPrimitiveDigi::swap ( EcalEBTriggerPrimitiveDigi rh)
inline

Definition at line 25 of file EcalEBTriggerPrimitiveDigi.h.

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

Referenced by swap().

25  {
26  std::swap(id_,rh.id_);
27  std::swap(size_,rh.size_);
28  std::swap(data_,rh.data_);
29  }
std::vector< EcalEBTriggerPrimitiveSample > data_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
int EcalEBTriggerPrimitiveDigi::time ( ) const

Time info.

Definition at line 53 of file EcalEBTriggerPrimitiveDigi.cc.

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

54 {
55  int sample = sampleOfInterest();
56  if (sample != -1)
57  return data_[sample].time();
58  else
59  return -1;
60 }
std::vector< EcalEBTriggerPrimitiveSample > data_
const EcalEBTriggerPrimitiveSample & sample(int i) const
int sampleOfInterest() const
Gets the interesting sample.

Member Data Documentation

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

Definition at line 59 of file EcalEBTriggerPrimitiveDigi.h.

Referenced by id(), and swap().

const int EcalEBTriggerPrimitiveDigi::MAXSAMPLES = 20
static

Definition at line 41 of file EcalEBTriggerPrimitiveDigi.h.

Referenced by setSize().

int EcalEBTriggerPrimitiveDigi::size_
private

Definition at line 60 of file EcalEBTriggerPrimitiveDigi.h.

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