CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HGCalTriggerCellBestChoiceCodec Class Reference

#include <HGCalTriggerCellBestChoiceCodec.h>

Inheritance diagram for HGCalTriggerCellBestChoiceCodec:
HGCalTriggerFE::Codec< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceDataPayload > HGCalTriggerFECodecBase

Public Types

typedef HGCalTriggerCellBestChoiceDataPayload data_type
 

Public Member Functions

data_type decodeImpl (const std::vector< bool > &, const uint32_t) const
 
std::vector< bool > encodeImpl (const data_type &) const
 
 HGCalTriggerCellBestChoiceCodec (const edm::ParameterSet &conf)
 
void setDataPayloadImpl (const HGCEEDigiCollection &ee, const HGCHEDigiCollection &fh, const HGCBHDigiCollection &bh)
 
void setDataPayloadImpl (const l1t::HGCFETriggerDigi &digi)
 
- Public Member Functions inherited from HGCalTriggerFE::Codec< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceDataPayload >
 Codec (const edm::ParameterSet &conf)
 
void decode (const l1t::HGCFETriggerDigi &digi) final
 
HGCalTriggerCellBestChoiceDataPayload decode (const std::vector< bool > &data, const uint32_t module=0) const
 
void encode (l1t::HGCFETriggerDigi &digi) final
 
std::vector< bool > encode (const HGCalTriggerCellBestChoiceDataPayload &data) const
 
std::vector< bool > getDataPayload () const final
 
void print (const l1t::HGCFETriggerDigi &digi, std::ostream &out=std::cout) const final
 
void setDataPayload (const HGCEEDigiCollection &ee, const HGCHEDigiCollection &fh, const HGCBHDigiCollection &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 ()
 

Private Attributes

HGCalTriggerCellBestChoiceCodecImpl codecImpl_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalTriggerFE::Codec< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceDataPayload >
HGCalTriggerCellBestChoiceDataPayload data_
 
- Protected Attributes inherited from HGCalTriggerFECodecBase
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

Definition at line 20 of file HGCalTriggerCellBestChoiceCodec.h.

Member Typedef Documentation

Definition at line 23 of file HGCalTriggerCellBestChoiceCodec.h.

Constructor & Destructor Documentation

HGCalTriggerCellBestChoiceCodec::HGCalTriggerCellBestChoiceCodec ( const edm::ParameterSet conf)

Definition at line 11 of file HGCalTriggerCellBestChoiceCodec.cc.

References setDataPayloadImpl().

Member Function Documentation

HGCalTriggerCellBestChoiceCodec::data_type HGCalTriggerCellBestChoiceCodec::decodeImpl ( const std::vector< bool > &  data,
const uint32_t  module 
) const

Definition at line 101 of file HGCalTriggerCellBestChoiceCodec.cc.

References codecImpl_, HGCalTriggerCellBestChoiceCodecImpl::decode(), and HGCalTriggerFECodecBase::geometry_.

Referenced by encodeImpl().

102 {
104 }
HGCalTriggerCellBestChoiceCodecImpl codecImpl_
data_type decode(const std::vector< bool > &, const uint32_t, const HGCalTriggerGeometryBase &) const
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Definition: vlib.h:208
std::vector< bool > HGCalTriggerCellBestChoiceCodec::encodeImpl ( const data_type data) const

Definition at line 94 of file HGCalTriggerCellBestChoiceCodec.cc.

References codecImpl_, decodeImpl(), HGCalTriggerCellBestChoiceCodecImpl::encode(), and HGCalTriggerFECodecBase::geometry_.

Referenced by setDataPayloadImpl().

95 {
96  return codecImpl_.encode(data, *geometry_);
97 }
HGCalTriggerCellBestChoiceCodecImpl codecImpl_
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< bool > encode(const data_type &, const HGCalTriggerGeometryBase &) const
void HGCalTriggerCellBestChoiceCodec::setDataPayloadImpl ( const HGCEEDigiCollection ee,
const HGCHEDigiCollection fh,
const HGCBHDigiCollection bh 
)

Definition at line 19 of file HGCalTriggerCellBestChoiceCodec.cc.

References HGCalTriggerCellBestChoiceCodecImpl::bestChoiceSelect(), codecImpl_, HGCalTriggerFE::Codec< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceDataPayload >::data_, edm::SortedCollection< T, SORT >::empty(), HGCalTriggerFECodecBase::geometry_, mps_fire::i, HGCalTriggerCellBestChoiceCodecImpl::linearize(), HGCalTriggerCellBestChoiceDataPayload::reset(), and HGCalTriggerCellBestChoiceCodecImpl::triggerCellSums().

Referenced by HGCalTriggerCellBestChoiceCodec().

22 {
23  data_.reset();
24  std::vector<HGCDataFrame<DetId,HGCSample>> dataframes;
25  std::vector<std::pair<DetId, uint32_t > > linearized_dataframes;
26  // convert ee and fh hit collections into the same object
27  if(!ee.empty())
28  {
29  for(const auto& eedata : ee)
30  {
31  dataframes.emplace_back(eedata.id());
32  for(int i=0; i<eedata.size(); i++)
33  {
34  dataframes.back().setSample(i, eedata.sample(i));
35  }
36  }
37  }
38  else if(!fh.empty())
39  {
40  for(const auto& fhdata : fh)
41  {
42  dataframes.emplace_back(fhdata.id());
43  for(int i=0; i<fhdata.size(); i++)
44  {
45  dataframes.back().setSample(i, fhdata.sample(i));
46  }
47  }
48  }
49  // linearize input energy on 16 bits
50  codecImpl_.linearize(dataframes, linearized_dataframes);
51  // sum energy in trigger cells
52  codecImpl_.triggerCellSums(*geometry_, linearized_dataframes, data_);
53  // choose best trigger cells in the module
55 }
HGCalTriggerCellBestChoiceCodecImpl codecImpl_
void linearize(const std::vector< HGCDataFrame< DetId, HGCSample >> &, std::vector< std::pair< DetId, uint32_t > > &)
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, data_type &)
const HGCalTriggerGeometryBase * geometry_
void HGCalTriggerCellBestChoiceCodec::setDataPayloadImpl ( const l1t::HGCFETriggerDigi digi)

