CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Attributes
HGCalTriggerFE::Codec< Impl, DATA > Class Template Reference

#include <HGCalTriggerFECodecBase.h>

Inheritance diagram for HGCalTriggerFE::Codec< Impl, DATA >:
HGCalTriggerFECodecBase

Public Member Functions

 Codec (const edm::ParameterSet &conf)
 
void decode (const l1t::HGCFETriggerDigi &digi) final
 
DATA decode (const std::vector< bool > &data, const uint32_t module=0) const
 
std::vector< bool > encode (const DATA &data) const
 
void encode (l1t::HGCFETriggerDigi &digi) final
 
std::vector< bool > getDataPayload () const final
 
void print (const l1t::HGCFETriggerDigi &digi, std::ostream &out=std::cout) const final
 
void setDataPayload (const HGCalDigiCollection &ee, const HGCalDigiCollection &fh, const HGCalDigiCollection &bh) final
 
void setDataPayload (const l1t::HGCFETriggerDigi &digi) final
 
void unSetDataPayload () final
 
- Public Member Functions inherited from HGCalTriggerFECodecBase
const unsigned char getCodecType () const
 
 HGCalTriggerFECodecBase (const edm::ParameterSet &conf)
 
const std::string & name () const
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
virtual ~HGCalTriggerFECodecBase ()
 

Protected Attributes

DATA data_
 
- Protected Attributes inherited from HGCalTriggerFECodecBase
const HGCalTriggerGeometryBasegeometry_
 

Private Attributes

bool dataIsSet_
 

Detailed Description

template<typename Impl, typename DATA>
class HGCalTriggerFE::Codec< Impl, DATA >

Definition at line 64 of file HGCalTriggerFECodecBase.h.

Constructor & Destructor Documentation

◆ Codec()

template<typename Impl , typename DATA >
HGCalTriggerFE::Codec< Impl, DATA >::Codec ( const edm::ParameterSet conf)
inline

Definition at line 66 of file HGCalTriggerFECodecBase.h.

66 :

Member Function Documentation

