CMS 3D CMS Logo

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

#include <HGCalTriggerCellThresholdCodec.h>

Inheritance diagram for HGCalTriggerCellThresholdCodec:
HGCalTriggerFE::Codec< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload > HGCalTriggerFECodecBase

Public Types

typedef HGCalTriggerCellThresholdDataPayload data_type
 

Public Member Functions

data_type decodeImpl (const std::vector< bool > &, const uint32_t) const
 
std::vector< bool > encodeImpl (const data_type &) const
 
 HGCalTriggerCellThresholdCodec (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< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload >
 Codec (const edm::ParameterSet &conf)
 
virtual void decode (const l1t::HGCFETriggerDigi &digi) override final
 
HGCalTriggerCellThresholdDataPayload decode (const std::vector< bool > &data, const uint32_t module=0) const
 
virtual void encode (l1t::HGCFETriggerDigi &digi) override final
 
std::vector< bool > encode (const HGCalTriggerCellThresholdDataPayload &data) const
 
std::vector< bool > getDataPayload () const override final
 
virtual void print (const l1t::HGCFETriggerDigi &digi, std::ostream &out=std::cout) const override final
 
virtual void setDataPayload (const HGCEEDigiCollection &ee, const HGCHEDigiCollection &fh, const HGCBHDigiCollection &bh) override final
 
virtual void setDataPayload (const l1t::HGCFETriggerDigi &digi) override final
 
virtual void unSetDataPayload () override 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

HGCalTriggerCellThresholdCodecImpl codecImpl_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalTriggerFE::Codec< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload >
HGCalTriggerCellThresholdDataPayload data_
 
- Protected Attributes inherited from HGCalTriggerFECodecBase
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

Definition at line 20 of file HGCalTriggerCellThresholdCodec.h.

Member Typedef Documentation

Definition at line 23 of file HGCalTriggerCellThresholdCodec.h.

Constructor & Destructor Documentation

HGCalTriggerCellThresholdCodec::HGCalTriggerCellThresholdCodec ( const edm::ParameterSet conf)

Definition at line 11 of file HGCalTriggerCellThresholdCodec.cc.

References setDataPayloadImpl().

Member Function Documentation

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

Definition at line 116 of file HGCalTriggerCellThresholdCodec.cc.

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

Referenced by encodeImpl().

117 {
119 }
HGCalTriggerCellThresholdCodecImpl 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 > HGCalTriggerCellThresholdCodec::encodeImpl ( const data_type data) const

Definition at line 109 of file HGCalTriggerCellThresholdCodec.cc.

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

Referenced by setDataPayloadImpl().

110 {
111  return codecImpl_.encode(data, *geometry_);
112 }
HGCalTriggerCellThresholdCodecImpl codecImpl_
std::vector< bool > encode(const data_type &, const HGCalTriggerGeometryBase &) const
const HGCalTriggerGeometryBase * geometry_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void HGCalTriggerCellThresholdCodec::setDataPayloadImpl ( const HGCEEDigiCollection ee,
const HGCHEDigiCollection fh,
const HGCBHDigiCollection bh 
)

Definition at line 19 of file HGCalTriggerCellThresholdCodec.cc.

References codecImpl_, HGCalTriggerFE::Codec< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload >::data_, HGCalTriggerFECodecBase::geometry_, mps_fire::i, HGCalTriggerCellThresholdCodecImpl::linearize(), HGCalTriggerCellThresholdDataPayload::reset(), edm::SortedCollection< T, SORT >::size(), HGCalTriggerCellThresholdCodecImpl::thresholdSelect(), and HGCalTriggerCellThresholdCodecImpl::triggerCellSums().

Referenced by HGCalTriggerCellThresholdCodec().

22 {
23  data_.reset();
24  std::vector<HGCDataFrame<DetId,HGCSample>> dataframes;
25  std::vector<std::pair<DetId, uint32_t > > linearized_dataframes;
26  // convert ee, fh and bh hit collections into the same object
27  if(ee.size()>0)
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.size()>0)
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  else if(bh.size()>0)
50  {
51  for(const auto& bhdata : bh)
52  {
53  dataframes.emplace_back(bhdata.id());
54  for(int i=0; i<bhdata.size(); i++)
55  {
56  dataframes.back().setSample(i, bhdata.sample(i));
57  }
58  }
59  }
60  // linearize input energy on 16 bits
61  codecImpl_.linearize(dataframes, linearized_dataframes);
62  // sum energy in trigger cells
63  codecImpl_.triggerCellSums(*geometry_, linearized_dataframes, data_);
64  // choose thresholds selected cells in the module
66 }
void linearize(const std::vector< HGCDataFrame< DetId, HGCSample >> &, std::vector< std::pair< DetId, uint32_t > > &)
HGCalTriggerCellThresholdCodecImpl codecImpl_
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, data_type &)
const HGCalTriggerGeometryBase * geometry_
size_type size() const
void HGCalTriggerCellThresholdCodec::setDataPayloadImpl ( const l1t::HGCFETriggerDigi digi)