Definition at line 59 of file HGCalTriggerCellBestChoiceCodec.cc.

References HGCalTriggerCellBestChoiceCodecImpl::adcnBits(), HGCalTriggerCellBestChoiceCodecImpl::adcsaturation(), edm::ParameterSet::addParameter(), HGCalTriggerCellBestChoiceCodecImpl::bestChoiceSelect(), codecImpl_, HGCalTriggerFE::Codec< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceDataPayload >::data_, HGCalTriggerCellBestChoiceCodecImpl::dataLength(), l1t::HGCFETriggerDigi::decode(), encodeImpl(), HGCalTriggerFECodecBase::geometry_, HGCalTriggerFECodecBase::getCodecType(), HGCalTriggerCellBestChoiceCodecImpl::linLSB(), HGCalTriggerCellBestChoiceCodecImpl::linnBits(), HGCalTriggerFECodecBase::name(), HGCalTriggerCellBestChoiceCodecImpl::nCellsInModule(), HGCalTriggerCellBestChoiceDataPayload::reset(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTriggerCellBestChoiceCodecImpl::tdcnBits(), HGCalTriggerCellBestChoiceCodecImpl::tdcOnsetfC(), HGCalTriggerCellBestChoiceCodecImpl::tdcsaturation(), HGCalTriggerCellBestChoiceCodecImpl::ThicknessCorrections(), and HGCalTriggerCellBestChoiceCodecImpl::triggerCellTruncationBits().

60 {
61  data_.reset();
62  // decode input data with different parameters
63  // (no selection, so NData=number of trigger cells in module)
64  // FIXME:
65  // Not very clean to define an alternative codec within this codec
66  // Also, the codec is built each time the method is called, which is not very efficient
67  // This may need a restructuration of the FECodec
68  edm::ParameterSet conf;
69  conf.addParameter<std::string>("CodecName", name());
70  conf.addParameter<uint32_t> ("CodecIndex", getCodecType());
71  conf.addParameter<uint32_t> ("MaxCellsInModule", codecImpl_.nCellsInModule());
72  conf.addParameter<uint32_t> ("NData", codecImpl_.nCellsInModule());
73  // The data length should be the same for input and output, which is limiting
74  conf.addParameter<uint32_t> ("DataLength", codecImpl_.dataLength());
75  conf.addParameter<double> ("linLSB", codecImpl_.linLSB());
76  conf.addParameter<uint32_t> ("linnBits", codecImpl_.linnBits());
77  conf.addParameter<double> ("adcsaturation", codecImpl_.adcsaturation());
78  conf.addParameter<uint32_t> ("adcnBits", codecImpl_.adcnBits());
79  conf.addParameter<double> ("tdcsaturation", codecImpl_.tdcsaturation());
80  conf.addParameter<uint32_t> ("tdcnBits", codecImpl_.tdcnBits());
81  conf.addParameter<double> ("tdcOnsetfC", codecImpl_.tdcOnsetfC());
82  conf.addParameter<uint32_t> ("triggerCellTruncationBits", codecImpl_.triggerCellTruncationBits());
83  conf.addParameter<std::vector<double>>("ThicknessCorrections", codecImpl_.ThicknessCorrections());
84  HGCalTriggerCellBestChoiceCodec codecInput(conf);
85  codecInput.setGeometry(geometry_);
86  digi.decode(codecInput,data_);
87  // choose best trigger cells in the module
89 }
HGCalTriggerCellBestChoiceCodecImpl codecImpl_
void decode(const CODEC &codec, DATA &data) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
const unsigned char getCodecType() const
const HGCalTriggerGeometryBase * geometry_
const std::string & name() const

Member Data Documentation

HGCalTriggerCellBestChoiceCodecImpl HGCalTriggerCellBestChoiceCodec::codecImpl_
private

Definition at line 37 of file HGCalTriggerCellBestChoiceCodec.h.

Referenced by decodeImpl(), encodeImpl(), and setDataPayloadImpl().