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

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

Definition at line 43 of file HGCFETriggerDigi.h.

Definition at line 44 of file HGCFETriggerDigi.h.

Constructor & Destructor Documentation

l1t::HGCFETriggerDigi::HGCFETriggerDigi ( )
inline

Definition at line 46 of file HGCFETriggerDigi.h.

References detid_.

46  : codec_((unsigned char)0xffff) {
47  detid_ = 0;
48  }
l1t::HGCFETriggerDigi::~HGCFETriggerDigi ( )
inline

Definition at line 49 of file HGCFETriggerDigi.h.

49 {}

Member Function Documentation

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_, TauDecayModes::dec, detid_, Exception, MillePedeFileConverter_cfg::out, and print().

Referenced by ztail.Decoder::follow(), ztail.Decoder::initial_synchronize(), HGCalBestChoiceCodec::setDataPayloadImpl(), HGCalTriggerCellBestChoiceCodec::setDataPayloadImpl(), and HGCalTriggerCellThresholdCodec::setDataPayloadImpl().

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: "
78  << codec_ << std::dec;
79  }
80  data = codec.decode(data_, detid_);
81  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename CODEC , typename DATA >
void l1t::HGCFETriggerDigi::encode ( const CODEC &  codec,
const DATA &  data 
)
inline

Definition at line 62 of file HGCFETriggerDigi.h.

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

62  {
63  if( codec_ != hgcal_bad_codec ) {
64  throw cms::Exception("HGCTriggerAlreadyEncoded")
65  << "HGC Codec and data already set with codec: "
66  << std::hex << codec_ << std::dec;
67  }
68  codec_ = codec.getCodecType();
69  data_ = codec.encode(data);
70  }
unsigned char hgcal_bad_codec(0xff)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename IDTYPE >
IDTYPE l1t::HGCFETriggerDigi::getDetId ( void  ) const
inline

Definition at line 54 of file HGCFETriggerDigi.h.

References detid_.

54 { return IDTYPE(detid_); }
unsigned char l1t::HGCFETriggerDigi::getWhichCodec ( ) const
inline

Definition at line 59 of file HGCFETriggerDigi.h.

References codec_.

59 { return codec_; }
uint32_t l1t::HGCFETriggerDigi::id ( ) const
inline

Definition at line 52 of file HGCFETriggerDigi.h.

References detid_.

52 { return detid_; } // for edm::SortedCollection
void HGCFETriggerDigi::print ( std::ostream &  out) const

Definition at line 5 of file HGCFETriggerDigi.cc.

References codec_, data_, and mps_fire::i.

Referenced by decode(), print(), and HGCalTriggerFE::Codec< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload >::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 }
template<typename CODEC >
void l1t::HGCFETriggerDigi::print ( const CODEC &  codec,
std::ostream &  out 
) const

Definition at line 94 of file HGCFETriggerDigi.h.

References codec_, data_, detid_, Exception, and print().

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

Definition at line 56 of file HGCFETriggerDigi.h.

References detid_.

Referenced by HGCalTriggerDigiProducer::produce(), and HGCalTriggerDigiFEReproducer::produce().

56 { detid_ = id.rawId(); }

Member Data Documentation

unsigned char l1t::HGCFETriggerDigi::codec_
private

Definition at line 89 of file HGCFETriggerDigi.h.

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

data_payload l1t::HGCFETriggerDigi::data_
private

Definition at line 90 of file HGCFETriggerDigi.h.

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

uint32_t l1t::HGCFETriggerDigi::detid_
private

Definition at line 88 of file HGCFETriggerDigi.h.

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