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 69 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 71 of file HGCalTriggerFECodecBase.h.

71  :
73  dataIsSet_(false) {
74  }
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 86 of file HGCalTriggerFECodecBase.h.

86  {
87  if( dataIsSet_ ) {
88  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
89  << "Data payload was already set for HGCTriggerFECodec: "
90  << this->name() << " overwriting current data!";
91  }
92  digi.decode(static_cast<const Impl&>(*this),data_);
93  dataIsSet_ = true;
94  }
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 147 of file HGCalTriggerFECodecBase.h.

147  {
148  if(geometry_==nullptr) {
149  throw cms::Exception("HGCTriggerBadInitialization")
150  << "The HGC trigger geometry has not been passed to the front-end codec\n";
151  }
152  return static_cast<const Impl&>(*this).decodeImpl(data, module);
153  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Definition: vlib.h:208
template<typename Impl, typename DATA>
void HGCalTriggerFE::Codec< Impl, DATA >::encode ( l1t::HGCFETriggerDigi digi)
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 78 of file HGCalTriggerFECodecBase.h.

78  {
79  if( !dataIsSet_ ) {
80  edm::LogWarning("HGCalTriggerFECodec|NoDataPayload")
81  << "No data payload was set for HGCTriggerFECodec: "
82  << this->name();
83  }
84  digi.encode(static_cast<const Impl&>(*this),data_);
85  }
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 139 of file HGCalTriggerFECodecBase.h.

139  {
140  if(geometry_==nullptr) {
141  throw cms::Exception("HGCTriggerBadInitialization")
142  << "The HGC trigger geometry has not been passed to the front-end codec\n";
143  }
144  return static_cast<const Impl&>(*this).encodeImpl(data);
145  }
Definition: __init__.py:1
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename Impl, typename DATA>
std::vector<bool> HGCalTriggerFE::Codec< Impl, DATA >::getDataPayload ( ) const
inlinefinalvirtual

Implements HGCalTriggerFECodecBase.

Definition at line 130 of file HGCalTriggerFECodecBase.h.

130  {
131  return this->encode(data_);
132  }
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 134 of file HGCalTriggerFECodecBase.h.

135  {
136  digi.print(static_cast<const Impl&>(*this),out);
137  }
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 96 of file HGCalTriggerFECodecBase.h.

98  {
99  if( dataIsSet_ ) {
100  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
101  << "Data payload was already set for HGCTriggerFECodec: "
102  << this->name() << " overwriting current data!";
103  }
104  if(geometry_==nullptr) {
105  throw cms::Exception("HGCTriggerBadInitialization")
106  << "The HGC trigger geometry has not been passed to the front-end codec\n";
107  }
108  static_cast<Impl&>(*this).setDataPayloadImpl(ee,fh,bh);
109  dataIsSet_ = true;
110  }
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 112 of file HGCalTriggerFECodecBase.h.

112  {
113  if( dataIsSet_ ) {
114  edm::LogWarning("HGCalTriggerFECodec|OverwritePayload")
115  << "Data payload was already set for HGCTriggerFECodec: "
116  << this->name() << " overwriting current data!";
117  }
118  if(geometry_==nullptr) {
119  throw cms::Exception("HGCTriggerBadInitialization")
120  << "The HGC trigger geometry has not been passed to the front-end codec\n";
121  }
122  static_cast<Impl&>(*this).setDataPayloadImpl(digi);
123  dataIsSet_ = true;
124  }
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 126 of file HGCalTriggerFECodecBase.h.

126  {
127  data_.reset();
128  dataIsSet_ = false;
129  }

Member Data Documentation

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

Definition at line 156 of file HGCalTriggerFECodecBase.h.

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

Definition at line 158 of file HGCalTriggerFECodecBase.h.