Definition at line 70 of file HGCalTriggerCellThresholdCodec.cc.

References HGCalTriggerCellThresholdCodecImpl::adcnBits(), HGCalTriggerCellThresholdCodecImpl::adcnBitsBH(), HGCalTriggerCellThresholdCodecImpl::adcsaturation(), HGCalTriggerCellThresholdCodecImpl::adcsaturationBH(), edm::ParameterSet::addParameter(), codecImpl_, HGCalTriggerFE::Codec< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdDataPayload >::data_, HGCalTriggerCellThresholdCodecImpl::dataLength(), l1t::HGCFETriggerDigi::decode(), encodeImpl(), HGCalTriggerFECodecBase::geometry_, HGCalTriggerFECodecBase::getCodecType(), HGCalTriggerCellThresholdCodecImpl::linLSB(), HGCalTriggerCellThresholdCodecImpl::linnBits(), HGCalTriggerFECodecBase::name(), HGCalTriggerCellThresholdCodecImpl::nCellsInModule(), HGCalTriggerCellThresholdDataPayload::reset(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTriggerCellThresholdCodecImpl::TCThreshold_fC(), HGCalTriggerCellThresholdCodecImpl::TCThresholdBH_MIP(), HGCalTriggerCellThresholdCodecImpl::tdcnBits(), HGCalTriggerCellThresholdCodecImpl::tdcOnsetfC(), HGCalTriggerCellThresholdCodecImpl::tdcsaturation(), HGCalTriggerCellThresholdCodecImpl::ThicknessCorrections(), HGCalTriggerCellThresholdCodecImpl::thresholdSelect(), and HGCalTriggerCellThresholdCodecImpl::triggerCellTruncationBits().

71 {
72  data_.reset();
73  // decode input data with different parameters
74  // (no selection, so NData=number of trigger cells in module)
75  // FIXME:
76  // Not very clean to define an alternative codec within this codec
77  // Also, the codec is built each time the method is called, which is not very efficient
78  // This may need a restructuration of the FECodec
79  edm::ParameterSet conf;
80  conf.addParameter<std::string>("CodecName", name());
81  conf.addParameter<uint32_t> ("CodecIndex", getCodecType());
82  conf.addParameter<uint32_t> ("MaxCellsInModule", codecImpl_.nCellsInModule());
83  conf.addParameter<uint32_t> ("NData", codecImpl_.nCellsInModule());
84  // The data length should be the same for input and output, which is limiting
85  conf.addParameter<uint32_t> ("DataLength", codecImpl_.dataLength());
86  conf.addParameter<double> ("linLSB", codecImpl_.linLSB());
87  conf.addParameter<uint32_t> ("linnBits", codecImpl_.linnBits());
88  conf.addParameter<double> ("adcsaturation", codecImpl_.adcsaturation());
89  conf.addParameter<uint32_t> ("adcnBits", codecImpl_.adcnBits());
90  conf.addParameter<double> ("tdcsaturation", codecImpl_.tdcsaturation());
91  conf.addParameter<uint32_t> ("tdcnBits", codecImpl_.tdcnBits());
92  conf.addParameter<double> ("tdcOnsetfC", codecImpl_.tdcOnsetfC());
93  conf.addParameter<double> ("adcsaturationBH", codecImpl_.adcsaturationBH());
94  conf.addParameter<uint32_t> ("adcnBitsBH", codecImpl_.adcnBitsBH());
95  conf.addParameter<uint32_t> ("triggerCellTruncationBits", codecImpl_.triggerCellTruncationBits());
96  conf.addParameter<double> ("TCThreshold_fC", codecImpl_.TCThreshold_fC());
97  conf.addParameter<double> ("TCThresholdBH_MIP", codecImpl_.TCThresholdBH_MIP());
98  conf.addParameter<std::vector<double>>("ThicknessCorrections", codecImpl_.ThicknessCorrections());
99  HGCalTriggerCellThresholdCodec codecInput(conf);
100  codecInput.setGeometry(geometry_);
101  digi.decode(codecInput,data_);
102  // choose threshold selected cells in the module
104 }
const std::vector< double > & ThicknessCorrections() const
void decode(const CODEC &codec, DATA &data) const
HGCalTriggerCellThresholdCodecImpl codecImpl_
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

HGCalTriggerCellThresholdCodecImpl HGCalTriggerCellThresholdCodec::codecImpl_
private

Definition at line 37 of file HGCalTriggerCellThresholdCodec.h.

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