1 #ifndef __L1Trigger_L1THGCal_HGCalTriggerFECodecBase_h__ 2 #define __L1Trigger_L1THGCal_HGCalTriggerFECodecBase_h__ 31 codec_idx_(static_cast<unsigned char>(conf.getParameter<uint32_t>(
"CodecIndex")))
68 template<
typename Impl,
typename DATA>
81 <<
"No data payload was set for HGCTriggerFECodec: " 84 digi.encode(static_cast<const Impl&>(*
this),data_);
89 <<
"Data payload was already set for HGCTriggerFECodec: " 90 << this->
name() <<
" overwriting current data!";
92 digi.decode(static_cast<const Impl&>(*
this),data_);
101 <<
"Data payload was already set for HGCTriggerFECodec: " 102 << this->
name() <<
" overwriting current data!";
106 <<
"The HGC trigger geometry has not been passed to the front-end codec\n";
108 static_cast<Impl&
>(*this).setDataPayloadImpl(ee,fh,bh);
115 <<
"Data payload was already set for HGCTriggerFECodec: " 116 << this->
name() <<
" overwriting current data!";
120 <<
"The HGC trigger geometry has not been passed to the front-end codec\n";
122 static_cast<Impl&
>(*this).setDataPayloadImpl(digi);
131 return this->
encode(data_);
136 digi.
print(static_cast<const Impl&>(*
this),
out);
142 <<
"The HGC trigger geometry has not been passed to the front-end codec\n";
144 return static_cast<const Impl&
>(*this).encodeImpl(data);
150 <<
"The HGC trigger geometry has not been passed to the front-end codec\n";
152 return static_cast<const Impl&
>(*this).decodeImpl(data,
module);
virtual void print(const l1t::HGCFETriggerDigi &digi, std::ostream &out=std::cout) const override final
virtual ~HGCalTriggerFECodecBase()
DATA decode(const std::vector< bool > &data, const uint32_t module=0) const
virtual void unSetDataPayload() override final
virtual std::vector< bool > getDataPayload() const =0
virtual void setDataPayload(const HGCEEDigiCollection &ee, const HGCHEDigiCollection &fh, const HGCBHDigiCollection &bh) override final
Codec(const edm::ParameterSet &conf)
std::vector< bool > encode(const DATA &data) const
virtual void decode(const l1t::HGCFETriggerDigi &digi) override final
virtual void unSetDataPayload()=0
edmplugin::PluginFactory< HGCalTriggerFECodecBase *(const edm::ParameterSet &) > HGCalTriggerFECodecFactory
HGCalTriggerFECodecBase(const edm::ParameterSet &conf)
virtual void encode(l1t::HGCFETriggerDigi &digi) override final
const unsigned char getCodecType() const
virtual void setDataPayload(const l1t::HGCFETriggerDigi &digi) override final
virtual void decode(const l1t::HGCFETriggerDigi &)=0
virtual void setDataPayload(const HGCEEDigiCollection &, const HGCHEDigiCollection &, const HGCBHDigiCollection &)=0
void setGeometry(const HGCalTriggerGeometryBase *const geom)
const HGCalTriggerGeometryBase * geometry_
void print(std::ostream &out) const
virtual void print(const l1t::HGCFETriggerDigi &digi, std::ostream &out=std::cout) const =0
std::vector< bool > getDataPayload() const override final
char data[epos_bytes_allocation]
const std::string & name() const
virtual void encode(l1t::HGCFETriggerDigi &)=0