CMS 3D CMS Logo

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

#include <EcalTriggerPrimitiveDigi.h>

Public Types

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

Public Member Functions

int compressedEt () const
 get the encoded/compressed Et of interesting sample More...
 
 EcalTriggerPrimitiveDigi ()
 
 EcalTriggerPrimitiveDigi (const EcalTrigTowerDetId &id)
 
bool fineGrain () const
 get the fine-grain bit of interesting sample More...
 
const EcalTrigTowerDetIdid () const
 
bool isDebug () const
 True if debug mode (# of samples > 1) More...
 
int l1aSpike () const
 
const EcalTriggerPrimitiveSampleoperator[] (int i) const
 
const EcalTriggerPrimitiveSamplesample (int i) const
 
int sampleOfInterest () const
 Gets the interesting sample. More...
 
void setSample (int i, const EcalTriggerPrimitiveSample &sam)
 
void setSampleValue (int i, uint16_t value)
 
void setSize (int size)
 
int sFGVB () const
 
int size () const
 
void swap (EcalTriggerPrimitiveDigi &rh)
 
int ttFlag () const
 get the Trigger tower Flag of interesting sample More...
 

Static Public Attributes

static const int MAXSAMPLES = 20
 

Private Attributes

std::vector< EcalTriggerPrimitiveSampledata_
 
EcalTrigTowerDetId id_
 
int size_
 

Detailed Description

see also EcalTrigPrimCompactColl.

Definition at line 16 of file EcalTriggerPrimitiveDigi.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 18 of file EcalTriggerPrimitiveDigi.h.

Constructor & Destructor Documentation

◆ EcalTriggerPrimitiveDigi() [1/2]

EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi ( )

Definition at line 4 of file EcalTriggerPrimitiveDigi.cc.

4 : size_(0), data_(MAXSAMPLES) {}
std::vector< EcalTriggerPrimitiveSample > data_

◆ EcalTriggerPrimitiveDigi() [2/2]

EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi ( const EcalTrigTowerDetId id)
explicit

Definition at line 6 of file EcalTriggerPrimitiveDigi.cc.

7  : id_(id), size_(0), data_(MAXSAMPLES) {}
std::vector< EcalTriggerPrimitiveSample > data_

Member Function Documentation

◆ compressedEt()

int EcalTriggerPrimitiveDigi::compressedEt ( ) const

get the encoded/compressed Et of interesting sample

Definition at line 19 of file EcalTriggerPrimitiveDigi.cc.

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

Referenced by TCCBlockFormatter::DigiToRaw(), EcalTPGScale::getTPGInGeV(), EcalFEtoDigi::produce(), and EcalTrigPrimFunctionalAlgo::run_part2().

19  {
20  int sample = sampleOfInterest();
21  if (sample != -1)
22  return data_[sample].compressedEt();
23  else
24  return -1;
25 }
int sampleOfInterest() const
Gets the interesting sample.
std::vector< EcalTriggerPrimitiveSample > data_
const EcalTriggerPrimitiveSample & sample(int i) const

◆ fineGrain()

bool EcalTriggerPrimitiveDigi::fineGrain ( ) const

get the fine-grain bit of interesting sample

Definition at line 28 of file EcalTriggerPrimitiveDigi.cc.

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

Referenced by TCCBlockFormatter::DigiToRaw(), and EcalFEtoDigi::produce().

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

◆ id()

const EcalTrigTowerDetId& EcalTriggerPrimitiveDigi::id ( ) const
inline

◆ isDebug()

bool EcalTriggerPrimitiveDigi::isDebug ( ) const

True if debug mode (# of samples > 1)

Definition at line 52 of file EcalTriggerPrimitiveDigi.cc.

References size_.

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

◆ l1aSpike()

int EcalTriggerPrimitiveDigi::l1aSpike ( ) const
inline

Gets the L1A spike detection flag. Beware the flag is inverted. Deprecated, use instead sFGVB() method, whose name is less missleading

Returns
0 spike like pattern 1 EM shower like pattern

Definition at line 59 of file EcalTriggerPrimitiveDigi.h.

References sFGVB().

59 { return sFGVB(); }

◆ operator[]()

const EcalTriggerPrimitiveSample& EcalTriggerPrimitiveDigi::operator[] ( int  i) const
inline

Definition at line 32 of file EcalTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

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

◆ sample()

const EcalTriggerPrimitiveSample& EcalTriggerPrimitiveDigi::sample ( int  i) const
inline

Definition at line 33 of file EcalTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

Referenced by compressedEt(), fineGrain(), operator<<(), sFGVB(), and ttFlag().

33 { return data_[i]; }
std::vector< EcalTriggerPrimitiveSample > data_

◆ sampleOfInterest()

int EcalTriggerPrimitiveDigi::sampleOfInterest ( ) const

Gets the interesting sample.

Definition at line 9 of file EcalTriggerPrimitiveDigi.cc.

References size_.

Referenced by compressedEt(), fineGrain(), sFGVB(), and ttFlag().

9  {
10  if (size_ == 1)
11  return 0;
12  else if (size_ == 5)
13  return 2;
14  else
15  return -1;
16 }

◆ setSample()

void EcalTriggerPrimitiveDigi::setSample ( int  i,
const EcalTriggerPrimitiveSample sam 
)
inline

◆ setSampleValue()

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

Definition at line 37 of file EcalTriggerPrimitiveDigi.h.

References data_, and mps_fire::i.

Referenced by DCCEBTCCBlock::addTriggerPrimitivesToCollection().

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

◆ setSize()

void EcalTriggerPrimitiveDigi::setSize ( int  size)

◆ sFGVB()

int EcalTriggerPrimitiveDigi::sFGVB ( ) const

Gets the "strip fine grain veto bit" (sFGVB) used as L1A spike detection

Returns
0 spike like pattern 1 EM shower like pattern

Definition at line 44 of file EcalTriggerPrimitiveDigi.cc.

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

Referenced by l1aSpike().

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

◆ size()

int EcalTriggerPrimitiveDigi::size ( void  ) const
inline

◆ swap()

void EcalTriggerPrimitiveDigi::swap ( EcalTriggerPrimitiveDigi rh)
inline

Definition at line 23 of file EcalTriggerPrimitiveDigi.h.

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

23  {
24  std::swap(id_, rh.id_);
25  std::swap(size_, rh.size_);
26  std::swap(data_, rh.data_);
27  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< EcalTriggerPrimitiveSample > data_

◆ ttFlag()

int EcalTriggerPrimitiveDigi::ttFlag ( ) const

get the Trigger tower Flag of interesting sample

Definition at line 36 of file EcalTriggerPrimitiveDigi.cc.

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

Referenced by TCCBlockFormatter::DigiToRaw(), EcalSelectiveReadoutProducer::printTTFlags(), and EcalFEtoDigi::produce().

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

Member Data Documentation

◆ data_

std::vector<EcalTriggerPrimitiveSample> EcalTriggerPrimitiveDigi::data_
private

◆ id_

EcalTrigTowerDetId EcalTriggerPrimitiveDigi::id_
private

Definition at line 68 of file EcalTriggerPrimitiveDigi.h.

Referenced by id(), and swap().

◆ MAXSAMPLES

const int EcalTriggerPrimitiveDigi::MAXSAMPLES = 20
static

Definition at line 39 of file EcalTriggerPrimitiveDigi.h.

Referenced by setSize().

◆ size_

int EcalTriggerPrimitiveDigi::size_
private

Definition at line 69 of file EcalTriggerPrimitiveDigi.h.

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