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
 
void encode (l1t::HGCFETriggerDigi &digi) final
 
std::vector< bool > encode (const DATA &data) const
 
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 65 of file HGCalTriggerFECodecBase.h.

Constructor & Destructor Documentation

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

Definition at line 67 of file HGCalTriggerFECodecBase.h.

67 : HGCalTriggerFECodecBase(conf), dataIsSet_(false) {}
HGCalTriggerFECodecBase(const edm::ParameterSet &conf)

Member Function Documentation

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

Implements HGCalTriggerFECodecBase.

Definition at line 78 of file HGCalTriggerFECodecBase.h.

References HGCalTriggerFECodecBase::name().

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;
85  }
void decode(const CODEC &codec, DATA &data) const
const std::string & name() const
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 133 of file HGCalTriggerFECodecBase.h.

References Exception, and HGCalTriggerFECodecBase::geometry_.

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);
139  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
Definition: vlib.h:198
template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::encode ( l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 71 of file HGCalTriggerFECodecBase.h.

References HGCalTriggerFECodecBase::name().

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_);
77  }
void encode(const CODEC &codec, const DATA &data)
const std::string & name() const
template<typename Impl , typename DATA >
std::vector<bool> HGCalTriggerFE::Codec< Impl, DATA >::encode ( const DATA &  data) const
inline

Definition at line 125 of file HGCalTriggerFECodecBase.h.

References Exception, and HGCalTriggerFECodecBase::geometry_.

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);
131  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
template<typename Impl , typename DATA >
std::vector<bool> HGCalTriggerFE::Codec< Impl, DATA >::getDataPayload ( ) const
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 119 of file HGCalTriggerFECodecBase.h.

References HGCalTriggerFECodecBase::encode().

119 { return this->encode(data_); }
void encode(l1t::HGCFETriggerDigi &digi) final
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 121 of file HGCalTriggerFECodecBase.h.

References MillePedeFileConverter_cfg::out, and l1t::HGCFETriggerDigi::print().

121  {
122  digi.print(static_cast<const Impl&>(*this), out);
123  }
void print(std::ostream &out) const
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 87 of file HGCalTriggerFECodecBase.h.

References Exception, HGCalTriggerFECodecBase::geometry_, and HGCalTriggerFECodecBase::name().

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;
100  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
const std::string & name() const
template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::setDataPayload ( const l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 102 of file HGCalTriggerFECodecBase.h.

References Exception, HGCalTriggerFECodecBase::geometry_, and HGCalTriggerFECodecBase::name().

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;
113  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
const std::string & name() const
template<typename Impl , typename DATA >
void HGCalTriggerFE::Codec< Impl, DATA >::unSetDataPayload ( )
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 115 of file HGCalTriggerFECodecBase.h.

115  {
116  data_.reset();
117  dataIsSet_ = false;
118  }

Member Data Documentation

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

Definition at line 142 of file HGCalTriggerFECodecBase.h.

template<typename Impl , typename DATA >
bool HGCalTriggerFE::Codec< Impl, DATA >::dataIsSet_
private

Definition at line 145 of file HGCalTriggerFECodecBase.h.