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.

46 : codec_((unsigned char)0xffff) {}
l1t::HGCFETriggerDigi::~HGCFETriggerDigi ( )
inline

Definition at line 47 of file HGCFETriggerDigi.h.

47 {}

Member Function Documentation

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

Definition at line 71 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().

71  {
72  if( codec_ != codec.getCodecType() ){
73  throw cms::Exception("HGCTriggerWrongCodec")
74  << "Wrong HGC codec: " << std::hex << codec.getCodecType()
75  << " given to data encoded with HGC codec type: "
76  << codec_ << std::dec;
77  }
78  data = codec.decode(data_, detid_);
79  }
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 60 of file HGCFETriggerDigi.h.

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

60  {
61  if( codec_ != hgcal_bad_codec ) {
62  throw cms::Exception("HGCTriggerAlreadyEncoded")
63  << "HGC Codec and data already set with codec: "
64  << std::hex << codec_ << std::dec;
65  }
66  codec_ = codec.getCodecType();
67  data_ = codec.encode(data);
68  }
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 52 of file HGCFETriggerDigi.h.

References detid_.

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

Definition at line 57 of file HGCFETriggerDigi.h.

References codec_.

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

Definition at line 50 of file HGCFETriggerDigi.h.

References detid_.

50 { 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 92 of file HGCFETriggerDigi.h.

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

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

Definition at line 54 of file HGCFETriggerDigi.h.

References detid_.

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

54 { detid_ = id.rawId(); }

Member Data Documentation

unsigned char l1t::HGCFETriggerDigi::codec_
private

Definition at line 87 of file HGCFETriggerDigi.h.

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

data_payload l1t::HGCFETriggerDigi::data_
private

Definition at line 88 of file HGCFETriggerDigi.h.

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

uint32_t l1t::HGCFETriggerDigi::detid_
private

Definition at line 86 of file HGCFETriggerDigi.h.

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