7 nData_(conf.getParameter<uint32_t>(
"NData")),
8 dataLength_(conf.getParameter<uint32_t>(
"DataLength")),
9 nCellsInModule_(conf.getParameter<uint32_t>(
"MaxCellsInModule")),
10 linLSB_(conf.getParameter<double>(
"linLSB")),
11 adcsaturation_(conf.getParameter<double>(
"adcsaturation")),
12 adcnBits_(conf.getParameter<uint32_t>(
"adcnBits")),
13 tdcsaturation_(conf.getParameter<double>(
"tdcsaturation")),
14 tdcnBits_(conf.getParameter<uint32_t>(
"tdcnBits")),
15 tdcOnsetfC_(conf.getParameter<double>(
"tdcOnsetfC")),
16 triggerCellTruncationBits_(conf.getParameter<uint32_t>(
"triggerCellTruncationBits"))
36 if(data.
payload.size()==0)
return result;
42 std::unordered_map<uint32_t, uint32_t> data_map;
43 for(
const auto& triggercell : data.
payload)
45 data_map.emplace(triggercell.detId(), triggercell.hwPt());
50 for(
const auto& triggercell_id : trigger_cells_in_module)
53 const auto& data_itr = data_map.find(triggercell_id);
55 if(data_itr==data_map.end())
65 <<
"Number of trigger cells in module too large for available data payload\n";
67 uint32_t
value = data_itr->second;
73 <<
"encode: Number of non-zero trigger cells larger than codec parameter\n"\
74 <<
" : Number of energy values = "<<nData_<<
"\n";
102 <<
"decode: data length ("<<data.size()<<
") inconsistent with codec parameters:\n"\
104 <<
" : Number of energy values = "<<
nData_<<
"\n"\
108 size_t iselected = 0;
110 for(
const auto& triggercell : trigger_cells_in_module)
115 <<
"Number of trigger cells in module too large for available data payload\n";
123 if(data[ibit]) value |= (0x1<<
i);
131 value, 0, 0, 0, triggercell);
135 result.
payload.back().setP4(p4);
136 result.
payload.back().setPosition(point);
148 std::vector<std::pair<HGCalDetId, uint32_t > >& linearized_dataframes)
150 double amplitude; uint32_t amplitude_int;
153 for(
const auto& frame : dataframes) {
154 if (frame[2].
mode()) {
161 amplitude_int = uint32_t (floor(amplitude/
linLSB_+0.5));
162 if (amplitude_int>65535) amplitude_int = 65535;
164 linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int));
173 if(linearized_dataframes.size()==0)
return;
174 std::map<HGCalDetId, uint32_t>
payload;
176 for(
const auto& frame : linearized_dataframes)
182 payload.insert( std::make_pair(triggercellid, 0) );
183 uint32_t
value = frame.second;
184 payload[triggercellid] +=
value;
190 for(
const auto& id_value : payload)
195 id_value.second, 0, 0, 0, id_value.first.rawId());
208 return a.
hwPt() >
b.hwPt();
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< HGCalDetId, uint32_t > > &, data_type &)
trigger_cell_list payload
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
Geom::Phi< T > phi() const
void linearize(const std::vector< HGCDataFrame< HGCalDetId, HGCSample >> &, std::vector< std::pair< HGCalDetId, uint32_t > > &)
uint32_t triggerCellSaturationBits_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
payload
payload postfix for testing
data_type decode(const std::vector< bool > &, const uint32_t, const HGCalTriggerGeometryBase &) const
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
HGCalTriggerCellBestChoiceCodecImpl(const edm::ParameterSet &conf)
std::set< unsigned > geom_ordered_set
char data[epos_bytes_allocation]
uint32_t triggerCellTruncationBits_
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< bool > encode(const data_type &, const HGCalTriggerGeometryBase &) const
Power< A, B >::type pow(const A &a, const B &b)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
void bestChoiceSelect(data_type &)