CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
l1t::HGCFETriggerDigi Class Reference

#include <HGCFETriggerDigi.h>

Public Types

typedef std::vector< bool > data_payload
 
typedef uint32_t key_type
 

Public Member Functions

template<typename CODEC , typename DATA >
void decode (const CODEC &codec, DATA &data) const
 
template<typename CODEC , typename DATA >
void encode (const CODEC &codec, const DATA &data)
 
template<typename IDTYPE >
IDTYPE getDetId () const
 
unsigned char getWhichCodec () const
 
 HGCFETriggerDigi ()
 
uint32_t id () const
 
void print (std::ostream &out) const
 
template<typename CODEC >
void print (const CODEC &codec, std::ostream &out) const
 
template<typename IDTYPE >
void setDetId (const IDTYPE &id)
 
 ~HGCFETriggerDigi ()
 

Private Attributes

unsigned char codec_
 
data_payload data_
 
uint32_t detid_
 

Detailed Description

Definition at line 40 of file HGCFETriggerDigi.h.

Member Typedef Documentation

◆ data_payload

typedef std::vector<bool> l1t::HGCFETriggerDigi::data_payload

Definition at line 42 of file HGCFETriggerDigi.h.

◆ key_type

Definition at line 43 of file HGCFETriggerDigi.h.

Constructor & Destructor Documentation

◆ HGCFETriggerDigi()

l1t::HGCFETriggerDigi::HGCFETriggerDigi ( )
inline

Definition at line 45 of file HGCFETriggerDigi.h.

References detid_.

45 : codec_((unsigned char)0xffff) { detid_ = 0; }

◆ ~HGCFETriggerDigi()

l1t::HGCFETriggerDigi::~HGCFETriggerDigi ( )
inline

Definition at line 46 of file HGCFETriggerDigi.h.

46 {}

Member Function Documentation

◆ decode()

template<typename CODEC , typename DATA >
void l1t::HGCFETriggerDigi::decode ( const CODEC &  codec,
DATA &  data 
) const
inline

Definition at line 73 of file HGCFETriggerDigi.h.

References codec_, data, data_, TauDecayModes::dec, detid_, and Exception.

Referenced by ztail.Decoder::follow(), and ztail.Decoder::initial_synchronize().

73  {
74  if (codec_ != codec.getCodecType()) {
75  throw cms::Exception("HGCTriggerWrongCodec")
76  << "Wrong HGC codec: " << std::hex << codec.getCodecType()
77  << " given to data encoded with HGC codec type: " << codec_ << std::dec;
78  }
79  data = codec.decode(data_, detid_);
80  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ encode()

template<typename CODEC , typename DATA >
void l1t::HGCFETriggerDigi::encode ( const CODEC &  codec,
const DATA &  data 
)
inline

Definition at line 63 of file HGCFETriggerDigi.h.

References codec_, data, data_, TauDecayModes::dec, Exception, and l1t::hgcal_bad_codec().

63  {
64  if (codec_ != hgcal_bad_codec) {
65  throw cms::Exception("HGCTriggerAlreadyEncoded")
66  << "HGC Codec and data already set with codec: " << std::hex << codec_ << std::dec;
67  }
68  codec_ = codec.getCodecType();
69  data_ = codec.encode(data);
70  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
constexpr unsigned char hgcal_bad_codec(0xff)

◆ getDetId()

template<typename IDTYPE >
IDTYPE l1t::HGCFETriggerDigi::getDetId ( void  ) const
inline

Definition at line 51 of file HGCFETriggerDigi.h.

References detid_.

51  {
52  return IDTYPE(detid_);
53  }

◆ getWhichCodec()

unsigned char l1t::HGCFETriggerDigi::getWhichCodec ( ) const
inline

Definition at line 60 of file HGCFETriggerDigi.h.

References codec_.

60 { return codec_; }

◆ id()

uint32_t l1t::HGCFETriggerDigi::id ( ) const
inline

Definition at line 49 of file HGCFETriggerDigi.h.

References detid_.

49 { return detid_; } // for edm::SortedCollection

◆ print() [1/2]

void HGCFETriggerDigi::print ( std::ostream &  out) const

Definition at line 5 of file HGCFETriggerDigi.cc.

References codec_, data_, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by print().

5  {
6  out << "Codec type: " << static_cast<unsigned>(codec_) << std::endl;
7  out << "Raw data payload: ";
8  for (unsigned i = data_.size(); i > 0; --i) {
9  out << (unsigned)data_[i - 1];
10  }
11  out << std::endl;
12 }

◆ print() [2/2]

template<typename CODEC >
void l1t::HGCFETriggerDigi::print ( const CODEC &  codec,
std::ostream &  out 
) const

Definition at line 93 of file HGCFETriggerDigi.h.

References codec_, data_, detid_, Exception, MillePedeFileConverter_cfg::out, and print().

93  {
94  if (codec_ != codec.getCodecType()) {
95  throw cms::Exception("HGCTriggerWrongCodec")
96  << "Wrong HGC codec: " << codec.getCodecType() << " given to data encoded with HGC codec type: " << codec_;
97  }
98  out << codec.decode(data_, detid_);
99  out << std::endl << " decoded from: " << std::endl;
100  this->print(out);
101  }
void print(std::ostream &out) const

◆ setDetId()

template<typename IDTYPE >
void l1t::HGCFETriggerDigi::setDetId ( const IDTYPE &  id)
inline

Definition at line 55 of file HGCFETriggerDigi.h.

References detid_.

55  {
56  detid_ = id.rawId();
57  }

Member Data Documentation

◆ codec_

unsigned char l1t::HGCFETriggerDigi::codec_
private

Definition at line 88 of file HGCFETriggerDigi.h.

Referenced by decode(), encode(), getWhichCodec(), and print().

◆ data_

data_payload l1t::HGCFETriggerDigi::data_
private

Definition at line 89 of file HGCFETriggerDigi.h.

Referenced by decode(), encode(), and print().

◆ detid_

uint32_t l1t::HGCFETriggerDigi::detid_
private

Definition at line 87 of file HGCFETriggerDigi.h.

Referenced by decode(), getDetId(), HGCFETriggerDigi(), id(), print(), and setDetId().