◆ decode() [1/2]

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::decode ( const l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 77 of file HGCalTriggerFECodecBase.h.

78  {
79  if (dataIsSet_) {
80  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
81  << "Data payload was already set for HGCTriggerFECodec: " << this->name() << " overwriting current data!";
82  }
83  digi.decode(static_cast<const Impl&>(*this), data_);
84  dataIsSet_ = true;

◆ decode() [2/2]

template<typename Impl , typename DATA >
DATA HGCalTriggerFE::Codec< Impl, DATA >::decode ( const std::vector< bool > &  data,
const uint32_t  module = 0 
) const
inline

Definition at line 132 of file HGCalTriggerFECodecBase.h.

133  {
134  if (geometry_ == nullptr) {
135  throw cms::Exception("HGCTriggerBadInitialization")
136  << "The HGC trigger geometry has not been passed to the front-end codec\n";
137  }
138  return static_cast<const Impl&>(*this).decodeImpl(data, module);

References data, Exception, and HGCalTriggerFECodecBase::geometry_.

◆ encode() [1/2]

template<typename Impl , typename DATA >
std::vector<bool> HGCalTriggerFE::Codec< Impl, DATA >::encode ( const DATA &  data) const
inline

Definition at line 124 of file HGCalTriggerFECodecBase.h.

125  {
126  if (geometry_ == nullptr) {
127  throw cms::Exception("HGCTriggerBadInitialization")
128  << "The HGC trigger geometry has not been passed to the front-end codec\n";
129  }
130  return static_cast<const Impl&>(*this).encodeImpl(data);

References data, Exception, and HGCalTriggerFECodecBase::geometry_.

◆ encode() [2/2]

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::encode ( l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 70 of file HGCalTriggerFECodecBase.h.

71  {
72  if (!dataIsSet_) {
73  edm::LogWarning("HGCalTriggerFECodec|NoDataPayload")
74  << "No data payload was set for HGCTriggerFECodec: " << this->name();
75  }
76  digi.encode(static_cast<const Impl&>(*this), data_);

References HGCalTriggerFE::Codec< Impl, DATA >::data_, HGCalTriggerFE::Codec< Impl, DATA >::dataIsSet_, and HGCalTriggerFECodecBase::name().

◆ getDataPayload()

template<typename Impl , typename DATA >
std::vector<bool> HGCalTriggerFE::Codec< Impl, DATA >::getDataPayload ( ) const
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 118 of file HGCalTriggerFECodecBase.h.

◆ print()

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::print ( const l1t::HGCFETriggerDigi digi,
std::ostream &  out = std::cout 
) const
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 120 of file HGCalTriggerFECodecBase.h.

121  {
122  digi.print(static_cast<const Impl&>(*this), out);

References MillePedeFileConverter_cfg::out.

◆ setDataPayload() [1/2]

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::setDataPayload ( const HGCalDigiCollection ee,
const HGCalDigiCollection fh,
const HGCalDigiCollection bh 
)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 86 of file HGCalTriggerFECodecBase.h.

89  {
90  if (dataIsSet_) {
91  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
92  << "Data payload was already set for HGCTriggerFECodec: " << this->name() << " overwriting current data!";
93  }
94  if (geometry_ == nullptr) {
95  throw cms::Exception("HGCTriggerBadInitialization")
96  << "The HGC trigger geometry has not been passed to the front-end codec\n";
97  }
98  static_cast<Impl&>(*this).setDataPayloadImpl(ee, fh, bh);
99  dataIsSet_ = true;

References HGCalTriggerFE::Codec< Impl, DATA >::dataIsSet_, Exception, HGCalTriggerFECodecBase::geometry_, and HGCalTriggerFECodecBase::name().

◆ setDataPayload() [2/2]

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::setDataPayload ( const l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 101 of file HGCalTriggerFECodecBase.h.

102  {
103  if (dataIsSet_) {
104  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
105  << "Data payload was already set for HGCTriggerFECodec: " << this->name() << " overwriting current data!";
106  }
107  if (geometry_ == nullptr) {
108  throw cms::Exception("HGCTriggerBadInitialization")
109  << "The HGC trigger geometry has not been passed to the front-end codec\n";
110  }
111  static_cast<Impl&>(*this).setDataPayloadImpl(digi);
112  dataIsSet_ = true;

References HGCalTriggerFE::Codec< Impl, DATA >::dataIsSet_, Exception, HGCalTriggerFECodecBase::geometry_, and HGCalTriggerFECodecBase::name().

◆ unSetDataPayload()

template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::unSetDataPayload ( )
inlinefinalvirtual

Member Data Documentation

◆ data_

template<typename Impl , typename DATA >
DATA HGCalTriggerFE::Codec< Impl, DATA >::data_
protected

◆ dataIsSet_

template<typename Impl , typename DATA >
bool HGCalTriggerFE::Codec< Impl, DATA >::dataIsSet_
private
funct::false
false
Definition: Factorize.h:34
HGCalTriggerFE::Codec::Codec
Codec(const edm::ParameterSet &conf)
Definition: HGCalTriggerFECodecBase.h:66
HGCalTriggerFE::Codec::data_
DATA data_
Definition: HGCalTriggerFECodecBase.h:141
l1t::HGCFETriggerDigi::encode
void encode(const CODEC &codec, const DATA &data)
Definition: HGCFETriggerDigi.h:87
HGCalTriggerFECodecBase::name
const std::string & name() const
Definition: HGCalTriggerFECodecBase.h:44
HGCalTriggerFECodecBase
Definition: HGCalTriggerFECodecBase.h:25
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
HGCalTriggerFECodecBase::geometry_
const HGCalTriggerGeometryBase * geometry_
Definition: HGCalTriggerFECodecBase.h:64
module
Definition: vlib.h:198
Exception
Definition: hltDiff.cc:246
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
l1t::HGCFETriggerDigi::print
void print(std::ostream &out) const
Definition: HGCFETriggerDigi.cc:5
HGCalTriggerFE::Codec::dataIsSet_
bool dataIsSet_
Definition: HGCalTriggerFECodecBase.h:144
l1t::HGCFETriggerDigi::decode
void decode(const CODEC &codec, DATA &data) const
Definition: HGCFETriggerDigi.h:97